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

Added support for netCDF4 classic format; option -f nc4c

parent 9d3d25f3
2011-04-27 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* Added support for netCDF4 classic format; option -f nc4c
2011-04-04 Uwe Schulzweida <Uwe.Schulzweida@zmaw.de>
* intyear: check contents of input files [report: Angelika Heil]
......
......@@ -3,6 +3,8 @@ CDO NEWS
Version 1.5.1 (?? ????? 2011):
New features:
* Added support for netCDF4 classic format; option -f nc4c
Fixed bugs:
* eofspatial: integer overflow; wrong result for grid size > 46340
......
......@@ -896,7 +896,7 @@ int import_e5res(const char *filename, VAR **vars, ATTS *atts)
{
if ( (int)attlen > attstringlen )
{
fprintf(stderr, "Attribute %s too large, skipped!\n", attname);
fprintf(stderr, "Attribute %s too large, skiped!\n", attname);
continue;
}
nce(nc_get_att_text(nc_file_id, NC_GLOBAL, attname, attstring));
......@@ -910,7 +910,7 @@ int import_e5res(const char *filename, VAR **vars, ATTS *atts)
{
if ( attlen > 1 )
{
fprintf(stderr, "Attribute %s too large, skipped!\n", attname);
fprintf(stderr, "Attribute %s too large, skiped!\n", attname);
continue;
}
nce(nc_get_att_int(nc_file_id, NC_GLOBAL, attname, &attint));
......@@ -919,7 +919,7 @@ int import_e5res(const char *filename, VAR **vars, ATTS *atts)
{
if ( attlen > 1 )
{
fprintf(stderr, "Attribute %s too large, skipped!\n", attname);
fprintf(stderr, "Attribute %s too large, skiped!\n", attname);
continue;
}
nce(nc_get_att_double(nc_file_id, NC_GLOBAL, attname, &attflt));
......
......@@ -499,7 +499,7 @@ void *Gradsdes(void *argument)
else
{
vlistInqVarName(vlistID, varID, varname);
cdoPrint("Unsupported grid type >%s<, skipped variable %s",
cdoPrint("Unsupported grid type >%s<, skiped variable %s",
gridNamePtr(gridInqType(vlistInqVarGrid(vlistID, varID))), varname);
vars[varID] = FALSE;
}
......
......@@ -174,7 +174,7 @@ void read_param(const char *paramfile, param_t *param, int maxparam, int *nparam
if ( nml->entry[nml_name]->occ == 0 )
{
cdoWarning("Parameter %d skipped, variable name not found!", nml_index);
cdoWarning("Parameter %d skiped, variable name not found!", nml_index);
continue;
}
......
......@@ -835,7 +835,7 @@ void read_dataset(hid_t loc_id, const char *name, void *opdata)
else if ( H5Tequal(native_type, H5T_NATIVE_DOUBLE) > 0 ) {ftype=1; dtype = DATATYPE_FLT64;}
else
{
cdoWarning("Dataset %s skipped, unsupported native datatype!", varname);
cdoWarning("Dataset %s skiped, unsupported native datatype!", varname);
goto RETURN;
}
H5Tclose(native_type);
......@@ -860,7 +860,7 @@ void read_dataset(hid_t loc_id, const char *name, void *opdata)
}
else
{
cdoWarning("Dataset %s skipped, unsupported rank (=%d)!", varname, rank);
cdoWarning("Dataset %s skiped, unsupported rank (=%d)!", varname, rank);
goto RETURN;
}
......
......@@ -233,7 +233,7 @@ void *Set(void *argument)
{
if ( nml->entry[nml_code]->occ == 0 )
{
cdoPrint("Parameter %d skipped, code number not found!", nml_index);
cdoPrint("Parameter %d skiped, code number not found!", nml_index);
continue;
}
}
......@@ -241,7 +241,7 @@ void *Set(void *argument)
{
if ( nml->entry[nml_name]->occ == 0 )
{
cdoWarning("Parameter %d skipped, variable name not found!", nml_index);
cdoWarning("Parameter %d skiped, variable name not found!", nml_index);
continue;
}
}
......
......@@ -190,7 +190,7 @@ void *Sorttimestamp(void *argument)
char vdatestr[32], vtimestr[32];
date2str(vdate[xtsID], vdatestr, sizeof(vdatestr));
time2str(vtime[xtsID], vtimestr, sizeof(vtimestr));
cdoPrint("Timestep %4d %s %s already exist, skipped!", xtsID, vdatestr, vtimestr);
cdoPrint("Timestep %4d %s %s already exist, skiped!", xtsID, vdatestr, vtimestr);
}
continue;
}
......
......@@ -433,7 +433,7 @@ void *Vertint(void *argument)
else
{
if ( zaxisInqType(zaxisID) == ZAXIS_HYBRID && zaxisIDh != -1 )
cdoWarning("Parameter %d has wrong number of levels, skipped! (param=%s nlevel=%d)",
cdoWarning("Parameter %d has wrong number of levels, skiped! (param=%s nlevel=%d)",
varID+1, paramstr, nlevel);
varinterp[varID] = FALSE;
vardata2[varID] = vardata1[varID];
......
......@@ -187,9 +187,9 @@ void usage(void)
fprintf(stderr, " Options:\n");
fprintf(stderr, " -a Generate an absolute time axis\n");
fprintf(stderr, " -b <nbits> Set the number of bits for the output precision\n");
fprintf(stderr, " (I8/I16/I32/F32/F64 for nc/nc2/nc4; F32/F64 for srv/ext/ieg; 1 - 24 for grb/grb2)\n");
fprintf(stderr, " (I8/I16/I32/F32/F64 for nc/nc2/nc4/nc4c; F32/F64 for srv/ext/ieg; 1 - 24 for grb/grb2)\n");
fprintf(stderr, " Add L or B to set the byteorder to Little or Big endian\n");
fprintf(stderr, " -f <format> Format of the output file. (grb, grb2, nc, nc2, nc4, srv, ext or ieg)\n");
fprintf(stderr, " -f <format> Format of the output file. (grb/grb2/nc/nc2/nc4/nc4c/srv/ext/ieg)\n");
fprintf(stderr, " -g <grid> Set default grid name or file. Available grids: \n");
fprintf(stderr, " n<N>, t<RES>, tl<RES>, r<NX>x<NY>, g<NX>x<NY>, gme<NI>, lon=<LON>/lat=<LAT>\n");
fprintf(stderr, " -h Help information for the operators\n");
......@@ -208,10 +208,6 @@ void usage(void)
#if defined (_OPENMP)
fprintf(stderr, " -P <nthreads> Set number of OpenMP threads\n");
#endif
/*
fprintf(stderr, " -p <prec> Set the precision of the output data in bytes\n");
fprintf(stderr, " (4/8 for nc, nc2, nc4, srv, ext, ieg; 1/2/3 for grb)\n");
*/
fprintf(stderr, " -Q Alphanumeric sorting of netCDF parameter names\n");
fprintf(stderr, " -R Convert GRIB1 data from reduced to regular grid (only with cgribex)\n");
fprintf(stderr, " -r Generate a relative time axis\n");
......@@ -413,7 +409,7 @@ void setDefaultDataType(char *datatypestr)
else
{
fprintf(stderr, "Unsupported number of bits %d!\n", nbits);
fprintf(stderr, "Use I8/I16/I32/F32/F64 for nc/nc2/nc4; F32/F64 for srv/ext/ieg; 1 - 24 for grb/grb2.\n");
fprintf(stderr, "Use I8/I16/I32/F32/F64 for nc/nc2/nc4/nc4c; F32/F64 for srv/ext/ieg; 1 - 24 for grb/grb2.\n");
exit(EXIT_FAILURE);
}
}
......@@ -539,6 +535,7 @@ void setDefaultFileType(char *filetypestr, int labort)
else if ( memcmp(filetypestr, "grb1", 4) == 0 ) { ftstr += 4; cdoDefaultFileType = FILETYPE_GRB; }
else if ( memcmp(filetypestr, "grb", 3) == 0 ) { ftstr += 3; cdoDefaultFileType = FILETYPE_GRB; }
else if ( memcmp(filetypestr, "nc2", 3) == 0 ) { ftstr += 3; cdoDefaultFileType = FILETYPE_NC2; }
else if ( memcmp(filetypestr, "nc4c", 4) == 0 ) { ftstr += 4; cdoDefaultFileType = FILETYPE_NC4C;}
else if ( memcmp(filetypestr, "nc4", 3) == 0 ) { ftstr += 3; cdoDefaultFileType = FILETYPE_NC4; }
else if ( memcmp(filetypestr, "nc", 2) == 0 ) { ftstr += 2; cdoDefaultFileType = FILETYPE_NC; }
else if ( memcmp(filetypestr, "srv", 3) == 0 ) { ftstr += 3; cdoDefaultFileType = FILETYPE_SRV; }
......@@ -549,7 +546,7 @@ void setDefaultFileType(char *filetypestr, int labort)
if ( labort )
{
fprintf(stderr, "Unsupported filetype %s!\n", filetypestr);
fprintf(stderr, "Available filetypes: grb, grb2, nc, nc2, nc4, srv, ext and ieg\n");
fprintf(stderr, "Available filetypes: grb/grb2/nc/nc2/nc4/nc4c/srv/ext/ieg\n");
exit(EXIT_FAILURE);
}
else
......@@ -570,8 +567,8 @@ void setDefaultFileType(char *filetypestr, int labort)
{
fprintf(stderr, "Unexpected character >%c< in file type >%s<!\n", *ftstr, filetypestr);
fprintf(stderr, "Use format[_nbits] with:\n");
fprintf(stderr, " format = grb, grb2, nc, nc2, nc4, srv, ext or ieg\n");
fprintf(stderr, " nbits = 32/64 for nc/nc2/nc4/srv/ext/ieg; 1 - 24 for grb/grb2\n");
fprintf(stderr, " format = grb, grb2, nc, nc2, nc4, nc4c, srv, ext or ieg\n");
fprintf(stderr, " nbits = 32/64 for nc/nc2/nc4/nc4c/srv/ext/ieg; 1 - 24 for grb/grb2\n");
exit(EXIT_FAILURE);
}
}
......
......@@ -727,7 +727,7 @@ int gridToCurvilinear(int gridID1)
if ( gridtype == GRID_LONLAT || gridtype == GRID_GAUSSIAN )
if ( check_range(2*nx, xbounds, -720, 720) )
{
cdoWarning("longitude bounds out of range, skipped!");
cdoWarning("longitude bounds out of range, skiped!");
free(xbounds);
xbounds = NULL;
}
......@@ -745,7 +745,7 @@ int gridToCurvilinear(int gridID1)
if ( gridtype == GRID_LONLAT || gridtype == GRID_GAUSSIAN )
if ( check_range(2*ny, ybounds, -180, 180) )
{
cdoWarning("latitude bounds out of range, skipped!");
cdoWarning("latitude bounds out of range, skiped!");
free(ybounds);
ybounds = NULL;
}
......
......@@ -52,6 +52,9 @@ void printFiletype(int streamID, int vlistID)
case FILETYPE_NC4:
printf("netCDF4");
break;
case FILETYPE_NC4C:
printf("netCDF4 classic");
break;
case FILETYPE_SRV:
printf("SERVICE");
break;
......@@ -78,7 +81,7 @@ void printFiletype(int streamID, int vlistID)
}
}
if ( filetype == FILETYPE_GRB || filetype == FILETYPE_NC4 )
if ( filetype == FILETYPE_GRB || filetype == FILETYPE_NC4 || filetype == FILETYPE_NC4C )
{
int nvars, varID;
int ztype;
......
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