Next: , Previous: Irregular grids, Up: ncap2 netCDF Arithmetic Processor


4.1.4 Intrinsic functions

ncap2 contains a small (and growing) library of intrinsic functions. In addition to the standard mathematical functions (see Intrinsic mathematical functions), ncap2 currently supports packing and unpacking.

pack(x)
The standard packing algorithm is applied to variable x.
unpack(x)
The standard unpacking algorithm is applied to variable x.

Type Conversion Functions

These intrinsic functions allow ncap2 to convert variables on disk among the available types supported by netCDF.

byte(x)
Convert to NC_BYTE Converts x to external type NC_BYTE, a C-type signed char.
char(x)
Convert to NC_CHAR Converts x to external type NC_CHAR, a C-type unsigned char.
double(x)
Convert to NC_DOUBLE Converts x to external type NC_DOUBLE, a C-type double.
float(x)
Convert to NC_FLOAT Converts x to external type NC_FLOAT, a C-type float.
int(x)
Convert to NC_INT Converts x to external type NC_INT, a C-type int.
short(x)
Convert to NC_SHORT Converts x to external type NC_SHORT, a C-type short.
See Type Conversion, for more details on automatic and manual type conversion.