Fix several PIO warnings: guard empty-string attributes and match start/count dims to variable rank#8464
Fix several PIO warnings: guard empty-string attributes and match start/count dims to variable rank#8464ndkeen wants to merge 2 commits into
Conversation
|
I started this effort with just a handful of cases, but then went through all of the tests in |
|
@ndkeen : Regarding the last change (autodetect ELM input file type), I think instead of reading a file to determine if its NetCDF4, a better approach is to convert NetCDF4 input files to ones that PnetCDF can work with ("64-bit data"). The choice of I/O type to read the file needs to be made in the config/xml stage. |
|
Yea I was also suspicious of that change. I reverted. |
|
Maybe the model should error if it finds a NetCDF4 input file? That would encourage people to do the conversion! |
|
OK to merge or do we want changes? |
|
@jonbob / @peterdschwartz : Please review the PR when you get a chance (please make sure that you are not losing any attributes. IMO, instead of removing the attributes a better approach would be to assign the correct value and write them out) |
peterdschwartz
left a comment
There was a problem hiding this comment.
Looks ok for the elm files
|
@jonbob please review. |
jonbob
left a comment
There was a problem hiding this comment.
approved based on visual inspection and developer testing
Fix a collection of PIO warnings emitted when writing NetCDF attributes with empty
strings and when start/count arrays do not match a variable's actual rank. Changes
span EAM, ELM, MPAS-framework, and the MCT/MOAB drivers.
Guard empty-string attribute writes (
units,standard_name): wrappio_put_attcalls in
if (len_trim(...) > 0)checks indriver-mct/seq_io_mod.F90,driver-moab/seq_io_mod.F90,cam_grid_support.F90,ncdio_pio.F90.in,restFileMod.F90, andmpas_stream_manager.Fto prevent PIO from writingzero-length string attributes.
Match start/count rank to variable rank (
tracer_data.F90,phys_prop.F90):query
pio_inq_varndimsbeforepio_get_var; passstrt(1:1)/cnt(1:1)for1-D variables to eliminate "count array size does not match variable rank" warnings.
Fix
avgflagrestart layout (cam_history.F90): add a dedicatedavgflag_lenstring-length dimension and store
avgflagas a 3-D variable to satisfy PIO'sleading-dimension convention. Read path detects old 2-D layout for backward
compatibility.
Fix date/time string dimension in ELM history (
histFileMod.F90): introducehist_date_str_len = 8fordate_written/time_writtendimensions instead ofreusing the 16-character field-name dimension; widen scale-type variables from
character(len=8)tocharacter(len=hist_dim_name_length).[BFB]