About Previous MFiX run is resumable. Reset job to edit model

Uploading: text-22-3-5.zip…


How can I solve this problem? Thank you very much
At the same time, the common problems are DT < DT_ MIN.

Hi Fandi
This is a normal message at the end of the run. I do not see any error in what you posted. And something went wrong with your upload, the zip file is not attached. So please try again, thanks.

– Charles

@cgw Hello, do you have a way to solve this problem, please

Please be patient, I’ll get to this soon.

The code is terminating with an FPE error (floating point exception)

Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.
Backtrace for this error:

#0  0x7f8840e5382f in ???
#1  0x7f87f4451a35 in usr_rates_des_
	at /tmp/text-22-3-5/usr_rates_des.f:80
#2  0x7f87f47b10d3 in __calc_rrates_des_mod_MOD_calc_rrates_des
	at /home/cgw/Work/NETL/mfix/model/des/calc_rrates_des.f:113
#3  0x7f87f45b4d19 in __rxns_gs_des1_mod_MOD_des_stiff_chem
	at /home/cgw/Work/NETL/mfix/model/des/rxns_gs_des1.f:414
#4  0x7f87f45b61e5 in __rxns_gs_des1_mod_MOD_rxns_gs_gas1
	at /home/cgw/Work/NETL/mfix/model/des/rxns_gs_des1.f:224

I see that you are running on Windows. The error handling on Windows is not as good as on Linux, due to platform limitations - there are fewer Fortran compiler and debugger options on Windows, and we are currently unable to get accurate stack traces for FPE errors on Windows.

Note that it the error is happening in your code (usr_rates_des.f)

Here’s line 80 of that file:

      DES_RATES(CaCO3_decomposition) = -k_s_CaCO3 * Sa * (p_CO2_e - p_CO2)/p_CO2_e
 

These kind of problems are almost always divide-by-zero errors. You can’t just divide one number by another without checking the denominator first.

On Linux, I get a core dump and can use the gdb debugger:

   Program terminated with signal SIGFPE, Arithmetic exception.
#0  0x00007f87f4451a35 in usr_rates_des (np=1, pm=1, ijk=1083, des_rates=...) at /tmp/text-22-3-5/usr_rates_des.f:80
80	      DES_RATES(CaCO3_decomposition) = -k_s_CaCO3 * Sa * (p_CO2_e - p_CO2)/p_CO2_e
[Current thread is 1 (Thread 0x7f87b585c640 (LWP 2171))]
(gdb) print  p_CO2_e
$1 = 0

Unfortunately, on Windows you don’t have such tools, but never underestimate the power of WRITE(*, *)

      write(*,*) "**********p_CO2_e=", p_CO2_e
      DES_RATES(CaCO3_decomposition) = -k_s_CaCO3 * Sa * (p_CO2_e - p_CO2)/p_CO2_e

running this clearly shows that it’s a divide-by-zero problem

 **********p_CO2_e=   0.0000000000000000     

– Charles

Hi again.

As mentioned previously, debugging custom code is not as easy on Windows as Linux. We are working on improving the user experience for our Windows-based users, however we are limited by the availability of good Fortran debugging tools on that platform.

On Linux, I get a backtrace and can see that the program exited with a segmentation fault, due to invalid memory access at line 98 of in your usr_rates_des.f

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f447e47cce8 in usr_rates_des (np=1, pm=1, ijk=1083, des_rates=...)
    at /tmp/3.26/usr_rates_des.f:89

89	               des_usr_var(4, :) = DES_RATES
[Current thread is 1 (Thread 0x7f447c958640 (LWP 15152))]
(gdb) pring des_usr_var
$1 = <not allocated>

In order to use des_usr_var, you need to enable it and give it a size via DES_USR_VAR_SIZE

In the GUI the control is here (can be found by clicking “Locate control”)

Is it possible for you to use a Linux machine for developing and debugging your Fortran code? Some users set up a Linux instance inside of VirtualBox to achieve this. We are working on improving the debugging support for Windows but it will always be easier on a Linux machine, which is far more developer-friendly!

– Charles