-
Notifications
You must be signed in to change notification settings - Fork 211
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
initialize_sponges_file
ignores default value of USE_REGRIDDING
#1576
Comments
Set default values in all get_param calls for USE_REGRIDDING. Previously, there had been 4 calls where this was missing, which led to the problems noted at mom-ocean#1576. This PR will allow that issue to be closed. Also used the default argument in a get_param call for INPUTDIR, although that case would not change any behavior because the value was set before the get_param call. A fail_in_missing argument was added to the FMS_cap call to get_param for GUST_2D_FILE, mirroring what is done for the solo_driver code, but cases where this was actually missing were very likely to have failed later anyway, but without an explicit error message. This PR could change unpredictable behavior in cases where USE_REGRIDDING is not explicitly set, but all answers are bitwise identical in the MOM6-examples test suite.
This specific issue will be corrected once NOAA-GFDL#180 has been merged into main. I have also created a test (in a separate commit) for any instances of calls to get_param without providing either a default value or a fail_if_missing argument, to avoid any other uninitialized variables. All code that is exercised by the MOM6-examples test suite (at https://github.com/NOAA-GFDL/MOM6-examples) are now passing these tests. However, I do not know whether this test is something that we will want to incorporate into our routine testing protocols, so for now I am keeping this new test on a separate branch at https://github.com/Hallberg-NOAA/MOM6/tree/fatal_missing_default, |
Set default values in all get_param calls for USE_REGRIDDING. Previously, there had been 4 calls where this was missing, which led to the problems noted at mom-ocean#1576. This PR will allow that issue to be closed. Also used the default argument in a get_param call for INPUTDIR, although that case would not change any behavior because the value was set before the get_param call. A fail_in_missing argument was added to the FMS_cap call to get_param for GUST_2D_FILE, mirroring what is done for the solo_driver code, but cases where this was actually missing were very likely to have failed later anyway, but without an explicit error message. This PR could change unpredictable behavior in cases where USE_REGRIDDING is not explicitly set, but all answers are bitwise identical in the MOM6-examples test suite.
The code correcting this issue has now been merged onto the main branch of MOM6 as a part of #1582, with the specific changes coming in from NOAA-GFDL#180. |
initialize_sponges_file
inMOM_state_initialization
reads theUSE_REGRIDDING
configuration parameter, but doesn't have a default set. The line in question isThis potentially leads to undefined behavior. In my case, I'm running in layered mode but didn't explicitly set
USE_REGRIDDING = False
since false is the default. With the Gnu11 compiler, this resulted inUSE_REGRIDDING
being set to true, but only ininitialize_sponges_file
. This made the sponges behave very strangely and took me a while to figure out what was going on.Explicitly setting
USE_REGRIDDING = False
solves the issue, but this is inconsistent with having it false by default.The text was updated successfully, but these errors were encountered: