turbulencia / tlab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: inigrid.x gives Floating-point exception

MomoInSpace opened this issue · comments

I compiled the master branch with the file uhhpc, and changed only the DEBUG flags:

set(USER_Fortran_FLAGS_DEBUG "-O0 -p -ggdb -Wall -fbacktrace -ffpe-trap=invalid,zero,overflow,underflow,precision,denormal")
#set(USER_Fortran_FLAGS_DEBUG "-O0 -ggdb -Wall -fbacktrace -fconvert=little-endian -fallow-argument-mismatch -ffpe-trap=invalid,zero,overflow")

If I use this setup, the grid doesn't get initialized with the test case Case05. (inigrid.x), but instead gives an error

Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.

Backtrace for this error:
#0  0x7fc04b8098c2 in ???
#1  0x7fc04b808a55 in ???
#2  0x7fc04b47096f in ???
	at /build/glibc-6iIyft/glibc-2.28/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
#3  0x406f19 in inigrid
	at /home/zmaw/u234116/Coding/tlab/src/tools/initialize/grid/grid_main.f90:65
#4  0x409f2f in main
	at /home/zmaw/u234116/Coding/tlab/src/tools/initialize/grid/grid_main.f90:7
Floating point exception

Hi,

Did you check which of the ffpe-flags does give you the errors?

FYI: grid generation has some multiplications with zero (or values close to zero). With
-ffpe-trap=underflow,precision

these will raise errors. It may be better to use
-ffpe-summary=all
which will yield an informative warning ideally containing information which exception was raised and where, but not kill the code.

Yes, when using the -ffpe-summary=all instead of -ffpe-trap=underflow,precision it works.
It may be useful to change these in all of the cmake setting files.