-
Notifications
You must be signed in to change notification settings - Fork 371
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
Make MPAS-Ocean units CF compliant #5027
Conversation
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.
Wow, @darincomeau! This was a lot of work! Thanks for putting in the time. I went through all the files and found ~80 things to fix, which sounds like a lot but it's a tiny fraction compared to what you changed already.
components/mpas-ocean/src/analysis_members/Registry_global_stats.xml
Outdated
Show resolved
Hide resolved
components/mpas-ocean/src/analysis_members/Registry_mixed_layer_heat_budget.xml
Outdated
Show resolved
Hide resolved
components/mpas-ocean/src/analysis_members/Registry_mixed_layer_heat_budget.xml
Outdated
Show resolved
Hide resolved
@@ -50,10 +50,10 @@ | |||
<var name="binBoundaryZonalMean" type="real" dimensions="nZonalMeanBinsP1" units="varies" |
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.
@czender, this variable sometimes gets used with units of radians
and sometimes with m
. Is there a way to handle this in a CF-compliant way?
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.
Just noting this is the only review comment I haven't addressed
components/mpas-ocean/src/tracer_groups/Registry_activeTracers.xml
Outdated
Show resolved
Hide resolved
components/mpas-ocean/src/tracer_groups/Registry_activeTracers.xml
Outdated
Show resolved
Hide resolved
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.
Looks great. I agree with @xylar on replacing the "per second" with "s^-1" or "second-1", and that inverse salinity is better as "1.e^3" than "1.e^-3^-1".
Thanks again @xylar for all of those comments! I've corrected them all, along with some other similar offenders that came up with grep. |
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 @darincomeau. This looks great. I ran a quick test to make sure. This compiles with both gnu and intel, and passes gnu optimized bfb against the branchpoint (as expected) with the compass nightly suite.
@xylar is this ready? |
@rljacob, no these changes are big enough that I will take another look when I get back from vacation and I do want all the reviewers listed here to have a look, too. @milenaveneziani and @vanroekel, can you have a look when you have time? |
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, @darincomeau, the updated version looks great!
@@ -52,7 +52,7 @@ | |||
description="sum of the volumeEdge variable over the full domain, used to normalize global statistics" | |||
packages="forwardMode;analysisMode" | |||
/> | |||
<var name="CFLNumberGlobal" type="real" dimensions="Time" units="unitless" | |||
<var name="CFLNumberGlobal" type="real" dimensions="Time"units="1" |
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.
Space issue
<var name="CFLNumberGlobal" type="real" dimensions="Time"units="1" | |
<var name="CFLNumberGlobal" type="real" dimensions="Time" units="1" |
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.
nice catch - thanks!
@milenaveneziani @vanroekel , this is good to go as far as I and the approved reviewers. Would you mind taking a look here, since there are extensive changes? |
description="Form of pressure gradient terms in momentum equation. For most applications, the gradient of pressure and layer mid-depth are appropriate. For isopycnal coordinates, one may use the gradient of the Montgomery potential. The sea surface height gradient (ssh_gradient) option is for barotropic, depth-averaged pressure." | ||
possible_values="'ssh_gradient', 'pressure_and_zmid' or 'Jacobian_from_density' or 'Jacobian_from_TS' or 'MontgomeryPotential' or 'constant_forced'" | ||
/> | ||
<nml_option name="config_common_level_weight" type="real" default_value="0.5" units="unitless" | ||
<nml_option name="config_common_level_weight" type="real" default_value="0.5" | ||
description="The weight between standard Jacobian and weighted Jacobian, $\gamma$." |
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.
Is the use of the latex '$$' allowed? (I noticed this here, but there might be other places that I might have missed)
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.
Good call! Those need to be removed because they just clutter things up now that we're not focusing on the latex documentation. My guess is that they won't cause errors in the CF-checker though.
@darincomeau, I suppose it's up to you if that's in the scope of this PR or should be a separate one.
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 pointing this out @milenaveneziani . But I think trying to remove all latex syntax from attributes like description, which won't impact CF compliance, are more general registry cleanup and outside the scope here, so I think I'd prefer to leave this as is for now rather than trying to do a more complete job of that.
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.
sounds good @darincomeau. I just wanted to make sure that it wasn't required.
description="divergence of transport velocity at cell centers at a depth of approximately 250 m" | ||
/> | ||
<var name="relativeVorticityVertexAt250m" type="real" dimensions="nVertices Time" units="s^{-1}" | ||
<var name="relativeVorticityVertexAt250m" type="real" dimensions="nVertices Time" units="s^-1" | ||
description="relative vorticity at cell vertices at a depth of approximately 250 m" | ||
/> | ||
<var_array name="activeTracersAtSurface" type="real" dimensions="nCells Time"> | ||
<var name="temperatureAtSurface" array_group="activeTracersAtSurface" units="^\circ C" name_in_code="temperatureAtSurface" |
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.
Should be 'C' above.
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.
Definitely a great catch here.
description="relative vorticity at cell centers at bottom" | ||
/> | ||
<var name="divergenceAtBottom" type="real" dimensions="nCells Time" units="s^{-1}" | ||
<var name="divergenceAtBottom" type="real" dimensions="nCells Time" units="s^-1" | ||
description="divergence at cell centers at bottom" | ||
/> | ||
<var_array name="activeTracersAvgTopto0100" type="real" dimensions="nCells Time"> | ||
<var name="temperatureAvgTopto0100" array_group="activeTracersAvgTopto0100" units="^\circ C" name_in_code="temperatureAvgTopto0100" |
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.
same here. I also noticed a couple of more places below, so you may want to check the whole file.
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.
and here... I'll grep for the offender to fix any others
description="flag to monitor if the particle was transfered" | ||
/> | ||
<!-- TEMP FIELDS THAT NEED MOVED TO NonHalo below after verifying interpolation is correct --> | ||
<var name="particleTemperature" type="real" dimensions="nParticles Time" units="degrees Celsius" | ||
<var name="particleTemperature" type="real" dimensions="nParticles Time" units="C" | ||
description="sampled temperature for particle" | ||
/> | ||
<var name="particleSalinity" type="real" dimensions="nParticles Time" units="grams salt per kilogram seawater" |
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.
change units above
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! will do
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.
wow @darincomeau: these are indeed extensive changes.. Thanks for implementing them.
I noted a few things by going through each file: not sure if I got everything, but hopefully..
Thanks for those catches @milenaveneziani - changes have been pushed. I think I've said this earlier in this PR, but I've only actually run |
@vanroekel please review. |
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.
looks good to me. Very impressive work @darincomeau
@darincomeau - can you please check the conflicts in Registry? I'd like to merge this and I'm not sure about some of the changes that have been introduced since you started this work |
7b18ec7
to
c577c12
Compare
Rebased to pick up and resolve conflicts in |
Make MPAS-Ocean units CF compliant This makes changes to the units in MPAS-Ocean's Registry files to be CF compliant. The main changes for CF compliance are: * variables not have a units attribute if they are unitless (i.e. no units='unitless', units='NA', etc.) * variables should have units=1 if they are dimensionless (e.g. real-valued coefficients) * we cannot use latex symbols like { and } in the units * we cannot use units='PSU' for salinity, we need to use units=1e-3, though we can state that the units are grams per kilogram in the description (used as the long_name attribute in output files). Further discussion found in E3SM-Ocean-Discussion#24 Note this does not change any units on BGC variables [BFB]
passed:
merged to next |
merged to master |
This makes changes to the units in MPAS-Ocean's Registry files to be CF compliant. CF Standard Units
The main changes for CF compliance are:
Further discussion found in E3SM-Ocean-Discussion#24
Note this does not change any units on BGC variables, as found in the following Registry files under
tracer_groups
:[BFB]