The table below lists the postfix character(s) to add to a number literal for type cohesion. To use the new netCDF4 types NCO must be compiled/linked to the netCDF4 library and the output file must be HDF5.
n1[$time]=1UL; // n1 will now by typeNC_UINT
n2[$lon]=4b; // n2 will be of typeNC_BYTE
n3[$lat]=5ull; // n3 will be of typeNC_UINT64
n3@a1=6.0d; // attribute will be typeNC_DOUBLE
n3@a2=-666L; // attribute will be typeNC_INT
A floating point number without a postfix will default to
NC_DOUBLE
.
An integer without a postfix will default to type NC_INT
.
There is no postfix for characters, use a quoted string instead.
n4[$rlev]=0.1 // n4 will be of typeNC_DOUBLE
n5[$lon_grd]=2.0 // n5 will be of typeNC_DOUBLE
n6[$gds_crd]=2e3; // n6 will be of typeNC_DOUBLE
n7[$gds_crd]=2e3f; // n7 will be of typeNC_FLOAT
n6@a1=41; // attribute will be typeNC_INT
n6@a2=-21; // attribute will be typeNC_INT
n6@units="kelvin" // attribute will be typeNC_CHAR
NC_BYTE
, a signed 1-byte integer
NC_CHAR
, an ISO/ASCII character
NC_SHORT
, a signed 2-byte integer
NC_INT
, a signed 4-byte integer
NC_FLOAT
, a single-precision (4-byte) floating point number
NC_DOUBLE
, a double-precision (8-byte) floating point number
NC_UBYTE
, an unsigned 1-byte integer
NC_USHORT
, an unsigned 2-byte integer
NC_UINT
, an unsigned 4-byte integer
NC_INT64
, a signed 8-byte integer
NC_UINT64
, an unsigned 8-byte integer