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

read_variable_2d modified to accept 3 or 4 dims #67

Conversation

marshallward
Copy link
Member

The read_variable_2d function was previously configured to only run if
the start and nread arrays matched the size of the field they were
accessing. This was incompatible with the history of the function,
which had previously required a fourth time axis (of one record), then
was later modified to not require this axis. As a result, there are now
files in use both with and without a time axis.

This patch relaxes this check to ensure that the read is quasi-2d, i.e.
the first two axes can read a segment of a 2d field, but will now
reshape the start and nread arrays to match the field being read. Some
additional checks are also added to ensure that it only reads one 2d
slice.

The read_variable_2d function was previously configured to only run if
the start and nread arrays matched the size of the field they were
accessing.  This was incompatible with the history of the function,
which had previously required a fourth time axis (of one record), then
was later modified to not require this axis.  As a result, there are now
files in use both with and without a time axis.

This patch relaxes this check to ensure that the read is quasi-2d, i.e.
the first two axes can read a segment of a 2d field, but will now
reshape the start and nread arrays to match the field being read.  Some
additional checks are also added to ensure that it only reads one 2d
slice.
@marshallward
Copy link
Member Author

This PR has been tenatively tested for regressions: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/14711 ✔️

@codecov
Copy link

codecov bot commented Feb 8, 2022

Codecov Report

Merging #67 (e75d844) into dev-gfdl-main-candidate-2022-01-29 (65998cd) will decrease coverage by 0.00%.
The diff coverage is 30.43%.

Impacted file tree graph

@@                          Coverage Diff                           @@
##           dev-gfdl-main-candidate-2022-01-29      #67      +/-   ##
======================================================================
- Coverage                               28.94%   28.94%   -0.01%     
======================================================================
  Files                                     242      242              
  Lines                                   71553    71589      +36     
======================================================================
+ Hits                                    20714    20723       +9     
- Misses                                  50839    50866      +27     
Impacted Files Coverage Δ
src/framework/MOM_io.F90 32.97% <30.43%> (-0.30%) ⬇️

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 65998cd...e75d844. Read the comment docs.

@marshallward
Copy link
Member Author

This is has been vetted by EMC, discussed within GFDL, and has passed regression, so I will merge into the candidate branch. We can do a further internal review when merging back to dev/gfdl if required.

@marshallward marshallward merged commit 3f58f8a into NOAA-GFDL:dev-gfdl-main-candidate-2022-01-29 Feb 8, 2022
@marshallward marshallward deleted the read_var2d_dimfix branch September 16, 2022 20:56
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.

1 participant