-
Notifications
You must be signed in to change notification settings - Fork 667
Description
@mcgratta @marcosvanella @gforney
Each time a simulation finishes successfully a note is displayed as the following:
STOP: FDS completed successfully (CHID: Test_Edev_case1)
Note: The following floating-point exceptions are signalling: IEEE_DIVIDE_BY_ZERO IEEE_UNDERFLOW_FLAG IEEE_DENORMAL
Doing some reading on this, this warning was added in june 2013 since Fortran 2008 standard require this type of reporting. So, with any version after gfortran-4.8 , this warning will be displayed.
This type of issue is caused by the internal LAPACK library, it calls a function IEEECK that does certain checks.
Normal exceptions of IEEE can be ignored:
IEEE_UNDERFLOW_FLAG is triggered when the result of an expression exceeds the precision of the variable being assigned the value. For most MESH variables this means a number smaller than E-38. This exception will also trigger IEEE_DENORMAL. This pair of flags can be triggered by parts of CLASS and WATDRN. The underflow error is typically inconsequential and should have no impact on the results of the simulation. It can be ignored.
Bad exceptions of IEEE
IEEE_DIVIDE_BY_ZERO is triggered when a number is divided by zero. This is more likely to occur by invalid drainage properties than bad parameterization. A common cause of the error is a cell that has invalid drainage properties, with drainage area, grid area, channel length, and/or channel slope set to zero.
One way to trace this warning is through adding this debugging flag: -ffpe-trap=invalid,zero .
-ffpe-trap=zero,overflow,underflow tells Fortran to trap the listed floating point errors (fpe). Having zero on the list means that if you divide by zero the code will die rather than setting the result to +INFINITY and continuing. Similarly, if overflow is on the list it will halt if you try to store a number larger than can be stored for the type of real number you are using because the exponent is too large.
Trapping underflow will halt if you compute a number that is too small because the exponent is a very large negative number. For 8-byte floating point numbers, this happens if the number is smaller than approximate 1E-324. If you don’t trap underflows, such numbers will just be set to 0, which is generally the correct thing to do. But computing such small numbers may indicate a bug of some sort in the program, so you might want to trap them.
Some reference for more info:
https://docs.oracle.com/cd/E19957-01/806-3568/ncg_handle.html
https://gcc.gnu.org/onlinedocs/gfortran/Debugging-Options.html