CAM: How do I customize CAM output fields?

In this example, we further modify our EXAMPLE_CASEp code to set various CAM output fields. The variables that we set are listed below. See CAM Namelist Variables for a complete list of CAM namelist variables.

avgflag_pertape

Sets the averaging flag for all variables on a particular history file series. Default is to use default averaging flags for each variable. Average (A), Instantaneous (I), Maximum (X), and Minimum (M).

nhtfrq

Array of write frequencies for each history files series.

When NHTFRQ(1) = 0, the file will be a monthly average. Only the first file series may be a monthly average.

When NHTFRQ(i) > 0, frequency is input as number of timesteps.

When NHTFRQ(i) < 0, frequency is input as number of hours.

mfilt

Array of number of time samples to write to each history file series (a time sample is the history output from a given timestep).

ndens

Array specifying output format for each history file series. Valid values are 1 or 2. '1' implies output real values are 8-byte and '2' implies output real values are 4-byte. Default: 2,2,2,2,2,2

fincl1 = 'field1', 'field2', ...

List of fields to add to the primary history file.

fincl[2..6] = 'field1', 'field2', ...

List of fields to add to the auxiliary history file.

fexcl1 = 'field1', 'field2', ...

List of field names to exclude from the default primary history file (default fields on the Master Field List).

fexcl[2..6] = 'field1', 'field2',...

List of the field names to exclude from the auxiliary history files.

Edit user_nl_cam and add the following lines at the end of the file:


avgflag_pertape = 'A','I'
nhtfrq = 0 ,-6
mfilt  = 1 , 30
ndens  = 2 , 2
fincl1 = 'FSN200','FSN200C','FLN200',
         'FLN200C','QFLX','PRECTMX:X','TREFMXAV:X','TREFMNAV:M',
         'TSMN:M','TSMX:X'
fincl2 = 'T','Z3','U','V','PSL','PS','TS','PHIS'

avgflag_pertape specifies how the output data will be averaged. In the first output file, b40.2000p.cam2.h0.yyyy-mm.nc, data will be averaged monthly. In the second output file, b40.2000p.cam2.h1.yyyy-mm-dd.nc, data will be instantaneous.

nhtfrq sets the frequency of data writes, so b40.2000p.cam2.h0.yyyy-mm.nc will be written as a monthly average, while b40.2000p.cam2.h1.yyyy-mm-dd.nc will contain time slices that are written every 6 hours.

mfilt sets the model to write one time sample in b40.2000p.cam2.h0.yyyy-mm.nc and 30 time samples in b40.2000p.cam2.h1.yyyy-mm-dd.nc.

ndens sets both files to have 32-bit netCDF format output files.

fincl1 sets the output fields for b40.2000p.cam2.h0.yyyy-mm.nc. A complete list of the CAM output fields appears here. In this example, we've asked for more variables than will fit on a Fortran line. As you can see, it is all right to split variable lists across lines. Also in this example, we've asked for maximum values of TREFMXAV and TSM, and minimum values of TREFMNAV and TSMN.

fincl2 sets the output fields for b40.2000p.cam2.h1.yyyy-mm-dd.nc, much the same as fincl1 sets output fields for b40.2000p.cam2.h0.yyyy-mm.nc, only in this case, we are asking for instantaneous values rather than averaged values, and choosing different output fields.