next up previous contents
Next: 4.3 Trouble-Shooting Model Changes Up: 4. Simple Code Modifications Previous: 4.1 Using the Scripts   Contents

4.2 Adding New Output Variables

This section describes how to add a variable to a history file. If the field is in the Master Field List (see Table 3.1), the user must ensure that there is an uncommented outfld call for that field and must also add it to the history output via namelist variable(s) FINCL(1-6).

If the field is not on the Master Field List, the user must add it to the list by inserting an addlfd call. Six pieces of information are passed to addfld in an argument list:

  1. Field name: 8-character field name, left-justified, alphanumeric or spaces only.
  2. Field units: 8-character units description. See Table 3.1
  3. Number of vertical levels in the field.
  4. Default averaging flag. See Section 3.1.1 for more information.
  5. Field descriptor: up to 128-characters
  6. Parallel decomposition type (i.e. is this a physics or dynamics variable)

Please see the file history.F90 for more information on the addfld interface. Two examples extracted from the model are shown below.

call addfld('TS      ', 'K       ', 1,'A', 'Surface temperature', phys\_decomp )
call addfld('U       ', 'K       ', plev,'A', 'Zonal wind'      , dyn\_decomp  )


Table 4.1: Units of History File Fields
Abbreviation Description
m meter
kg kilogram
s second
K degree Kelvin
percent percent
fraction fraction
gram gram
um micro meter
N Newton
Pa Pascal
W Watt

The user must then add an outfld call for the field at an appropriate location in the code. For example, the outfld call for the field T, taken from diagnostics.F90, is shown below:

call outfld('T       ',  state\%t, pcols, lchnk )

The arguments in the call to outfld are the 8-character field name, the variable array in which it is stored, the first dimension of the data array, and the chunk index.

Once these steps are taken, the field may be added to the desired history file by using namelist variable FINCL(1-6).


next up previous contents
Next: 4.3 Trouble-Shooting Model Changes Up: 4. Simple Code Modifications Previous: 4.1 Using the Scripts   Contents
Jim McCaa 2004-10-22