-
Notifications
You must be signed in to change notification settings - Fork 78
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
Add quiet nan and signaling nan options to FieldFill. #133
Conversation
Thanks for this. I like the idea of providing a mechanism for initializing fields to NaN. According to https://fortranwiki.org/fortran/show/Fortran+2003+status, IEEE arithmetic is supported for all Fortran compilers listed there except g95 (is that compiler actually still used anywhere?)... though there may be some other compilers not listed in the table, and we have definitely found instances where this table lists a compiler as supporting something when in fact the support is incomplete / buggy. For what it's worth, here is the inf/nan module we use in CESM: https://github.com/escomp/CESM_share/blob/main/src/shr_infnan_mod.F90.in It's quite possible that it is out of date in terms of its list of compilers that support ieee arithmetic - e.g., you found that gnu supports it, though it's possible that its support isn't complete (see also my comment in the next paragraph). Also, as a side-note: When working with NaNs in gfortran, I ran into this issue: ESMCI/ccs_config_cesm#4. I don't think this should affect the changes here, but is something to be aware of when working with NaNs. I'd suggest that, if we include this, then we include at least one unit test that can indicate whether this is working for a given machine/compiler – e.g., setting a field to NaN and then checking that the value is NaN. |
@theurich @billsacks |
@danrosen25 Add unit test to FieldFill for filling nan and snan. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes look good, and results under https://earthsystemmodeling.org/esmf-test-summary/feature_fill_nan/index.html are as expected.
This is ready to be merged into develop.
@danrosen25 after this PR is closed, please open a new one for looking at adding additional compiler flags under under the ESMF_BOPT=g option. Thanks. |
@theurich Should we worry about any of these results?
|
No, they are as expected. The branch is behind a fix that went into develop recently to bring many of those counts down. I did not see anything in the results I looked at that would indicate there is any issue with the NaNs, especially not on a fundamental level, like not finding the ieee module, etc. Please merge into develop at your convenience. Thanks. |
Questions
Testing
I've added a test to ESMF_FieldRegridUTest. There's also a snan (signaling nan) test that will fail IF floating point exceptions are added to the build; this test is turned off.
Intel fpe flags
Testing complete with gfortran (mac os) and intel (linux)