2011 Unidata NetCDF Workshop > The Two NetCDF Data Models
4.4 Variables
Variables hold data values. In the classic
netCDF data model, a variable can hold a multidimensional array of
values of the same type.
A variable has a name, type, shape, attributes, and values.
- In the classic data model, the type of a variable is the
external type of its data as represented on disk, one of
- char
- byte (8 bits)
- short (16 bits)
- int (32 bits)
- float (32 bits)
- double (64 bits)
- The shape of a variable is specified with a list of
dimensions.
- no dimensions: a scalar variable with only one value
- 1 dimension: a 1-D (vector) variable
- 2 dimensions: a 2-D (matrix or grid) variable
- ...
- A variable may have attributes to specify properties
such as units.
- The values of variables are the data in a netCDF file.
- A record variable is a variable that uses a record (or
unlimited) dimension. It can grow efficiently by having data added
along the record dimension.
- The enhanced data model adds new types, and also allows the user
to define data types.
2011 Unidata NetCDF Workshop > The Two NetCDF Data Models