NCL attributes are the metadata that describe a variable or data file and its contents. The attributes can specify data range, variable sizes, a file title, a file history, and any other user-defined descriptive information. Attributes can have any valid NCL type, but they must be single dimensioned. Common variable attributes are the valid range of the variable, the units, the long name of the variable, and other user-defined information. Common data file attributes are the file title and date. Variables and files can have as many attributes as the user desires. Attributes are limited to be single dimension values. Individual elements of an attribute can be selected using standard array subscripting following the reference to the variable and attribute.
For example, a data file, called file1, may have variables, such as temperature and precipitation, and global attributes, such as the file title, and creation date. The variables may also have attributes, such as the units or the maximum valid data value.
The at sign, '@', is used to specify a variable or a file attribute name. Attributes are created in the following manner:
; File attributes called "title" and "date" file1@title = "South American Climate Data" file1@date = "November 23, 1994" ; Variable attributes called "units" and "max" file1->temperature@units = "Degrees C" file1-> precipitation@units = "centimeters" file1->temperature@max = 40.87
NG4.1 Home, Index, Examples, Glossary, Feedback, UG Contents, UG WhereAmI?