Because of additional requirements placed upon POP2 time-averaged output files by CESM1 and because of the extended capability of the CESM1 POP2 time-averaged history fields, the two versions are documented separately in the following two subsections.

LANL Time-averaged history files

The namelist tavg_nml controls the frequency and content of time-averaged history files. These files are constructed by accumulating in memory at each time-step the running sums of selected variables or correlation of variables. Consequently, time averaging can be very memory intensive and may not be feasible on your computer. Snapshot history files provide an alternative, but at the price of having to recall many files from archival storage to compute the sums. The tavg_freq determines both the frequency at which the files are written as well as the interval over which the time average is to be performed.

Because the time averages are running averages, tavg restart files are written whenever a model restart file is written so that the averaging can continue upon restart. Note that the fields in the output files are normalized by the accumulated time since the start of the time average. The time interval used for this normalization is output as the file attribute tavg_sum. When the model restarts from a restart file, the sums are de-normalized before continuing the accumulated sum.

The user may also control when the time averaging will begin. For example, if the time averaging should be started after the model has equilibrated, the user can specify when time averaging should start through the tavg_start variables. The choices are similar to the model start options.

Table: LANL POP2 Time-average file namelist
&tavg_nml Valid Values
[default]
generation of time-average history files
tavg_freq_opt['never'], 'nyear', 'nmonth', 'nday', 'nhour', 'nsecond', 'nstep'units of time for 'tavg_freq'
tavg_freq[100000]interval in above units for computation and output of time-average history files
tavg_start_opt['nstep'], 'nyear', 'nmonth', 'nday', 'date'units for tavg_start ('date' implies yyyymmdd)
tavg_start[100000]time in above units after which to start accumulating time average
tavg_infile['unknown']restart file for partial tavg sums if starting from restart (ignored if luse_pointer_files is enabled)
tavg_fmt_in['bin'],'nc'format for tavg restart file (binary or netCDF)
tavg_outfile['unknown']root filename (with path) for tavg output files (suffixes will be added)
tavg_fmt_out['bin'],'nc'format for tavg output files (binary or netCDF)
tavg_contents'sample_tavg_contents'file name for input file containing names of fields requested for tavg output
/

IMPORTANT: Before a new run-sequence is begun, careful thought should be given to the contents of the time-average history files. The same considerations apply to snapshot history and movie files. Although it is possible to redefine the contents at any time during the sequence, this is not recommended. Changing the contents can greatly complicate the process of combining short-interval (e.g., monthly) files into longer-interval files, such as seasonal, annual and multi-year composite files.

For time-averaged output, a tavg_contents file is required containing a simple list (one field per line) of accepted short names for all the fields desired for the output file. A sample_tavg_contents file is supplied containing a large list of fields available for tavg output. It is meant for the user to use as a template, modifying it for their own needs by deleting entries or adding new ones. If a user wishes to add a field that is currently not available, the user must modify the code to add that field using other available fields as a template.

CESM1 Time-averaged history files

In CESM1 POP2, the time-averaged history-file ("tavg") module has been modified to provide additional features and options to the user:

  • support for the creation of multiple, simultaneous output streams generated during a single model run
  • "timeseries files," which are output files containing multiple time levels per file.
  • an "offset" date specification, which allows finer control over the tavg_freq and tavg_freq_opt options described below.
  • the option for a "one-time header," in which all time-invariant information is written into the first tavg file of each stream, at the beginning of each run segment, and then omitted from all subsequent files in that stream for the remainder of the run segment.
  • support for double-precision tavg output files

Presently, CESM1 POP2 supports the creation of a maximum of four concurrent tavg output streams, with a hard limit of nine streams possible if the tavg module is appropriately modified. Options for each of the streams is set individually, using array syntax in the namelist.

In order to support these additional features, the CESM1 POP2 tavg_contents files and the tavg_nml namelist have necessarily become more complex than the basic LANL POP2.

There are two main differences between the CESM1 POP2 tavg_contents file and the LANL counterpart, but they are small:

  • The first line in LANL tavg_contents file contains the integer number of fields in the file, whereas in CESM1, this line is unnecessary and has been eliminated.
  • Each subsequent line of the LANL tavg_contents file is filled with a single string that identifies a requested variable via a unique variable short name. In CESM1, the format of each line is only slightly different: three characters have been inserted on each line prior to the variable's short-name string.

The first character of each line in the CESM1 POP2 tavg_contents file is either a comment character or an integer in the interval [1,4]. The next two characters must be blank; the remaining characters on the line spell out the short name of a requested variable.

If the leading character is a comment character -- either the pound sign (#) or the exclamation point (!) -- then the entire line is treated as a comment.

If the leading character on the line is an integer, it identifies the number of the output stream in which the requested field will appear. Each requested tavg output field may be assigned to only one stream; assigning the same field to more than one stream will result in the model ignoring it and all subsequent requests. Similarly, duplicate requests of the same field within the same stream will be eliminated. In all cases, a summary of field and stream assignments is printed in the output log file, which allows the user to confirm which fields will be written to which stream.

Output filenames for the each stream are determined from within the CESM1 tavg module, incorporating the stream number into the output filename in all but the first stream. This seemingly inconsistent treatment of tavg output filenames was chosen based on the requirement for backwards-compatibility in filenames. For example, a one-stream case would generate tavg output files of the form $CASE.pop.h.*; an N-stream case would generate tavg output files of the form $CASE.pop.h.*, $CASE.pop.h2.*, ..., $CASE.pop.hN.*

Most of the CESM1 tavg namelist variables are now arrays of length (max_avail_tavg_streams), which allows the user to set controls for each tavg history-file stream on a stream-by-stream basis.

In the table below, any array element that is undefined in the CESM1 pop2 namelist file is set to the default value identified in curly braces.

Table: CESM1 POP2 Time-average file namelist
&tavg_nml CESM1 dipole-grid default CESM1 tripole-grid default Valid values generation of time-average history files
for stream-dimensioned variable, specify one value per stream
n_tavg_streams32(1,9)number of tavg output files ("streams")
tavg_freq_opt('nmonth' 'nday' 'once')('nmonth' 'nday')'never', 'nyear', 'nmonth', 'nday', 'nhour', 'nsecond', 'nstep', 'once'units of time for 'tavg_freq'
tavg_freq(1,1,1)(1,1)integers > 0interval in above units for computation and output of time-average history fields
tavg_file_freq_opt('nmonth','nmonth','once')('nmonth','nmonth')'never', 'nyear', 'nmonth', 'nday', 'nhour', 'nsecond', 'nstep', 'once'units of time for 'tavg_file_freq' (file-writing frequency)
tavg_file_freq(1,1,1)(1,1)integers > 0units of time for 'tavg_file_freq'
tavg_start_opt('nstep','nstep','nstep')('nstep','nstep')'nstep', 'nyear', 'nmonth', 'nday', 'date'units for tavg_start ('date' implies yyyymmdd)
tavg_start(1,1,1)(1,1)integers > 0time in above units after which to start accumulating time average
tavg_infileauto-filled by CESM1 scriptsauto-filled by CESM1 scriptsstring ≤ 256 charsrestart file for partial tavg sums if starting from restart (ignored if luse_pointer_files is enabled)
tavg_fmt_in('nc','nc','nc')('nc','nc')'bin','nc'format for tavg restart file (binary or netCDF)
tavg_outfileauto-filled by CESM1 scripts to $CASE.pop.hauto-filled by CESM1 scripts to $CASE.pop.hstring ≤ 256 charactersroot filename (with path) for tavg output files (suffixes will be added automatically in the code)
tavg_fmt_out('nc','nc','nc')('nc','nc')'bin','nc'format for tavg output files (binary or netCDF)
tavg_contentsauto-filled by CESM1 scripts to '${resolution}_tavg_contents'auto-filled by CESM1 scripts to '${resolution}_tavg_contents'string ≤ 256 charactersfile name for input file containing names of fields requested for tavg output
ltavg_has_offset_date(.false. .false. .false.)(.false. .false.)true., .false.if .true., sets the time from which counting begins for tavg_freq
tavg_offset_years(1 1 1)(1 1)integer > 0the reference year number in the time-management time_to_do function
tavg_offset_months(1 1 1)(1 1)integer > 0the reference month number in the time-management time_to_do function
tavg_offset_days(1 1 1)(1 1)integer > 0the reference day number in the time-management time_to_do function
ltavg_one_time_header(.false. .false. .false.)(.false. .false. ).true., .false.write time-invariant information only into the first file of each stream in each model run segment
ltavg_nino_diags_requested.true..false..true.,.false.if .true., compute NINO diagnostics. If n_tavg_streams > 1, the code will determine which stream contains the necessary fields from which to compute the diagnostics.
/
Table: Current available tavg fields
Name Units Description
SHFW/m2Surface Heat Flux
SFWFmm/daySurface Freshwater Flux (p-e)
SSHcmSea Surface Height
H2
(SSH2 in CESM1)
cm2SSH2
H3unitlessx(SSH))2 + (Δy(SSH))2
TAUXdyne/cm2Zonal windstress
TAUYdyne/cm2Meridional windstress
UVELcm/sZonal Velocity
VVELcm/sMeridional Velocity
KEcm2/s2Horizontal Kinetic Energy (U2 + V2)/2
TEMPoCPotential Temperature
SALTg/gSalinity
TEMP2oC2Temperature2
SALT2(g/g)2Salt2
UEToC/sEast Flux of Heat
VNToC/sNorth Flux of Heat
WTToC/sTop Flux of Heat
UESg/g/sEast Flux of Salt
VNSg/g/sNorth Flux of Salt
WTSg/g/sTop Flux of Salt
UEUcm/s2East Flux of Zonal Momentum
VNUcm/s2North Flux of Zonal Momentum
UEVcm/s2East Flux of Meridional Momentum
VNVcm/s2North Flux of Meridional Momentum
PV1/sPotential Vorticity
Qg/cm4z-derivative of potential density
PDg/cm3Potential density referenced to surface
UDPergPressure work
PECg/cm3Potential energy release due to convection
NCNVadjustments/sConvective adjustments per second
WTUcm/s2Top flux of Zonal Momentum
WTVcm/s2Top flux of Meridional Momentum
SToCg/gTemperature*Salinity
RHOg/cm3In-situ density
Table: Additional available CESM1 tavg fields
Name Units Description
QFLUXWatts/m2Internal Ocean Heat Flux Due to Ice Formation;
heat of fusion > 0 or ice-melting potential < 0
BSFSvBarotropic Stream Function
TFW_TWatts/m2T flux due to freshwater flux
TFW_Skg/m2/sS flux due to freshwater flux (kg of salt/m^2/s)
RESID_TWatts/m2Free-Surface Residual Flux (T)
RESID_Skg/m2/sFree-Surface Residual Flux (S)
QSW_HTPWatts/m2Solar Short-Wave Heat Flux in top layer
QSW_HBLWatts/m2Solar Short-Wave Heat Flux in boundary layer
SHF_QSWWatts/m2Solar Short-Wave Heat Flux
PREC_Fkg/m2/sPrecipitation Flux from Coupler (rain+snow)
SNOW_Fkg/m2/sSnow Flux from Coupler
EVAP_Fkg/m2/sEvaporation Flux from Coupler
MELT_Fkg/m2/sMelt Flux from Coupler
ROFF_Fkg/m2/sRunoff Flux from Coupler
IOFF_Fkg/m2/sIce Flux from Coupler due to Land-Model Snow Capping
SALT_Fkg/m2/sSalt Flux from Coupler (kg of salt/m^2/s)
SENH_Fkg/m2/sSensible Heat Flux from Coupler
LWUP_FWatts/m2Longwave Heat Flux (up) from Coupler
LWDN_FWatts/m2Longwave Heat Flux (down) from Coupler
MELTH_FWatts/m2Melt Heat Flux from Coupler
IFRACunitless fractionIce Fraction from Coupler
HMXL and
HMXL_2
cmMixed-Layer Depth
XMXL and
XMXL_2
cmMaximum Mixed-Layer Depth
TMXLcmMinimum Mixed-Layer Depth
HBLTcmBoundary-Layer Depth
XBLTcmMaximum Boundary-Layer Depth
TBLTcmMinimum Boundary-Layer Depth
FWcm/sFreshwater Flux
ADVTcm/oC/sVertically-Integrated T Advection Tendency
ADVScm g/km/sVertically-Integrated S Advection Tendency
dTEMP_POS_2DoCmax positive column temperature timestep diff
dTEMP_NEG_2DoCmax negative column temperature timestep diff
KAPPA_ISOPcm2/sIsopycnal diffusion coefficient
KAPPA_THICcm2/sThickness diffusion coefficient
HOR_DIFFcm2/sHorizontal diffusion coefficient
DIA_DEPTHcmDepth of the Diabatic Region at the Surface
TLTcmTransition Layer Thickness
INT_DEPTHcmDepth at which the Interior Region Starts
UISOPcm/sBolus Velocity in grid-x direction (diagnostic)
VISOPcm/sBolus Velocity in grid-y direction (diagnostic)
WISOPcm/sVertical Bolus Velocity (diagnostic)
ADVT_ISOPcm/oC/sVertically-Integrated T Eddy-Induced Advection Tendency (diagnostic)
ADVS_ISOPcm g/km/sVertically-Integrated S Eddy-Induced Advection Tendency (diagnostic)
VNT_ISOPoC/sHeat Flux Tendency in grid-y Dir due to Eddy-Induced Vel (diagnostic)
VNS_ISOPg/km/sSalt Flux Tendency in grid-y Dir due to Eddy-Induced Vel (diagnostic)
KVMIXcm2/sVertical diabatic diffusivity due to background
or Tidal Mixing + background
KVMIX_Mcm2/sVertical viscosity due to background
or Tidal Mixing + background
TPOWERerg/sEnergy Used by Vertical Mixing
VVC_BCKcm2/sVertical viscosity due to background
USUBMcm/sSubmeso velocity in grid-x direction (diagnostic)
VSUBMcm/sSubmeso velocity in grid-y direction (diagnostic)
WSUBMcm/sVertical submeso velocity (diagnostic)
ADVT_SUBMcm/oC/sVertically-Integrated T submeso Advection Tendency (diagnostic)
ADVS_SUBMcm g/km/sVertically-Integrated S submeso Advection Tendency (diagnostic)
VNT_SUBMoC/sHeat Flux Tendency in grid-y Dir due to submeso Vel (diagnostic)
VNS_SUBMoC/sSalt Flux Tendency in grid-y Dir due to submeso Vel (diagnostic)
HLS_SUBMcmHorizontal length scale used in submeso
VDC_Tcm2/stotal diabatic vertical TEMP diffusivity
VDC_Scm2/stotal diabatic vertical SALT diffusivity
UVEL2cm2/s2Velocity in grid-x direction
VVEL2cm2/s2Velocity in grid-y direction
WVEL2cm2/s2Vertical Velocity2
RHO_VINTg/cm2Vertical Integral of In-Situ Density
SFWF_WRSTkg/m2/sVirtual Salt Flux due to weak restoring
TAUX2dyne2/cm4Windstress2 in grid-x direction
TAUY2dyne2/cm4Windstress2 in grid-y direction
SSH2
(H2 in LANL POP)
cm2SSH2
VVCcm2/stotal vertical momentum viscosity
VDC_BCKcm2/sVertical diabatic diffusivity due to background

Note that we append "_2" to a variable name in order to write that variable to two tavg output files; this convention can be extended to more than two streams in a similar fashion.

To customize tavg output in your CESM1 run:

  • > create_newcase -case $CASE ... per the CESM1.0 instructions
  • > cd $CASE
  • > cd $CASE/SourceMods/src.pop2
  • > cp $CCSMROOT/models/ocn/pop2/input_templates/$RES_tavg_contents .
  • > edit $RES_tavg_contents -- comment out, activate, or change streams according the instructions above.

then continue with the CESM1 $CASE configure, build, and run procedure.