A variable represents a multidimensional array of values of the same type. 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. An attribute contains information about a variable or about the whole netCDF dataset. Attributes may be used to specify such properties as units, special values, maximum and minimum valid values, and packing parameters.
Attribute information is represented by single values or arrays of values.
For example, units is an attribute represented by a character array such as celsius . 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 or the number of characters in the character string assigned to it. All values assigned to an attribute must be of the same type.