The netCDF data types char
, byte
,
short
, int
,
float
or real
, and double
are all acceptable. The
char
type is not intended for numeric data. One
byte numeric data should be stored using the
byte
data type. All integer types are treated by
the netCDF interface as signed. It is possible
to treat the byte
type as unsigned by using the
NUG convention of indicating the unsigned range
using the
valid_min
,
valid_max
,
or
valid_range
attributes.
NetCDF does not support a character string type, so these must be represented as character arrays. In this document, a one dimensional array of character data is simply referred to as a "string". An n-dimensional array of strings must be implemented as a character array of dimension (n,max_string_length), with the last (most rapidly varying) dimension declared large enough to contain the longest string in the array. All the strings in a given array are therefore defined to be equal in length. For example, an array of strings containing the names of the months would be dimensioned (12,9) in order to accommodate "September", the month with the longest name.