Commit c05b576e authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Renamed DATATYPE_ to CDI_DATATYPE_.

parent 0fde8a93
......@@ -419,18 +419,18 @@ void printShortinfo(int streamID, int vlistID, int vardis)
/* datatype */
datatype = vlistInqVarDatatype(vlistID, varID);
if ( datatype == DATATYPE_PACK ) strcpy(pstr, "P0");
if ( datatype == CDI_DATATYPE_PACK ) strcpy(pstr, "P0");
else if ( datatype > 0 && datatype <= 32 ) sprintf(pstr, "P%d", datatype);
else if ( datatype == DATATYPE_CPX32 ) strcpy(pstr, "C32");
else if ( datatype == DATATYPE_CPX64 ) strcpy(pstr, "C64");
else if ( datatype == DATATYPE_FLT32 ) strcpy(pstr, "F32");
else if ( datatype == DATATYPE_FLT64 ) strcpy(pstr, "F64");
else if ( datatype == DATATYPE_INT8 ) strcpy(pstr, "I8");
else if ( datatype == DATATYPE_INT16 ) strcpy(pstr, "I16");
else if ( datatype == DATATYPE_INT32 ) strcpy(pstr, "I32");
else if ( datatype == DATATYPE_UINT8 ) strcpy(pstr, "U8");
else if ( datatype == DATATYPE_UINT16 ) strcpy(pstr, "U16");
else if ( datatype == DATATYPE_UINT32 ) strcpy(pstr, "U32");
else if ( datatype == CDI_DATATYPE_CPX32 ) strcpy(pstr, "C32");
else if ( datatype == CDI_DATATYPE_CPX64 ) strcpy(pstr, "C64");
else if ( datatype == CDI_DATATYPE_FLT32 ) strcpy(pstr, "F32");
else if ( datatype == CDI_DATATYPE_FLT64 ) strcpy(pstr, "F64");
else if ( datatype == CDI_DATATYPE_INT8 ) strcpy(pstr, "I8");
else if ( datatype == CDI_DATATYPE_INT16 ) strcpy(pstr, "I16");
else if ( datatype == CDI_DATATYPE_INT32 ) strcpy(pstr, "I32");
else if ( datatype == CDI_DATATYPE_UINT8 ) strcpy(pstr, "U8");
else if ( datatype == CDI_DATATYPE_UINT16 ) strcpy(pstr, "U16");
else if ( datatype == CDI_DATATYPE_UINT32 ) strcpy(pstr, "U32");
else strcpy(pstr, "-1");
fprintf(stdout, " %-3s", pstr);
......@@ -564,11 +564,11 @@ void setDefaultDataType(char *datatypestr)
else if ( nbits == 32 )
{
if ( DefaultFileType == CDI_FILETYPE_GRB )
DefaultDataType = DATATYPE_PACK32;
DefaultDataType = CDI_DATATYPE_PACK32;
else
DefaultDataType = DATATYPE_FLT32;
DefaultDataType = CDI_DATATYPE_FLT32;
}
else if ( nbits == 64 ) DefaultDataType = DATATYPE_FLT64;
else if ( nbits == 64 ) DefaultDataType = CDI_DATATYPE_FLT64;
else
{
fprintf(stderr, "Unsupported number of bits %d!\n", nbits);
......@@ -580,9 +580,9 @@ void setDefaultDataType(char *datatypestr)
{
if ( dtype == D_INT )
{
if ( nbits == 8 ) DefaultDataType = DATATYPE_INT8;
else if ( nbits == 16 ) DefaultDataType = DATATYPE_INT16;
else if ( nbits == 32 ) DefaultDataType = DATATYPE_INT32;
if ( nbits == 8 ) DefaultDataType = CDI_DATATYPE_INT8;
else if ( nbits == 16 ) DefaultDataType = CDI_DATATYPE_INT16;
else if ( nbits == 32 ) DefaultDataType = CDI_DATATYPE_INT32;
else
{
fprintf(stderr, "Unsupported number of bits = %d for datatype INT!\n", nbits);
......@@ -592,7 +592,7 @@ void setDefaultDataType(char *datatypestr)
/*
else if ( dtype == D_UINT )
{
if ( nbits == 8 ) DefaultDataType = DATATYPE_UINT8;
if ( nbits == 8 ) DefaultDataType = CDI_DATATYPE_UINT8;
else
{
fprintf(stderr, "Unsupported number of bits = %d for datatype UINT!\n", nbits);
......@@ -602,8 +602,8 @@ void setDefaultDataType(char *datatypestr)
*/
else if ( dtype == D_FLT )
{
if ( nbits == 32 ) DefaultDataType = DATATYPE_FLT32;
else if ( nbits == 64 ) DefaultDataType = DATATYPE_FLT64;
if ( nbits == 32 ) DefaultDataType = CDI_DATATYPE_FLT32;
else if ( nbits == 64 ) DefaultDataType = CDI_DATATYPE_FLT64;
else
{
fprintf(stderr, "Unsupported number of bits = %d for datatype FLT!\n", nbits);
......@@ -612,8 +612,8 @@ void setDefaultDataType(char *datatypestr)
}
else if ( dtype == D_CPX )
{
if ( nbits == 32 ) DefaultDataType = DATATYPE_CPX32;
else if ( nbits == 64 ) DefaultDataType = DATATYPE_CPX64;
if ( nbits == 32 ) DefaultDataType = CDI_DATATYPE_CPX32;
else if ( nbits == 64 ) DefaultDataType = CDI_DATATYPE_CPX64;
else
{
fprintf(stderr, "Unsupported number of bits = %d for datatype CPX!\n", nbits);
......
......@@ -277,7 +277,7 @@ void printGridInfoKernel(int gridID, int index, bool lproj)
int xysize = xsize*ysize;
// int prec = gridInqPrec(gridID);
// int dig = (prec == DATATYPE_FLT64) ? 15 : 7;
// int dig = (prec == CDI_DATATYPE_FLT64) ? 15 : 7;
int dig = 7;
if ( !lproj )
......@@ -493,7 +493,7 @@ void printZaxisInfo(int vlistID)
int ltype = zaxisInqLtype(zaxisID);
int levelsize = zaxisInqSize(zaxisID);
// int prec = zaxisInqPrec(zaxisID);
// int dig = (prec == DATATYPE_FLT64) ? 15 : 7;
// int dig = (prec == CDI_DATATYPE_FLT64) ? 15 : 7;
int dig = 7;
zaxisName(zaxistype, zaxisname);
......
......@@ -17,11 +17,11 @@ by the following predefined constants:
\vspace*{3mm}
\hspace*{8mm}\begin{minipage}{15cm}
\begin{deflist}{{\large\tt DATATYPE\_TXT \ \ }}
\item[{\large\tt DATATYPE\_INT16}] 16-bit integer attribute
\item[{\large\tt DATATYPE\_INT32}] 32-bit integer attribute
\item[{\large\tt DATATYPE\_FLT32}] 32-bit floating point attribute
\item[{\large\tt DATATYPE\_FLT64}] 64-bit floating point attribute
\item[{\large\tt DATATYPE\_TXT}] Text attribute
\begin{deflist}{{\large\tt CDI\_DATATYPE\_TXT \ \ }}
\item[{\large\tt CDI\_DATATYPE\_INT16}] 16-bit integer attribute
\item[{\large\tt CDI\_DATATYPE\_INT32}] 32-bit integer attribute
\item[{\large\tt CDI\_DATATYPE\_FLT32}] 32-bit floating point attribute
\item[{\large\tt CDI\_DATATYPE\_FLT64}] 64-bit floating point attribute
\item[{\large\tt CDI\_DATATYPE\_TXT}] Text attribute
\end{deflist}
\end{minipage}
......@@ -80,7 +80,7 @@ Variable identifier, or {\tt CDI\_GLOBAL} for a global attribute.
\item[{\tt name}]
Attribute name.
\item[{\tt type}]
External data type ({\tt DATATYPE\_INT16} or {\tt DATATYPE\_INT32}).
External data type ({\tt CDI\_DATATYPE\_INT16} or {\tt CDI\_DATATYPE\_INT32}).
\item[{\tt len}]
Number of values provided for the attribute.
\item[{\tt ip}]
......@@ -141,7 +141,7 @@ Variable identifier, or {\tt CDI\_GLOBAL} for a global attribute.
\item[{\tt name}]
Attribute name.
\item[{\tt type}]
External data type ({\tt DATATYPE\_FLT32} or {\tt DATATYPE\_FLT64}).
External data type ({\tt CDI\_DATATYPE\_FLT32} or {\tt CDI\_DATATYPE\_FLT64}).
\item[{\tt len}]
Number of values provided for the attribute.
\item[{\tt dp}]
......
......@@ -446,9 +446,9 @@ Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate
Variable identifier.
\item[{\tt datatype}]
The data type identifier.
The valid {\CDI} data types are {\tt DATATYPE\_PACK8}, {\tt DATATYPE\_PACK16},
{\tt DATATYPE\_PACK24}, {\tt DATATYPE\_FLT32}, {\tt DATATYPE\_FLT64},
{\tt DATATYPE\_INT8}, {\tt DATATYPE\_INT16} and {\tt DATATYPE\_INT32}.
The valid {\CDI} data types are {\tt CDI\_DATATYPE\_PACK8}, {\tt CDI\_DATATYPE\_PACK16},
{\tt CDI\_DATATYPE\_PACK24}, {\tt CDI\_DATATYPE\_FLT32}, {\tt CDI\_DATATYPE\_FLT64},
{\tt CDI\_DATATYPE\_INT8}, {\tt CDI\_DATATYPE\_INT16} and {\tt CDI\_DATATYPE\_INT32}.
\end{deflist}
\end{minipage}
......@@ -479,9 +479,9 @@ Variable identifier.
\subsubsection*{Result}
{\tt vlistInqVarDatatype} returns an identifier to the data type of the variable.
The valid {\CDI} data types are {\tt DATATYPE\_PACK8}, {\tt DATATYPE\_PACK16}, {\tt DATATYPE\_PACK24},
{\tt DATATYPE\_FLT32}, {\tt DATATYPE\_FLT64}, {\tt DATATYPE\_INT8}, {\tt DATATYPE\_INT16} and
{\tt DATATYPE\_INT32}.
The valid {\CDI} data types are {\tt CDI\_DATATYPE\_PACK8}, {\tt CDI\_DATATYPE\_PACK16}, {\tt CDI\_DATATYPE\_PACK24},
{\tt CDI\_DATATYPE\_FLT32}, {\tt CDI\_DATATYPE\_FLT64}, {\tt CDI\_DATATYPE\_INT8}, {\tt CDI\_DATATYPE\_INT16} and
{\tt CDI\_DATATYPE\_INT32}.
......
......@@ -81,7 +81,7 @@ Variable identifier, or {\tt CDI\_GLOBAL} for a global attribute.
\item[{\tt name}]
Attribute name.
\item[{\tt type}]
External data type ({\tt DATATYPE\_INT16} or {\tt DATATYPE\_INT32}).
External data type ({\tt CDI\_DATATYPE\_INT16} or {\tt CDI\_DATATYPE\_INT32}).
\item[{\tt len}]
Number of values provided for the attribute.
\item[{\tt ip}]
......@@ -143,7 +143,7 @@ Variable identifier, or {\tt CDI\_GLOBAL} for a global attribute.
\item[{\tt name}]
Attribute name.
\item[{\tt type}]
External data type ({\tt DATATYPE\_FLT32} or {\tt DATATYPE\_FLT64}).
External data type ({\tt CDI\_DATATYPE\_FLT32} or {\tt CDI\_DATATYPE\_FLT64}).
\item[{\tt len}]
Number of values provided for the attribute.
\item[{\tt dp}]
......
......@@ -451,9 +451,9 @@ Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate
Variable identifier.
\item[{\tt datatype}]
The data type identifier.
The valid {\CDI} data types are {\tt DATATYPE\_PACK8}, {\tt DATATYPE\_PACK16},
{\tt DATATYPE\_PACK24}, {\tt DATATYPE\_FLT32}, {\tt DATATYPE\_FLT64},
{\tt DATATYPE\_INT8}, {\tt DATATYPE\_INT16} and {\tt DATATYPE\_INT32}.
The valid {\CDI} data types are {\tt CDI\_DATATYPE\_PACK8}, {\tt CDI\_DATATYPE\_PACK16},
{\tt CDI\_DATATYPE\_PACK24}, {\tt CDI\_DATATYPE\_FLT32}, {\tt CDI\_DATATYPE\_FLT64},
{\tt CDI\_DATATYPE\_INT8}, {\tt CDI\_DATATYPE\_INT16} and {\tt CDI\_DATATYPE\_INT32}.
\end{deflist}
\end{minipage}
......@@ -484,9 +484,9 @@ Variable identifier.
\subsubsection*{Result}
{\tt vlistInqVarDatatype} returns an identifier to the data type of the variable.
The valid {\CDI} data types are {\tt DATATYPE\_PACK8}, {\tt DATATYPE\_PACK16}, {\tt DATATYPE\_PACK24},
{\tt DATATYPE\_FLT32}, {\tt DATATYPE\_FLT64}, {\tt DATATYPE\_INT8}, {\tt DATATYPE\_INT16} and
{\tt DATATYPE\_INT32}.
The valid {\CDI} data types are {\tt CDI\_DATATYPE\_PACK8}, {\tt CDI\_DATATYPE\_PACK16}, {\tt CDI\_DATATYPE\_PACK24},
{\tt CDI\_DATATYPE\_FLT32}, {\tt CDI\_DATATYPE\_FLT64}, {\tt CDI\_DATATYPE\_INT8}, {\tt CDI\_DATATYPE\_INT16} and
{\tt CDI\_DATATYPE\_INT32}.
......
......@@ -23,15 +23,15 @@ predefined constants:
\vspace*{3mm}
\hspace*{8mm}\begin{minipage}{15cm}
\begin{deflist}{{\large\tt DATATYPE\_PACK1 \ \ }}
\item[{\large\tt DATATYPE\_PACK8}] 8 packed bit (only for GRIB)
\item[{\large\tt DATATYPE\_PACK16}] 16 packed bit (only for GRIB)
\item[{\large\tt DATATYPE\_PACK24}] 24 packed bit (only for GRIB)
\item[{\large\tt DATATYPE\_FLT32}] 32 bit floating point
\item[{\large\tt DATATYPE\_FLT64}] 64 bit floating point
\item[{\large\tt DATATYPE\_INT8}] 8 bit integer
\item[{\large\tt DATATYPE\_INT16}] 16 bit integer
\item[{\large\tt DATATYPE\_INT32}] 32 bit integer
\begin{deflist}{{\large\tt CDI\_DATATYPE\_PACK1 \ \ }}
\item[{\large\tt CDI\_DATATYPE\_PACK8}] 8 packed bit (only for GRIB)
\item[{\large\tt CDI\_DATATYPE\_PACK16}] 16 packed bit (only for GRIB)
\item[{\large\tt CDI\_DATATYPE\_PACK24}] 24 packed bit (only for GRIB)
\item[{\large\tt CDI\_DATATYPE\_FLT32}] 32 bit floating point
\item[{\large\tt CDI\_DATATYPE\_FLT64}] 64 bit floating point
\item[{\large\tt CDI\_DATATYPE\_INT8}] 8 bit integer
\item[{\large\tt CDI\_DATATYPE\_INT16}] 16 bit integer
\item[{\large\tt CDI\_DATATYPE\_INT32}] 32 bit integer
\end{deflist}
\end{minipage}
%\vspace*{3mm}
......@@ -40,10 +40,10 @@ predefined constants:
%
%\vspace*{3mm}
%\hspace*{8mm}\begin{minipage}{15cm}
%\begin{deflist}{{\large\tt DATATYPE\_TXT \ \ }}
%\item[{\large\tt DATATYPE\_TXT}] Text
%\item[{\large\tt DATATYPE\_INT}] Integer
%\item[{\large\tt DATATYPE\_FLT}] Floating point
%\begin{deflist}{{\large\tt CDI\_DATATYPE\_TXT \ \ }}
%\item[{\large\tt CDI\_DATATYPE\_TXT}] Text
%\item[{\large\tt CDI\_DATATYPE\_INT}] Integer
%\item[{\large\tt CDI\_DATATYPE\_FLT}] Floating point
%\end{deflist}
%\end{minipage}
......@@ -48,7 +48,7 @@
status = vlistInqAtt(vlistID, -1, ia-1, attname, atttype,
& attlen)
IF ( atttype == DATATYPE_TXT ) THEN
IF ( atttype == CDI_DATATYPE_TXT ) THEN
status = vlistInqAttTxt(vlistID, -1, attname, 80,
& atttxt)
WRITE(0,*) attname(1:10), attlen, atttxt(1:attlen)
......
......@@ -146,7 +146,7 @@ static int defineVlist ( int gridID, int zaxisID, int taxisID )
vlistDefVarName(vlistID, varID1, "varname1");
{
int globfac[] = { 23, 42 };
vlistDefAttInt(vlistID, varID1, "seer's globule factors", DATATYPE_INT16,
vlistDefAttInt(vlistID, varID1, "seer's globule factors", CDI_DATATYPE_INT16,
2, globfac);
}
vlistDefVarName(vlistID, varID2, "varname2");
......
......@@ -582,7 +582,7 @@ void cdfReadVarSliceDP(stream_t *streamptr, int varID, int levelID, double *data
size_t xsize = (size_t)gridInqXsize(gridId);
size_t ysize = (size_t)gridInqYsize(gridId);
if ( vlistInqVarDatatype(vlistID, varID) == DATATYPE_FLT32 )
if ( vlistInqVarDatatype(vlistID, varID) == CDI_DATATYPE_FLT32 )
{
float *data_fp = (float *) Malloc(gridsize*sizeof(*data_fp));
cdf_get_vara_float(fileID, ncvarid, start, count, data_fp);
......@@ -594,7 +594,7 @@ void cdfReadVarSliceDP(stream_t *streamptr, int varID, int levelID, double *data
{
cdf_get_vara_double(fileID, ncvarid, start, count, data);
if ( vlistInqVarDatatype(vlistID, varID) == DATATYPE_UINT8 )
if ( vlistInqVarDatatype(vlistID, varID) == CDI_DATATYPE_UINT8 )
{
nc_type xtype;
cdf_inq_vartype(fileID, ncvarid, &xtype);
......@@ -639,7 +639,7 @@ void cdfReadVarSliceSP(stream_t *streamptr, int varID, int levelID, float *data,
size_t xsize = (size_t)gridInqXsize(gridId);
size_t ysize = (size_t)gridInqYsize(gridId);
if ( vlistInqVarDatatype(vlistID, varID) == DATATYPE_FLT64 )
if ( vlistInqVarDatatype(vlistID, varID) == CDI_DATATYPE_FLT64 )
{
double *data_dp = (double *) Malloc(gridsize*sizeof(*data_dp));
cdf_get_vara_double(fileID, ncvarid, start, count, data_dp);
......@@ -651,7 +651,7 @@ void cdfReadVarSliceSP(stream_t *streamptr, int varID, int levelID, float *data,
{
cdf_get_vara_float(fileID, ncvarid, start, count, data);
if ( vlistInqVarDatatype(vlistID, varID) == DATATYPE_UINT8 )
if ( vlistInqVarDatatype(vlistID, varID) == CDI_DATATYPE_UINT8 )
{
nc_type xtype;
cdf_inq_vartype(fileID, ncvarid, &xtype);
......
......@@ -46,35 +46,35 @@ int cdfDefDatatype(int datatype, int filetype)
{
int xtype = NC_FLOAT;
if ( datatype == DATATYPE_CPX32 || datatype == DATATYPE_CPX64 )
if ( datatype == CDI_DATATYPE_CPX32 || datatype == CDI_DATATYPE_CPX64 )
Error("CDI/NetCDF library does not support complex numbers!");
if ( filetype == CDI_FILETYPE_NC4 )
{
if ( datatype == DATATYPE_INT8 ) xtype = NC_BYTE;
else if ( datatype == DATATYPE_INT16 ) xtype = NC_SHORT;
else if ( datatype == DATATYPE_INT32 ) xtype = NC_INT;
if ( datatype == CDI_DATATYPE_INT8 ) xtype = NC_BYTE;
else if ( datatype == CDI_DATATYPE_INT16 ) xtype = NC_SHORT;
else if ( datatype == CDI_DATATYPE_INT32 ) xtype = NC_INT;
#if defined (HAVE_NETCDF4)
else if ( datatype == DATATYPE_UINT8 ) xtype = NC_UBYTE;
else if ( datatype == DATATYPE_UINT16 ) xtype = NC_USHORT;
else if ( datatype == DATATYPE_UINT32 ) xtype = NC_UINT;
else if ( datatype == CDI_DATATYPE_UINT8 ) xtype = NC_UBYTE;
else if ( datatype == CDI_DATATYPE_UINT16 ) xtype = NC_USHORT;
else if ( datatype == CDI_DATATYPE_UINT32 ) xtype = NC_UINT;
#else
else if ( datatype == DATATYPE_UINT8 ) xtype = NC_SHORT;
else if ( datatype == DATATYPE_UINT16 ) xtype = NC_INT;
else if ( datatype == DATATYPE_UINT32 ) xtype = NC_INT;
else if ( datatype == CDI_DATATYPE_UINT8 ) xtype = NC_SHORT;
else if ( datatype == CDI_DATATYPE_UINT16 ) xtype = NC_INT;
else if ( datatype == CDI_DATATYPE_UINT32 ) xtype = NC_INT;
#endif
else if ( datatype == DATATYPE_FLT64 ) xtype = NC_DOUBLE;
else if ( datatype == CDI_DATATYPE_FLT64 ) xtype = NC_DOUBLE;
else xtype = NC_FLOAT;
}
else
{
if ( datatype == DATATYPE_INT8 ) xtype = NC_BYTE;
else if ( datatype == DATATYPE_INT16 ) xtype = NC_SHORT;
else if ( datatype == DATATYPE_INT32 ) xtype = NC_INT;
else if ( datatype == DATATYPE_UINT8 ) xtype = NC_SHORT;
else if ( datatype == DATATYPE_UINT16 ) xtype = NC_INT;
else if ( datatype == DATATYPE_UINT32 ) xtype = NC_INT;
else if ( datatype == DATATYPE_FLT64 ) xtype = NC_DOUBLE;
if ( datatype == CDI_DATATYPE_INT8 ) xtype = NC_BYTE;
else if ( datatype == CDI_DATATYPE_INT16 ) xtype = NC_SHORT;
else if ( datatype == CDI_DATATYPE_INT32 ) xtype = NC_INT;
else if ( datatype == CDI_DATATYPE_UINT8 ) xtype = NC_SHORT;
else if ( datatype == CDI_DATATYPE_UINT16 ) xtype = NC_INT;
else if ( datatype == CDI_DATATYPE_UINT32 ) xtype = NC_INT;
else if ( datatype == CDI_DATATYPE_FLT64 ) xtype = NC_DOUBLE;
else xtype = NC_FLOAT;
}
......@@ -181,7 +181,7 @@ void cdfDefineAttributes(int cdiID, int varID, int fileID, int ncvarID)
if ( attlen == 0 ) continue;
if ( atttype == DATATYPE_TXT )
if ( atttype == CDI_DATATYPE_TXT )
{
size_t attSize = (size_t)attlen*sizeof(char);
char *atttxt = (char *)resizeBuf(&attBuf, &attBufSize, attSize);
......@@ -189,31 +189,31 @@ void cdfDefineAttributes(int cdiID, int varID, int fileID, int ncvarID)
len = (size_t)attlen;
cdf_put_att_text(fileID, ncvarID, attname, len, atttxt);
}
else if ( atttype == DATATYPE_INT8 || atttype == DATATYPE_UINT8 ||
atttype == DATATYPE_INT16 || atttype == DATATYPE_UINT16 ||
atttype == DATATYPE_INT32 || atttype == DATATYPE_UINT32 )
else if ( atttype == CDI_DATATYPE_INT8 || atttype == CDI_DATATYPE_UINT8 ||
atttype == CDI_DATATYPE_INT16 || atttype == CDI_DATATYPE_UINT16 ||
atttype == CDI_DATATYPE_INT32 || atttype == CDI_DATATYPE_UINT32 )
{
size_t attSize = (size_t)attlen*sizeof(int);
int *attint = (int *)resizeBuf(&attBuf, &attBufSize, attSize);
cdiInqAttInt(cdiID, varID, attname, attlen, &attint[0]);
len = (size_t)attlen;
nc_type xtype = (atttype == DATATYPE_INT8) ? NC_BYTE :
(atttype == DATATYPE_INT16) ? NC_SHORT :
nc_type xtype = (atttype == CDI_DATATYPE_INT8) ? NC_BYTE :
(atttype == CDI_DATATYPE_INT16) ? NC_SHORT :
#if defined (HAVE_NETCDF4)
(atttype == DATATYPE_UINT8) ? NC_UBYTE :
(atttype == DATATYPE_UINT16) ? NC_USHORT :
(atttype == DATATYPE_UINT32) ? NC_UINT :
(atttype == CDI_DATATYPE_UINT8) ? NC_UBYTE :
(atttype == CDI_DATATYPE_UINT16) ? NC_USHORT :
(atttype == CDI_DATATYPE_UINT32) ? NC_UINT :
#endif
NC_INT;
cdf_put_att_int(fileID, ncvarID, attname, xtype, len, attint);
}
else if ( atttype == DATATYPE_FLT32 || atttype == DATATYPE_FLT64 )
else if ( atttype == CDI_DATATYPE_FLT32 || atttype == CDI_DATATYPE_FLT64 )
{
size_t attSize = (size_t)attlen * sizeof(double);
double *attflt = (double *)resizeBuf(&attBuf, &attBufSize, attSize);
cdiInqAttFlt(cdiID, varID, attname, attlen, attflt);
len = (size_t)attlen;
if ( atttype == DATATYPE_FLT32 )
if ( atttype == CDI_DATATYPE_FLT32 )
{
float attflt_sp[len];
for ( size_t i = 0; i < len; ++i ) attflt_sp[i] = (float)attflt[i];
......@@ -710,7 +710,7 @@ int cdfDefVar(stream_t *streamptr, int varID)
}
}
if ( dtype == DATATYPE_UINT8 && xtype == NC_BYTE )
if ( dtype == CDI_DATATYPE_UINT8 && xtype == NC_BYTE )
{
int validrange[2] = {0, 255};
cdf_put_att_int(fileID, ncvarid, "valid_range", NC_SHORT, 2, validrange);
......@@ -814,7 +814,7 @@ void cdf_write_var_data(int fileID, int vlistID, int varID, int ncvarid, int dty
float *mdata_sp = NULL;
float *sdata_sp = NULL;
/* if ( dtype == DATATYPE_INT8 || dtype == DATATYPE_INT16 || dtype == DATATYPE_INT32 ) */
/* if ( dtype == CDI_DATATYPE_INT8 || dtype == CDI_DATATYPE_INT16 || dtype == CDI_DATATYPE_INT32 ) */
{
double missval = vlistInqVarMissval(vlistID, varID);
double addoffset = vlistInqVarAddoffset(vlistID, varID);
......@@ -882,8 +882,8 @@ void cdf_write_var_data(int fileID, int vlistID, int varID, int ncvarid, int dty
}
}
if ( dtype == DATATYPE_UINT8 || dtype == DATATYPE_INT8 ||
dtype == DATATYPE_INT16 || dtype == DATATYPE_INT32 )
if ( dtype == CDI_DATATYPE_UINT8 || dtype == CDI_DATATYPE_INT8 ||
dtype == CDI_DATATYPE_INT16 || dtype == CDI_DATATYPE_INT32 )
{
if ( memtype == MEMTYPE_FLOAT )
{
......@@ -896,7 +896,7 @@ void cdf_write_var_data(int fileID, int vlistID, int varID, int ncvarid, int dty
for ( size_t i = 0; i < nvals; i++ ) mdata_sp[i] = roundf(mdata_sp[i]);
if ( dtype == DATATYPE_UINT8 )
if ( dtype == CDI_DATATYPE_UINT8 )
{
nc_type xtype;
cdf_inq_vartype(fileID, ncvarid, &xtype);
......@@ -918,7 +918,7 @@ void cdf_write_var_data(int fileID, int vlistID, int varID, int ncvarid, int dty
for ( size_t i = 0; i < nvals; i++ ) mdata_dp[i] = round(mdata_dp[i]);
if ( dtype == DATATYPE_UINT8 )
if ( dtype == CDI_DATATYPE_UINT8 )
{
nc_type xtype;
cdf_inq_vartype(fileID, ncvarid, &xtype);
......
......@@ -54,15 +54,15 @@ extern "C" {
#define CDI_FILETYPE_EXT 8 // File type EXTRA
#define CDI_FILETYPE_IEG 9 // File type IEG
#define FILETYPE_GRB CDI_FILETYPE_GRB
#define FILETYPE_GRB2 CDI_FILETYPE_GRB2
#define FILETYPE_NC CDI_FILETYPE_NC
#define FILETYPE_NC2 CDI_FILETYPE_NC2
#define FILETYPE_NC4 CDI_FILETYPE_NC4
#define FILETYPE_NC4C CDI_FILETYPE_NC4C
#define FILETYPE_SRV CDI_FILETYPE_SRV
#define FILETYPE_EXT CDI_FILETYPE_EXT
#define FILETYPE_IEG CDI_FILETYPE_IEG
#define FILETYPE_GRB 1
#define FILETYPE_GRB2 2
#define FILETYPE_NC 3
#define FILETYPE_NC2 4
#define FILETYPE_NC4 5
#define FILETYPE_NC4C 6
#define FILETYPE_SRV 7
#define FILETYPE_EXT 8
#define FILETYPE_IEG 9
/* Compress types */
......@@ -75,57 +75,57 @@ extern "C" {
/* external data types */
#define DATATYPE_PACK 0
#define DATATYPE_PACK1 1
#define DATATYPE_PACK2 2
#define DATATYPE_PACK3 3
#define DATATYPE_PACK4 4
#define DATATYPE_PACK5 5
#define DATATYPE_PACK6 6
#define DATATYPE_PACK7 7
#define DATATYPE_PACK8 8
#define DATATYPE_PACK9 9
#define DATATYPE_PACK10 10
#define DATATYPE_PACK11 11
#define DATATYPE_PACK12 12
#define DATATYPE_PACK13 13
#define DATATYPE_PACK14 14
#define DATATYPE_PACK15 15
#define DATATYPE_PACK16 16
#define DATATYPE_PACK17 17
#define DATATYPE_PACK18 18
#define DATATYPE_PACK19 19
#define DATATYPE_PACK20 20
#define DATATYPE_PACK21 21
#define DATATYPE_PACK22 22
#define DATATYPE_PACK23 23
#define DATATYPE_PACK24 24
#define DATATYPE_PACK25 25
#define DATATYPE_PACK26 26
#define DATATYPE_PACK27 27
#define DATATYPE_PACK28 28
#define DATATYPE_PACK29 29
#define DATATYPE_PACK30 30
#define DATATYPE_PACK31 31
#define DATATYPE_PACK32 32
#define DATATYPE_CPX32 64
#define DATATYPE_CPX64 128
#define DATATYPE_FLT32 132
#define DATATYPE_FLT64 164
#define DATATYPE_INT8 208
#define DATATYPE_INT16 216
#define DATATYPE_INT32 232
#define DATATYPE_UINT8 308
#define DATATYPE_UINT16 316
#define DATATYPE_UINT32 332
#define CDI_DATATYPE_PACK 0
#define CDI_DATATYPE_PACK1 1
#define CDI_DATATYPE_PACK2 2
#define CDI_DATATYPE_PACK3 3
#define CDI_DATATYPE_PACK4 4
#define CDI_DATATYPE_PACK5 5
#define CDI_DATATYPE_PACK6 6
#define CDI_DATATYPE_PACK7 7
#define CDI_DATATYPE_PACK8 8
#define CDI_DATATYPE_PACK9 9
#define CDI_DATATYPE_PACK10 10
#define CDI_DATATYPE_PACK11 11
#define CDI_DATATYPE_PACK12 12
#define CDI_DATATYPE_PACK13 13
#define CDI_DATATYPE_PACK14 14
#define CDI_DATATYPE_PACK15 15
#define CDI_DATATYPE_PACK16 16
#define CDI_DATATYPE_PACK17 17
#define CDI_DATATYPE_PACK18 18
#define CDI_DATATYPE_PACK19 19
#define CDI_DATATYPE_PACK20 20
#define CDI_DATATYPE_PACK21 21
#define CDI_DATATYPE_PACK22 22
#define CDI_DATATYPE_PACK23 23
#define CDI_DATATYPE_PACK24 24
#define CDI_DATATYPE_PACK25 25
#define CDI_DATATYPE_PACK26 26
#define CDI_DATATYPE_PACK27 27
#define CDI_DATATYPE_PACK28 28
#define CDI_DATATYPE_PACK29 29
#define CDI_DATATYPE_PACK30 30
#define CDI_DATATYPE_PACK31 31
#define CDI_DATATYPE_PACK32 32
#define CDI_DATATYPE_CPX32 64
#define CDI_DATATYPE_CPX64 128
#define CDI_DATATYPE_FLT32 132
#define CDI_DATATYPE_FLT64 164
#define CDI_DATATYPE_INT8 208
#define CDI_DATATYPE_INT16 216
#define CDI_DATATYPE_INT32 232
#define CDI_DATATYPE_UINT8 308
#define CDI_DATATYPE_UINT16 316
#define CDI_DATATYPE_UINT32 332
/* internal data types */
#define DATATYPE_INT 251
#define DATATYPE_FLT 252
#define DATATYPE_TXT 253
#define DATATYPE_CPX 254
#define DATATYPE_UCHAR 255
#define DATATYPE_LONG 256
#define CDI_DATATYPE_INT 251
#define CDI_DATATYPE_FLT 252
#define CDI_DATATYPE_TXT 253
#define CDI_DATATYPE_CPX 254
#define CDI_DATATYPE_UCHAR 255
#define CDI_DATATYPE_LONG 256
/* Chunks */
......
......@@ -315,7 +315,7 @@ int cdiCopyVarAtts(int cdiID1, int varID_1, int cdiID2, int varID_2)
@Item cdiID CDI ID, from a previous call to @fref{vlistCreate} or @fref{gridCreate}.
@Item varID Variable identifier, or @func{CDI_GLOBAL} for a global attribute.
@Item name Attribute name.
@Item type External data type (@func{DATATYPE_INT16} or @func{DATATYPE_INT32}).
@Item type External data type (@func{CDI_DATATYPE_INT16} or @func{CDI_DATATYPE_INT32}).
@Item len Number of values provided for the attribute.
@Item ip Pointer to one or more integer values.
......@@ -326,7 +326,7 @@ The function @func{cdiDefAttInt} defines an integer attribute.
*/
int cdiDefAttInt(int cdiID, int varID, const char *name, int type, int len, const int *ip)