Floating-point exception - erroneous arithmetic operation when running with Thompson microphysics and DEBUG=true

Peiyang

New member
Hello all,

Recently, I was testing the capabilty of MPAS-A model in simulating tropical cyclones. However, when I compiled the model with 'make gfortran CORE=atmosphere PRECISION=single AUTOCLEAN=true DEBUG=true', and ran the model with Thompson microphysics (with the 'convection_permitting' physics suite), I always encountered the "Floating-point exception - erroneous arithmetic operation" error at the first time step.

Here are some details:
  • I compiled the code with gcc v9.5.0, mpich 3.3.2, hdf5 1.10.11, netcdf v4.7.4, netcdf-fortran v4.5.4 + p-netcdf v1.10.0, hdf5 v1.10.11, pio v2.5.4.
  • The pbs log file points the error to file 'src/core_atmosphere/physics/physics_wrf/module_mp_thompson.F' line 1860. The model would write history and diag files at the initial timestep but fail afterwards. I did some tests and realized the problem has something to do with 'mvd_r(k).gt.100.E-6' in the if statement.
  • I tested the (a) the 'mesoscale_reference' suite and (b) the 'convection_permitting' suite overridden with 'WSM6' microphysics, and both worked.
  • I tested both 60-3 km and 60-15km grids, and both showed the same behavior.
  • Finally, I tested Thompson microphysics (with the 'convection_permitting' physics suite) with DEBUG option been turn off, the model ran smoothly.
  • I'm attaching the namelist and log files associated with the failed run for your reference.
This problem is quite confusing to me. I cannot tell if the results given by Thompson microphysics and DEBUG=true are reasonable as of now. Could it just be compiler issues or something more important. Any thoughts on this would be helpful. Thank you!
 

Attachments

Thanks very much for the detailed description of the issue! I think you're correct that the floating-point exception is related to the 'mvd_r' variable, and looking through the code, it seems likely that at some levels this variable is being used where its value has never been set. As a quick work-around (note: I haven't tried to validate the correctness of this fix!), I think you could add some code like the following
Code:
      do k = kts, kte
         mvd_r(k) = 0.
      end do
around line 1597 of module_mp_thompson.F.

We'll work on getting a fix in place for this in an upcoming bugfix release. Thanks again for pointing this out!
 
Thanks very much for the detailed description of the issue! I think you're correct that the floating-point exception is related to the 'mvd_r' variable, and looking through the code, it seems likely that at some levels this variable is being used where its value has never been set. As a quick work-around (note: I haven't tried to validate the correctness of this fix!), I think you could add some code like the following
Code:
      do k = kts, kte
         mvd_r(k) = 0.
      end do
around line 1597 of module_mp_thompson.F.

We'll work on getting a fix in place for this in an upcoming bugfix release. Thanks again for pointing this out!
Thank you for the quick work-around. Good to know it is just a initialization issue. And the fix does the trick!

BTW, I also encountered the issue given in this thread. I noticed that static.nc for the 60-3 km grid can be generated when compiling init_atmosphere with DEBUG=false, but not when DEBUG=true. I'm currently using your fix given in the thread, but I would like to let you know about the similar DEBUG thing.
 
Last edited:
Back
Top