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

update for changed interface of error.h

parent 06d453da
......@@ -68,7 +68,7 @@ am_cdo_OBJECTS = cdo-cdo.$(OBJEXT) cdo-Arith.$(OBJEXT) \
cdo-EOFs.$(OBJEXT) cdo-Eof3d.$(OBJEXT) \
cdo-EcaIndices.$(OBJEXT) cdo-Echam5ini.$(OBJEXT) \
cdo-Enlarge.$(OBJEXT) cdo-Enlargegrid.$(OBJEXT) \
cdo-Ensstat.$(OBJEXT) cdo-Ensstat2.$(OBJEXT) \
cdo-Ensstat.$(OBJEXT) cdo-Ensstat3.$(OBJEXT) \
cdo-Eofcoeff.$(OBJEXT) cdo-Eofcoeff3d.$(OBJEXT) \
cdo-Exprf.$(OBJEXT) cdo-Filedes.$(OBJEXT) \
cdo-Fillmiss.$(OBJEXT) cdo-Filter.$(OBJEXT) \
......@@ -335,7 +335,7 @@ cdo_SOURCES = cdo.c Arith.c Arithc.c Arithdays.c Arithlat.c CDItest.c \
Cat.c Change.c Change_e5slm.c Cloudlayer.c Command.c Comp.c \
Compc.c Complextorect.c Cond.c Cond2.c Condc.c Consecstat.c \
Copy.c Deltime.c Detrend.c Diff.c EOFs.c Eof3d.c EcaIndices.c \
Echam5ini.c Enlarge.c Enlargegrid.c Ensstat.c Ensstat2.c \
Echam5ini.c Enlarge.c Enlargegrid.c Ensstat.c Ensstat3.c \
Eofcoeff.c Eofcoeff3d.c Exprf.c Filedes.c Fillmiss.c Filter.c \
Fldrms.c Fldstat.c Fldstat2.c Fourier.c Gather.c Gengrid.c \
Gradsdes.c Gridboxstat.c Gridcell.c Harmonic.c Hi.c \
......@@ -534,7 +534,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Enlarge.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Enlargegrid.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Ensstat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Ensstat2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Ensstat3.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Eof3d.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Eofcoeff.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Eofcoeff3d.Po@am__quote@
......@@ -1151,19 +1151,19 @@ cdo-Ensstat.obj: Ensstat.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ensstat.obj `if test -f 'Ensstat.c'; then $(CYGPATH_W) 'Ensstat.c'; else $(CYGPATH_W) '$(srcdir)/Ensstat.c'; fi`
cdo-Ensstat2.o: Ensstat2.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ensstat2.o -MD -MP -MF $(DEPDIR)/cdo-Ensstat2.Tpo -c -o cdo-Ensstat2.o `test -f 'Ensstat2.c' || echo '$(srcdir)/'`Ensstat2.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cdo-Ensstat2.Tpo $(DEPDIR)/cdo-Ensstat2.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Ensstat2.c' object='cdo-Ensstat2.o' libtool=no @AMDEPBACKSLASH@
cdo-Ensstat3.o: Ensstat3.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ensstat3.o -MD -MP -MF $(DEPDIR)/cdo-Ensstat3.Tpo -c -o cdo-Ensstat3.o `test -f 'Ensstat3.c' || echo '$(srcdir)/'`Ensstat3.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cdo-Ensstat3.Tpo $(DEPDIR)/cdo-Ensstat3.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Ensstat3.c' object='cdo-Ensstat3.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ensstat2.o `test -f 'Ensstat2.c' || echo '$(srcdir)/'`Ensstat2.c
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ensstat3.o `test -f 'Ensstat3.c' || echo '$(srcdir)/'`Ensstat3.c
cdo-Ensstat2.obj: Ensstat2.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ensstat2.obj -MD -MP -MF $(DEPDIR)/cdo-Ensstat2.Tpo -c -o cdo-Ensstat2.obj `if test -f 'Ensstat2.c'; then $(CYGPATH_W) 'Ensstat2.c'; else $(CYGPATH_W) '$(srcdir)/Ensstat2.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cdo-Ensstat2.Tpo $(DEPDIR)/cdo-Ensstat2.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Ensstat2.c' object='cdo-Ensstat2.obj' libtool=no @AMDEPBACKSLASH@
cdo-Ensstat3.obj: Ensstat3.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ensstat3.obj -MD -MP -MF $(DEPDIR)/cdo-Ensstat3.Tpo -c -o cdo-Ensstat3.obj `if test -f 'Ensstat3.c'; then $(CYGPATH_W) 'Ensstat3.c'; else $(CYGPATH_W) '$(srcdir)/Ensstat3.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cdo-Ensstat3.Tpo $(DEPDIR)/cdo-Ensstat3.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Ensstat3.c' object='cdo-Ensstat3.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ensstat2.obj `if test -f 'Ensstat2.c'; then $(CYGPATH_W) 'Ensstat2.c'; else $(CYGPATH_W) '$(srcdir)/Ensstat2.c'; fi`
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ensstat3.obj `if test -f 'Ensstat3.c'; then $(CYGPATH_W) 'Ensstat3.c'; else $(CYGPATH_W) '$(srcdir)/Ensstat3.c'; fi`
cdo-Eofcoeff.o: Eofcoeff.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Eofcoeff.o -MD -MP -MF $(DEPDIR)/cdo-Eofcoeff.Tpo -c -o cdo-Eofcoeff.o `test -f 'Eofcoeff.c' || echo '$(srcdir)/'`Eofcoeff.c
......
......@@ -9,7 +9,9 @@
#define DEBUG_MEMORY
#ifndef WITH_CALLER_NAME
#define WITH_CALLER_NAME
#endif
extern size_t memTotal(void);
extern void memDebug(int debug);
......
#ifndef _ERROR_H
#define _ERROR_H
#ifndef WITH_CALLER_NAME
#define WITH_CALLER_NAME
#endif
#define _FATAL 1 /* Error flag: exit on error */
#define _VERBOSE 2 /* Error flag: report errors */
#define _DEBUG 4 /* Error flag: debug */
......@@ -14,4 +18,20 @@ void Error(const char *caller, const char *fmt, ...);
void Warning(const char *caller, const char *fmt, ...);
void Message(const char *caller, const char *fmt, ...);
#if defined WITH_CALLER_NAME
# define SysError(...) SysError(__func__, __VA_ARGS__)
# define Error(...) Error(__func__, __VA_ARGS__)
# define Errorc(...) Error(caller, __VA_ARGS__)
# define Warning(...) Warning(__func__, __VA_ARGS__)
# define Message(...) Message(__func__, __VA_ARGS__)
# define Messagec(...) Message(caller, __VA_ARGS__)
#else
# define SysError(...) SysError((void *), __VA_ARGS__)
# define Error(...) Error((void *), __VA_ARGS__)
# define Errorc(...) Error((void *), __VA_ARGS__)
# define Warning(...) Warning((void *), __VA_ARGS__)
# define Message(...) Message((void *), __VA_ARGS__)
# define Messagec(...) Message((void *), __VA_ARGS__)
#endif
#endif /* _ERROR_H */
......@@ -85,7 +85,7 @@ int gridToZonal(int gridID1)
}
else
{
Error(func, "Gridtype %s unsupported!", gridNamePtr(gridtype));
Error("Gridtype %s unsupported!", gridNamePtr(gridtype));
}
return (gridID2);
......@@ -125,7 +125,7 @@ int gridToMeridional(int gridID1)
}
else
{
Error(func, "Gridtype %s unsupported!", gridNamePtr(gridtype));
Error("Gridtype %s unsupported!", gridNamePtr(gridtype));
}
return (gridID2);
......@@ -334,11 +334,11 @@ void lcc_to_geo(int gridID, int gridsize, double *xvals, double *yvals)
while ( lonParY < 0 ) lonParY += 360;
*/
if ( IS_NOT_EQUAL(xincm, yincm) )
Warning(func, "X and Y increment must be equal on Lambert Conformal grid (Xinc = %g, Yinc = %g)\n",
Warning("X and Y increment must be equal on Lambert Conformal grid (Xinc = %g, Yinc = %g)\n",
xincm, yincm);
/*
if ( IS_NOT_EQUAL(lat1, lat2) )
Warning(func, "Lat1 and Lat2 must be equal on Lambert Conformal grid (Lat1 = %g, Lat2 = %g)\n",
Warning("Lat1 and Lat2 must be equal on Lambert Conformal grid (Lat1 = %g, Lat2 = %g)\n",
lat1, lat2);
*/
map_set(PROJ_LC, originLat, originLon, xincm, lonParY, lat1, lat2, &proj);
......@@ -495,14 +495,14 @@ void field2regular(int gridID1, int gridID2, double missval, double *array, int
gridtype = gridInqType(gridID1);
if ( gridtype != GRID_GAUSSIAN_REDUCED ) Error(func, "Not a reduced gaussian grid!");
if ( gridtype != GRID_GAUSSIAN_REDUCED ) Error("Not a reduced gaussian grid!");
nlat = gridInqYsize(gridID1);
nlon = 2*nlat;
rowlonptr = (int *) malloc(nlat*sizeof(int));
if ( gridInqSize(gridID2) != nlon*nlat ) Error(func, "Gridsize differ!");
if ( gridInqSize(gridID2) != nlon*nlat ) Error("Gridsize differ!");
gridInqRowlon(gridID1, rowlonptr);
......@@ -527,7 +527,7 @@ int gridToRegular(int gridID1)
gridtype = gridInqType(gridID1);
if ( gridtype != GRID_GAUSSIAN_REDUCED ) Error(func, "Not a reduced gaussian grid!");
if ( gridtype != GRID_GAUSSIAN_REDUCED ) Error("Not a reduced gaussian grid!");
ny = gridInqYsize(gridID1);
nx = 2*ny;
......@@ -627,7 +627,7 @@ int gridToCurvilinear(int gridID1)
else
{
if ( ! (gridInqXvals(gridID1, NULL) && gridInqYvals(gridID1, NULL)) )
Error(func, "Grid has no values");
Error("Grid has no values");
xvals = (double *) malloc(nx*sizeof(double));
yvals = (double *) malloc(ny*sizeof(double));
......@@ -815,7 +815,7 @@ int gridToCurvilinear(int gridID1)
}
default:
{
Error(func, "Grid type >%s< unsupported!", gridNamePtr(gridtype));
Error("Grid type >%s< unsupported!", gridNamePtr(gridtype));
break;
}
}
......@@ -1007,7 +1007,7 @@ int gridToCell(int gridID1)
}
default:
{
Error(func, "Grid type %s unsupported!", gridNamePtr(gridtype));
Error("Grid type %s unsupported!", gridNamePtr(gridtype));
break;
}
}
......
......@@ -176,8 +176,8 @@ int gridDefine(grid_t grid)
{
if ( grid.size != 1 )
{
if ( grid.xsize == 0 ) Error(func, "xsize undefined!");
if ( grid.ysize == 0 ) Error(func, "ysize undefined!");
if ( grid.xsize == 0 ) Error("xsize undefined!");
if ( grid.ysize == 0 ) Error("ysize undefined!");
}
if ( grid.size == 0 ) grid.size = grid.xsize*grid.ysize;
......@@ -291,8 +291,8 @@ int gridDefine(grid_t grid)
if ( grid.type == GRID_CURVILINEAR )
{
if ( grid.xsize == 0 ) Error(func, "xsize undefined!");
if ( grid.ysize == 0 ) Error(func, "ysize undefined!");
if ( grid.xsize == 0 ) Error("xsize undefined!");
if ( grid.ysize == 0 ) Error("ysize undefined!");
gridDefXsize(gridID, grid.xsize);
gridDefYsize(gridID, grid.ysize);
}
......@@ -341,8 +341,8 @@ int gridDefine(grid_t grid)
}
case GRID_LCC:
{
if ( grid.xsize == 0 ) Error(func, "xsize undefined!");
if ( grid.ysize == 0 ) Error(func, "ysize undefined!");
if ( grid.xsize == 0 ) Error("xsize undefined!");
if ( grid.ysize == 0 ) Error("ysize undefined!");
if ( grid.size == 0 ) grid.size = grid.xsize*grid.ysize;
......@@ -353,13 +353,13 @@ int gridDefine(grid_t grid)
gridDefXsize(gridID, grid.xsize);
gridDefYsize(gridID, grid.ysize);
if ( grid.def_originLon == FALSE ) Error(func, "originLon undefined!");
if ( grid.def_originLat == FALSE ) Error(func, "originLat undefined!");
if ( grid.def_lonParY == FALSE ) Error(func, "lonParY undefined!");
if ( grid.def_lat1 == FALSE ) Error(func, "lat1 undefined!");
if ( grid.def_lat2 == FALSE ) Error(func, "lat2 undefined!");
if ( grid.def_xinc == FALSE ) Error(func, "xinc undefined!");
if ( grid.def_yinc == FALSE ) Error(func, "yinc undefined!");
if ( grid.def_originLon == FALSE ) Error("originLon undefined!");
if ( grid.def_originLat == FALSE ) Error("originLat undefined!");
if ( grid.def_lonParY == FALSE ) Error("lonParY undefined!");
if ( grid.def_lat1 == FALSE ) Error("lat1 undefined!");
if ( grid.def_lat2 == FALSE ) Error("lat2 undefined!");
if ( grid.def_xinc == FALSE ) Error("xinc undefined!");
if ( grid.def_yinc == FALSE ) Error("yinc undefined!");
gridDefLCC(gridID, grid.originLon, grid.originLat, grid.lonParY,
grid.lat1, grid.lat2, grid.xinc, grid.yinc, grid.projflag, grid.scanflag);
......@@ -374,8 +374,8 @@ int gridDefine(grid_t grid)
}
case GRID_LCC2:
{
if ( grid.xsize == 0 ) Error(func, "xsize undefined!");
if ( grid.ysize == 0 ) Error(func, "ysize undefined!");
if ( grid.xsize == 0 ) Error("xsize undefined!");
if ( grid.ysize == 0 ) Error("ysize undefined!");
if ( grid.size == 0 ) grid.size = grid.xsize*grid.ysize;
......@@ -412,9 +412,9 @@ int gridDefine(grid_t grid)
free(grid.yvals);
}
if ( grid.def_lon_0 == FALSE ) Error(func, "lon_0 undefined!");
if ( grid.def_lat_0 == FALSE ) Error(func, "lat_0 undefined!");
if ( grid.def_lat_1 == FALSE ) Error(func, "lat_1 undefined!");
if ( grid.def_lon_0 == FALSE ) Error("lon_0 undefined!");
if ( grid.def_lat_0 == FALSE ) Error("lat_0 undefined!");
if ( grid.def_lat_1 == FALSE ) Error("lat_1 undefined!");
if ( grid.def_lat_2 == FALSE ) grid.def_lat_2 = grid.def_lat_1;
gridDefLcc2(gridID, grid.a, grid.lon_0, grid.lat_0, grid.lat_1, grid.lat_2);
......@@ -430,7 +430,7 @@ int gridDefine(grid_t grid)
case GRID_SPECTRAL:
{
if ( grid.ntr == 0 )
Error(func, "truncation undefined!");
Error("truncation undefined!");
if ( grid.size == 0 )
grid.size = (grid.ntr+1) * (grid.ntr+2);
......@@ -446,9 +446,9 @@ int gridDefine(grid_t grid)
}
case GRID_GME:
{
if ( grid.nd == 0 ) Error(func, "nd undefined!");
if ( grid.ni == 0 ) Error(func, "ni undefined!");
if ( grid.size == 0 ) Error(func, "size undefined!");
if ( grid.nd == 0 ) Error("nd undefined!");
if ( grid.ni == 0 ) Error("ni undefined!");
if ( grid.size == 0 ) Error("size undefined!");
gridID = gridCreate(grid.type, grid.size);
......@@ -470,9 +470,9 @@ int gridDefine(grid_t grid)
default:
{
if ( grid.type == -1 )
Error(func, "Undefined grid type!");
Error("Undefined grid type!");
else
Error(func, "Unsupported grid type: %s", gridNamePtr(grid.type));
Error("Unsupported grid type: %s", gridNamePtr(grid.type));
}
}
......@@ -560,9 +560,9 @@ double *readfield(grid_t *grid, int record, char *format, char *filename)
int fileID, rxysize, ierr, irec;
double *vals;
if ( grid->size == 0 ) Error(func, "grid size = 0!");
if ( format == NULL ) Error(func, "format undefined!");
if ( filename == NULL ) Error(func, "file name undefined!");
if ( grid->size == 0 ) Error("grid size = 0!");
if ( format == NULL ) Error("format undefined!");
if ( filename == NULL ) Error("file name undefined!");
vals = (double *) malloc(grid->size*sizeof(double));
......@@ -570,21 +570,21 @@ double *readfield(grid_t *grid, int record, char *format, char *filename)
{
int header[4];
fileID = extOpen(filename, "r");
if ( fileID == UNDEFID ) SysError(func, filename);
if ( fileID == UNDEFID ) SysError(filename);
for ( irec = 0; irec < record; irec++ )
{
ierr = extReadHeader(fileID, header);
if ( ierr <= 0 ) Error(func, "Record %d unexpected EOF in file %s", irec+1, filename);
if ( ierr <= 0 ) Error("Record %d unexpected EOF in file %s", irec+1, filename);
}
grid->prec = extInqPrec(fileID);
rxysize = header[3];
if ( rxysize != (int) grid->size ) Error(func, "unexpected record size of %d!", rxysize);
if ( rxysize != (int) grid->size ) Error("unexpected record size of %d!", rxysize);
ierr = extReadDataDP(fileID, vals);
extClose(fileID);
}
else
Error(func, "format %s unsupported!", format);
Error("format %s unsupported!", format);
return (vals);
}
......@@ -596,9 +596,9 @@ double *readfield4(grid_t *grid, int record, char *format, char *filename)
int fileID, rxysize, ierr, irec;
double *vals;
if ( grid->size == 0 ) Error(func, "grid size = 0!");
if ( format == NULL ) Error(func, "format undefined!");
if ( filename == NULL ) Error(func, "file name undefined!");
if ( grid->size == 0 ) Error("grid size = 0!");
if ( format == NULL ) Error("format undefined!");
if ( filename == NULL ) Error("file name undefined!");
vals = (double *) malloc(4*grid->size*sizeof(double));
......@@ -606,22 +606,22 @@ double *readfield4(grid_t *grid, int record, char *format, char *filename)
{
int header[4];
fileID = extOpen(filename, "r");
if ( fileID == UNDEFID ) SysError(func, filename);
if ( fileID == UNDEFID ) SysError(filename);
for ( irec = 0; irec < record; irec++ )
{
ierr = extReadHeader(fileID, header);
if ( ierr <= 0 ) Error(func, "Record %d unexpected EOF in file %s", irec+1, filename);
if ( ierr <= 0 ) Error("Record %d unexpected EOF in file %s", irec+1, filename);
}
grid->prec = extInqPrec(fileID);
rxysize = header[3];
if ( rxysize != (int) (4*grid->size) ) Error(func, "unexpected record size of %d!", rxysize);
if ( rxysize != (int) (4*grid->size) ) Error("unexpected record size of %d!", rxysize);
ierr = extReadDataDP(fileID, vals);
extClose(fileID);
}
else
Error(func, "format %s unsupported!", format);
Error("format %s unsupported!", format);
return (vals);
}
......@@ -635,7 +635,7 @@ double readflt(const char *name, const char *pline)
val = strtod(pline, &endptr);
if ( pline == endptr )
Warning(func, "Couldn't read value for %s, set to zero!", name);
Warning("Couldn't read value for %s, set to zero!", name);
return (val);
}
......@@ -695,7 +695,7 @@ int gridFromFile(FILE *gfp, const char *dname)
else if ( cmpstr(pline, "laea", len) == 0 )
grid.type = GRID_LAEA;
else
Warning(func, "Invalid grid name : %s", pline);
Warning("Invalid grid name : %s", pline);
}
else if ( cmpstr(pline, "gridprec", len) == 0 )
{
......@@ -861,7 +861,7 @@ int gridFromFile(FILE *gfp, const char *dname)
grid.scanflag = 64;
}
else
Warning(func, "Invalid projection : %s", pline);
Warning("Invalid projection : %s", pline);
}
else if ( cmpstr(pline, "a", len) == 0 )
{
......@@ -919,7 +919,7 @@ int gridFromFile(FILE *gfp, const char *dname)
{
if ( ! readline(gfp, line, MAX_LINE_LEN) )
{
Warning(func, "Incomplete command: >gridlatlon<");
Warning("Incomplete command: >gridlatlon<");
break;
}
sscanf(line, "%lg %lg", &flat, &flon);
......@@ -949,7 +949,7 @@ int gridFromFile(FILE *gfp, const char *dname)
{
if ( ! readline(gfp, line, MAX_LINE_LEN) )
{
Warning(func, "Incomplete command: >mask<");
Warning("Incomplete command: >mask<");
break;
}
pline = line;
......@@ -967,7 +967,7 @@ int gridFromFile(FILE *gfp, const char *dname)
}
}
else
Warning(func, "gridsize undefined!");
Warning("gridsize undefined!");
}
else if ( cmpstr(pline, "xvals", len) == 0 )
{
......@@ -993,7 +993,7 @@ int gridFromFile(FILE *gfp, const char *dname)
{
if ( ! readline(gfp, line, MAX_LINE_LEN) )
{
Warning(func, "Incomplete command: >xvals<");
Warning("Incomplete command: >xvals<");
break;
}
pline = line;
......@@ -1004,7 +1004,7 @@ int gridFromFile(FILE *gfp, const char *dname)
}
}
else
Warning(func, "xsize or gridsize undefined!");
Warning("xsize or gridsize undefined!");
}
else if ( cmpstr(pline, "yvals", len) == 0 )
{
......@@ -1030,7 +1030,7 @@ int gridFromFile(FILE *gfp, const char *dname)
{
if ( ! readline(gfp, line, MAX_LINE_LEN) )
{
Warning(func, "Incomplete command: >yvals<");
Warning("Incomplete command: >yvals<");
break;
}
pline = line;
......@@ -1041,7 +1041,7 @@ int gridFromFile(FILE *gfp, const char *dname)
}
}
else
Warning(func, "ysize or gridsize undefined!");
Warning("ysize or gridsize undefined!");
}
else if ( cmpstr(pline, "xbounds", len) == 0 )
{
......@@ -1072,7 +1072,7 @@ int gridFromFile(FILE *gfp, const char *dname)
{
if ( ! readline(gfp, line, MAX_LINE_LEN) )
{
Warning(func, "Incomplete command: >xbounds<");
Warning("Incomplete command: >xbounds<");
break;
}
pline = line;
......@@ -1084,8 +1084,8 @@ int gridFromFile(FILE *gfp, const char *dname)
}
else
{
if ( size == 0 ) Warning(func, "xsize or gridsize undefined!");
if ( grid.nvertex == 0 ) Warning(func, "nvertex undefined!");
if ( size == 0 ) Warning("xsize or gridsize undefined!");
if ( grid.nvertex == 0 ) Warning("nvertex undefined!");
}
}
else if ( cmpstr(pline, "ybounds", len) == 0 )
......@@ -1117,7 +1117,7 @@ int gridFromFile(FILE *gfp, const char *dname)
{
if ( ! readline(gfp, line, MAX_LINE_LEN) )
{
Warning(func, "Incomplete command: >ybounds<");
Warning("Incomplete command: >ybounds<");
break;
}
pline = line;
......@@ -1129,14 +1129,14 @@ int gridFromFile(FILE *gfp, const char *dname)
}
else
{
if ( grid.ysize == 0 ) Warning(func, "ysize or gridsize undefined!");
if ( grid.nvertex == 0 ) Warning(func, "nvertex undefined!");
if ( grid.ysize == 0 ) Warning("ysize or gridsize undefined!");
if ( grid.nvertex == 0 ) Warning("nvertex undefined!");
}
}
else
{
if ( grid.type != UNDEFID )
Warning(func, "Invalid grid command : >%s<", pline);
Warning("Invalid grid command : >%s<", pline);
}
}
/*
......@@ -1257,7 +1257,7 @@ int gridFromPingo(FILE *gfp, const char *dname)
grid.xvals[i] += 360;
if ( i < nlon - 1 && grid.xvals[i+1] + 360 <= grid.xvals[i] )
{
Message(func, "Longitudes are not in ascending order!");
Message("Longitudes are not in ascending order!");
return (gridID);
}
}
......@@ -1284,7 +1284,7 @@ int gridFromPingo(FILE *gfp, const char *dname)
grid.yvals[0] < -90.001 ||
grid.yvals[nlat-1] < -90.001 )
{
Message(func, "Latitudes must be between 90 and -90!");
Message("Latitudes must be between 90 and -90!");
return (gridID);
}
......@@ -1292,7 +1292,7 @@ int gridFromPingo(FILE *gfp, const char *dname)
if ( IS_EQUAL(grid.yvals[i+1], grid.yvals[i]) || (i < nlat - 2 &&
((grid.yvals[i+1] > grid.yvals[i]) != (grid.yvals[i+2] > grid.yvals[i+1]))) )
{
Message(func, "Latitudes must be in descending or ascending order!");
Message("Latitudes must be in descending or ascending order!");
return (gridID);
}
......@@ -1357,7 +1357,7 @@ int ntr2nlat(int ntr)
nlat2 = NINT(((ntr+1)*3.+1.)/2.);
/*
if ( nlat == nlat2 )
Error(func, "Computation of latitudes failed for truncation %d", ntr);
Error("Computation of latitudes failed for truncation %d", ntr);
*/
}
......@@ -1376,7 +1376,7 @@ int ntr2nlat_linear(int ntr)
nlat2 = NINT(((ntr+1)*2.+1.)/2.);
/*
if ( nlat == nlat2 )
Error(func, "Computation of latitudes failed for truncation %d", ntr);
Error("Computation of latitudes failed for truncation %d", ntr);
*/
}
......@@ -1664,7 +1664,7 @@ int cdoDefineGrid(const char *gridfile)
else
{
if ( fread(buffer, 1, 4, gfp) != 4 )
SysError(func, "Read grid from %s failed!", gridfile);
SysError("Read grid from %s failed!", gridfile);
fclose(gfp);
......
......@@ -98,7 +98,7 @@ int gridFromNCfile(const char *gridfile)
{
grid.type = GRID_CURVILINEAR;
if ( grid.nvertex != 4 )
Error(func, "curvilinear grid with %d corners unsupported", grid.nvertex);
Error("curvilinear grid with %d corners unsupported", grid.nvertex);
grid.xsize = grid_dims[0];
grid.ysize = grid_dims[1];
......@@ -327,6 +327,6 @@ void writeNCgrid(const char *gridfile, int gridID, int *grid_imask)
nce(nc_close(nc_file_id));
#else
Error(func, "netCDF support not compiled in!");
Error("netCDF support not compiled in!");
#endif
}
......@@ -73,7 +73,7 @@ int readInstitution(const char *instfile)
if ( nvar == 2 && maxvar == 4 )
{
if ( ! isdigit((int) pline[0]) )
Error(func, "wrong format in line %d. Missing subcenter!", lnr);
Error("wrong format in line %d. Missing subcenter!", lnr);
subcenter = atoi(pline);
}
......@@ -113,7 +113,7 @@ void defineInstitution(char *instarg)
instID = institutInq(0, 0, instname, NULL);
if ( instID == UNDEFID )
Error(func, "institution <%s> not found", instname);
Error("institution <%s> not found", instname);
cdoDefaultInstID = instID;
}
......@@ -840,7 +840,7 @@ int operatorInqModID(char *operatorName)
{
fclose(fp);
fprintf(stderr, "Use commandline option -h for help.");
Error(func, "operator missing! %s is a file on disk!", operatorName);
Error("operator missing! %s is a file on disk!", operatorName);
}
fprintf(stderr, "Operator >%s< not found!\n", operatorName);
fprintf(stderr, "Similar operators are:\n");
......@@ -876,7 +876,7 @@ int operatorInqModID(char *operatorName)
if ( modID != -1 )
if ( ! Modules[modID].func )
Error(func, "Module for operator >%s< not installed!", operatorName);
Error("Module for operator >%s< not installed!", operatorName);
return (modID);
}
......
......@@ -45,8 +45,8 @@ void pipe_init(pipe_t *pipe)
#if defined (_POSIX_THREAD_PROCESS_SHARED)
if ( PipeDebug )
{
Message(func, "setpshared mutexattr to PTHREAD_PROCESS_SHARED");
Message(func, "setpshared condattr to PTHREAD_PROCESS_SHARED");
Message("setpshared mutexattr to PTHREAD_PROCESS_SHARED");
Message("setpshared condattr to PTHREAD_PROCESS_SHARED");
}
pthread_mutexattr_setpshared(&m_attr, PTHREAD_PROCESS_SHARED);
......@@ -57,19 +57,19 @@ void pipe_init(pipe_t *pipe)
int pshared;
pthread_mutexattr_getpshared(&m_attr, &pshared);
if ( pshared == PTHREAD_PROCESS_SHARED )
Message(func, "getpshared mutexattr is PTHREAD_PROCESS_SHARED");
Message("getpshared mutexattr is PTHREAD_PROCESS_SHARED");
else if ( pshared == PTHREAD_PROCESS_PRIVATE )
Message(func, "getpshared mutexattr is PTHREAD_PROCESS_PRIVATE");
Message("getpshared mutexattr is PTHREAD_PROCESS_PRIVATE");
pthread_condattr_getpshared(&c_attr, &pshared);
if ( pshared == PTHREAD_PROCESS_SHARED )
Message(func, "getpshared condattr is PTHREAD_PROCESS_SHARED");
Message("getpshared condattr is PTHREAD_PROCESS_SHARED");
else if ( pshared == PTHREAD_PROCESS_PRIVATE )
Message(func, "getpshared condattr is PTHREAD_PROCESS_PRIVATE");
Message("getpshared condattr is PTHREAD_PROCESS_PRIVATE");
}