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

MOM6: +I/O interface changes, including a new file_type #1327

Merged
merged 8 commits into from
Feb 18, 2021

Conversation

Hallberg-NOAA
Copy link
Collaborator

Revised the interfaces for I/O to prepare for the substantial differences
between the FMS1 and FMS2 interfaces, by adding a MOM6-specific file_type,
clearly separating calls for ASCII file I/O and netCDF I/O, and other related
changes. Although there are nontrivial I/O interface changes, all answers and
output files are bitwise identical. The commits in this PR include:

  Added the new subroutine open_ASCII_file to open text files that can be read
or written to using simple Fortran read or write statements.  This was
previously handled via a common open_file call, but FMS2 is changing the
interface for this routine, and creating this new file de-conflicts most the
MOM6 calls to open_file from these altered interfaces.  The existing routine
open_file is unaltered and works exactly as before.  A number of existing calls
to open_file were also modified to use this new interface, in some cases where
only the root_PE was writing, this includes altering the code so that only the
root_PE actually opens the file.  All answers and output are bitwise identical.
  Added the overloaded interface rescale_comp_data to MOM_domains_infra to
rescale the values in the computational domain of a 2-d, 3-d, or 4-d array by
some factor without having to know the index convention that those arrays used.
Also simplified some of the code in MOM_io_infra by making use of
rescale_comp_data, and added a new optional scale argument to the various
MOM_write_field routines.  All answers are bitwise identical, but there are new
interfaces and optional arguments for existing routines.
  Use the new scale argument to MOM_write_field to simplify write_vertgrid_file
and write_ocean_geometry_file.  All output and answers are bitwise identical.
  Added and used the file_type as the handle for input and output, changing from
using an integer.  This changes the type of one of the required arguments to
write_field, write_MOM_field, create_file, reopen_file, get_file_info,
get_file_times, get_file_fields, write_metadata_axis and write_metadata_field,
and added new variants of open_file, close_file and flush_file using this new
type.  Also added the new routine file_is_open.  All answers are bitwise
identical, but there are changes to multiple I/O interfaces.
@codecov
Copy link

codecov bot commented Feb 13, 2021

Codecov Report

Merging #1327 (acb63eb) into dev/gfdl (4ea2f71) will decrease coverage by 0.01%.
The diff coverage is 54.04%.

Impacted file tree graph

@@             Coverage Diff              @@
##           dev/gfdl    #1327      +/-   ##
============================================
- Coverage     45.76%   45.74%   -0.02%     
============================================
  Files           234      234              
  Lines         72524    72540      +16     
============================================
- Hits          33192    33187       -5     
- Misses        39332    39353      +21     
Impacted Files Coverage Δ
src/diagnostics/MOM_PointAccel.F90 4.32% <0.00%> (ø)
src/framework/MOM_array_transform.F90 0.00% <ø> (ø)
src/framework/MOM_domain_infra.F90 47.47% <0.00%> (-1.35%) ⬇️
src/framework/MOM_domains.F90 55.46% <ø> (ø)
src/framework/MOM_restart.F90 37.58% <22.22%> (-0.04%) ⬇️
src/diagnostics/MOM_sum_output.F90 67.38% <47.05%> (+0.09%) ⬆️
src/framework/MOM_write_cputime.F90 87.87% <50.00%> (ø)
src/initialization/MOM_state_initialization.F90 29.88% <50.00%> (ø)
src/framework/MOM_io_infra.F90 38.67% <56.06%> (+3.70%) ⬆️
src/framework/MOM_io.F90 30.99% <56.71%> (+0.99%) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ea2f71...95f6711. Read the comment docs.

  Added the new optional scale argument to the real versions of the
read_variable routines.  All answers are bitwise identical, but there are
new optional arguments to public routines.
  Revised the depth list type used in MOM_sum_output to accommodate I/O using
ordinary routines, and to make the code creating, reading and writing it
potentially separable from the MOM_sum_output module by avoiding the use of the
MOM_sum_output control structure in most of the routines.  Also changed the
index 'l' to 'li' in some places to avoid having it misread as '1'.  All answers
are bitwise identical but there are changes in some subroutine arguments.
@Hallberg-NOAA
Copy link
Collaborator Author

Added two more commits that are closely related to this PR.

@marshallward
Copy link
Collaborator

marshallward commented Feb 18, 2021

@marshallward marshallward merged commit 45b3366 into mom-ocean:dev/gfdl Feb 18, 2021
@Hallberg-NOAA Hallberg-NOAA deleted the add_file_type branch July 30, 2021 18:03
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