Change name of missing value attribute from missing_value to _FillValue#616
Conversation
|
I conducted some performance tests to see if The main message is that PIO2 is much faster than PIO1! But for this PR, the attribute name makes no difference with PIO2, but does make a slight difference with PIO1. |
|
@mark-petersen, thank you for doing this timing. Based on the results, I would advocate for just using I will do some testing of my own shortly and hopefully approve the PR. @mgduda and @MiCurry, are you and your collaborators using both PIO1 and PIO2 on a regular basis? |
|
@xylar I'm using PIO2 on almost every machine where I regularly build MPAS. But, I suspect there are a number of our collaborators who use PIO1 (if only because it can be easier to install). I don't think we should break compatibility with PIO1, though I don't see any issues in that regard with this PR. I agree that we should use just the |
|
@mark-petersen In the description of this PR, would it be more accurate to say that this merge "changes the name of the missing value attribute from It might also be helpful to summarize why we're making this change. Given the amount of time we all have spent in arriving at to this PR, I think a few sentences are in order. I can even add these if you're busy this week. |
|
While these changes do add a Checking out 6525f33 (the commit before), and running the same test the field is filled with 'missing_value'. |
|
@MiCurry, could you explain a bit more how you tested? Looking at the code, I don't understand why #562 would be affected. We are only changing the name of the attribute in the Fortran data structure, not the name in the registry. My reading of #562 is that it gets missing value from parsing the XML from the registry so it should still have |
|
Following up, I reran my test from before in which I created a variable that is all zeros about the MPAS-ocean bathymetry an fill values (filled using @MiCurry's changes in #562) below it. I created a variable array that is all ones above the bathymetry and all fill values below. That worked out just fine for me. So I don't think this PR is having any negative effect on the changes in #562. @MiCurry, can you please provide steps to reproduce the problem you're seeing? |
xylar
left a comment
There was a problem hiding this comment.
This worked great in my testing (see above)! I'm seeing _FillValue attributes on my test variables, as expected:
$ ncdump -h output.nc
...
double testMissingVar(Time, nCells, nVertLevels) ;
testMissingVar:units = "unitless" ;
testMissingVar:long_name = "A variable that is zero where valid and missing_value where not" ;
testMissingVar:_FillValue = 9.96920996838687e+36 ;
double testMissingArrayVar(Time, nCells, nVertLevels) ;
testMissingArrayVar:long_name = "A variable that is one where valid and missing_value where not" ;
testMissingArrayVar:units = "unitless" ;
testMissingArrayVar:_FillValue = 9.96920996838687e+36 ;
...
and corresponding dashes where the variable is invalid:
....
testMissingArrayVar =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _, _,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _, _, _, _,
...
|
Sorry about the delay. @xylar, I was trying to see if I could get a little more information on what I was experiencing. I'm quite confused myself as to what is happening. I created a <var name="int_field" type="integer" dimensions="nCells" missing_value="-1"/>And ran the init_atmosphere_model to interpolate real-data conditions and did not alter the code, so But the field was not set to -1 and had '-'. Switching the field to <var name="real_field" type="real" dimensions="nCells" missing_value="-1"/>But then it doesn't set the Perhaps I am setting things up incorrectly. I'll try another test on a different machine and see how that goes. |
|
@MiCurry, the first example with |
|
The second case sounds odd. The |
Ah that makes sense! My mistake!
I think I've discovered it. Looks like |
|
Hmm, maybe we should fix that. Seems like it will happen to others, too. |
@mark-petersen everything looks good to me, but I agree with @mgduda on the above. I also think it would be nice to be more explicit in the PR message e.g. 'The _Fillvalue attribute can be set by using missing_value in the registry'. I think that would be a clearer example than PR #571. |
|
I just added the words "in netCDF output files" to distinguish between XML attributes in the Registry and netCDF attributes. I also wrapped the description so that in plain text the lines won't be longer than 80 columns. |
mgduda
left a comment
There was a problem hiding this comment.
Thanks for the detailed timing numbers, @mark-petersen . This looks good to me.
#3737) Update MPAS framework This PR brings in a new mpas-source submodule with updates to the mpas framework itself, plus changes to the cores supporting the framework update. Some changes are made to the atmosphere core, even though it is not used by E3SM, in order to maintain consistency with the framework. This update includes the following individual branches and PRs, many of which are additions to the makefiles for summit, or optional libraries: * az/azamat/mpas-cmake/mpas-tool-dir (MPAS-Dev/MPAS-Model#629) * init_atmosphere/kd_tree_ties (MPAS-Dev/MPAS-Model#630) * mark-petersen/framework/add_FillValue (MPAS-Dev/MPAS-Model#616) * mark-petersen/framework/add_lapack_option (MPAS-Dev/MPAS-Model#613) * amametjanov/framework/nullify-field-pointers (MPAS-Dev/MPAS-Model#578) * framework/makefile_e3sm (MPAS-Dev/MPAS-Model#603) * xylar/framework/make_shell_bash (MPAS-Dev/MPAS-Model#594) * registry/missing_value (MPAS-Dev/MPAS-Model#562) * pwolfram/updates_make_intel_stack (MPAS-Dev/MPAS-Model#592) * azamat/framework/pgi-cpr-omp-workaround (MPAS-Dev/MPAS-Model#449) * az/framework/e3sm-cmake-qnosmp-typo (MPAS-Dev/MPAS-Model#579) * xylar/compass/add_prerequisite_tag * atmosphere/fix_timekeeping_imports (MPAS-Dev/MPAS-Model#582) * xylar/fix_docs_ci (MPAS-Dev/MPAS-Model#575) * xylar/add_compass_docs (MPAS-Dev/MPAS-Model#472) * philipwjones/framework/summitmake (MPAS-Dev/MPAS-Model#536) * atmosphere/atm_core_cleanup (MPAS-Dev/MPAS-Model#548) * init_atmosphere/parse_geoindex (MPAS-Dev/MPAS-Model#459) * xylar/compass/add_copy_file (MPAS-Dev/MPAS-Model#467) * init_atmosphere/kd_tree (MPAS-Dev/MPAS-Model#438) * init_atmosphere/mpas_stack (MPAS-Dev/MPAS-Model#426) * operators/add_mpas_in_cell (MPAS-Dev/MPAS-Model#400) Fixes #3396 Fixes #3236 [BFB]
Update MPAS framework This PR brings in a new mpas-source submodule with updates to the mpas framework itself, plus changes to the cores supporting the framework update. Some changes are made to the atmosphere core, even though it is not used by E3SM, in order to maintain consistency with the framework. This update includes the following individual branches and PRs, many of which are additions to the makefiles for summit, or optional libraries: * az/azamat/mpas-cmake/mpas-tool-dir (MPAS-Dev/MPAS-Model#629) * init_atmosphere/kd_tree_ties (MPAS-Dev/MPAS-Model#630) * mark-petersen/framework/add_FillValue (MPAS-Dev/MPAS-Model#616) * mark-petersen/framework/add_lapack_option (MPAS-Dev/MPAS-Model#613) * amametjanov/framework/nullify-field-pointers (MPAS-Dev/MPAS-Model#578) * framework/makefile_e3sm (MPAS-Dev/MPAS-Model#603) * xylar/framework/make_shell_bash (MPAS-Dev/MPAS-Model#594) * registry/missing_value (MPAS-Dev/MPAS-Model#562) * pwolfram/updates_make_intel_stack (MPAS-Dev/MPAS-Model#592) * azamat/framework/pgi-cpr-omp-workaround (MPAS-Dev/MPAS-Model#449) * az/framework/e3sm-cmake-qnosmp-typo (MPAS-Dev/MPAS-Model#579) * xylar/compass/add_prerequisite_tag * atmosphere/fix_timekeeping_imports (MPAS-Dev/MPAS-Model#582) * xylar/fix_docs_ci (MPAS-Dev/MPAS-Model#575) * xylar/add_compass_docs (MPAS-Dev/MPAS-Model#472) * philipwjones/framework/summitmake (MPAS-Dev/MPAS-Model#536) * atmosphere/atm_core_cleanup (MPAS-Dev/MPAS-Model#548) * init_atmosphere/parse_geoindex (MPAS-Dev/MPAS-Model#459) * xylar/compass/add_copy_file (MPAS-Dev/MPAS-Model#467) * init_atmosphere/kd_tree (MPAS-Dev/MPAS-Model#438) * init_atmosphere/mpas_stack (MPAS-Dev/MPAS-Model#426) * operators/add_mpas_in_cell (MPAS-Dev/MPAS-Model#400) Fixes #3396 Fixes #3236 [BFB]

This PR changes the name of the missing value attribute in netCDF output files
from
missing_valueto_FillValue. The_FillValueattribute can be set by addinga
missing_valueto individual variables andvar_arraysin the Registry file(See #571 for an example).
This change is needed because some analysis software, notably NCO, does not
support the
missing_valueattribute by default and expects_FillValueinstead.