A variable has a name, a data type, and a shape described by its list of dimensions. The name, data type, and shape of a variable are specified by its declaration in the variable section of a CDL description. Dimensions need not have corresponding variables. A netCDF attribute contains information about a netCDF variable or about the whole netCDF dataset. Attributes are used to specify such properties as units, special values, maximum and minimum valid values, scaling factors, offsets, and parameters.
Attribute information is represented by single values or arrays of values.
An attribute has an associated variable, a name, a data type, a length, and a value. The data type of an attribute in CDL is derived from the type of the value assigned to it. The length of an attribute is the number of data values assigned to it, or the number of characters in the character string assigned to it. Multiple values are assigned to non-character attributes by separating the values with commas. All values assigned to an attribute must be of the same type.