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


3. CCM3.6 Internals
    3.5 Output Datasets
        3.5.1 History Files


3.5.1.2 History File Header Records

The first three records in a time sample comprise the history file header. These records are written from common blocks /comhdi/, /comhdc/, and /comhdr/ (declared in the file comhed.h). Using the three-record header structure, the model splits the integer, character, and real header values into separate records, making the code more easily portable to other computers. The header of an output history file serves two functions:

Contents of the three header records are shown below in Table 3.1  (integer), Table 3.2 (character), and Table 3.3 (real). Each variable is listed by name and word number within each header record, along with a short description and a typical value based on the T42, 18 vertical-layer case. Output fields in a CCM3 history file are located on the hybrid vertical coordinate grid. Thus, three arrays of hybrid coefficients are saved in the real header record along with the Gaussian latitudes and weights (see Table 3.3).

There are some differences in the format depending on what machine wrote the files out. On IEEE machines integer words are 4-bytes long, while floating point words are 8-bytes long. On Cray machines both integer and floating point words are 8-bytes long. Furthermore, numbers are written in native machine format. For example, on the Cray, floating point numbers are written in Cray floating point format, while on a Sun workstation floating point numbers will be written in IEEE floating point format. Also, some machines may have words that are "byte-swapped" (a different Endian representation) from other machines. FORTRAN adds "control-words" to the begining and end of each FORTRAN record. The control-words are a full integer word and represent the number of bytes written out on each record. A FORTRAN program that reads the file doesn't need to worry about these words, but a program written in another language (such as "C") will need to process them. The Operating system may add blocking control words as well (ie. the Cray adds COS-blocking control words). The offline program "ccm2nc" deals with most of these issues (other than byte-swapping) and as such is generally able to read CCM files produced on a non-native machine platform.

Table 3.1: History File Header Record 1-- Integer Variables
(Note: On IEEE machines integer words are 4-bytes long, on Cray machines integer words are 8-bytes long)
Variable Name
Word Number
Description
T42 Value
LENHDI  Length of header record 1 (in integer words, 4-bytes for IEEE machines and 8-bytes for Cray machines) 292
MFTYP  Format code for this history file  43
MFILH  Number of this "time sample" within this disk file or Mass Store tape. 1
MFILTH  Maximum number of time samples in this history file.  20
NRBD  Number of records before data records  3
MAXSIZ  Length of packed data record in words 33662
NDAVU  Length of the data record in words after unpacking  65282
  Unused 
NLON  Number of longitude points in one latitude line  128
NLONW  10  Number of longitude data values written on the history file 128
NOREC  11  Number of latitude lines and number of data records  64
NLEV  12  Number of vertical levels written on the history file  18
NTRM  13  M spectral truncation parameter  42
NTRN  14  N spectral truncation parameter  42
NTRK  15  K spectral truncation parameter  42
NFLDH  16  Number of fields in this time sample 85
NSTEPH  17  Timestep on which this data was written 0
NSTPRH  18  Iteration number for the start of this run  0
NITSLF  19  Number of timesteps since last time sample was written  0
NDBASE  20  Base day number for this case  0
NSBASE  21  Base number of seconds for this case  0
NDCUR  22  Current day number corresponding to NSTEPH 0
NSCUR  23  Seconds of the current day NDCUR  0
NBDATE  24  Base date (yr mo day) as 6-digit integer 000901
NBSEC  25  Seconds to complete NBDATE date. 
(Note: may be different from NSBASE.)
0
NCDATE  26  Current date (yr mo day) as 6-digit integer corresponding to NSTEPH 000901
NCSEC  27  Current seconds for date NCDATE 0
MDT  28  Model timestep in seconds  1200
MHISF  29  Frequency in timesteps at which time samples are written 72
MFSTRT  30  Flag to indicate type of run: 
= 0 for initial run 
= 1 for restart 
= 3 for branch run
0
LENHDC  31  Length of header record 2  259
LENHDR  32  Length of header record 3  239
MPSIG  33  Position in header record 3 of first word of sigma value list. 
sigapb(1) = REALHD(MPSIG)
1
MPLAT  34  Position in header record 3 of list of latitude lines. 
hdlat(1) = REALHD(MPlat)
112
MPWTS  35  Position in header record 3 of list of Gaussian weights. 
hdwt(1) = REALHD(MPwts)
176
MPFLDS  36  Position of header field information list in header record 1 
(integer values)
38
MPCFLD  37  Position of field information list in header record 2 (character values), given as a number of 8-character items from the start of record 2 90
MFLDS 38  Integer field information, dimensioned (3, NFLDH). See description of MFLDS array in Table 3.4 . --
 

Table 3.2: History File Header Record 2 -- Character Variables*
Variable Name
Word Number
Format
Description
Example T42 Value
MCASE 1 C*8 Case identifier clsst01
MCSTIT 2-11 C*80 Case title Test run
Current History File 
LNHSTC 12-21 C*80 Pathname of this history file  /USER/csm/clsst01/ccm3/hist/h0001
LDHSTC 22 C*8 Date this header record was written (MM/DD/YY) 04/27/98
LTHSTC 23 C*8 Time this header record was written (HH:MM:SS) 00:28:25
LSHSTC 24 C*8 Unused  
First History File of Case
LNHSTF 25-34 C*80 Pathname of first history file for this case /USER/csm/clsst01/ccm3/hist/h0001
LDHSTF 35 C*8 Date this case started 
(MM/DD/YY)
04/27/98
LTHSTF 36 C*8 Time this case started (HH:MM:SS) 00:28:22
LSHSTF 37 C*8 Unused
 
Initial Dataset File
LNHSTI 38-47 C*80 Pathname of initial dataset file  SEP1.T42.0198.nc
LDHSTI 48 C*8 Date initial dataset was created 
(MM/DD/YYun)
02/06/98
LTHSTI 49 C*8 Time initial dataset created (HH:MM:SS) 06:26:35
LSHSTI 50 C*8 Unused
 
   -- 51-63     -- Words 51-63 are unused.
 
Time-variant SST Dataset File
LNHSTVS 64-73 C*80 Pathname of SST boundary dataset STR-sst.T42.0596.nc
LDHSTVS 74 C*8 Date SST boundary dataset was created (MM/DD/YY) 05/17/97
LTHSTVS 75 C*8 Time SST boundary dataset was created (HH:MM:SS) 17:03:13
LSHSTVS 76 C*8 Unused  
Ozone Dataset
LNHSTVO 77-86 C*80 Pathname of ozone boundary dataset ozn.0596.r8.nc
LDHSTVO 87 C*8 Date ozone boundary dataset was created 
(MM/DD/YY)
09/21/92
LTHSTVO09/21/92 88 C*8 Time ozone boundary dataset was created (HH:MM:SS) 13:34:26
LSHSTVO 89 C*8 Unused  
MCFLDS 90 C*8 Character field information, dimensioned (2,NFLDH). See description of MCFLDS array in Table 3.4 --
*All character strings are left-justified, blank-filled, and multiples of 8 characters.

Table 3.3: History File Header Record 3 -- Real Variables
(Note: These are 8-byte native floating point numbers)
Variable Name*
Word Number
Description
REALHD(MPSIG)   Contains 3 arrays of (2 * NLEV +1) hybrid coefficients as follows: 
sigapb = hybrid A+B coefficients 
siga = hybrid A (pressure) coefficients 
sigb = hybrid B (sigma) coefficients
REALHD(MPLAT)   Points to the first word, relative to the start of the header, of a list of NOREC Gaussian latitudes in degrees (south to north)
REALHD(MPWTS)   Points to the first word of a list of NOREC Gaussian weights corresponding to the Gaussian latitudes
*MPSIG, MPLAT, and MPWTS are from header record 1, words 33, 34, and 35, respectively.

Two arrays mflds (starting at word 38 of the integer header) and mcflds (starting at word 90 of the character header) contain integer and character information describing each field stored in a latitude data record. Table 3.4 shows details of the contents of these two arrays. Also see figure Figure 3.8 for more details.

Table 3.4: Description of Field Information List Arrays, MFLDS and MCFLDS
Variable Name
Description
MFLDS(1,IFld) Flag for number of levels and field flag, packed in one integer word. The ones digit is for the level number flag; the tens digit states whether the field is an instantaneous value, a value averaged between history file writes, a time minimum between writes, or a time maximum between writes. 

ones digit of MFLDS(1,ifld) 
 0 = single-level field, 
 1 = multilevel field at layer interfaces, 
 2 = multilevel field at layer midpoints. 

tens digit: 
 0 = instantaneous field, 
 1 = time-averaged field. 
 2 = minimum field value since the last time sample. 
 3 = maximum field value since the last time sample.

MFLDS(2,IFld) Pointer to the first field value in packed data record (in terms of 8-byte words, see Figure 3.8).
MFLDS(3,IFld) Data-packing flag (set to 1 if not packed). 
MCFLDS(1,IFld) Field name for field number IFld. (8 characters)
MCFLDS(2,IFld) Units of this field (SI units). See Table 4.1 . (8 characters)
The index ifld goes from 1 to nfldh (the number of fields in the history buffer).
  


 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_latest2 $ $Revision: 1.35.2.1 $ $Date: 1999/03/25 21:38:44 $ $Author: erik $