Skip to content

Commit

Permalink
Merge branch 'mark-petersen/ocean/single_precision_output' (PR #3360)
Browse files Browse the repository at this point in the history
Change all ocean output files to single precision

Currently, all MPAS-Ocean output files are double precision. This is not
necessary and doubles file space and write time. This PR adds the single
line to specify single precision to all output streams with 2D and 3D fields.
For standard simulations, this only alters:
* monthly time averages, used for MPAS-Analysis
* high frequency stats, used for animations
Restart files remain double precision. The time average is computed in double
precision, and the final value is then written in single precision.

This will be bit-for-bit for comparison of restart and coupler files,
but not for ocean output files.

[BFB]
  • Loading branch information
jonbob committed Mar 2, 2020
2 parents 77b6390 + b8bca6c commit 621e360
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions components/mpas-ocean/cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ def buildnml(case, caseroot, compname):
lines.append('')
lines.append('<stream name="eddyProductVariablesOutput"')
lines.append(' type="output"')
lines.append(' precision="single"')
if ocn_grid.startswith("oRRS1"):
lines.append(' io_type="pnetcdf,cdf5"')
else:
Expand All @@ -663,6 +664,7 @@ def buildnml(case, caseroot, compname):
lines.append('')
lines.append('<stream name="highFrequencyOutput"')
lines.append(' type="output"')
lines.append(' precision="single"')
lines.append(' io_type="{}"'.format(ocn_pio_typename))
lines.append(' filename_template="mpaso.hist.am.highFrequencyOutput.$Y-$M-$D_$h.$m.$s.nc"')
lines.append(' filename_interval="00-01-00_00:00:00"')
Expand Down Expand Up @@ -710,6 +712,7 @@ def buildnml(case, caseroot, compname):
lines.append('')
lines.append('<stream name="mixedLayerDepthsOutput"')
lines.append(' type="output"')
lines.append(' precision="single"')
lines.append(' io_type="{}"'.format(ocn_pio_typename))
lines.append(' filename_template="mpaso.hist.am.mixedLayerDepths.$Y-$M-$D.nc"')
lines.append(' filename_interval="00-01-00_00:00:00"')
Expand All @@ -726,6 +729,7 @@ def buildnml(case, caseroot, compname):
lines.append('')
lines.append('<stream name="timeSeriesStatsDailyOutput"')
lines.append(' type="output"')
lines.append(' precision="single"')
lines.append(' io_type="{}"'.format(ocn_pio_typename))
lines.append(' filename_template="mpaso.hist.am.timeSeriesStatsDaily.$Y-$M-$D.nc"')
lines.append(' filename_interval="00-01-00_00:00:00"')
Expand Down Expand Up @@ -775,6 +779,7 @@ def buildnml(case, caseroot, compname):
lines.append('')
lines.append('<stream name="timeSeriesStatsMonthlyOutput"')
lines.append(' type="output"')
lines.append(' precision="single"')
if ocn_grid.startswith("oRRS1"):
lines.append(' io_type="pnetcdf,cdf5"')
else:
Expand Down Expand Up @@ -973,6 +978,7 @@ def buildnml(case, caseroot, compname):
lines.append('')
lines.append('<stream name="timeSeriesStatsMonthlyMaxOutput"')
lines.append(' type="output"')
lines.append(' precision="single"')
if ocn_grid.startswith("oRRS1"):
lines.append(' io_type="pnetcdf,cdf5"')
else:
Expand Down Expand Up @@ -1024,6 +1030,7 @@ def buildnml(case, caseroot, compname):
lines.append('')
lines.append('<stream name="timeSeriesStatsMonthlyMinOutput"')
lines.append(' type="output"')
lines.append(' precision="single"')
if ocn_grid.startswith("oRRS1"):
lines.append(' io_type="pnetcdf,cdf5"')
else:
Expand Down Expand Up @@ -1075,6 +1082,7 @@ def buildnml(case, caseroot, compname):
lines.append('')
lines.append('<stream name="timeSeriesStatsClimatologyOutput"')
lines.append(' type="output"')
lines.append(' precision="single"')
lines.append(' io_type="{}"'.format(ocn_pio_typename))
lines.append(' filename_template="mpaso.hist.am.timeSeriesStatsClimatology.$Y-$M-$D.nc"')
lines.append(' filename_interval="00-01-00_00:00:00"')
Expand All @@ -1088,6 +1096,7 @@ def buildnml(case, caseroot, compname):
lines.append('')
lines.append('<stream name="timeSeriesStatsCustomOutput"')
lines.append(' type="output"')
lines.append(' precision="single"')
lines.append(' io_type="{}"'.format(ocn_pio_typename))
lines.append(' filename_template="mpaso.hist.am.timeSeriesStatsCustom.$Y-$M-$D.nc"')
lines.append(' filename_interval="00-01-00_00:00:00"')
Expand Down

0 comments on commit 621e360

Please sign in to comment.