Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: inigrid.x gives Floating-point exception #53

Closed
MomoInSpace opened this issue Aug 28, 2023 · 2 comments
Closed

Bug: inigrid.x gives Floating-point exception #53

MomoInSpace opened this issue Aug 28, 2023 · 2 comments

Comments

@MomoInSpace
Copy link

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

@zrick
Copy link
Contributor

zrick commented Aug 28, 2023

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.

@MomoInSpace
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants