Commit 6fefa1e6 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Renamed DATATYPE_ to CDI_DATATYPE_.

parent ba2aac82
......@@ -255,10 +255,10 @@ void *Adisit(void *argument)
sao.missval = vlistInqVarMissval(vlistID1, saoID);
tis.missval = tho.missval;
int datatype = DATATYPE_FLT32;
if ( vlistInqVarDatatype(vlistID1, thoID) == DATATYPE_FLT64 &&
vlistInqVarDatatype(vlistID1, saoID) == DATATYPE_FLT64 )
datatype = DATATYPE_FLT64;
int datatype = CDI_DATATYPE_FLT32;
if ( vlistInqVarDatatype(vlistID1, thoID) == CDI_DATATYPE_FLT64 &&
vlistInqVarDatatype(vlistID1, saoID) == CDI_DATATYPE_FLT64 )
datatype = CDI_DATATYPE_FLT64;
int vlistID2 = vlistCreate();
......
......@@ -1368,11 +1368,11 @@ void after_parini(struct Control *globs, struct Variable *vars)
if ( precision )
switch ( precision )
{
case 8: DataType = DATATYPE_PACK8; break;
case 16: DataType = DATATYPE_PACK16; break;
case 24: DataType = DATATYPE_PACK24; break;
case 32: DataType = DATATYPE_FLT32; break;
case 64: DataType = DATATYPE_FLT64; break;
case 8: DataType = CDI_DATATYPE_PACK8; break;
case 16: DataType = CDI_DATATYPE_PACK16; break;
case 24: DataType = CDI_DATATYPE_PACK24; break;
case 32: DataType = CDI_DATATYPE_FLT32; break;
case 64: DataType = CDI_DATATYPE_FLT64; break;
default: Error( "unsupported data precision %d", precision);
}
......
......@@ -48,18 +48,18 @@ const char *datatypestr(int datatype)
str[0] = 0;
sprintf(str, "%d bit packed", datatype);
if ( datatype == DATATYPE_PACK ) return ("P0");
if ( datatype == CDI_DATATYPE_PACK ) return ("P0");
else if ( datatype > 0 && datatype <= 32 ) return (str);
else if ( datatype == DATATYPE_CPX32 ) return ("C32");
else if ( datatype == DATATYPE_CPX64 ) return ("C64");
else if ( datatype == DATATYPE_FLT32 ) return ("32 bit floats");
else if ( datatype == DATATYPE_FLT64 ) return ("64 bit floats");
else if ( datatype == DATATYPE_INT8 ) return ("I8");
else if ( datatype == DATATYPE_INT16 ) return ("I16");
else if ( datatype == DATATYPE_INT32 ) return ("I32");
else if ( datatype == DATATYPE_UINT8 ) return ("U8");
else if ( datatype == DATATYPE_UINT16 ) return ("U16");
else if ( datatype == DATATYPE_UINT32 ) return ("U32");
else if ( datatype == CDI_DATATYPE_CPX32 ) return ("C32");
else if ( datatype == CDI_DATATYPE_CPX64 ) return ("C64");
else if ( datatype == CDI_DATATYPE_FLT32 ) return ("32 bit floats");
else if ( datatype == CDI_DATATYPE_FLT64 ) return ("64 bit floats");
else if ( datatype == CDI_DATATYPE_INT8 ) return ("I8");
else if ( datatype == CDI_DATATYPE_INT16 ) return ("I16");
else if ( datatype == CDI_DATATYPE_INT32 ) return ("I32");
else if ( datatype == CDI_DATATYPE_UINT8 ) return ("U8");
else if ( datatype == CDI_DATATYPE_UINT16 ) return ("U16");
else if ( datatype == CDI_DATATYPE_UINT32 ) return ("U32");
else return ("");
}
......
......@@ -49,18 +49,18 @@ const char *datatypestr(int datatype)
str[0] = 0;
sprintf(str, "%d bit packed", datatype);
if ( datatype == DATATYPE_PACK ) return ("P0");
if ( datatype == CDI_DATATYPE_PACK ) return ("P0");
else if ( datatype > 0 && datatype <= 32 ) return (str);
else if ( datatype == DATATYPE_CPX32 ) return ("C32");
else if ( datatype == DATATYPE_CPX64 ) return ("C64");
else if ( datatype == DATATYPE_FLT32 ) return ("32 bit floats");
else if ( datatype == DATATYPE_FLT64 ) return ("64 bit floats");
else if ( datatype == DATATYPE_INT8 ) return ("I8");
else if ( datatype == DATATYPE_INT16 ) return ("I16");
else if ( datatype == DATATYPE_INT32 ) return ("I32");
else if ( datatype == DATATYPE_UINT8 ) return ("U8");
else if ( datatype == DATATYPE_UINT16 ) return ("U16");
else if ( datatype == DATATYPE_UINT32 ) return ("U32");
else if ( datatype == CDI_DATATYPE_CPX32 ) return ("C32");
else if ( datatype == CDI_DATATYPE_CPX64 ) return ("C64");
else if ( datatype == CDI_DATATYPE_FLT32 ) return ("32 bit floats");
else if ( datatype == CDI_DATATYPE_FLT64 ) return ("64 bit floats");
else if ( datatype == CDI_DATATYPE_INT8 ) return ("I8");
else if ( datatype == CDI_DATATYPE_INT16 ) return ("I16");
else if ( datatype == CDI_DATATYPE_INT32 ) return ("I32");
else if ( datatype == CDI_DATATYPE_UINT8 ) return ("U8");
else if ( datatype == CDI_DATATYPE_UINT16 ) return ("U16");
else if ( datatype == CDI_DATATYPE_UINT32 ) return ("U32");
else return ("");
}
......
......@@ -157,17 +157,17 @@ static void dump_global_attributes(struct kv **ht, int streamID)
cdiInqAtt(vlistID, CDI_GLOBAL, i, name, &type, &len);
switch ( type )
{
case DATATYPE_TXT:
case CDI_DATATYPE_TXT:
value = Malloc(len + 1);
cdiInqAttTxt(vlistID, CDI_GLOBAL, name, len, value);
value[len] = '\0';
break;
case DATATYPE_INT32:
case CDI_DATATYPE_INT32:
value = Malloc(CDI_MAX_NAME);
cdiInqAttInt(vlistID, CDI_GLOBAL, name, len, (int *)buffer);
snprintf(value, CDI_MAX_NAME, "%i", *(int *)buffer);
break;
case DATATYPE_FLT64:
case CDI_DATATYPE_FLT64:
value = Malloc(CDI_MAX_NAME);
cdiInqAttFlt(vlistID, CDI_GLOBAL, name, len, (double *)buffer);
snprintf(value, CDI_MAX_NAME, "%e", *(double *)buffer);
......@@ -471,7 +471,7 @@ static void register_cmor_grid_mapping(int projID, int cmor_grid_id)
for ( int iatt = 0; iatt < natts; ++iatt )
{
cdiInqAtt(projID, CDI_GLOBAL, iatt, attname, &atttype, &attlen);
if ( atttype == DATATYPE_FLT32 || atttype == DATATYPE_FLT64 )
if ( atttype == CDI_DATATYPE_FLT32 || atttype == CDI_DATATYPE_FLT64 )
{
double attflt[attlen];
cdiInqAttFlt(projID, CDI_GLOBAL, attname, attlen, attflt);
......@@ -588,7 +588,7 @@ static void register_variable(int vlistID, int varID, int *axis_ids,
size_t gridsize = vlistGridsizeMax(vlistID);
int levels = zaxisInqSize(vlistInqVarZaxis(vlistID, varID));
var->cdi_varID = varID;
if ( vlistInqVarDatatype(vlistID, varID) == DATATYPE_FLT32 )
if ( vlistInqVarDatatype(vlistID, varID) == CDI_DATATYPE_FLT32 )
{
var->datatype = 'f';
*(float *) missing_value = vlistInqVarMissval(vlistID, varID);
......
......@@ -46,10 +46,10 @@ void *Complextorect(void *argument)
for ( varID = 0; varID < nvars; ++varID )
{
datatype = vlistInqVarDatatype(vlistID2, varID);
if ( datatype == DATATYPE_CPX64 )
datatype = DATATYPE_FLT64;
if ( datatype == CDI_DATATYPE_CPX64 )
datatype = CDI_DATATYPE_FLT64;
else
datatype = DATATYPE_FLT32;
datatype = CDI_DATATYPE_FLT32;
vlistDefVarDatatype(vlistID2, varID, datatype);
vlistDefVarDatatype(vlistID3, varID, datatype);
......
......@@ -1478,7 +1478,7 @@ void *Echam5ini(void *argument)
if ( vars[iv].name ) vlistDefVarName(vlistID2, varID, vars[iv].name);
if ( vars[iv].longname ) vlistDefVarLongname(vlistID2, varID, vars[iv].longname);
if ( vars[iv].units ) vlistDefVarUnits(vlistID2, varID, vars[iv].units);
vlistDefVarDatatype(vlistID2, varID, DATATYPE_FLT64);
vlistDefVarDatatype(vlistID2, varID, CDI_DATATYPE_FLT64);
}
for ( iatt = 0; iatt < atts.natxt; ++iatt )
......
......@@ -144,7 +144,7 @@ void *Ensstat(void *argument)
int tsteptype = vlistInqVarTsteptype(vlistID2, varID);
int cvarID = vlistDefVar(vlistID2, gridID, zaxisID, tsteptype);
vlistDefVarName(vlistID2, cvarID, name);
vlistDefVarDatatype(vlistID2, cvarID, DATATYPE_INT16);
vlistDefVarDatatype(vlistID2, cvarID, CDI_DATATYPE_INT16);
if ( cvarID != (varID+nvars) ) cdoAbort("Internal error, varIDs do not match!");
}
}
......
......@@ -46,7 +46,7 @@ void printAtts(FILE *fp, int vlistID, int varID)
for ( int ia = 0; ia < natts; ++ia )
{
cdiInqAtt(vlistID, varID, ia, attname, &atttype, &attlen);
if ( atttype == DATATYPE_INT )
if ( atttype == CDI_DATATYPE_INT )
{
if ( attlen > MAXATT ) attlen = MAXATT;
cdiInqAttInt(vlistID, varID, attname, attlen, attint);
......@@ -58,7 +58,7 @@ void printAtts(FILE *fp, int vlistID, int varID)
}
fprintf(fp, "\n");
}
else if ( atttype == DATATYPE_FLT )
else if ( atttype == CDI_DATATYPE_FLT )
{
if ( attlen > MAXATT ) attlen = MAXATT;
cdiInqAttFlt(vlistID, varID, attname, MAXATT, attflt);
......@@ -70,7 +70,7 @@ void printAtts(FILE *fp, int vlistID, int varID)
}
fprintf(fp, "\n");
}
else if ( atttype == DATATYPE_TXT )
else if ( atttype == CDI_DATATYPE_TXT )
{
cdiInqAttTxt(vlistID, varID, attname, sizeof(atttxt), atttxt);
atttxt[attlen] = 0;
......
......@@ -78,10 +78,10 @@ void *Gengrid(void *argument)
gridDefXvals(gridID3, array1);
gridDefYvals(gridID3, array2);
if ( datatype == DATATYPE_FLT64 )
gridDefPrec(gridID3, DATATYPE_FLT64);
if ( datatype == CDI_DATATYPE_FLT64 )
gridDefPrec(gridID3, CDI_DATATYPE_FLT64);
else
gridDefPrec(gridID3, DATATYPE_FLT32);
gridDefPrec(gridID3, CDI_DATATYPE_FLT32);
double xminval = array1[0];
double xmaxval = array1[0];
......@@ -120,7 +120,7 @@ void *Gengrid(void *argument)
vlistDefVar(vlistID3, gridID3, zaxisID3, TSTEP_CONSTANT);
vlistDefVarMissval(vlistID3, 0, missval);
vlistDefVarName(vlistID3, 0, "dummy");
vlistDefVarDatatype(vlistID3, 0, DATATYPE_INT8);
vlistDefVarDatatype(vlistID3, 0, CDI_DATATYPE_INT8);
int taxisID3 = taxisCreate(TAXIS_ABSOLUTE);
......
......@@ -1074,7 +1074,7 @@ void *Gradsdes(void *argument)
filetype == CDI_FILETYPE_IEG )
{
prec = vlistInqVarDatatype(vlistID, varID);
if ( prec == DATATYPE_FLT64 ) flt64 = true;
if ( prec == CDI_DATATYPE_FLT64 ) flt64 = true;
}
vars[varID] = TRUE;
recoffset[varID] = nrecsout;
......
......@@ -132,17 +132,17 @@ void *Gridcell(void *argument)
vlistDefVarStdname(vlistID2, varID, "area");
vlistDefVarLongname(vlistID2, varID, "area of grid cell");
vlistDefVarUnits(vlistID2, varID, "m2");
vlistDefVarDatatype(vlistID2, varID, DATATYPE_FLT64);
vlistDefVarDatatype(vlistID2, varID, CDI_DATATYPE_FLT64);
}
else if ( operatorID == GRIDWGTS )
{
vlistDefVarName(vlistID2, varID, "cell_weights");
vlistDefVarDatatype(vlistID2, varID, DATATYPE_FLT64);
vlistDefVarDatatype(vlistID2, varID, CDI_DATATYPE_FLT64);
}
else if ( operatorID == GRIDMASK )
{
vlistDefVarName(vlistID2, varID, "grid_mask");
vlistDefVarDatatype(vlistID2, varID, DATATYPE_UINT8);
vlistDefVarDatatype(vlistID2, varID, CDI_DATATYPE_UINT8);
}
else if ( operatorID == GRIDDX )
{
......
......@@ -56,7 +56,7 @@ void init_amsr_day(int vlistID, int gridID, int zaxisID, int nvars)
varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_INSTANT);
vlistDefVarName(vlistID, varID, name[i]);
vlistDefVarUnits(vlistID, varID, units[i]);
vlistDefVarDatatype(vlistID, varID, DATATYPE_INT16);
vlistDefVarDatatype(vlistID, varID, CDI_DATATYPE_INT16);
vlistDefVarMissval(vlistID, varID, 254);
vlistDefVarScalefactor(vlistID, varID, xscale[i]);
vlistDefVarAddoffset(vlistID, varID, xminval[i]);
......@@ -103,7 +103,7 @@ void init_amsr_averaged(int vlistID, int gridID, int zaxisID, int nvars)
varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_INSTANT);
vlistDefVarName(vlistID, varID, name[i]);
vlistDefVarUnits(vlistID, varID, units[i]);
vlistDefVarDatatype(vlistID, varID, DATATYPE_INT16);
vlistDefVarDatatype(vlistID, varID, CDI_DATATYPE_INT16);
vlistDefVarMissval(vlistID, varID, 254);
vlistDefVarScalefactor(vlistID, varID, xscale[i]);
vlistDefVarAddoffset(vlistID, varID, xminval[i]);
......
......@@ -298,26 +298,26 @@ void *Importbinary(void *argument)
}
missval = pfi.undef;
datatype = DATATYPE_FLT32;
datatype = CDI_DATATYPE_FLT32;
if ( pvar->dfrm == 1 ) {
datatype = DATATYPE_UINT8;
datatype = CDI_DATATYPE_UINT8;
if ( missval < 0 || missval > 255 ) missval = 255;
}
else if ( pvar->dfrm == 2 ) {
datatype = DATATYPE_UINT16;
datatype = CDI_DATATYPE_UINT16;
if ( missval < 0 || missval > 65535 ) missval = 65535;
}
else if ( pvar->dfrm == -2 ) {
datatype = DATATYPE_INT16;
datatype = CDI_DATATYPE_INT16;
if ( missval < -32768 || missval > 32767 ) missval = -32768;
}
else if ( pvar->dfrm == 4 ) {
datatype = DATATYPE_INT32;
datatype = CDI_DATATYPE_INT32;
if ( missval < -2147483648 || missval > 2147483647 ) missval = -2147483646;
}
else if ( pfi.flt64 )
datatype = DATATYPE_FLT64;
datatype = CDI_DATATYPE_FLT64;
vlistDefVarDatatype(vlistID, varID, datatype);
vlistDefVarMissval(vlistID, varID, missval);
......
......@@ -765,7 +765,7 @@ void read_dataset(hid_t loc_id, const char *name, void *opdata)
int i, k;
int ftype = 0;
int len;
int dtype = DATATYPE_FLT32;
int dtype = CDI_DATATYPE_FLT32;
char attstring[4096]; /* Buffer to read string attribute back */
char varname[CDI_MAX_NAME];
short *mask = NULL;
......@@ -802,14 +802,14 @@ void read_dataset(hid_t loc_id, const char *name, void *opdata)
}
*/
native_type = H5Tget_native_type(type_id, H5T_DIR_ASCEND);
if ( H5Tequal(native_type, H5T_NATIVE_SCHAR) > 0 ) {ftype=0; dtype = DATATYPE_INT8;}
else if ( H5Tequal(native_type, H5T_NATIVE_UCHAR) > 0 ) {ftype=0; dtype = DATATYPE_UINT8;}
else if ( H5Tequal(native_type, H5T_NATIVE_SHORT) > 0 ) {ftype=0; dtype = DATATYPE_INT16;}
else if ( H5Tequal(native_type, H5T_NATIVE_USHORT) > 0 ) {ftype=0; dtype = DATATYPE_UINT16;}
else if ( H5Tequal(native_type, H5T_NATIVE_INT) > 0 ) {ftype=0; dtype = DATATYPE_INT32;}
else if ( H5Tequal(native_type, H5T_NATIVE_UINT) > 0 ) {ftype=0; dtype = DATATYPE_UINT32;}
else if ( H5Tequal(native_type, H5T_NATIVE_FLOAT) > 0 ) {ftype=1; dtype = DATATYPE_FLT32;}
else if ( H5Tequal(native_type, H5T_NATIVE_DOUBLE) > 0 ) {ftype=1; dtype = DATATYPE_FLT64;}
if ( H5Tequal(native_type, H5T_NATIVE_SCHAR) > 0 ) {ftype=0; dtype = CDI_DATATYPE_INT8;}
else if ( H5Tequal(native_type, H5T_NATIVE_UCHAR) > 0 ) {ftype=0; dtype = CDI_DATATYPE_UINT8;}
else if ( H5Tequal(native_type, H5T_NATIVE_SHORT) > 0 ) {ftype=0; dtype = CDI_DATATYPE_INT16;}
else if ( H5Tequal(native_type, H5T_NATIVE_USHORT) > 0 ) {ftype=0; dtype = CDI_DATATYPE_UINT16;}
else if ( H5Tequal(native_type, H5T_NATIVE_INT) > 0 ) {ftype=0; dtype = CDI_DATATYPE_INT32;}
else if ( H5Tequal(native_type, H5T_NATIVE_UINT) > 0 ) {ftype=0; dtype = CDI_DATATYPE_UINT32;}
else if ( H5Tequal(native_type, H5T_NATIVE_FLOAT) > 0 ) {ftype=1; dtype = CDI_DATATYPE_FLT32;}
else if ( H5Tequal(native_type, H5T_NATIVE_DOUBLE) > 0 ) {ftype=1; dtype = CDI_DATATYPE_FLT64;}
else
{
cdoWarning("Dataset %s skipped, unsupported native datatype!", varname);
......@@ -1052,7 +1052,7 @@ void read_dataset(hid_t loc_id, const char *name, void *opdata)
if ( ftype )
{
if ( dtype == DATATYPE_FLT32 )
if ( dtype == CDI_DATATYPE_FLT32 )
{
float *farray;
int i;
......@@ -1126,13 +1126,13 @@ void read_dataset(hid_t loc_id, const char *name, void *opdata)
cdoPrint("Dataset %s: dtype = %d minval = %g maxval = %g missval = %g",
varname, dtype, minval, maxval, missval);
if ( dtype == DATATYPE_UINT8 )
if ( dtype == CDI_DATATYPE_UINT8 )
{
if ( minval >= 0 && maxval <= 127 ) dtype = DATATYPE_INT8;
if ( minval >= 0 && maxval <= 127 ) dtype = CDI_DATATYPE_INT8;
}
else if ( dtype == DATATYPE_UINT16 )
else if ( dtype == CDI_DATATYPE_UINT16 )
{
if ( minval >= 0 && maxval <= 32767 ) dtype = DATATYPE_INT16;
if ( minval >= 0 && maxval <= 32767 ) dtype = CDI_DATATYPE_INT16;
}
laddoffset = IS_NOT_EQUAL(addoffset, 0);
......@@ -1172,10 +1172,10 @@ void read_dataset(hid_t loc_id, const char *name, void *opdata)
{
if ( ! (missval < minval || missval > maxval) )
{
if ( DBL_IS_EQUAL(missval, 255.) && dtype == DATATYPE_UINT8 )
if ( DBL_IS_EQUAL(missval, 255.) && dtype == CDI_DATATYPE_UINT8 )
{
missval = -255;
dtype = DATATYPE_INT16;
dtype = CDI_DATATYPE_INT16;
cdoPrint("Dataset %s: changed missval to %g and datatype to INT16!",
varname, missval);
......@@ -1311,12 +1311,12 @@ void get_global_att(hid_t file_id, const char *obj_path, int vlistID)
else if ( type_class == H5T_INTEGER )
{
H5Aread(attr, H5T_NATIVE_INT, &attint);
cdiDefAttInt(vlistID, CDI_GLOBAL, attname, DATATYPE_INT32, 1, &attint);
cdiDefAttInt(vlistID, CDI_GLOBAL, attname, CDI_DATATYPE_INT32, 1, &attint);
}
else if ( type_class == H5T_FLOAT )
{
H5Aread(attr, H5T_NATIVE_DOUBLE, &attflt);
cdiDefAttFlt(vlistID, CDI_GLOBAL, attname, DATATYPE_FLT64, 1, &attflt);
cdiDefAttFlt(vlistID, CDI_GLOBAL, attname, CDI_DATATYPE_FLT64, 1, &attflt);
}
H5Tclose(atype_mem);
H5Aclose(attr);
......@@ -1341,7 +1341,7 @@ int get_vdate(int vlistID)
for ( i = 0; i < natts; ++i )
{
cdiInqAtt(vlistID, CDI_GLOBAL, i, name, &type, &len);
if ( type == DATATYPE_TXT )
if ( type == CDI_DATATYPE_TXT )
{
if ( strcmp(name, "DateAndTime") == 0 ||
strcmp(name, "Date_Time") == 0 )
......
......@@ -41,7 +41,7 @@ void init_vars(int vlistID, int gridID, int zaxisID, int nvars)
vlistDefVarParam(vlistID, varID, cdiEncodeParam(code[i], 255, 255));
vlistDefVarName(vlistID, varID, name[i]);
vlistDefVarUnits(vlistID, varID, units[i]);
vlistDefVarDatatype(vlistID, varID, DATATYPE_FLT32);
vlistDefVarDatatype(vlistID, varID, CDI_DATATYPE_FLT32);
}
}
......
......@@ -150,7 +150,7 @@ void *Mastrfu(void *argument)
vlistDefVarName(vlistID2, 0, "mastrfu");
vlistDefVarLongname(vlistID2, 0, "mass stream function");
vlistDefVarUnits(vlistID2, 0, "kg/s");
vlistDefVarDatatype(vlistID2, 0, DATATYPE_FLT32);
vlistDefVarDatatype(vlistID2, 0, CDI_DATATYPE_FLT32);
int streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
......
......@@ -43,12 +43,12 @@ int get_type_values(int datatype, double *tmin, double *tmax)
switch (datatype)
{
case DATATYPE_INT8: *tmin = -SCHAR_MAX+1; *tmax = SCHAR_MAX; break;
case DATATYPE_UINT8: *tmin = 0; *tmax = UCHAR_MAX-1; break;
case DATATYPE_INT16: *tmin = -SHRT_MAX+1; *tmax = SHRT_MAX; break;
case DATATYPE_UINT16: *tmin = 0; *tmax = USHRT_MAX-1; break;
case DATATYPE_INT32: *tmin = -INT_MAX+1; *tmax = INT_MAX; break;
case DATATYPE_UINT32: *tmin = 0; *tmax = UINT_MAX-1; break;
case CDI_DATATYPE_INT8: *tmin = -SCHAR_MAX+1; *tmax = SCHAR_MAX; break;
case CDI_DATATYPE_UINT8: *tmin = 0; *tmax = UCHAR_MAX-1; break;
case CDI_DATATYPE_INT16: *tmin = -SHRT_MAX+1; *tmax = SHRT_MAX; break;
case CDI_DATATYPE_UINT16: *tmin = 0; *tmax = USHRT_MAX-1; break;
case CDI_DATATYPE_INT32: *tmin = -INT_MAX+1; *tmax = INT_MAX; break;
case CDI_DATATYPE_UINT32: *tmin = 0; *tmax = UINT_MAX-1; break;
default: status = 1; break;
}
......@@ -87,7 +87,7 @@ void *Pack(void *argument)
int nalloc = 0;
int nmiss;
int nlevel;
int datatype = DATATYPE_INT16;
int datatype = CDI_DATATYPE_INT16;
dtlist_type *dtlist = dtlist_new();
double missval1, missval2;
field_t ***vars = NULL;
......@@ -135,7 +135,7 @@ void *Pack(void *argument)
if ( cdoDefaultDataType != CDI_UNDEFID )
{
if ( cdoDefaultDataType == DATATYPE_FLT64 || cdoDefaultDataType == DATATYPE_FLT32 )
if ( cdoDefaultDataType == CDI_DATATYPE_FLT64 || cdoDefaultDataType == CDI_DATATYPE_FLT32 )
{
cdoWarning("Changed default output datatype to int16");
cdoDefaultDataType = datatype;
......
......@@ -248,10 +248,10 @@ void *Rhopot(void *argument)
sao.missval = vlistInqVarMissval(vlistID1, saoID);
rho.missval = to.missval;
int datatype = DATATYPE_FLT32;
if ( vlistInqVarDatatype(vlistID1, toID) == DATATYPE_FLT64 &&
vlistInqVarDatatype(vlistID1, saoID) == DATATYPE_FLT64 )
datatype = DATATYPE_FLT64;
int datatype = CDI_DATATYPE_FLT32;
if ( vlistInqVarDatatype(vlistID1, toID) == CDI_DATATYPE_FLT64 &&
vlistInqVarDatatype(vlistID1, saoID) == CDI_DATATYPE_FLT64 )
datatype = CDI_DATATYPE_FLT64;
int vlistID2 = vlistCreate();
varID = vlistDefVar(vlistID2, gridID, zaxisID, TSTEP_INSTANT);
......
......@@ -124,7 +124,7 @@ void *Setmiss(void *argument)
nvars = vlistNvars(vlistID2);
for ( varID = 0; varID < nvars; varID++ )
cdiDefAttFlt(vlistID2, varID, "valid_range", DATATYPE_FLT64, 2, range);
cdiDefAttFlt(vlistID2, varID, "valid_range", CDI_DATATYPE_FLT64, 2, range);
}
*/
int streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment