The following table gives the netCDF external data types and the corresponding type constants for defining variables in the C interface:
Type | C #define | Bits
|
byte | NC_BYTE | 8
|
char | NC_CHAR | 8
|
short | NC_SHORT | 16
|
int | NC_INT | 32
|
float | NC_FLOAT | 32
|
double | NC_DOUBLE | 64
|
The first column gives the netCDF external data type, which is the same as the CDL data type. The next column gives the corresponding C preprocessor macro for use in netCDF functions (the preprocessor macros are defined in the netCDF C header-file netcdf.h). The last column gives the number of bits used in the external representation of values of the corresponding type.
Note that there are no netCDF types corresponding to 64-bit integers or to characters wider than 8 bits in the current version of the netCDF library.