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

Renamed FILETYPE_ to CDI_FILETYPE_.

parent 7c5c32b0
......@@ -688,7 +688,7 @@ void after_control(struct Control *globs, struct Variable *vars)
rtime = after_getTime(globs->StartDate);
}
if ( ofiletype == FILETYPE_NC || ofiletype == FILETYPE_NC2 || ofiletype == FILETYPE_NC4 )
if ( ofiletype == CDI_FILETYPE_NC || ofiletype == CDI_FILETYPE_NC2 || ofiletype == CDI_FILETYPE_NC4 )
{
taxisDefCalendar(globs->taxisID2, CALENDAR_PROLEPTIC);
taxisDefType(globs->taxisID2, TAXIS_RELATIVE);
......@@ -1350,19 +1350,19 @@ void after_parini(struct Control *globs, struct Variable *vars)
#if defined(CDO)
case -1: ofiletype = -1; break;
#else
case -1: ofiletype = FILETYPE_SRV; break;
case -1: ofiletype = CDI_FILETYPE_SRV; break;
#endif
case 0: ofiletype = FILETYPE_SRV; break;
case 1: ofiletype = FILETYPE_GRB; break;
case 2: ofiletype = FILETYPE_NC; break;
case 3: ofiletype = FILETYPE_EXT; break;
case 4: ofiletype = FILETYPE_NC2; break;
case 6: ofiletype = FILETYPE_NC4; break;
case 0: ofiletype = CDI_FILETYPE_SRV; break;
case 1: ofiletype = CDI_FILETYPE_GRB; break;
case 2: ofiletype = CDI_FILETYPE_NC; break;
case 3: ofiletype = CDI_FILETYPE_EXT; break;
case 4: ofiletype = CDI_FILETYPE_NC2; break;
case 6: ofiletype = CDI_FILETYPE_NC4; break;
default: Error( "unknown file format %d", fileFormat);
}
if ( gribFormat ) ofiletype = FILETYPE_GRB;
if ( cdfFormat ) ofiletype = FILETYPE_NC;
if ( gribFormat ) ofiletype = CDI_FILETYPE_GRB;
if ( cdfFormat ) ofiletype = CDI_FILETYPE_NC;
int precision = scan_par(globs->Verbose, namelist, "precision", 0);
if ( precision )
......@@ -2117,7 +2117,7 @@ void after_processing(struct Control *globs, struct Variable *vars)
if ( ! globs->AnalysisData )
for (i = 0; i < globs->NumLevelRequest; i++)
{
if ( (globs->LevelRequest[i] >= 65535) && globs->unitsel && ofiletype == FILETYPE_GRB )
if ( (globs->LevelRequest[i] >= 65535) && globs->unitsel && ofiletype == CDI_FILETYPE_GRB )
{
fprintf(stderr,"\n Level %9.2f out of range (max=65535)!\n", globs->LevelRequest[i]);
exit(1);
......@@ -2149,10 +2149,10 @@ void after_processing(struct Control *globs, struct Variable *vars)
if ( globs->Type == 10 || globs->Type == 40 || globs->Type == 60 )
{
if ( ofiletype == FILETYPE_GRB )
if ( ofiletype == CDI_FILETYPE_GRB )
Error("Can't write fourier coefficients to GRIB!");
else if ( ofiletype == FILETYPE_NC || ofiletype == FILETYPE_NC2 ||
ofiletype == FILETYPE_NC4 )
else if ( ofiletype == CDI_FILETYPE_NC || ofiletype == CDI_FILETYPE_NC2 ||
ofiletype == CDI_FILETYPE_NC4 )
Error("Can't write fourier coefficients to NetCDF!");
}
......
......@@ -27,15 +27,15 @@ const char *filetypestr(int filetype)
{
switch ( filetype )
{
case FILETYPE_GRB: return ("GRIB"); break;
case FILETYPE_GRB2: return ("GRIB2"); break;
case FILETYPE_NC: return ("NetCDF"); break;
case FILETYPE_NC2: return ("NetCDF2"); break;
case FILETYPE_NC4: return ("NetCDF4"); break;
case FILETYPE_NC4C: return ("NetCDF4 classic"); break;
case FILETYPE_SRV: return ("SERVICE"); break;
case FILETYPE_EXT: return ("EXTRA"); break;
case FILETYPE_IEG: return ("IEG"); break;
case CDI_FILETYPE_GRB: return ("GRIB"); break;
case CDI_FILETYPE_GRB2: return ("GRIB2"); break;
case CDI_FILETYPE_NC: return ("NetCDF"); break;
case CDI_FILETYPE_NC2: return ("NetCDF2"); break;
case CDI_FILETYPE_NC4: return ("NetCDF4"); break;
case CDI_FILETYPE_NC4C: return ("NetCDF4 classic"); break;
case CDI_FILETYPE_SRV: return ("SERVICE"); break;
case CDI_FILETYPE_EXT: return ("EXTRA"); break;
case CDI_FILETYPE_IEG: return ("IEG"); break;
default: return ("");
}
}
......
......@@ -28,15 +28,15 @@ const char *filetypestr(int filetype)
{
switch ( filetype )
{
case FILETYPE_GRB: return ("GRIB"); break;
case FILETYPE_GRB2: return ("GRIB2"); break;
case FILETYPE_NC: return ("NetCDF"); break;
case FILETYPE_NC2: return ("NetCDF2"); break;
case FILETYPE_NC4: return ("NetCDF4"); break;
case FILETYPE_NC4C: return ("NetCDF4 classic"); break;
case FILETYPE_SRV: return ("SERVICE"); break;
case FILETYPE_EXT: return ("EXTRA"); break;
case FILETYPE_IEG: return ("IEG"); break;
case CDI_FILETYPE_GRB: return ("GRIB"); break;
case CDI_FILETYPE_GRB2: return ("GRIB2"); break;
case CDI_FILETYPE_NC: return ("NetCDF"); break;
case CDI_FILETYPE_NC2: return ("NetCDF2"); break;
case CDI_FILETYPE_NC4: return ("NetCDF4"); break;
case CDI_FILETYPE_NC4C: return ("NetCDF4 classic"); break;
case CDI_FILETYPE_SRV: return ("SERVICE"); break;
case CDI_FILETYPE_EXT: return ("EXTRA"); break;
case CDI_FILETYPE_IEG: return ("IEG"); break;
default: return ("");
}
}
......
......@@ -1492,7 +1492,7 @@ void *Echam5ini(void *argument)
vlistDefTaxis(vlistID2, taxisID);
if ( cdoDefaultFileType == CDI_UNDEFID )
cdoDefaultFileType = FILETYPE_NC;
cdoDefaultFileType = CDI_FILETYPE_NC;
streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
......
......@@ -243,25 +243,25 @@ void filedes(int streamID)
int filetype = streamInqFiletype(streamID);
switch ( filetype )
{
case FILETYPE_GRB:
case CDI_FILETYPE_GRB:
printf(" GRIB data\n");
break;
case FILETYPE_GRB2:
case CDI_FILETYPE_GRB2:
printf(" GRIB2 data\n");
break;
case FILETYPE_NC:
case CDI_FILETYPE_NC:
printf(" NetCDF data\n");
break;
case FILETYPE_NC2:
case CDI_FILETYPE_NC2:
printf(" NetCDF2 data\n");
break;
case FILETYPE_NC4:
case CDI_FILETYPE_NC4:
printf(" NetCDF4 data\n");
break;
case FILETYPE_NC4C:
case CDI_FILETYPE_NC4C:
printf(" NetCDF4 classic data\n");
break;
case FILETYPE_SRV:
case CDI_FILETYPE_SRV:
printf(" SERVICE data\n");
switch ( streamInqByteorder(streamID) )
{
......@@ -273,7 +273,7 @@ void filedes(int streamID)
printf(" byteorder %d undefined\n", streamInqByteorder(streamID)); break;
}
break;
case FILETYPE_EXT:
case CDI_FILETYPE_EXT:
printf(" EXTRA data\n");
switch ( streamInqByteorder(streamID) )
{
......@@ -285,7 +285,7 @@ void filedes(int streamID)
printf(" byteorder %d undefined\n", streamInqByteorder(streamID)); break;
}
break;
case FILETYPE_IEG:
case CDI_FILETYPE_IEG:
printf(" IEG data\n");
switch ( streamInqByteorder(streamID) )
{
......
......@@ -660,7 +660,7 @@ void ctl_zdef(FILE *gdp, int vlistID, bool *zrev)
static
void ctl_options(FILE *gdp, bool yrev, bool zrev, bool sequential, bool bigendian, bool littleendian, bool flt64, bool cal365day)
{
/* if ( filetype == FILETYPE_GRB ) zrev = false; */
/* if ( filetype == CDI_FILETYPE_GRB ) zrev = false; */
if ( yrev || zrev || sequential || bigendian || littleendian || flt64 )
{
......@@ -721,7 +721,7 @@ void ctl_vars(FILE *gdp, int filetype, int vlistID, int nvarsout, int *vars)
fprintf(gdp, " %3d", nlev);
if ( filetype == FILETYPE_GRB )
if ( filetype == CDI_FILETYPE_GRB )
{
code = vlistInqVarCode(vlistID, varID);
/*
......@@ -732,7 +732,7 @@ void ctl_vars(FILE *gdp, int filetype, int vlistID, int nvarsout, int *vars)
*/
fprintf(gdp, " %d,%d", code, ltype);
}
else if ( filetype == FILETYPE_NC )
else if ( filetype == CDI_FILETYPE_NC )
{
int xyz = vlistInqVarXYZ(vlistID, varID);
......@@ -1030,17 +1030,17 @@ void *Gradsdes(void *argument)
int filetype = streamInqFiletype(streamID);
int byteorder = streamInqByteorder(streamID);
if ( filetype == FILETYPE_NC2 || filetype == FILETYPE_NC4 ) filetype = FILETYPE_NC;
if ( filetype == CDI_FILETYPE_NC2 || filetype == CDI_FILETYPE_NC4 ) filetype = CDI_FILETYPE_NC;
if ( filetype != FILETYPE_SRV &&
filetype != FILETYPE_EXT &&
filetype != FILETYPE_IEG &&
filetype != FILETYPE_GRB )
if ( filetype != CDI_FILETYPE_SRV &&
filetype != CDI_FILETYPE_EXT &&
filetype != CDI_FILETYPE_IEG &&
filetype != CDI_FILETYPE_GRB )
{
if ( filetype == FILETYPE_NC )
if ( filetype == CDI_FILETYPE_NC )
// cdoAbort("Unsupported file format: NetCDF");
;
else if ( filetype == FILETYPE_GRB2 )
else if ( filetype == CDI_FILETYPE_GRB2 )
//cdoAbort("Unsupported file format: GRIB2");
;
else
......@@ -1069,9 +1069,9 @@ void *Gradsdes(void *argument)
{
if ( vlistInqVarGrid(vlistID, varID) == gridID )
{
if ( filetype == FILETYPE_SRV ||
filetype == FILETYPE_EXT ||
filetype == FILETYPE_IEG )
if ( filetype == CDI_FILETYPE_SRV ||
filetype == CDI_FILETYPE_EXT ||
filetype == CDI_FILETYPE_IEG )
{
prec = vlistInqVarDatatype(vlistID, varID);
if ( prec == DATATYPE_FLT64 ) flt64 = true;
......@@ -1093,10 +1093,10 @@ void *Gradsdes(void *argument)
}
}
if ( filetype != FILETYPE_GRB && nvars != nvarsout )
if ( filetype != CDI_FILETYPE_GRB && nvars != nvarsout )
cdoAbort("Too many different grids!");
if ( filetype == FILETYPE_SRV )
if ( filetype == CDI_FILETYPE_SRV )
{
xyheader = 40;
if ( flt64 ) xyheader = 72;
......@@ -1105,7 +1105,7 @@ void *Gradsdes(void *argument)
if ( byteorder == CDI_LITTLEENDIAN ) littleendian = true;
}
if ( filetype == FILETYPE_EXT )
if ( filetype == CDI_FILETYPE_EXT )
{
xyheader = 24;
if ( flt64 ) xyheader = 40;
......@@ -1114,7 +1114,7 @@ void *Gradsdes(void *argument)
if ( byteorder == CDI_LITTLEENDIAN ) littleendian = true;
}
if ( filetype == FILETYPE_IEG )
if ( filetype == CDI_FILETYPE_IEG )
{
xyheader = 644;
if ( flt64 ) xyheader = 1048;
......@@ -1154,19 +1154,19 @@ void *Gradsdes(void *argument)
* DTYPE Print file type
* INDEX Print filename of the control/index file .ctl/.idx
*/
if ( filetype == FILETYPE_GRB || filetype == FILETYPE_GRB2 )
if ( filetype == CDI_FILETYPE_GRB || filetype == CDI_FILETYPE_GRB2 )
{
idxfile = strdup(ctlfile);
char *pidxfile = idxfile;
// print GRIB[12] file type
// generate the index file
if ( filetype == FILETYPE_GRB )
if ( filetype == CDI_FILETYPE_GRB )
{
fprintf(gdp, "DTYPE GRIB\n");
repl_filetypeext(idxfile, ".ctl", ".gmp");
}
else if ( filetype == FILETYPE_GRB2 )
else if ( filetype == CDI_FILETYPE_GRB2 )
{
fprintf(gdp, "DTYPE GRIB2\n");
repl_filetypeext(pidxfile, ".ctl", ".idx");
......@@ -1186,7 +1186,7 @@ void *Gradsdes(void *argument)
gridsize = vlistGridsizeMax(vlistID);
array = (double*) Malloc(gridsize*sizeof(double));
}
else if ( filetype == FILETYPE_NC )
else if ( filetype == CDI_FILETYPE_NC )
{
fprintf(gdp, "DTYPE NetCDF\n");
}
......@@ -1294,7 +1294,7 @@ void *Gradsdes(void *argument)
iyys = iyy;
}
if ( filetype == FILETYPE_GRB )
if ( filetype == CDI_FILETYPE_GRB )
{
nrecords += nrecsout;
if ( nrecords >= maxrecs )
......@@ -1385,11 +1385,11 @@ void *Gradsdes(void *argument)
/* INDEX file */
if ( filetype == FILETYPE_GRB )
if ( filetype == CDI_FILETYPE_GRB )
{
write_map_grib1(idxfile, map_version, nrecords, intnum, fltnum, bignum);
}
if ( filetype == FILETYPE_GRB2 )
if ( filetype == CDI_FILETYPE_GRB2 )
{
cdoAbort("The fileformat GRIB2 is not fully supported yet for the gradsdes operator.\n"
"The .ctl file %s was generated. You can add the necessary .idx file by running\n\tgribmap -i %s", ctlfile, ctlfile);
......
......@@ -1412,7 +1412,7 @@ void *Importcmsaf(void *argument)
cdoInitialize(argument);
if ( cdoDefaultFileType == CDI_UNDEFID )
cdoDefaultFileType = FILETYPE_NC;
cdoDefaultFileType = CDI_FILETYPE_NC;
#if defined(HAVE_LIBHDF5)
dsets_init(&dsets);
......
......@@ -58,7 +58,7 @@ void *Input(void *argument)
int vlistID = -1;
int i;
int code = 0, level = 0, date = 0, time = 0, nlon = 0, nlat = 0;
int output_filetype = FILETYPE_GRB;
int output_filetype = CDI_FILETYPE_GRB;
int ihead[8];
double missval = 0;
double levels[1];
......@@ -120,7 +120,7 @@ void *Input(void *argument)
else if ( operatorID == INPUTEXT )
{
output_filetype = cdoDefaultFileType;
if ( output_filetype == CDI_UNDEFID ) output_filetype = FILETYPE_EXT;
if ( output_filetype == CDI_UNDEFID ) output_filetype = CDI_FILETYPE_EXT;
cdoPrint("Enter header (code,level,date,time,nlon,nlat,dispo1,dispo2)"
" of record %d (or EOF(=^D))!", nrecs+1);
......@@ -164,7 +164,7 @@ void *Input(void *argument)
else if ( operatorID == INPUTSRV )
{
output_filetype = cdoDefaultFileType;
if ( output_filetype == CDI_UNDEFID ) output_filetype = FILETYPE_SRV;
if ( output_filetype == CDI_UNDEFID ) output_filetype = CDI_FILETYPE_SRV;
cdoPrint("Enter header (code,level,date,time,nlon,nlat,dispo1,dispo2)"
" of record %d (or EOF(=^D))!", nrecs+1);
......
......@@ -588,7 +588,7 @@ int set_remapgrids(int filetype, int vlistID, int ngrids, bool *remapgrids)
{
if ( gridtype == GRID_GAUSSIAN_REDUCED )
{
if ( !cdoRegulargrid && filetype == FILETYPE_GRB )
if ( !cdoRegulargrid && filetype == CDI_FILETYPE_GRB )
cdoAbort("Unsupported grid type: %s, use CDO option -R to convert reduced to regular grid!", gridNamePtr(gridtype));
else
cdoAbort("Unsupported grid type: %s, use CDO operator -setgridtype,regular to convert reduced to regular grid!", gridNamePtr(gridtype));
......
......@@ -56,7 +56,7 @@ void *Selrec(void *argument)
int filetype = streamInqFiletype(streamID1);
if ( filetype == FILETYPE_NC || filetype == FILETYPE_NC2 || filetype == FILETYPE_NC4 || filetype == FILETYPE_NC4C )
if ( filetype == CDI_FILETYPE_NC || filetype == CDI_FILETYPE_NC2 || filetype == CDI_FILETYPE_NC4 || filetype == CDI_FILETYPE_NC4C )
cdoAbort("This operator does not work on NetCDF data!");
int vlistID1 = streamInqVlist(streamID1);
......
......@@ -364,7 +364,7 @@ void *Settime(void *argument)
*/
if ( taxisInqType(taxisID1) == TAXIS_ABSOLUTE )
{/*
if ( cdoFiletype() != FILETYPE_NC )
if ( cdoFiletype() != CDI_FILETYPE_NC )
cdoAbort("This operator does not work on an absolute time axis!");
*/
cdoPrint("Changing absolute to relative time axis!");
......
......@@ -56,7 +56,7 @@ void *Tocomplex(void *argument)
int taxisID2 = taxisDuplicate(taxisID1);
vlistDefTaxis(vlistID2, taxisID2);
if ( cdoFiletype() != FILETYPE_EXT ) cdoAbort("Complex numbers need EXTRA format; used CDO option -f ext!");
if ( cdoFiletype() != CDI_FILETYPE_EXT ) cdoAbort("Complex numbers need EXTRA format; used CDO option -f ext!");
int streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
streamDefVlist(streamID2, vlistID2);
......
......@@ -160,7 +160,7 @@ void cdo_sig_handler(int signo)
static
void cdo_version(void)
{
const int filetypes[] = {FILETYPE_SRV, FILETYPE_EXT, FILETYPE_IEG, FILETYPE_GRB, FILETYPE_GRB2, FILETYPE_NC, FILETYPE_NC2, FILETYPE_NC4, FILETYPE_NC4C};
const int filetypes[] = {CDI_FILETYPE_SRV, CDI_FILETYPE_EXT, CDI_FILETYPE_IEG, CDI_FILETYPE_GRB, CDI_FILETYPE_GRB2, CDI_FILETYPE_NC, CDI_FILETYPE_NC2, CDI_FILETYPE_NC4, CDI_FILETYPE_NC4C};
const char* typenames[] = { "srv", "ext", "ieg", "grb1", "grb2", "nc1", "nc2", "nc4", "nc4c"};
fprintf(stderr, "%s\n", CDO_Version);
......@@ -390,7 +390,7 @@ void setDefaultDataType(const char *datatypestr)
if ( nbits > 0 && nbits < 32 ) cdoDefaultDataType = nbits;
else if ( nbits == 32 )
{
if ( cdoDefaultFileType == FILETYPE_GRB )
if ( cdoDefaultFileType == CDI_FILETYPE_GRB )
cdoDefaultDataType = DATATYPE_PACK32;
else
cdoDefaultDataType = DATATYPE_FLT32;
......@@ -522,17 +522,17 @@ void setDefaultFileType(const char *filetypestr, int labort)
const char *ftstr = filetypestr;
size_t len;
if ( cmpstrlen(filetypestr, "grb2", len) == 0 ) { ftstr += len; cdoDefaultFileType = FILETYPE_GRB2;}
else if ( cmpstrlen(filetypestr, "grb1", len) == 0 ) { ftstr += len; cdoDefaultFileType = FILETYPE_GRB; }
else if ( cmpstrlen(filetypestr, "grb", len) == 0 ) { ftstr += len; cdoDefaultFileType = FILETYPE_GRB; }
else if ( cmpstrlen(filetypestr, "nc2", len) == 0 ) { ftstr += len; cdoDefaultFileType = FILETYPE_NC2; }
else if ( cmpstrlen(filetypestr, "nc4c", len) == 0 ) { ftstr += len; cdoDefaultFileType = FILETYPE_NC4C;}
else if ( cmpstrlen(filetypestr, "nc4", len) == 0 ) { ftstr += len; cdoDefaultFileType = FILETYPE_NC4; }
else if ( cmpstrlen(filetypestr, "nc1", len) == 0 ) { ftstr += len; cdoDefaultFileType = FILETYPE_NC; }
else if ( cmpstrlen(filetypestr, "nc", len) == 0 ) { ftstr += len; cdoDefaultFileType = FILETYPE_NC2; }
else if ( cmpstrlen(filetypestr, "srv", len) == 0 ) { ftstr += len; cdoDefaultFileType = FILETYPE_SRV; }
else if ( cmpstrlen(filetypestr, "ext", len) == 0 ) { ftstr += len; cdoDefaultFileType = FILETYPE_EXT; }
else if ( cmpstrlen(filetypestr, "ieg", len) == 0 ) { ftstr += len; cdoDefaultFileType = FILETYPE_IEG; }
if ( cmpstrlen(filetypestr, "grb2", len) == 0 ) { ftstr += len; cdoDefaultFileType = CDI_FILETYPE_GRB2;}
else if ( cmpstrlen(filetypestr, "grb1", len) == 0 ) { ftstr += len; cdoDefaultFileType = CDI_FILETYPE_GRB; }
else if ( cmpstrlen(filetypestr, "grb", len) == 0 ) { ftstr += len; cdoDefaultFileType = CDI_FILETYPE_GRB; }
else if ( cmpstrlen(filetypestr, "nc2", len) == 0 ) { ftstr += len; cdoDefaultFileType = CDI_FILETYPE_NC2; }
else if ( cmpstrlen(filetypestr, "nc4c", len) == 0 ) { ftstr += len; cdoDefaultFileType = CDI_FILETYPE_NC4C;}
else if ( cmpstrlen(filetypestr, "nc4", len) == 0 ) { ftstr += len; cdoDefaultFileType = CDI_FILETYPE_NC4; }
else if ( cmpstrlen(filetypestr, "nc1", len) == 0 ) { ftstr += len; cdoDefaultFileType = CDI_FILETYPE_NC; }
else if ( cmpstrlen(filetypestr, "nc", len) == 0 ) { ftstr += len; cdoDefaultFileType = CDI_FILETYPE_NC2; }
else if ( cmpstrlen(filetypestr, "srv", len) == 0 ) { ftstr += len; cdoDefaultFileType = CDI_FILETYPE_SRV; }
else if ( cmpstrlen(filetypestr, "ext", len) == 0 ) { ftstr += len; cdoDefaultFileType = CDI_FILETYPE_EXT; }
else if ( cmpstrlen(filetypestr, "ieg", len) == 0 ) { ftstr += len; cdoDefaultFileType = CDI_FILETYPE_IEG; }
else
{
if ( labort )
......
......@@ -116,7 +116,7 @@ void writeNcFile(const char path[], const double array[], int length)
taxisID = taxisCreate(TAXIS_ABSOLUTE);
vlistDefTaxis(vlistID, taxisID);
streamID = streamOpenWrite(path, FILETYPE_NC);
streamID = streamOpenWrite(path, CDI_FILETYPE_NC);
if ( streamID < 0 )
{
fprintf(stderr, "%s\n", cdiStringError(streamID));
......
......@@ -32,23 +32,23 @@ void cdiOpenError(int cdiErrno, const char *fmt, const char *path)
switch (filetype)
{
case FILETYPE_GRB:
case CDI_FILETYPE_GRB:
break;
case FILETYPE_GRB2:
case CDI_FILETYPE_GRB2:
fprintf(stderr, "To create a CDO application with GRIB2 support use: ./configure --with-grib_api=<GRIB_API root directory> ...\n");
break;
case FILETYPE_SRV:
case CDI_FILETYPE_SRV:
break;
case FILETYPE_EXT:
case CDI_FILETYPE_EXT:
break;
case FILETYPE_IEG:
case CDI_FILETYPE_IEG:
break;
case FILETYPE_NC:
case FILETYPE_NC2:
case FILETYPE_NC4:
case FILETYPE_NC4C:
case CDI_FILETYPE_NC:
case CDI_FILETYPE_NC2:
case CDI_FILETYPE_NC4:
case CDI_FILETYPE_NC4C:
{
const char *ncv = (filetype == FILETYPE_NC4 || filetype == FILETYPE_NC4C) ? "4" : ((filetype == FILETYPE_NC2) ? "2" : "");
const char *ncv = (filetype == CDI_FILETYPE_NC4 || filetype == CDI_FILETYPE_NC4C) ? "4" : ((filetype == CDI_FILETYPE_NC2) ? "2" : "");
#if defined HAVE_LIBNETCDF
fprintf(stderr, "CDO was build with a NetCDF version which doesn't support NetCDF%s data!\n", ncv);
#else
......
......@@ -58,31 +58,31 @@ void printFiletype(int streamID, int vlistID)
switch ( filetype )
{
case FILETYPE_GRB:
case CDI_FILETYPE_GRB:
printf("GRIB");
break;
case FILETYPE_GRB2:
case CDI_FILETYPE_GRB2:
printf("GRIB2");
break;
case FILETYPE_NC:
case CDI_FILETYPE_NC:
printf("NetCDF");
break;
case FILETYPE_NC2:
case CDI_FILETYPE_NC2:
printf("NetCDF2");
break;
case FILETYPE_NC4:
case CDI_FILETYPE_NC4:
printf("NetCDF4");
break;
case FILETYPE_NC4C:
case CDI_FILETYPE_NC4C:
printf("NetCDF4 classic");
break;
case FILETYPE_SRV:
case CDI_FILETYPE_SRV:
printf("SERVICE");
break;
case FILETYPE_EXT:
case CDI_FILETYPE_EXT:
printf("EXTRA");
break;
case FILETYPE_IEG:
case CDI_FILETYPE_IEG:
printf("IEG");
break;
default:
......@@ -90,7 +90,7 @@ void printFiletype(int streamID, int vlistID)
break;
}
if ( filetype == FILETYPE_SRV || filetype == FILETYPE_EXT || filetype == FILETYPE_IEG )
if ( filetype == CDI_FILETYPE_SRV || filetype == CDI_FILETYPE_EXT || filetype == CDI_FILETYPE_IEG )
{
switch ( streamInqByteorder(streamID) )
{
......@@ -103,7 +103,7 @@ void printFiletype(int streamID, int vlistID)
}
}
if ( filetype == FILETYPE_GRB || filetype == FILETYPE_NC4 || filetype == FILETYPE_NC4C )
if ( filetype == CDI_FILETYPE_GRB || filetype == CDI_FILETYPE_NC4 || filetype == CDI_FILETYPE_NC4C )
{
int nvars = vlistNvars(vlistID);
for ( int varID = 0; varID < nvars; varID++ )
......@@ -119,7 +119,7 @@ void printFiletype(int streamID, int vlistID)
}
}
if ( filetype == FILETYPE_GRB2 )
if ( filetype == CDI_FILETYPE_GRB2 )
{
int nvars = vlistNvars(vlistID);
for ( int varID = 0; varID < nvars; varID++ )
......
......@@ -651,12 +651,12 @@ void set_comp(int fileID, int filetype)
{
if ( cdoCompress )
{
if ( filetype == FILETYPE_GRB )
if ( filetype == CDI_FILETYPE_GRB )
{
cdoCompType = CDI_COMPRESS_SZIP;
cdoCompLevel = 0;
}
else if ( filetype == FILETYPE_NC4 || filetype == FILETYPE_NC4C )
else if ( filetype == CDI_FILETYPE_NC4 || filetype == CDI_FILETYPE_NC4C )
{
cdoCompType = CDI_COMPRESS_ZIP;
cdoCompLevel = 1;
......@@ -669,13 +669,13 @@ void set_comp(int fileID, int filetype)
streamDefCompLevel(fileID, cdoCompLevel);
if ( cdoCompType == CDI_COMPRESS_SZIP &&
(filetype != FILETYPE_GRB && filetype != FILETYPE_GRB2 && filetype != FILETYPE_NC4 && filetype != FILETYPE_NC4C) )
(filetype != CDI_FILETYPE_GRB && filetype != CDI_FILETYPE_GRB2 && filetype != CDI_FILETYPE_NC4 && filetype != CDI_FILETYPE_NC4C) )
cdoWarning("SZIP compression not available for non GRIB/NetCDF4 data!");
if ( cdoCompType == CDI_COMPRESS_JPEG && filetype != FILETYPE_GRB2 )
if ( cdoCompType == CDI_COMPRESS_JPEG && filetype != CDI_FILETYPE_GRB2 )
cdoWarning("JPEG compression not available for non GRIB2 data!");
if ( cdoCompType == CDI_COMPRESS_ZIP && (filetype != FILETYPE_NC4 && filetype != FILETYPE_NC4C) )
if ( cdoCompType == CDI_COMPRESS_ZIP && (filetype != CDI_FILETYPE_NC4 && filetype != CDI_FILETYPE_NC4C) )
cdoWarning("Deflate compression not available for non NetCDF4 data!");
}
}
......@@ -692,7 +692,7 @@ int pstreamOpenWriteFile(const argument_t *argument, int filetype)
if ( PSTREAM_Debug ) Message("file %s", argument->args);
if ( filetype == CDI_UNDEFID ) filetype = FILETYPE_GRB;
if ( filetype == CDI_UNDEFID ) filetype = CDI_FILETYPE_GRB;
if ( cdoInteractive )
{
......@@ -1027,15 +1027,15 @@ void pstreamDefVarlist(pstream_t *pstreamptr, int vlistID)
int datatype = varlist[varID].datatype;
if ( filetype == FILETYPE_NC || filetype == FILETYPE_NC2 || filetype == FILETYPE_NC4 || filetype == FILETYPE_NC4C )
if ( filetype == CDI_FILETYPE_NC || filetype == CDI_FILETYPE_NC2 || filetype == CDI_FILETYPE_NC4 || filetype == CDI_FILETYPE_NC4C )
{
if ( datatype == DATATYPE_UINT8 && (filetype == FILETYPE_NC || filetype == FILETYPE_NC2) )
if ( datatype == DATATYPE_UINT8 && (filetype == CDI_FILETYPE_NC || filetype == CDI_FILETYPE_NC2) )
{
datatype = DATATYPE_INT16;
varlist[varID].datatype = datatype;
}
if ( datatype == DATATYPE_UINT16 && (filetype == FILETYPE_NC || filetype == FILETYPE_NC2) )
if ( datatype == DATATYPE_UINT16 && (filetype == CDI_FILETYPE_NC || filetype == CDI_FILETYPE_NC2) )
{
datatype = DATATYPE_INT32;
varlist[varID].datatype = datatype;
......