Commit 7007a336 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Replaced Error() by cdoAbort().

parent 29ec1414
......@@ -27,10 +27,8 @@
*/
#include <cdi.h>
#include "cdo.h"
#include "cdo_int.h"
#include "pstream.h"
#include "error.h"
static
......
......@@ -22,10 +22,8 @@
*/
#include <cdi.h>
#include "cdo.h"
#include "cdo_int.h"
#include "pstream.h"
#include "error.h"
static
......
......@@ -30,7 +30,6 @@
*/
#include <cdi.h>
#include "cdo.h"
#include "cdo_int.h"
#include "pstream.h"
......
......@@ -22,12 +22,8 @@
*/
#include <cdi.h>
#include "cdo.h"
#include "cdo_int.h"
#include "pstream.h"
#include "error.h"
#include "util.h"
#include "pmlist.h"
#include "sellist.h"
......
......@@ -22,11 +22,8 @@
*/
#include <cdi.h>
#include "cdo.h"
#include "cdo_int.h" /* processSelf */
#include "pstream.h"
#include "error.h"
#include "util.h"
#include "listarray.h"
......
......@@ -31,11 +31,8 @@
#include <cdi.h>
#include "cdo.h"
#include "cdo_int.h"
#include "pstream.h"
#include "error.h"
#include "util.h"
#include "listarray.h"
......
......@@ -35,11 +35,8 @@
#include <cdi.h>
#include "cdo.h"
#include "cdo_int.h"
#include "pstream.h"
#include "error.h"
#include "util.h"
#include "listarray.h"
......
......@@ -15,11 +15,8 @@
GNU General Public License for more details.
*/
#include <stdlib.h>
#include <cdi.h>
#include "cdo.h"
#include "cdo_int.h"
#include "error.h"
double cdoZaxisInqLevel(int zaxisID, int levelID)
......
......@@ -15,9 +15,7 @@
*/
#include <cdi.h>
#include "cdo.h"
#include "cdo_int.h"
#include "error.h"
#include "grid.h"
......
......@@ -21,7 +21,6 @@
#include <limits.h>
#include <cdi.h>
#include "cdo.h"
#include "cdo_int.h"
#include "grid.h"
#include "griddes.h"
......
......@@ -9,10 +9,8 @@
#endif
#include <cdi.h>
#include "cdo.h"
#include "cdo_int.h"
#include "griddes.h"
#include "error.h"
#if defined(HAVE_LIBHDF5)
......
......@@ -6,21 +6,15 @@
# include "netcdf.h"
#endif
#include <stdio.h>
#include <cdi.h>
#include "cdo.h"
#include "cdo_int.h"
#include "griddes.h"
#include "error.h"
#if defined(HAVE_LIBNETCDF)
static void nce(int istat)
{
/*
This routine provides a simple interface to NetCDF error message routine.
*/
// This routine provides a simple interface to NetCDF error message routine.
if ( istat != NC_NOERR ) cdoAbort(nc_strerror(istat));
}
#endif
......@@ -100,7 +94,7 @@ int gridFromNCfile(const char *gridfile)
{
grid.type = GRID_CURVILINEAR;
if ( grid.nvertex != 4 )
Error("curvilinear grid with %d corners unsupported", grid.nvertex);
cdoAbort("curvilinear grid with %d corners unsupported", grid.nvertex);
grid.xsize = grid_dims[0];
grid.ysize = grid_dims[1];
......@@ -331,6 +325,6 @@ void writeNCgrid(const char *gridfile, int gridID, int *grid_imask)
nce(nc_close(nc_file_id));
#else
Error("NetCDF support not compiled in!");
cdoAbort("NetCDF support not compiled in!");
#endif
}
......@@ -15,29 +15,19 @@
GNU General Public License for more details.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <cdi.h>
#include "cdo.h"
#include "cdo_int.h"
#include "error.h"
#ifndef UNDEFID
#define UNDEFID CDI_UNDEFID
#endif
static
int readInstitution(const char *instfile)
{
int instID = UNDEFID;
int instID = CDI_UNDEFID;
char line[1024], *pline;
int lnr = 0;
int nvar = 0, maxvar = 4;
char name[1024], longname[1024];
int center = UNDEFID, subcenter = UNDEFID;
int center = CDI_UNDEFID, subcenter = CDI_UNDEFID;
FILE *instfp = fopen(instfile, "r");
......@@ -69,7 +59,7 @@ int readInstitution(const char *instfile)
if ( nvar == 2 && maxvar == 4 )
{
if ( ! isdigit((int) pline[0]) )
Error("wrong format in line %d. Missing subcenter!", lnr);
cdoAbort("wrong format in line %d. Missing subcenter!", lnr);
subcenter = atoi(pline);
}
......@@ -88,7 +78,7 @@ int readInstitution(const char *instfile)
fclose(instfp);
instID = institutInq(center, subcenter, name, longname);
if ( instID == UNDEFID )
if ( instID == CDI_UNDEFID )
instID = institutDef(center, subcenter, name, longname);
return instID;
......@@ -100,11 +90,11 @@ void defineInstitution(const char *instarg)
const char *instname = instarg;
int instID = readInstitution(instname);
if ( instID == UNDEFID )
if ( instID == CDI_UNDEFID )
instID = institutInq(0, 0, instname, NULL);
if ( instID == UNDEFID )
Error("institution <%s> not found", instname);
if ( instID == CDI_UNDEFID )
cdoAbort("institution <%s> not found", instname);
cdoDefaultInstID = instID;
}
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <cdi.h>
#include "cdo.h"
#include "cdo_int.h"
#include "specspace.h"
#include "error.h"
#include "grid.h"
......@@ -223,10 +217,10 @@ void trans_uv2dv(SPTRANS *sptrans, int nlev,
int gridID2, double *sd, double *svo)
{
if ( gridInqType(gridID1) != GRID_GAUSSIAN )
Error("unexpected grid1 type: %s instead of Gaussian", gridNamePtr(gridInqType(gridID1)));
cdoAbort("unexpected grid1 type: %s instead of Gaussian", gridNamePtr(gridInqType(gridID1)));
if ( gridInqType(gridID2) != GRID_SPECTRAL )
Error("unexpected grid2 type: %s instead of spectral", gridNamePtr(gridInqType(gridID2)));
cdoAbort("unexpected grid2 type: %s instead of spectral", gridNamePtr(gridInqType(gridID2)));
int ntr = gridInqTrunc(gridID2);
int nlon = gridInqXsize(gridID1);
......
......@@ -18,12 +18,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <cdi.h>
#include "cdo.h"
#include "util.h"
#include "error.h"
int defineTable(const char *tablearg)
......@@ -48,7 +45,7 @@ int defineTable(const char *tablearg)
if ( tableID == CDI_UNDEFID ) tableID = tableInq(-1, 0, tablename);
if ( tableID == CDI_UNDEFID ) Error("table <%s> not found", tablename);
if ( tableID == CDI_UNDEFID ) cdoAbort("table <%s> not found", tablename);
return tableID;
}
......@@ -15,15 +15,8 @@
GNU General Public License for more details.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <cdi.h>
#include "cdo.h"
#include "cdo_int.h"
#include "error.h"
#define UNDEFID -1
......@@ -92,8 +85,8 @@ int getoptname(char *optname, const char *optstring, int nopt)
int zaxisDefine(zaxis_t zaxis)
{
if ( zaxis.type == -1 ) Error("zaxistype undefined!");
if ( zaxis.size == 0 ) Error("zaxis size undefined!");
if ( zaxis.type == -1 ) cdoAbort("zaxistype undefined!");
if ( zaxis.size == 0 ) cdoAbort("zaxis size undefined!");
int zaxisID = zaxisCreate(zaxis.type, zaxis.size);
......@@ -124,7 +117,7 @@ int zaxisDefine(zaxis_t zaxis)
if ( zaxis.vctsize && zaxis.vct )
zaxisDefVct(zaxisID, zaxis.vctsize, zaxis.vct);
else
Warning("vct undefined!");
cdoWarning("vct undefined!");
}
return zaxisID;
......
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