M. \underline{Model Output Conventions}

The NCAR CSM ocean model saves a variety of prognostic and diagnostic quantities to several history files during the course of an integration. In the initial release, the history files are written using Fortran unformatted IO. The choice of file content and format is largely historical, guided by the types of analysis undertaken with the model and by the characteristics of the NCAR Mass Storage System. To make the data more accessible through commonly available visualization and analysis tools, a set of filters have been developed to convert the model’s native history files to netCDF files that conform to CSM conventions. This document briefly describes the content of the native history files, the filters and the resulting netCDF files.

Native History Files

The output from the model is stored in a series of history files. If instantaneous output has been generated, these files are named H1, H2, H3, etc. If time-averaged output has been generated, files containing time-averaged data are named H121, H122, H120, etc., as indicated in the table below. Variables are organized roughly into groups that would typically be used together in an analysis. The table below describes the organization of the files. Refer to the model documentation and source code for the definitions of variable names.

Inst. Avg.
File File  Record Variables
H1 H121 1 - jmt fitt, fj, ttsec, t(imt,km,nt)
H11 H122 1 - jmt fitt, fj, ttsec, u(imt,km), v(imt,km), w(imt,kmt)
H2 H120 1  fitt, ttsec, dtuv, psi(imt,jmt)
2  nconxy(imt,jmt,4)
3  fitt, ttsec, c2dtuv, err(imt,jmt), dpdx(imt,jmt),dpdy(imt,jmt)
4  fitt, ttsec, hblt(imt,jmt)
5  fitt, ttsec, hbml(imt,jmt)
H3 H125 1  fitt, ttsec, ttn(8,jmt,nt), tmt(jmt,km)
2  fitt, ttsec, ttn2(6:9,jmt,nt,0:nhreg), tmtiso(jmt,km)
H4 — 1 fitt, ttsec, buoy(0:km), plicin, plicex, ekt,

engint(8), engext(8)

2  psile(nisle), Tbarglb(km,nt), Tbarreg(nhreg,km,nt),pnorthpole
H5 H123 1 - jmt fitt, fj, ttsec, uiso(imt,km), viso(imt,km),wiso(imt,km)
H7 H124 1 - jmt fitt, fj, ttsec, smf(imt,2), stf(imt,nt), sswt(imt)

File Conversion Filters

While the native file organization provides efficient storage and access on the NCAR MSS, it can be awkward for model analysis purposes. Two filters that convert the data to netCDF format are provided to help ameliorate this problem. The first filter, “filtdiag”,

M-1 converts the model H3 (H125) and H4 file data, and the second, “filtprog”, converts the data from the remaining model H-files. Both filters produce netCDF files that conform to CSM conventions for global and variable attributes. Our practice is to store data from multiple times (typically one year’s worth) in the “diagnostic” files, and data from a single time in the prognostic files, though this easily configurable at run time. Due to the large number of land points carrying constant fill values in the model output, the files are efficiently (40% to 55%) compressed by standard Unix utilities like compress or gzip.

The output of the filters is minimally configurable at runtime through their input (via namelist IO) as indicated in Appendices A (filtdiag) and B (filtprog). The filters are written in ANSI standard Fortran 90 and have been tested in the NCAR Cray and IBM/RS6000 cluster environments. Example batch queue system scripts are also provided for each of these environments.

netCDF History Files

The netCDF file format is self describing. NCL descriptions of example ocean model netCDF files are included in Appendices C and D.

Appendix A. filtdiag input group fileinfo

ncfilenm – (character) – name of output netCDF file title – (character) – global attribute title string save kmt – (logical) – save integer depth array in file save rmask – (logical) – save integer basin index array in file

group expinfo modver – (character) – global attribute model version string case – (character) – global attribute case string daypyr – (real) – length of model calendar in days

group trcinfo trcname – (character array) – tracer variable names trclname – (character array) – tracer long name variable attribute string trcunit – (character array) – tracer units variable attribute string trcscl – (real array) – tracer scale variable attribute trcoff – (real array) – tracer offset variable attribute ttnname – (character array) – northward tracer transport variable names ttnlname – (character array) – northward tracer transport long name variable attribute string ttnunit – (character array) – northward tracer transport units variable attribute string ttnscl – (real array) – northward tracer transport scale variable attribute ttnoff – (real array) – northward tracer transport offset variable attribute

group basinfo

basin nm – (character array) – names of basins in region mask group auxinfo

file kmt – (character) – Unix file name for integer depth data file rmask – (character) – Unix file name for integer region mask data

group inpinfo (repeatable)

done – (logical) – no more input data to process file h3 – (character) – Unix filename of H3 data file h4 – (character) – Unix filename of H4 data

M-2 Appendix B. filtprog input group fileinfo

ncfilenm – (character) – name of output netCDF file title – (character) – global attribute title string save kmt – (logical) – save integer depth array in file save depth – (logical) – save real valued depth array in file save rmask – (logical) – save integer basin index array in file save ncon – (logical) – save convective adjustment counter data in file save sswt – (logical) – save penetrative radiation flux data in file

group expinfo modver – (character) – global attribute model version string case – (character) – global attribute case string daypyr – (real) – length of model calendar in days is average – (logical) – input history data is already averaged

group trcinfo trcname – (character array) – tracer variable names trclname – (character array) – tracer long name variable attribute string trcunit – (character array) – tracer units variable attribute string trcscl – (real array) – tracer scale variable attribute trcoff – (real array) – tracer offset variable attribute flxname – (character array) – surface tracer flux variable names flxlname – (character array) – surface tracer flux long name variable attribute string flxunit – (character array) – surface tracer flux units variable attribute string flxscl – (real array) – surface tracer flux scale variable attribute flxoff – (real array) – surface tracer flux offset variable attribute rfillval – (real) – value to use for missing real valued data ifillval – (integer) – value to use for missing integer valued data

group auxinfo file kmt – (character) – Unix file name for integer depth data file rmask – (character) – Unix file name for integer region mask data

group basinfo

basin nm – (character array) – names of basins in region mask group inpinfo (repeatable)

done – (logical) – no more input data to process file h1t – (character) – Unix filename of H1 data file h1u – (character) – Unix filename of H11 data file h2 – (character) – Unix filename of H2 data file h5 – (character) – Unix filename of H5 data file 75 – (character) – Unix filename of H7 data

Appendix C. Example Prognostic Data File NCL (2 × 2 model) netcdf ocnprog y0007.d000.00 dimensions:

time = UNLIMITED ; // (1 currently) lon t = 152 ; lon u = 152 ; lat t = 111 ; lat u = 111 ; z t = 45 ; z w = 46 ; nchar = 132 ; basins = 8 ;

M-3 variables:

double time(time) ;

time:long name = “time” ; float lon t(lon t) ;

lon t:long name = “Longitude (T grid)” ; float lon u(lon u) ;

lon u:long name = “Longitude (U grid)” ; float lat t(lat t) ;

lat t:long name = “Latitude (T grid)” ; float lat u(lat u) ;

lat u:long name = “Latitude (U grid)” ; float z t(z t) ;

z t:long name = “Depth (T grid)” ; float z w(z w) ;

z w:long name = “Depth (W grid)” ; char basins label(basins, nchar) ;

basins label:long name = “Ocean Basins” ; float daypyr ;

daypyr:long name = “Calendar Length” ; long itt(time) ;

itt:long name = “Time Step Number” ; float dz(z t) ;

dz:long name = “Vertical Grid Cell Thickness” ; float dzz(z w) ;

dzz:long name = “Vertical Grid Cell Spacing” ; float dxt(lon t) ;

dxt:long name = “Zonal T Grid Cell Width” ; float dxu(lon u) ;

dxu:long name = “Zonal U Grid Cell Width” ; float dyt(0lat t) ;

dyt:long name = “Meridional T Grid Cell Width” ; float dyu(lat u) ;

dyu:long name = “Meridional U Grid Cell Width” ; long kmt(lat t, lon t) ;

kmt:long name = “Depth of Ocean in Model Levels” ; long rmask(lat t, lon t) ;

rmask:long name = “Basin Index” ; long H(lat t, lon t) ;

H:long name = “Ocean Depth” ; float T(time, lat t, z t, lon t) ;

T:long name = “Potential Temperature” ; float S(time, lat t, z t, lon t) ;

S:long name = “Salinity” ; float U(time, lat u, z t, lon u) ;

U:long name = “Eulerian Velocity East Component” ; float V(time, lat u, z t, lon u) ;

V:long name = “Eulerian Velocity North Component” ; float W(time, lat t, z w, lon t) ;

W:long name = “Eulerian Velocity Vertical Component” ; float Uiso(time, lat u, z t, lon u) ;

Uiso:long name = “Eddy Induced Transport Velocity East Component” ; float Viso(time, lat u, z t, lon u) ;

Viso:long name = “Eddy Induced Transport Velocity North Component” ;

M-4 float Wiso(time, lat t, z w, lon t) ;

Wiso:long name = “Eddy Induced Transport Velocity Vertical Component” ; float psi(time, lat t, lon t) ;

psi:long name = “Barotropic Transport Streamfunction” ; float dpdx(time, lat u, lon u) ;

dpdx:long name = “Surface Pressure Gradient East Component” ; float dpdy(time, lat u, lon u) ;

dpdy:long name = “Surface Pressure Gradient North Component” ; float hblt(time, lat t, lon t) ;

hblt:long name = “Boundary Layer Depth” ; float hbml(time, lat t, lon t) ;

hbml:long name = “Mixed Layer Depth” ; float smfx(time, lat u, lon u) ;

smfx:long name = “Surface Momentum Flux East Component” ; float smfy(time, lat u, lon u) ;

smfy:long name = “Surface Momentum Flux North Component” ; float Tflx(time, lat t, lon t) ;

Tflx:long name = “Surface Heat Flux” ; float Sflx(time, lat t, lon t) ;

Sflx:long name = “Surface Salt Flux” ;

// global attributes:

:conventions = “CSM NetCDF Conventions Version 0.0” ; :filename = “ocnprog y0007.d000.00.nc” ; :platform = “Model: CSM Ocean Component” ; :model ver = “D02L45T2” ; :case = “b001.02” ; :title = “Field Variables” ; :time rep = “n”,

Appendix D. Example Diagnostic Data File NCL (2 × 2 model) netcdf ocndiag y0005 dimensions:

time = UNLIMITED ; // (12 currently) lon t = 152 ; lon u = 152 ; lat t = 111 ; lat u = 111 ; z t = 45 ; z w = 46 ; nchar = 132 ; islands = 8 ; basins = 8 ; engterm = 9 ; ttnterm1 = 8 ; ttnterm2 = 4 ;

M-5 variables:

double time(time) ;

time:long name = “time” ; float lon t(lon t) ;

lon t:long name = “Longitude (T grid)” ; float lon u(lon u) ;

lon u:long name = “Longitude (U grid)” ; float lat t(lat t) ;

lat t:long name = “Latitude (T grid)” ; float lat u(lat u) ;

lat u:long name = “Latitude (U grid)” ; float z t(z t) ;

z t:long name = “Depth (T grid)” ; float z w(z w) ;

z w:long name = “Depth (W grid)” ; char islands label(islands, nchar) ;

islands label:long name = “Islands” ; char basins label(basins, nchar) ;

basins label:long name = “Ocean Basins” ; char engterm label(engterm, nchar) ;

engterm label:long name = “Energy Diagnostic Terms” ; char ttnterm1 label(ttnterm1, nchar) ;

ttnterm1 label:long name = “Meridional Tracer Transport Terms” ; char ttnterm2 label(ttnterm2, nchar) ;

ttnterm2 label:long name = “Meridional Tracer Transport Terms” ; float daypyr ;

daypyr:long name = “Calendar Length” ; long itt(time) ;

itt:long name = “Time Step Number” ; float dz(z t) ;

dz:long name = “Vertical Grid Cell Thickness” ; float dzz(z w) ;

dzz:long name = “Vertical Grid Cell Spacing” ; float dxt(lon t) ;

dxt:long name = “Zonal T Grid Cell Width” ; float dxu(lon u) ;

dxu:long name = “Zonal U Grid Cell Width” ; float dyt(lat t) ;

dyt:long name = “Meridional T Grid Cell Width” ; float dyu(lat u) ;

dyu:long name = “Meridional U Grid Cell Width” ; long kmt(lat t, lon t) ;

kmt:long name = “Depth of Ocean in Model Levels” ; long rmask(lat t, lon t) ;

rmask:long name = “Basin Index” ; float tmt(time, z w, lat u) ;

tmt:long name = “Eulerian Meridional Transport Streamfunction” ; float tmtiso(time, z w, lat u) ;

tmtiso:long name = “Eddy Induced Meridional Transport Streamfunction” ; float Tttn terms(time, lat u, ttnterm1) ;

Tttn terms:long name = “Meridional Heat Transport” ; float Sttn terms(time, lat u, ttnterm1) ;

Sttn terms:long name = “Meridional Salt Transport” ;

M-6 float Tttn basins(time, basins, lat u, ttnterm2) ;

Tttn basins:long name = “Meridional Heat Transport” ; float Sttn basins(time, basins, lat u, ttnterm2) ;

Sttn basins:long name = “Meridional Salt Transport” ; float ekt(time) ;

ekt:long name = “Global Average Kinetic Energy Density” ; float buoylev(time, z w) ;

buoylev:long name = “Level Integrated Buoyancy Work” ; float buoyglb(time) ;

buoyglb:long name = “Global Average Buoyancy Work” ; float engext(time, engterm) ;

Pengext:long name = “Global Average External Mode Energy Budget” ; float engint(time, engterm) ;

engint:long name = “Global Average Internal Mode Energy Budget” ; float T horz(time, basins, z t) ;

T horz:long name = “Horizontal Average Potential Temperature” ; float S horz(time, basins, z t) ;

S horz:long name = “Horizontal Average Salinity” ; float pisle(time, islands) ;

pisle:long name = “Island Streamfunction” ; float pnp(time) ;

pnp:long name = “Barotropic Transport Streamfunction at North Pole” ;

// global attributes: :conventions = “CSM NetCDF Conventions Version 0.0” ; :filename = “ocndiag y0005.nc” ; :platform = “Model: CSM Ocean Component” ; :model ver = “D02L45T2” ; :case = “b001.02” ; :title = “Diagnostic Variables” ; :time rep = “n”,

M-7