Go to the bottom of this page. See the search engine and sub-section links.
Go to next page Go to previous page Go to top of this section Go to top page Go to table of contents

Previous Section Headers

User's Guide to NCAR CCM3.6 Search Page

4. Changing the Model

4.2 Adding New Variables

If the user wishes to add new variables to the model, such as variables to a history file, new diagnostic fields, transported constituents ( Sec. 4.3 ), or variables within a physical parameterization (Sec. 4.5), two different cases need to be considered.

 Case 1: The variable already exists and the user wants to save it on a history file.

If the field is in the Master Field List (see Table 2.13), the user must modify the code by uncommenting the outfld call for that field and must also add it to the history output via namelist variables PRIMARY or AUXF. PRIMARY will place the field on the primary history file, while AUXF will place the field on an auxiliary file, as described in Table 2.5.

If the field is not on the Master Field List, the user must add it to the list by modifying bldfld. Within bldfld, fields are added to the Master Field List by calling addfld. Four pieces of information are passed to addfld in an argument list:

  1. Field name:

  2. 8-character field name, left-justified, alphanumeric or spaces only.
  3. Field units:

  4. 8-character units description. See Table 4.1
  5. Field level indicator:

  6. nsingle = single-level
    nmulth = multi-level at layer interfaces
    nmultf = multi-level at layer mid-levels
  7. Field active/inactive flag:

  8. A value of active indicates that this field will appear on the primary history file by default, whereas inactive indicates it will not. These flags can be overridden by namelist variables PRIMARY or EXCLUDE.
Table 4.1: SI Units of History File Fields
M meter
KG kilogram
S second
K degree Kelvin
MOL mole
N Newton
PA Pascal
J Joule
W Watt
An example extracted from bldfld is shown below: These three calls are responsible for including PHIS, PS, and T as active (default) fields on the Master Field List. Notice that the arguments passed to addfld are the 8-character field name, the 8-character field units, nf (a field counter used by bldfld), the level indicator, and the active/inactive flag.

     call addfld('PHIS    ','M2/S2   ',nf,nsingl,active)
     call addfld('PS      ','PA      ',nf,nsingl,active)
     call addfld('T       ','K       ',nf,nmultf,active)

The user must then add an outfld call for the field at the proper location in the code. This means that outfld must be called either from linemsbc, linemsac, or from a routine below either one in the calling tree. For example, the outfld call for the field T, taken from linemsbc, is shown below: 

     call outfld('T       ',t3m1,plond,lat,hbuf)

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, the latitude index, and the name of the history buffer. In adding a call to outfld, the user need only modify the first three arguments in the list (the last two will always be lat and hbuf).

Once these steps are taken, the field may either be added to a history file using namelist variables PRIMARY or AUXF, or removed from the history file via the namelist variable EXCLUDE.

 Case 2: The variable is new and diagnostic in nature.

The new field should be in a user-defined local array or in the model buffer, if the information needs to be carried across time levels. To add a field to the model buffer requires the following steps:

Follow directions under Case 1 to include the new variable in a history file. 

Go to the top of this page. See links to previous section headers.
Go to next page Go to previous page Go to top of this section Go to top page Go to table of contents

 Search for keywords in the CCM3.6 Users GuideSearch page

Questions on these pages can be sent to... erik@ucar.edu .

$Name: ccm3_6_6_latest3 $ $Revision: $ $Date: 1999/03/25 21:37:28 $ $Author: erik $