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

Use MOM_io in Surface_Bands_by_data_override #1388

Merged

Conversation

Hallberg-NOAA
Copy link
Collaborator

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.

  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.
@breichl
Copy link
Collaborator

breichl commented Apr 30, 2021

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.
Copy link
Collaborator

@breichl breichl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes now work in my test case. I approve.

@marshallward
Copy link
Collaborator

marshallward commented May 14, 2021

@marshallward marshallward merged commit aacba8f into mom-ocean:dev/gfdl May 14, 2021
@Hallberg-NOAA Hallberg-NOAA deleted the MOM_io_in_wave_interface branch July 30, 2021 17:59
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

Successfully merging this pull request may close these issues.

3 participants