Commit 8b291c94 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Renamed FILETYPE_ to CDI_FILETYPE_.

parent da949e85
......@@ -75,7 +75,7 @@ static int datamode = DP_MODE;
static
void version(void)
{
int filetypes[] = {FILETYPE_SRV, FILETYPE_EXT, FILETYPE_IEG, FILETYPE_GRB, FILETYPE_GRB2, FILETYPE_NC, FILETYPE_NC2, FILETYPE_NC4, FILETYPE_NC4C};
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", "grb", "grb2", "nc", "nc2", "nc4", "nc4c"};
fprintf(stderr, "CDI version 1.8\n");
......@@ -563,7 +563,7 @@ void setDefaultDataType(char *datatypestr)
if ( nbits > 0 && nbits < 32 ) DefaultDataType = nbits;
else if ( nbits == 32 )
{
if ( DefaultFileType == FILETYPE_GRB )
if ( DefaultFileType == CDI_FILETYPE_GRB )
DefaultDataType = DATATYPE_PACK32;
else
DefaultDataType = DATATYPE_FLT32;
......@@ -650,17 +650,17 @@ void setDefaultFileType(char *filetypestr)
{
char *ftstr = filetypestr;
if ( memcmp(filetypestr, "grb2", 4) == 0 ) { ftstr += 4; DefaultFileType = FILETYPE_GRB2;}
else if ( memcmp(filetypestr, "grb1", 4) == 0 ) { ftstr += 4; DefaultFileType = FILETYPE_GRB; }
else if ( memcmp(filetypestr, "grb", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_GRB; }
else if ( memcmp(filetypestr, "nc2", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_NC2; }
else if ( memcmp(filetypestr, "nc4c", 4) == 0 ) { ftstr += 4; DefaultFileType = FILETYPE_NC4C;}
else if ( memcmp(filetypestr, "nc4", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_NC4; }
else if ( memcmp(filetypestr, "nc1", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_NC; }
else if ( memcmp(filetypestr, "nc", 2) == 0 ) { ftstr += 2; DefaultFileType = FILETYPE_NC2; }
else if ( memcmp(filetypestr, "srv", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_SRV; }
else if ( memcmp(filetypestr, "ext", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_EXT; }
else if ( memcmp(filetypestr, "ieg", 3) == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_IEG; }
if ( memcmp(filetypestr, "grb2", 4) == 0 ) { ftstr += 4; DefaultFileType = CDI_FILETYPE_GRB2;}
else if ( memcmp(filetypestr, "grb1", 4) == 0 ) { ftstr += 4; DefaultFileType = CDI_FILETYPE_GRB; }
else if ( memcmp(filetypestr, "grb", 3) == 0 ) { ftstr += 3; DefaultFileType = CDI_FILETYPE_GRB; }
else if ( memcmp(filetypestr, "nc2", 3) == 0 ) { ftstr += 3; DefaultFileType = CDI_FILETYPE_NC2; }
else if ( memcmp(filetypestr, "nc4c", 4) == 0 ) { ftstr += 4; DefaultFileType = CDI_FILETYPE_NC4C;}
else if ( memcmp(filetypestr, "nc4", 3) == 0 ) { ftstr += 3; DefaultFileType = CDI_FILETYPE_NC4; }
else if ( memcmp(filetypestr, "nc1", 3) == 0 ) { ftstr += 3; DefaultFileType = CDI_FILETYPE_NC; }
else if ( memcmp(filetypestr, "nc", 2) == 0 ) { ftstr += 2; DefaultFileType = CDI_FILETYPE_NC2; }
else if ( memcmp(filetypestr, "srv", 3) == 0 ) { ftstr += 3; DefaultFileType = CDI_FILETYPE_SRV; }
else if ( memcmp(filetypestr, "ext", 3) == 0 ) { ftstr += 3; DefaultFileType = CDI_FILETYPE_EXT; }
else if ( memcmp(filetypestr, "ieg", 3) == 0 ) { ftstr += 3; DefaultFileType = CDI_FILETYPE_IEG; }
else
{
fprintf(stderr, "Unsupported filetype %s!\n", filetypestr);
......
......@@ -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++ )
......
......@@ -28,7 +28,7 @@ int main(void)
int varID2 = 1;
// Open the output dataset (GRIB format)
int streamID2 = streamOpenWrite("example.grb", FILETYPE_GRB);
int streamID2 = streamOpenWrite("example.grb", CDI_FILETYPE_GRB);
if ( streamID2 < 0 )
{
fprintf(stderr, "%s\n", cdiStringError(streamID2));
......
......@@ -30,7 +30,7 @@
varID2 = 1
! Open the output dataset (GRIB format)
streamID2 = streamOpenWrite("example.grb", FILETYPE_GRB)
streamID2 = streamOpenWrite("example.grb", CDI_FILETYPE_GRB)
IF ( streamID2 < 0 ) THEN
WRITE(0,*) cdiStringError(streamID2)
STOP
......
......@@ -40,7 +40,7 @@ int main(int argc, char *argv[])
vardata = (double *) malloc(gridsize*MAX_LEVEL*sizeof(double));
/* Open the output dataset (GRIB format) */
streamID2 = streamOpenWrite(ofile, FILETYPE_GRB);
streamID2 = streamOpenWrite(ofile, CDI_FILETYPE_GRB);
if ( streamID2 < 0 )
{
fprintf(stderr, "%s\n", cdiStringError(streamID2));
......
......@@ -47,7 +47,7 @@ int main(void)
vlistDefTaxis(vlistID, taxisID);
// Create a dataset in netCDF format
int streamID = streamOpenWrite("example.nc", FILETYPE_NC);
int streamID = streamOpenWrite("example.nc", CDI_FILETYPE_NC);
if ( streamID < 0 )
{
fprintf(stderr, "%s\n", cdiStringError(streamID));
......
......@@ -43,7 +43,7 @@ int main(void)
vlistDefVarName(vlistID, varID2, "varname2");
// Create a dataset in netCDF format
streamID = streamOpenWrite("example_const.nc", FILETYPE_NC);
streamID = streamOpenWrite("example_const.nc", CDI_FILETYPE_NC);
if ( streamID < 0 )
{
fprintf(stderr, "%s\n", cdiStringError(streamID));
......
......@@ -51,7 +51,7 @@ int main(void)
vlistDefTaxis(vlistID, taxisID);
// Create a dataset in netCDF format
streamID = streamOpenWrite("example.grb", FILETYPE_GRB);
streamID = streamOpenWrite("example.grb", CDI_FILETYPE_GRB);
if ( streamID < 0 )
{
fprintf(stderr, "%s\n", cdiStringError(streamID));
......
......@@ -7,7 +7,7 @@
int main(void)
{
char fname[] = "test_ens.grb2";
int filetype = FILETYPE_GRB2;
int filetype = CDI_FILETYPE_GRB2;
int nlat = 18, nlon = 2*nlat;
double *data = NULL;
int nlevel;
......
......@@ -54,7 +54,7 @@
CALL vlistDefTaxis(vlistID, taxisID)
! Create a dataset in netCDF format
streamID = streamOpenWrite("example.nc", FILETYPE_NC)
streamID = streamOpenWrite("example.nc", CDI_FILETYPE_NC)
IF ( streamID < 0 ) THEN
WRITE(0,*) cdiStringError(streamID)
STOP
......
......@@ -58,7 +58,7 @@
CALL vlistDefTaxis(vlistID, taxisID)
! Create a dataset in netCDF format
streamID = streamOpenWrite(C_CHAR_"example.nc"//C_NULL_CHAR, FILETYPE_NC)
streamID = streamOpenWrite(C_CHAR_"example.nc"//C_NULL_CHAR, CDI_FILETYPE_NC)
IF ( streamID < 0 ) THEN
msg => cdiStringError(streamID)
WRITE(0,'(132a)') msg
......
......@@ -50,7 +50,7 @@ int main(void)
vlistDefTaxis(vlistID, taxisID);
// Create a dataset in netCDF format
streamID = streamOpenWrite("example_f.nc", FILETYPE_NC);
streamID = streamOpenWrite("example_f.nc", CDI_FILETYPE_NC);
if ( streamID < 0 )
{
fprintf(stderr, "%s\n", cdiStringError(streamID));
......
......@@ -52,7 +52,7 @@ int main(void)
vlistDefTaxis(vlistID, taxisID);
// Create a dataset in netCDF format
streamID = streamOpenWrite("example.nc", FILETYPE_NC);
streamID = streamOpenWrite("example.nc", CDI_FILETYPE_NC);
if ( streamID < 0 )
{
fprintf(stderr, "%s\n", cdiStringError(streamID));
......
......@@ -52,7 +52,7 @@ int main(void)
vlistDefTaxis(vlistID, taxisID);
// Create a dataset in netCDF format
streamID = streamOpenWrite("example_ens.grb", FILETYPE_GRB2);
streamID = streamOpenWrite("example_ens.grb", CDI_FILETYPE_GRB2);
if ( streamID < 0 )
{
fprintf(stderr, "%s\n", cdiStringError(streamID));
......
......@@ -72,7 +72,7 @@ int main(void)
vlistDefTaxis(vlistID, taxisID);
// Create a dataset in netCDF format
streamID = streamOpenWrite("example.nc", FILETYPE_NC);
streamID = streamOpenWrite("example.nc", CDI_FILETYPE_NC);
if ( streamID < 0 )
{
fprintf(stderr, "%s\n", cdiStringError(streamID));
......
......@@ -53,7 +53,7 @@ int main(void)
vlistDefTaxis(vlistID, taxisID);
// Create a dataset in netCDF format
streamID = streamOpenWrite("example.grb2", FILETYPE_GRB2);
streamID = streamOpenWrite("example.grb2", CDI_FILETYPE_GRB2);
if ( streamID < 0 )
{
fprintf(stderr, "%s\n", cdiStringError(streamID));
......
......@@ -43,7 +43,7 @@ int main(void)
vlistDefTaxis(vlistID, taxisID);
// Create a dataset in netCDF format
streamID = streamOpenWrite("example.nc", FILETYPE_NC);
streamID = streamOpenWrite("example.nc", CDI_FILETYPE_NC);
if ( streamID < 0 )
{
fprintf(stderr, "%s\n", cdiStringError(streamID));
......
......@@ -48,8 +48,8 @@ int main(void)
vlistDefTaxis(vlistID, taxisID);
// Create a dataset in netCDF format
//streamID = streamOpenWrite("example.grb2", FILETYPE_GRB2);
streamID = streamOpenWrite("example.nc", FILETYPE_NC);
//streamID = streamOpenWrite("example.grb2", CDI_FILETYPE_GRB2);
streamID = streamOpenWrite("example.nc", CDI_FILETYPE_NC);
if ( streamID < 0 )
{
fprintf(stderr, "%s\n", cdiStringError(streamID));
......
......@@ -52,8 +52,8 @@ int main(void)
vlistDefTaxis(vlistID, taxisID);
// Create a dataset in netCDF format
streamID = streamOpenWrite("example.grb2", FILETYPE_GRB2);
//streamID = streamOpenWrite("example.nc", FILETYPE_NC);
streamID = streamOpenWrite("example.grb2", CDI_FILETYPE_GRB2);
//streamID = streamOpenWrite("example.nc", CDI_FILETYPE_NC);
if ( streamID < 0 )
{
fprintf(stderr, "%s\n", cdiStringError(streamID));
......
......@@ -51,7 +51,7 @@ int run(int irun)
vlistDefTaxis(vlistID, taxisID);
// Create a dataset in netCDF format
streamID = streamOpenWrite("example.nc", FILETYPE_NC);
streamID = streamOpenWrite("example.nc", CDI_FILETYPE_NC);
if ( streamID < 0 )
{
fprintf(stderr, "%s\n", cdiStringError(streamID));
......
Markdown is supported
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