.. highlightlang:: us .. _nc_varinq_datatype: nc_varinq_datatype ================== .. index:: nc_varinq_datatype .. us.tag nc_varinq_datatype ENGLISH NC_Var :ref:`nc_varinq_datatype` returns the data type of a variable when given its ID. .. function:: datatype = nc_varinq_datatype(ncid, varid) .. us.return **Return Value** *datatype* is the data type of the variable with the ID *varid* and is one of the following: .. list-table:: :header-rows: 1 * - Value - Meaning * - NC_BYTE - Eight-bit data * - NC_CHAR - for representing text strings as arrays of ASCII characters * - NC_SHORT - 16-Bit integers * - NC_LONG - 32-Bit integers * - NC_FLOAT - 32-Bit IEEE floating-point * - NC_DOUBLE - 64-Bit IEEE floating-point If an error occurs, *datatype* is -1. .. us.params **Parameters** .. uparam:: ncid Identifies the netCDF file. .. uparam:: varid *varid* is the ID of the variable. .. seealso:: :ref:`overview-netcdf-files`, :ref:`nc_create` :sub:`id-1540160`