Setting CAM output fields

In this example, we further modify our b40.B2000p 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.


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).


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.


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


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.

In the $CASEROOT/Buildconf/cam.buildnml.csh file, namelists are delineated with an ampersand followed by the namelist's name. Namelists end with a slash. For example, the first namelist might look like this:

& phys_ctl_nl
atm_dep_flux   = .false.
deep_scheme    = 'ZM'
eddy_scheme    = 'HB'
microp_scheme  = 'RK'
shallow_scheme = 'Hack'
srf_flux_avg = 0

Just before the ending slash for the cam_inparm namelist, add the following lines:

avgflag_pertape = 'A','I'
nhtfrq = 0 ,-6
mfilt  = 1 , 30
ndens  = 2 , 2
fincl1 = 'FSN200','FSN200C','FLN200',
fincl2 = 'T','Z3','U','V','PSL','PS','TS','PHIS'

avgflag_pertape specifies how the output data will be averaged. In the first output file,, data will be averaged monthly. In the second output file,, data will be instantaneous.

nhtfrq sets the frequency of data writes, so will be written as a monthly average, while will contain time slices that are written every 6 hours.

mfilt sets the model to write one time sample in and 30 time samples in

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

fincl1 sets the output fields for 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, much the same as fincl1 sets output fields for, only in this case, we are asking for instantaneous values rather than averaged values, and choosing different output fields.