BADC: Language types corresponding to netCDF data types

The following information is taken from the Unidata netCDF language page, it gives the correspondence between netCDF data types and C and FORTRAN data types.

C FORTRAN
netCDF/CDL Data API Data API
Data TypeType Mnemonic*TypeMnemonic*Bits
bytecharNC_BYTEBYTE, LOGICAL*1 (INTEGER)NCBYTE8
charcharNC_CHARCHARACTER NCCHAR8
shortshortNC_SHORTINTEGER*2 (INTEGER) NCSHORT16
longnclongNC_LONGINTEGER*4 (INTEGER) NCLONG32
floatfloatNC_FLOATREAL*4 (REAL) NCFLOAT32
doubledoubleNC_DOUBLEREAL*8 (DOUBLEPRECISION)NCDOUBLE64

*API Mnemonic: this is the name used in the Application Programmable Interface (API) provided in the NetCDF package.

The first column gives the netCDF data type, which is the same as the CDL data type. The next pair of columns give, respectively, the C data type corresponding to the first column and the corresponding C preprocessor macro for use in netCDF functions (the preprocessor macros are defined in the netCDF C header-file netcdf.h). The next pair of columns give, respectively, the FORTRAN data type corresponding to the first column and the corresponding FORTRAN parameter for use when calling netCDF routines (the parameters are defined in the netCDF FORTRAN include-file netcdf.inc). You should use the un-parenthesized FORTRAN types if possible. For any type that your FORTRAN compiler doesn't support, use the corresponding parenthesized type. The last column gives the number of bits used in the external representation of values of the corresponding type.

Note that the C data type corresponding to a netCDF long is nclong. This type should be used rather than int or long. It is defined in the netCDF header-file netcdf.h, where it is set to the appropriate type.

Note that there are no netCDF types corresponding to 64-bit integers or to wide characters in the current version of the netCDF library.