Go to the previous, next section.

Attributes

Attributes may be associated with each netCDF variable to specify such properties as units, special values, maximum and minimum valid values, scaling factors, and offsets. Attributes for a netCDF file are defined when the file is first created, while the netCDF file is in define mode. Additional attributes may be added later by reentering define mode. A netCDF attribute has a netCDF variable to which it is assigned, a name, a type, a length, and a sequence of one or more values. An attribute is designated by its variable ID and name, except in one case (ncattname or NCANAM in FORTRAN), where attributes are designated by variable ID and number because their names are unknown.

The attributes associated with a variable are typically defined right after the variable is created, while still in define mode. The data type, length, and value of an attribute may be changed even when in data mode, as long as the changed attribute requires no more space than the attribute as originally defined.

It is also possible to assign attributes not associated with any variable to the netCDF as a whole, by using the NC_GLOBAL variable pseudo-ID. Global attributes may be used for purposes such as providing a title or processing history for a netCDF data set.

Operations supported on attributes are:

Go to the previous, next section.