SEACOOS CDL v2.0
December 9, 2004
6
netcdf example {
// example CDL for netCDF notation
dimensions:
// dimension names are declared first
time = 5 ;
lat = 3 ;
lon = 2 ;
variables:
// variable types, names, shapes, attributes
double time(time) ;
time:units = "hours since 1994-01-01 00:00:00" ;
time:long_name = "time" ;
float lat(lat) ;
lat:units = "degrees_north" ;
lat:long_name = "latitude" ;
float lon(lon) ;
lon:units = "degrees_east" ;
lon:long_name = "longitude" ;
float temp(time, lat, lon) ;
temp:long_name = "Surface temperature in degrees C" ;
temp:units = "deg_C" ;
// global attributes
:source = "NetCDF Users Guide";
data:
// data assignments
time = 0.5, 1.5, 2.5, 3.5, 4.5 ;
lat = 54.2, 54.4, 54.6 ;
lon = 2.0, 2.5 ;
temp = 34.5, 31.2, 23.7, 19.6, 35.8, 29.2, 24.4, 5.6, 7.2,
8.1, 18.6, 15.2, 13.1, 4.6, 3.7, 8.2, 9.7, 34.2, 26.7, 28.7, 2.1, 3.4,
5.6, 7.8, 9.0, 10.2, 11.2, 11.6, 11.7, 11.8 ;
// Fill arrays by outermost dimension in CDL (other programming
// languages might take a different index order). Indexing in CDL for
// this example is as follows:
// temp = temp(1,1,1), temp(1,1,2), temp(1,2,1), temp(1,2,2),
// temp(1,3,1), temp(1,3,2), temp(2,1,1), etc.
Figure 3.1 displays a simple CDL example with basic components: dimensions,
variables and data.
3.3 NetCDF Conventions
SEACOOS CDL uses the NetCDF Climate and Forecast (CF) Metadata Conventions v1.0
wherever possible. However, this does not limit SEACOOS CDL to using just one convention
where an attribute or concept from another convention might prove useful. After the DMCC
conducted a survey of existing conventions and standards for netCDF, it was decided to adopt
CF as the starting point.
The purpose of the CF conventions is to require conforming datasets to contain sufficient
metadata so that they are self-describing in the sense that each variable in the file has an
associated description of what it represents, including physical units if appropriate, and that each
value can be located in space (relative to earth-based coordinates) and time (Eaton, et al, 2001).
The main digression from CF that SEACOOS took is that SEACOOS CDL gets standard names
from the SEACOOS Data Dictionary instead of the CF Standard Name Table. Section 11 on
Standard Names contains more info rmation about the SEACOOS Data Dictionary.