-
Notifications
You must be signed in to change notification settings - Fork 16
PIO reader class cleanup #408
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
Conversation
…le instead of pointer variables.
@@ -371,7 +326,7 @@ subroutine get_netcdf_var_int_1d(this, varname, var, errmsg, errcode) | |||
errmsg = '' | |||
end subroutine get_netcdf_var_int_1d | |||
|
|||
subroutine get_netcdf_var_int_2d(this, varname, var, errmsg, errcode) | |||
subroutine get_netcdf_var_int_2d(this, varname, var, errmsg, errcode, start, count) |
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.
You've added start/count to all of these routines, but you are not doing anything with them yet. I assume this is for future development. I would suggest that you might want to have
- A check that both start and count are either set or not set, as I don't know if the underlying netCDF routines will gracefully handle just one of them being present
- A check that the dimensionality of start and count matches var_ndims
- That count(i) <= dim_sizes(i)
- That start(i) <= dim_sizes(i)
Some of these may be handled by the pio calls, but if they are not, perhaps checks like these should be made
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.
Thanks for these great suggestions! My hope was to tackle all of the actual subsetting code in a future PR (as we needed this one in ASAP), so is it ok if I implement these requests then? If not then please let me know!
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.
Leaving this unresolved to aid in finding it again with the future PR
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.
a couple of wee questions
@@ -371,7 +326,7 @@ subroutine get_netcdf_var_int_1d(this, varname, var, errmsg, errcode) | |||
errmsg = '' | |||
end subroutine get_netcdf_var_int_1d | |||
|
|||
subroutine get_netcdf_var_int_2d(this, varname, var, errmsg, errcode) | |||
subroutine get_netcdf_var_int_2d(this, varname, var, errmsg, errcode, start, count) |
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.
Leaving this unresolved to aid in finding it again with the future PR
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.
thanks for accommodating my pedantry!
Tag name (required for release branches):
Originator(s): nusbaume
Description (include the issue title, and the keyword ['closes', 'fixes', 'resolves'] followed by the issue number):
This PR does several things:
Modifies the "get_var" methods to expect allocatables and not pointers, which is needed for Change file reader class allocation methods atmospheric_physics#265
Adds optional "start" and "count" variables to the "get_var" method, in preparation for variable subsetting. However, for now these variables are both no-ops.
Cleanup the code by creating a new "get_dim_sizes" subroutine, which noticeably reduces the amount of duplicated code.
Addresses #406
Describe any changes made to build system: N/A
Describe any changes made to the namelist: N/A
List any changes to the defaults for the input datasets (e.g. boundary datasets): N/A
List all files eliminated and why: N/A
List all files added and what they do: N/A
List all existing files that have been modified, and describe the changes:
(Helpful git command:
git diff --name-status development...<your_branch_name>
)M .gitmodules
M src/physics/ncar_ccpp
M src/physics/utils/pio_reader.F90
M test/unit/fortran/src/pio_reader/test_pio_reader.pf
If there are new failures (compared to the
test/existing-test-failures.txt
file),have them OK'd by the gatekeeper, note them here, and add them to the file.
If there are baseline differences, include the test and the reason for the
diff. What is the nature of the change? Roundoff?
derecho/intel/aux_sima: ALL PASS
derecho/gnu/aux_sima: ALL PASS
If this changes climate describe any run(s) done to evaluate the new
climate in enough detail that it(they) could be reproduced:
CAM-SIMA date used for the baseline comparison tests if different than latest: