SEACOOS CDL v2.0
December 9, 2004
5
NetCDF files contain the data in variables, which can be single numbers, vectors, or multi-
dimensional arrays. Variables can be of data type char, byte, short, int, float or real and
double. netCDF files can contain data that can be organized into a collection of named array
variables with named attributes which is widely applicable to many situations. However, netCDF
has some limitations. For instance, a netCDF file size cannot exceed two Gigabytes. Also,
netCDF data model does not support nested data structures such as trees, nested arrays, or other
recursive structures. The NetCDF Users Gu ide thoroughly documents the many assets and few
limitations of netCDF (http://my.unidata.ucar.edu/content/software/netcdf/docs.html).
3.2 Common Data Language (CDL)
Common Data Language (CDL) is textual notation that describes the netCDF object and it is
human readable. The netCDF utility ncdump converts netCDF object binary to CDL text. The
netCDF utility ncgen creates netCDF binary file from well- formed CDL text file.
A CDL description of a netCDF dataset takes the form
netCDF name {
dimensions: ...
variables: ...
data: ...
}
where the name is used only as a default in constructing file names by the ncgen utility. The
CDL description consists of three optional parts, introduced by the keywords dimensions,
variables, and data. NetCDF dimension declarations appear after the dimensions keyword,
netCDF variables and attributes are defined after the variables keyword, and variable data
assignments appear after the data keyword. CDL statements are terminated by a semicolon.
Spaces, tabs, and newlines can be used freely for readability. Comments in CDL follow the
characters '
//' on any line
(Rew, et al, 1997). A simple CDL example is provided in Figure 3.1.