Use MOM_io in Surface_Bands_by_data_override#1388
Merged
marshallward merged 4 commits intoMay 14, 2021
Merged
Conversation
Revised Surface_Bands_by_data_override in MOM_wave_interface to use the interfaces from MOM_io instead of direct calls to NF90_ routines to read the coordinate frequency or wavenumber. This change will be more efficient by having only the root processor read the files and then broadcast the information to the other PEs, and it will be more robust by reusing common code used by other MOM6 routines. This commit partially addresses MOM6 issue mom-ocean#1312. All answers are bitwise identical.
Collaborator
|
Thanks @Hallberg-NOAA . At a glance this looks like a good rewriting of the NetCDF interfaces. I'm going to try to piece together a short test case to verify all the behavior (there unfortunately isn't any way to test in the current MOM6-examples repo). This may take a few days, but hopefully by early next week. Might be worth merging that test back into MOM6-examples, probably a light-weight single column example. |
Modified get_var_sizes so it does return ndims = -1 when querying for a variable that does not exist in a file (which was the intended behavior) and made use of this new and proper functionality to avoid using the function field_exists() in Surface_Bands_by_data_override(), because the fms_io implementation of field_exists incorrectly returns false when the variable being sought is also the name of a coordinate. Three minor bugs in wave diagnostics that Brandon Reichl had identified were also fixed, as was a test controlling an allocate statement. All answers are bitwise identical in cases that worked before, and the waves code is now working correctly with all IO calls going via MOM_io, rather than calling netCDF routines directly.
breichl
approved these changes
May 14, 2021
Collaborator
breichl
left a comment
There was a problem hiding this comment.
These changes now work in my test case. I approve.
Collaborator
marshallward
approved these changes
May 14, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Revised Surface_Bands_by_data_override in MOM_wave_interface to use the
interfaces from MOM_io instead of direct calls to NF90_ routines to read the
coordinate frequency or wavenumber. This change will be more efficient by
having only the root processor read the files and then broadcast the information
to the other PEs, and it will be more robust by reusing common code used by
other MOM6 routines. This commit partially addresses MOM6 issue #1312. All
answers are bitwise identical.