Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.
Backtrace for this error: #0 0x7f019ce912da in ??? #1 0x7f019ce90503 in ??? #2 0x7f019c2d7f1f in ??? #3 0x55e5854f669b in resistcalc_
at /home/a13/NAS/a13/mcip/src/resistcalc.f90:281 #4 0x55e5854cc2bc in pblsup_
at /home/a13/NAS/a13/mcip/src/pblsup.f90:331 #5 0x55e585477edd in dynflds_
at /home/a13/NAS/a13/mcip/src/dynflds.f90:67 #6 0x55e58543952c in mcip
at /home/a13/NAS/a13/mcip/src/mcip.f90:169 #7 0x55e585439833 in main
at /home/a13/NAS/a13/mcip/src/mcip.f90:79
Floating point exception (core dumped)
Error running mcip
The traceback shows that MCIP is crashing on line 281 in resistcalc.f90 where there is a division by leaf area index, which I suspect is set to 0.0 when MCIP is crashing. LAI could be 0.0 over water, but the block where LAI is calculated in MCIP should only be activated on land points. Can you check the values of XLAI and XLWMASK for the point where MCIP is crashing?
I thank you for your quick response. I am sorry, but can you please tell me how I can check that?
I just saw LAI and LANDMASK in my WRF output, the values were fine to me(zero at sea, and not zero on land). Can you please tell me what you mean by the point where MCIP is crashing?
Hi,
I think sheâs referring the grid cell where mcip is dividing by zero and then crashing. One way to do it would be to add some write statements to resistcalc.f90 outputting i,j and the lai and landmask values just above line 281 (where it crashes) and then recompile and rerun
Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.
Backtrace for this error: #0 0x7f2bcbed22da in ??? #1 0x7f2bcbed1503 in ??? #2 0x7f2bcb318f1f in ??? #3 0x559d436207c3 in resistcalc_
at /home/a13/NAS/a13/mcip/src/resistcalc.f90:282 #4 0x559d435f62bc in pblsup_
at /home/a13/NAS/a13/mcip/src/pblsup.f90:331 #5 0x559d435a1edd in dynflds_
at /home/a13/NAS/a13/mcip/src/dynflds.f90:67 #6 0x559d4356352c in mcip
at /home/a13/NAS/a13/mcip/src/mcip.f90:169 #7 0x559d43563833 in main
at /home/a13/NAS/a13/mcip/src/mcip.f90:79
Floating point exception (core dumped)
Error running mcip
Thatâs puzzling⌠I expected that LAI would have been set to zero somehow and the error was caused by dividing by zero. But LAI was set to a reasonable value just before the crash.
This type of error could also be caused by trying to do arithmetic operations with really, really small or big numbers. Iâd recommend outputting the other variables in the equation (xrgrnd and radl) for completeness to make sure that all terms have reasonable values.
The result is:
45
111
0.599254608
1.00000000
0.00000000
45
112
0.625336707
1.00000000
0.00000000
45
113
0.652132213
1.00000000
0.00000000
45
114
0.00000000
1.00000000
0.00000000
46
40
Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.
Backtrace for this error: #0 0x7f83c0e1f2da in ??? #1 0x7f83c0e1e503 in ??? #2 0x7f83c0265f1f in ??? #3 0x5632d6bed925 in resistcalc_
at /home/a13/NAS/a13/mcip/src/resistcalc.f90:286 #4 0x5632d6bc32bc in pblsup_
at /home/a13/NAS/a13/mcip/src/pblsup.f90:331 #5 0x5632d6b6eedd in dynflds_
at /home/a13/NAS/a13/mcip/src/dynflds.f90:67 #6 0x5632d6b3052c in mcip
at /home/a13/NAS/a13/mcip/src/mcip.f90:169 #7 0x5632d6b30833 in main
at /home/a13/NAS/a13/mcip/src/mcip.f90:79
Floating point exception (core dumped)
Error running mcip
I was wondering if the land use category was a snow or ice category where LAI would be reduced. Just to clarify, even for cells in such categories, LAI should be set to a minimum value of 0.01. So this could be an odd bug on WRFâs end, or maybe thereâs some confusion with the landsea mask. Either way, itâd be good to know the landuse category.
To find the LU category for this grid cell, you can check the field LU_INDEX in the wrfout file to get the category number or you could modify the resistcalc code to output it from mcip (âluâ is used just above around line 200). Then check the wrfoutâs attributes to see which LU dataset was used. For example, for runs that used the USGS dataset, the attribute MMINLU = âUSGSâ. If you look at WRFâs vegetation parameter table under the âUSGSâ heading, youâll find the category numbers on the first column and the category names in the last column. Youâd need to check the corresponding stanzas of the table if you used a different dataset, such as NLCD.
A copy of the vegparm table can be found here:
0.652132213
1.00000000
0.00000000
45
114
12
0.00000000
1.00000000
0.00000000
46
40
7
MMINLU of WRF output is âMODIFIED_IGBP_MODIS_NOAHâ, and for this option 7 is âOpen Shrublandsâ.
No problem!
LAI should be constrained to a minimum value of 0.6 for that land use category. By the way, have you verified that there is a zero LAI at this grid cell within the wrfout file thatâs being read? I doubt that mcip is overwriting it with a zero, but itâs worth eliminating the possibility.
Also, what WRF version is this? You can tell be looking at the TITLE attribute in your wrfout files.
By the way, if it turns out that this is a single odd value coming in from WRF and youâd like a quick, hard-coded solution to get by it, you could overwrite the zero LAI at that point with a quick if statement. metvars2ctm.f90 (see line 406) plugs in hard-coded LAI values from arrays just in case they are not available to read in from WRF, so you could use those as a reference of what to hard-code it to (see the 7th entry in the âlaimodâ and âlaimnmodâ arrays further down).
Of course, this would be a problematic solution if there are several zeroâd LAI values to contend with and this is just the first one encountered by the code. So itâd be good to verify where the zero LAI value at that grid cell comes from so we can continue diagnosing the problem.
I do appreciate your help. Yes, there are also other points with zero LAI in WRF output. I am using WRFv4.1.3.
And for your suggestion, it also did not work, because the metvars2ctm.f90 does not execute to the line 406. It would execute line 377 first and skip the rest of the script.
ELSE IF ( iflai .AND. ( MAXVAL(lai) < smallnum ) ) THEN
xlai(:,: ) = lai(sc:ec,sr:er)
My fix is to just change the greater sign (>) to the less sign (<) and everything will be fine. Is that the right way do you think?
I just checked the metvars2ctm.f90 in the CMAQv5.2.1 package, the above IF condition is also different.
Please let me know how it goes.
The MCIP variable âlaiâ is initialized to 0.0 in init_met.f90. If leaf-area index is available in the WRF output as netCDF variable âLAIâ or âLAI_PXâ, it will be read and loaded into MCIP variable âlaiâ or âlai_pxâ in rdwrfem.f90.
In metvars2ctm.f90, the MCIP internal variable âxlaiâ is filled on the transfer grid (hence, the âxâ in the name of the variable) which is the MCIP output domain plus the boundaries. In the section of code that you identified in metvars2ctm.f90, MCIP is trying to determine how to fill âxlaiâ, whether it uses leaf-area index from a variable in the WRF output or whether it will use a look-up table based on land use classification.
In the solution that you propose, you are suggesting that leaf-area index might be available in the WRF output file, but you want to bypass it and use a lookup table instead. That is, âMAXVAL(lai)â will still be 0.0 if LAI was not read from the WRF output, but it will be larger than âsmallnumâ if LAI was in the WRF output and filled with realistic values. We only want to use the lookup table if LAI is not available. However, if LAI is available, we need to ensure that there are reasonable values in the field.
I need a few more pieces of information from you to determine whether MCIP has been properly coded to handle the 5-layer thermal diffusion scheme (which I cannot guarantee that it has).
I need to know whether or not LAI is present in your WRF output file and what kind of values it contains. Therefore, Iâd like for you to first type âncdump -h wrfout | grep LAI $1â, and then paste the result of that in your reply here. That will show whether or not LAI is even in your WRF output file (so we know whether we need to use a lookup table in MCIP or if we are getting LAI directly from WRF).
If LAI is in the file, Iâd like for you to visualize the field and tell me the range of values.
Iâd also like to see the header to your WRF file. Please type âncdump -h wrfoutâ and post the results in your reply. You can either cut-and-paste to the reply or add an attachment.
Thank you. Hopefully we will get this resolved for you soon. I want to determine if this is specific to you or if there is a bug in MCIP for handling the 5-layer thermal diffusion scheme.
âTanya
Thank you for providing the information. Iâm still looking into your issue, and I donât see anything obvious, so Iâll need to do a little more digging. I may need to ask for some additional files, as well.
In the meantime, Iâm curious as to why (scientifically) youâve selected the 5-layer thermal diffusion instead of a more advanced LSM like Noah or P-X. Would you be willing to answer that?
I would just like to add that Iâm having the exact same error message after running MCIP V5.1 over the weekend. So, this isnât specific to a.kashfi73. Please let me know if there is any information I can provide with regard to my run/error that might help find the cause of this bug.
Iâm sorry that youâre also having the same issue. Can you confirm the setting you used for sf_surface_physics in WRF, as well as the land use classification in your runs?