forked from mom-ocean/MOM6
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Rewrite horizontal regridding to use netCDF wrapper functions #48
Merged
Merged
Changes from 6 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
2400ea0
Refresh attempt to get rid of NetCDF calls
MJHarrison-GFDL 95f509e
Fix comments
MJHarrison-GFDL 2909e52
Set netCDF attrs in MOM_horizontal_regridding
marshallward 221df78
Merge pull request #13 from marshallward/pr_1534_mods
MJHarrison-GFDL 051e8a4
read_variable_2d in horizontal remapping
marshallward 577c0c1
Merge branch 'dev/gfdl' into hor_regrid
marshallward 93b74ad
set default scale factor to 1
MJHarrison-GFDL 282395b
Merge branch 'dev/gfdl' into hor_regrid
marshallward c664aa5
add missing start/count arguments
MJHarrison-GFDL 8fae1ee
Update MOM_io.F90
marshallward 9865334
Manage optional args in read_variable_2d
marshallward ecfa52c
Merge branch 'dev/gfdl' into hor_regrid
Hallberg-NOAA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that there a several problems with this test.
start
andnread
arguments are optional, there needs to be test for whether they are present to wrap the test for whether they have the right size. Otherwise, this code as written could lead to a segmentation fault.start
andnread
are used in the call to nf90_get_var.ndims
is a property of an input file, whereas the sizes ofstart
andnread
are effectively hard coded in the call to read_variable. Could there be a case where it would be appropriate to set start and nread so that this routine could, for example, read either from a 2-d file or read a single level from a 3-d file into a 2-d array, depending on what is in the file that is being read? If so, issuing an fatal error might not be the right answer.Could this work properly if the tests were changed to
if (present(start) .and. present(nread)) then ; if ((size(start) < ndims) .or. size(nread) < ndims) then
, and then the call to nf90_get_var were changed toif (present(start) .and. present(nread) then call nf90_get_var(ncid, varid, var, start(1:ndims), nread(1:ndims)) else call nf90_get_var(ncid, varid, var) endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional arguments are pass-through, so the call to
nf90_get_var
does not need to be changed. But I agree with the general conclusions here.