Skip to content

Commit

Permalink
Merge branch 'darincomeau/ocn/cf-compliant-units' into next (PR #5027)
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
jonbob committed Aug 8, 2022
2 parents c31102d + c577c12 commit 2cc6c97
Show file tree
Hide file tree
Showing 41 changed files with 1,613 additions and 1,829 deletions.
1,260 changes: 624 additions & 636 deletions components/mpas-ocean/src/Registry.xml

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions components/mpas-ocean/src/analysis_members/Registry_TEMPLATE.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@
Pools and streams should be named with the camel case name as well (e.g. globalStatsOutput and globalStatsAM)
-->
<nml_record name="AM_temPlate" mode="forward;analysis">
<nml_option name="config_AM_temPlate_enable" type="logical" default_value=".false." units="unitless"
<nml_option name="config_AM_temPlate_enable" type="logical" default_value=".false."
description="If true, ocean analysis member temPlate is called."
possible_values=".true. or .false."
/>
<nml_option name="config_AM_temPlate_compute_interval" type="character" default_value="output_interval" units="unitless"
<nml_option name="config_AM_temPlate_compute_interval" type="character" default_value="output_interval"
description="Timestamp determining how often analysis member computation should be performed."
possible_values="Any valid time stamp, 'dt', or 'output_interval'"
/>
<nml_option name="config_AM_temPlate_output_stream" type="character" default_value="temPlateOutput" units="unitless"
<nml_option name="config_AM_temPlate_output_stream" type="character" default_value="temPlateOutput"
description="Name of the stream that the temPlate analysis member should be tied to."
possible_values="Any existing stream name or 'none'"
/>
<nml_option name="config_AM_temPlate_compute_on_startup" type="logical" default_value=".true." units="unitless"
<nml_option name="config_AM_temPlate_compute_on_startup" type="logical" default_value=".true."
description="Logical flag determining if an analysis member computation occurs on start-up."
possible_values=".true. or .false."
/>
<nml_option name="config_AM_temPlate_write_on_startup" type="logical" default_value=".true." units="unitless"
<nml_option name="config_AM_temPlate_write_on_startup" type="logical" default_value=".true."
description="Logical flag determining if an analysis member write occurs on start-up."
possible_values=".true. or .false."
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<nml_record name="AM_conservationCheck">
<nml_option name="config_AM_conservationCheck_enable" type="logical" default_value=".false." units="unitless"
<nml_option name="config_AM_conservationCheck_enable" type="logical" default_value=".false."
description="If true, ocean analysis member conservationCheck is called."
possible_values="true or false"
/>
<nml_option name="config_AM_conservationCheck_compute_interval" type="character" default_value="dt" units="unitless"
<nml_option name="config_AM_conservationCheck_compute_interval" type="character" default_value="dt"
description="Timestamp determining how often analysis member computation should be performed."
possible_values="Any valid time stamp, 'dt', or 'output_interval'"
/>
<nml_option name="config_AM_conservationCheck_output_stream" type="character" default_value="conservationCheckOutput" units="unitless"
<nml_option name="config_AM_conservationCheck_output_stream" type="character" default_value="conservationCheckOutput"
description="Name of the stream that the conservationCheck analysis member should be tied to."
possible_values="Any existing stream name or 'none'"
/>
<nml_option name="config_AM_conservationCheck_compute_on_startup" type="logical" default_value=".false." units="unitless"
<nml_option name="config_AM_conservationCheck_compute_on_startup" type="logical" default_value=".false."
description="Logical flag determining if an analysis member computation occurs on start-up."
possible_values="true or false"
/>
<nml_option name="config_AM_conservationCheck_write_on_startup" type="logical" default_value=".false." units="unitless"
<nml_option name="config_AM_conservationCheck_write_on_startup" type="logical" default_value=".false."
description="Logical flag determining if an analysis member write occurs on start-up."
possible_values="true or false"
/>
<nml_option name="config_AM_conservationCheck_write_to_logfile" type="logical" default_value=".true." units="unitless"
<nml_option name="config_AM_conservationCheck_write_to_logfile" type="logical" default_value=".true."
description="Logical flag determining if the conservation check is written to the log file."
possible_values="true or false"
/>
<nml_option name="config_AM_conservationCheck_restart_stream" type="character" default_value="conservationCheckRestart" units="unitless"
<nml_option name="config_AM_conservationCheck_restart_stream" type="character" default_value="conservationCheckRestart"
description="Name of the restart stream the analysis member will use to initialize itself if restart is enabled."
possible_values="A restart stream with state of the conservation check."
/>
Expand All @@ -32,7 +32,7 @@
<package name="conservationCheckAMPKG" description="This package includes variables required for the conservationCheck analysis member."/>
</packages>
<var_struct name="conservationCheckAM" time_levs="1" packages="conservationCheckAMPKG">
<var name="performConservationPrecompute" type="integer" dimensions="" units=""
<var name="performConservationPrecompute" type="integer" dimensions=""
description="" default_value="1"
/>
</var_struct>
Expand All @@ -52,61 +52,61 @@
<var name="absoluteEnergyError" type="real" dimensions="Time" units="J"
description="Absolute energy conservation error"
/>
<var name="relativeEnergyError" type="real" dimensions="Time" units="None"
<var name="relativeEnergyError" type="real" dimensions="Time" units="1"
description="Relative energy conservation error"
/>
<var name="accumulatedLatentHeatFlux" type="real" dimensions="Time" units="W m^{-2}"
<var name="accumulatedLatentHeatFlux" type="real" dimensions="Time" units="W m^-2"
description="Latent heat flux from coupler, integrated in space and time. Positive into the ocean."
/>
<var name="accumulatedSensibleHeatFlux" type="real" dimensions="Time" units="W m^{-2}"
<var name="accumulatedSensibleHeatFlux" type="real" dimensions="Time" units="W m^-2"
description="Sensible heat flux from coupler, integrated in space and time. Positive into the ocean."
/>
<var name="accumulatedLongWaveHeatFluxUp" type="real" dimensions="Time" units="W m^{-2}"
<var name="accumulatedLongWaveHeatFluxUp" type="real" dimensions="Time" units="W m^-2"
description="Upward long Wave heat flux from coupler, integrated in space and time. Positive into the ocean."
/>
<var name="accumulatedLongWaveHeatFluxDown" type="real" dimensions="Time" units="W m^{-2}"
<var name="accumulatedLongWaveHeatFluxDown" type="real" dimensions="Time" units="W m^-2"
description="Downward long wave heat flux from coupler, integrated in space and time. Positive into the ocean."
/>
<var name="accumulatedShortWaveHeatFlux" type="real" dimensions="Time" units="W m^{-2}"
<var name="accumulatedShortWaveHeatFlux" type="real" dimensions="Time" units="W m^-2"
description="shortwave heat flux from coupler, integrated in space and time. Positive into the ocean."
/>
<var name="accumulatedSeaIceHeatFlux" type="real" dimensions="Time" units="W m^{-2}"
<var name="accumulatedSeaIceHeatFlux" type="real" dimensions="Time" units="W m^-2"
description="Sea ice heat flux from coupler, integrated in space and time. Positive into the ocean."
/>
<var name="accumulatedMeltingSnowHeatFlux" type="real" dimensions="Time" units="W m^{-2}"
<var name="accumulatedMeltingSnowHeatFlux" type="real" dimensions="Time" units="W m^-2"
description="This is snowFlux * latent_heat_fusion_mks. Positive into the ocean."
/>
<var name="accumulatedMeltingIceRunoffHeatFlux" type="real" dimensions="Time" units="W m^{-2}"
<var name="accumulatedMeltingIceRunoffHeatFlux" type="real" dimensions="Time" units="W m^-2"
description="This is iceRunoffFlux * latent_heat_fusion_mks. Positive into the ocean."
/>
<var name="accumulatedRemovedIceRunoffHeatFlux" type="real" dimensions="Time" units="W m^{-2}"
<var name="accumulatedRemovedIceRunoffHeatFlux" type="real" dimensions="Time" units="W m^-2"
description="This is iceRunoffFlux * latent_heat_fusion_mks. Positive into the ocean."
/>
<var name="accumulatedIcebergHeatFlux" type="real" dimensions="Time" units="W m^{-2}"
<var name="accumulatedIcebergHeatFlux" type="real" dimensions="Time" units="W m^-2"
description="Iceberg heat flux from coupler, integrated in space and time. Positive into the ocean."
/>
<var name="accumulatedFrazilHeatFlux" type="real" dimensions="Time" units="W m^{-2}"
<var name="accumulatedFrazilHeatFlux" type="real" dimensions="Time" units="W m^-2"
description="Heat flux from frazil, integrated in space and time, given to couipler. Positive into the ocean."
/>
<var name="accumulatedLandIceHeatFlux" type="real" dimensions="Time" units="W m^{-2}"
<var name="accumulatedLandIceHeatFlux" type="real" dimensions="Time" units="W m^-2"
description="Land ice heat flux, integrated in space and time. Positive into the ocean."
/>
<var name="accumulatedLandIceFrazilHeatFlux" type="real" dimensions="Time" units="W m^{-2}"
<var name="accumulatedLandIceFrazilHeatFlux" type="real" dimensions="Time" units="W m^-2"
description="Land ice heat flux from frazil, integrated in space and time, given to couipler. Positive into the ocean."
/>
<var name="accumulatedRainTemperatureFlux" type="real" dimensions="Time" units="degC m s^{-1}"
<var name="accumulatedRainTemperatureFlux" type="real" dimensions="Time" units="C m s^-1"
description="Heat flux associated with rain. Positive into the ocean."
/>
<var name="accumulatedEvapTemperatureFlux" type="real" dimensions="Time" units="degC m s^{-1}"
<var name="accumulatedEvapTemperatureFlux" type="real" dimensions="Time" units="C m s^-1"
description="Heat flux associated with Evaporation. Positive into the ocean."
/>
<var name="accumulatedSeaIceTemperatureFlux" type="real" dimensions="Time" units="degC m s^{-1}"
<var name="accumulatedSeaIceTemperatureFlux" type="real" dimensions="Time" units="C m s^-1"
description="Heat flux associated with sea ice melt water. Positive into the ocean."
/>
<var name="accumulatedRiverRunoffTemperatureFlux" type="real" dimensions="Time" units="degC m s^{-1}"
<var name="accumulatedRiverRunoffTemperatureFlux" type="real" dimensions="Time" units="C m s^-1"
description="Heat flux associated with river runoff. Positive into the ocean."
/>
<var name="accumulatedIcebergTemperatureFlux" type="real" dimensions="Time" units="degC m s^{-1}"
<var name="accumulatedIcebergTemperatureFlux" type="real" dimensions="Time" units="C m s^-1"
description="Heat flux associated with iceberg melt. Positive into the ocean."
/>
</var_struct>
Expand All @@ -126,46 +126,46 @@
<var name="absoluteMassError" type="real" dimensions="Time" units="kg"
description="Absolute mass conservation error"
/>
<var name="relativeMassError" type="real" dimensions="Time" units="None"
<var name="relativeMassError" type="real" dimensions="Time" units="1"
description="Relative mass conservation error"
/>
<var name="accumulatedRainFlux" type="real" dimensions="Time" units="kg m^{-2} s^{-1}"
<var name="accumulatedRainFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
description="Fresh water flux from rain from coupler. Positive into the ocean."
/>
<var name="accumulatedSnowFlux" type="real" dimensions="Time" units="kg m^{-2} s^{-1}"
<var name="accumulatedSnowFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
description="Fresh water flux from snow from coupler. Positive into the ocean."
/>
<var name="accumulatedEvaporationFlux" type="real" dimensions="Time" units="kg m^{-2} s^{-1}"
<var name="accumulatedEvaporationFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
description="Evaporation flux from coupler. Positive into the ocean."
/>
<var name="accumulatedSeaIceFlux" type="real" dimensions="Time" units="kg m^{-2} s^{-1}"
<var name="accumulatedSeaIceFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
description="Fresh water flux from sea ice from coupler. Positive into the ocean."
/>
<var name="accumulatedRiverRunoffFlux" type="real" dimensions="Time" units="kg m^{-2} s^{-1}"
<var name="accumulatedRiverRunoffFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
description="Fresh water flux from river runoff from coupler. Positive into the ocean."
packages="thicknessBulkPKG"
/>
<var name="accumulatedIceRunoffFlux" type="real" dimensions="Time" units="kg m^{-2} s^{-1}"
<var name="accumulatedIceRunoffFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
description="Fresh water flux from ice runoff from coupler. Positive into the ocean."
/>
<var name="accumulatedRemovedRiverRunoffFlux" type="real" dimensions="Time" units="kg m^{-2} s^{-1}"
<var name="accumulatedRemovedRiverRunoffFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
description="Fresh water flux from river runoff from the coupler that was removed due to config_remove_AIS_coupler_runoff option. Positive into the ocean."
packages="thicknessBulkPKG"
/>
<var name="accumulatedRemovedIceRunoffFlux" type="real" dimensions="Time" units="kg m^{-2} s^{-1}"
<var name="accumulatedRemovedIceRunoffFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
description="Fresh water flux from ice runoff from the coupler that was removed due to config_remove_AIS_coupler_runoff option. Positive into the ocean."
packages="thicknessBulkPKG;activeTracersBulkRestoringPKG"
/>
<var name="accumulatedIcebergFlux" type="real" dimensions="Time" units="kg m^{-2} s^{-1}"
<var name="accumulatedIcebergFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
description="Fresh water flux from iceberg melt from coupler. Positive into the ocean."
/>
<var name="accumulatedFrazilFlux" type="real" dimensions="Time" units="kg m^{-2} s^{-1}"
<var name="accumulatedFrazilFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
description="Fresh water flux from frazil freezing under sea ice. Positive into the ocean."
/>
<var name="accumulatedLandIceFlux" type="real" dimensions="Time" units="kg m^{-2} s^{-1}"
<var name="accumulatedLandIceFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
description="Fresh water flux from land ice melt from coupler. Positive into the ocean."
/>
<var name="accumulatedLandIceFrazilFlux" type="real" dimensions="Time" units="kg m^{-2} s^{-1}"
<var name="accumulatedLandIceFrazilFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
description="Fresh water flux from frazil freezing under land ice. Positive into the ocean."
/>
</var_struct>
Expand All @@ -185,16 +185,16 @@
<var name="absoluteSaltError" type="real" dimensions="Time" units="kg"
description="Absolute salt conservation error"
/>
<var name="relativeSaltError" type="real" dimensions="Time" units="None"
<var name="relativeSaltError" type="real" dimensions="Time" units="1"
description="Relative salt conservation error"
/>
<var name="accumulatedSeaIceSalinityFlux" type="real" dimensions="Time" units="kg m^{-2} s^{-1}"
<var name="accumulatedSeaIceSalinityFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
description="Sea ice salinity flux from coupler. Positive into the ocean."
/>
<var name="accumulatedFrazilSalinityFlux" type="real" dimensions="Time" units="kg m^{-2} s^{-1}"
<var name="accumulatedFrazilSalinityFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
description="Salinity flux from frazil to sea ice, given to coupler. Positive into the ocean."
/>
<var name="accumulatedLandIceFrazilSalinityFlux" type="real" dimensions="Time" units="kg m^{-2} s^{-1}"
<var name="accumulatedLandIceFrazilSalinityFlux" type="real" dimensions="Time" units="kg m^-2 s^-1"
description="Salinity flux from frazil to Land Ice, given to coupler. Positive into the ocean."
/>
</var_struct>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<nml_record name="AM_debugDiagnostics" mode="forward;analysis">
<nml_option name="config_AM_debugDiagnostics_enable" type="logical" default_value=".false." units="unitless"
<nml_option name="config_AM_debugDiagnostics_enable" type="logical" default_value=".false."
description="If true, ocean analysis member debugDiagnostics is called."
possible_values=".true. or .false."
/>
<nml_option name="config_AM_debugDiagnostics_compute_interval" type="character" default_value="output_interval" units="unitless"
<nml_option name="config_AM_debugDiagnostics_compute_interval" type="character" default_value="output_interval"
description="Timestamp determining how often analysis member computation should be performed."
possible_values="Any valid time stamp, 'dt', or 'output_interval'"
/>
<nml_option name="config_AM_debugDiagnostics_output_stream" type="character" default_value="debugDiagnosticsOutput" units="unitless"
<nml_option name="config_AM_debugDiagnostics_output_stream" type="character" default_value="debugDiagnosticsOutput"
description="Name of the stream that the debugDiagnostics analysis member should be tied to."
possible_values="Any existing stream name or 'none'"
/>
<nml_option name="config_AM_debugDiagnostics_compute_on_startup" type="logical" default_value=".true." units="unitless"
<nml_option name="config_AM_debugDiagnostics_compute_on_startup" type="logical" default_value=".true."
description="Logical flag determining if an analysis member computation occurs on start-up."
possible_values=".true. or .false."
/>
<nml_option name="config_AM_debugDiagnostics_write_on_startup" type="logical" default_value=".true." units="unitless"
<nml_option name="config_AM_debugDiagnostics_write_on_startup" type="logical" default_value=".true."
description="Logical flag determining if an analysis member write occurs on start-up."
possible_values=".true. or .false."
/>
<nml_option name="config_AM_debugDiagnostics_check_state" type="logical" default_value=".false." units="unitless"
<nml_option name="config_AM_debugDiagnostics_check_state" type="logical" default_value=".false."
description="Logical flag determining if state checking happens when the debug diagnostics AM is called."
possible_values=".true. or .false."
/>
Expand Down
Loading

0 comments on commit 2cc6c97

Please sign in to comment.