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

Fixed parameter and format missmatch in calls to cdoAbort().

parent 5c5c08a0
......@@ -235,7 +235,7 @@ void *Arith(void *process)
nrecs2 = pstreamInqTimestep(streamIDx2, tsID2);
if ( nrecs2 == 0 )
cdoAbort("Empty input stream %s!", 1);
cdoAbort("Empty input stream %s!", cdoGetStreamName(1).c_str());
}
else
cdoAbort("Input streams have different number of timesteps!");
......
......@@ -489,7 +489,7 @@ void *Collgrid(void *process)
{
int nrecs = pstreamInqTimestep(ef[fileID].streamID, tsID);
if ( nrecs != nrecs0 )
cdoAbort("Number of records at time step %d of %s and %s differ!", tsID+1, cdoGetStreamName(0).c_str(), cdoStreamName(fileID));
cdoAbort("Number of records at time step %d of %s and %s differ!", tsID+1, cdoGetStreamName(0).c_str(), cdoGetStreamName(fileID).c_str());
}
taxisCopyTimestep(taxisID2, taxisID1);
......
......@@ -1043,7 +1043,7 @@ void *EcaPd(void *process)
threshold = parameter2double(operatorArgv()[0]);
if ( threshold < 0 ) cdoAbort("Parameter out of range: threshold = %d", threshold);
if ( threshold < 0 ) cdoAbort("Parameter out of range: threshold = %g", threshold);
sprintf(lnamebuffer, PD_LONGNAME, threshold);
request.var1.name = PD_NAME;
......
......@@ -245,7 +245,7 @@ void *Ensstat3(void *process)
cdoAbort("Inconsistent ensemble file, too few time steps in %s!", cdoGetStreamName(fileID).c_str());
else
cdoAbort("Inconsistent ensemble file, number of records at time step %d of %s and %s differ!",
tsID+1, cdoGetStreamName(0).c_str(), cdoStreamName(fileID));
tsID+1, cdoGetStreamName(0).c_str(), cdoGetStreamName(fileID).c_str());
}
}
......
......@@ -234,7 +234,7 @@ void *Ensval(void *process)
streamID = ef[fileID].streamID;
nrecs = pstreamInqTimestep(streamID, tsID);
if ( nrecs != nrecs0 )
cdoAbort("Number of records at time step %d of %s and %s differ!", tsID+1, cdoGetStreamName(0).c_str(), cdoStreamName(fileID));
cdoAbort("Number of records at time step %d of %s and %s differ!", tsID+1, cdoGetStreamName(0).c_str(), cdoGetStreamName(fileID).c_str());
}
for ( stream = 0; stream < nostreams; stream++ ) {
......
......@@ -62,7 +62,7 @@ void *Eofcoeff(void *process)
size_t gridsize = vlistGridsizeMax(vlistID1);
if ( gridsize != vlistGridsizeMax(vlistID2) )
cdoAbort("Gridsize of input files does not match! %d and %d", gridsize, vlistGridsizeMax(vlistID2));
cdoAbort("Gridsize of input files does not match! %zu and %zu", gridsize, vlistGridsizeMax(vlistID2));
if ( vlistNgrids(vlistID2) > 1 || vlistNgrids(vlistID1) > 1 )
cdoAbort("Too many different grids in input!");
......
......@@ -142,7 +142,7 @@ void fillmiss(field_type *field1, field_type *field2, int nfill)
}
}
if ( nmiss1 != nmiss2 ) cdoAbort("found only %d of %d missing values!", nmiss2, nmiss1);
if ( nmiss1 != nmiss2 ) cdoAbort("found only %zu of %zu missing values!", nmiss2, nmiss1);
Free(matrix2);
Free(matrix1);
......
......@@ -33,14 +33,14 @@
static
void sampleData(double *array1, int gridID1, double *array2, int gridID2, int resampleFactor)
{
long nlon1 = gridInqXsize(gridID1);
long nlat1 = gridInqYsize(gridID1);
size_t nlon1 = gridInqXsize(gridID1);
size_t nlat1 = gridInqYsize(gridID1);
long nlon2 = gridInqXsize(gridID2);
long nlat2 = gridInqYsize(gridID2);
size_t nlon2 = gridInqXsize(gridID2);
size_t nlat2 = gridInqYsize(gridID2);
if ( CdoDebug::cdoDebugExt >= 100 )
cdoPrint("%s(): (nlon1: %d; nlat1: %d) => (nlon2: %d; nlat2: %d); gridID1: %d; gridID2: %d; resampleFactor: %d)",
cdoPrint("%s(): (nlon1: %zu; nlat1: %zu) => (nlon2: %zu; nlat2: %zu); gridID1: %d; gridID2: %d; resampleFactor: %d)",
__func__, nlon1, nlat1, nlon2,nlat2, gridID1, gridID2, resampleFactor);
for ( long ilat1 = 0; ilat1 < nlat1; ilat1+=resampleFactor )
......
......@@ -277,7 +277,7 @@ void read_coordinates(const char *filename, long n, double *lon, double *lat, in
gridInqNvertex(gridID) == 3 ) break;
}
if ( gridID == -1 ) cdoAbort("No ICON grid with %d cells found in %s!", filename, n);
if ( gridID == -1 ) cdoAbort("No ICON grid with %ld cells found in %s!", n, filename);
gridInqXvals(gridID, lon);
gridInqYvals(gridID, lat);
......@@ -555,7 +555,7 @@ void *Samplegridicon(void *process)
long gridsize = vlistGridsizeMax(vlistID1);
if ( cdoVerbose ) cdoPrint("Source gridsize = %zu", gridsize);
if ( gridsize != cellindex[0]->ncells )
cdoAbort("Gridsize (%ls) of input stream and first grid (%ld) differ!", gridsize, cellindex[0]->ncells);
cdoAbort("Gridsize (%ld) of input stream and first grid (%ld) differ!", gridsize, cellindex[0]->ncells);
if ( vlistNumber(vlistID1) != CDI_REAL ) gridsize *= 2;
double *array1 = (double *) Malloc(gridsize*sizeof(double));
......
......@@ -107,7 +107,7 @@ double datestr_to_double(const char *datestr, int opt)
{
int c = datestr[i];
if ( !(isdigit(c) || c == '-' || c == ':' || c == '.' || c == 'T') )
cdoAbort("Date string >%s< contains invalid character at position %d!", datestr, i+1);
cdoAbort("Date string >%s< contains invalid character at position %zu!", datestr, i+1);
}
if ( opt ) { hour = 23; minute = 59; second = 59; }
......
......@@ -141,8 +141,7 @@ void *Selvar(void *process)
if ( operatorID == SELGRID && !args_are_numeric && nsel == 1 && strncmp(argnames[0], "var=", 4) == 0 )
{
const char *gridvarname = argnames[0] + 4;
if ( *gridvarname == 0 ) cdoAbort("Variable name missing!", gridvarname);
if ( *gridvarname == 0 ) cdoAbort("Variable name missing!");
for ( varID = 0; varID < nvars; varID++ )
{
......
......@@ -515,7 +515,7 @@ void *Settime(void *process)
if ( operatorID == SETMON ) month = newval;
if ( operatorID == SETMON && (month < 0 || month > 16) ) cdoAbort("parameter month=%d out of range!", month);
if ( operatorID == SETDAY ) day = newval;
if ( operatorID == SETDAY && (day < 0 || day > 31) ) cdoAbort("parameter day=%d %d out of range!", day);
if ( operatorID == SETDAY && (day < 0 || day > 31) ) cdoAbort("parameter day=%d out of range!", day);
vdate = cdiEncodeDate(year, month, day);
......
......@@ -211,7 +211,7 @@ void *Spectral(void *process)
{
j = wnums[i] - 1;
if ( j < 0 || j >= maxntr )
cdoAbort("wave number %d out of range (min=1, max=%d)!", wnums[i], maxntr);
cdoAbort("wave number %ld out of range (min=1, max=%l qd)!", wnums[i], maxntr);
waves[j] = 0;
}
}
......
......@@ -209,7 +209,7 @@ void *Ydaypctl(void *process)
{
if ( getmonthday(vdates1[dayoy]) != getmonthday(vdates2[dayoy]) )
cdoAbort("Verification dates for the day %d of %s and %s are different!",
dayoy, cdoGetStreamName(0).c_str(), cdoStreamName(1));
dayoy, cdoGetStreamName(0).c_str(), cdoGetStreamName(1).c_str());
for ( varID = 0; varID < nvars; varID++ )
{
......
......@@ -290,7 +290,7 @@ void *Ydrunpctl(void *process)
{
if ( getmonthday(vdates1[dayoy]) != getmonthday(vdates2[dayoy]) )
cdoAbort("Verification dates for day %d of %s, %s and %s are different!",
dayoy, cdoGetStreamName(0).c_str(), cdoStreamName(1));
dayoy, cdoGetStreamName(0).c_str(), cdoGetStreamName(1).c_str());
for ( varID = 0; varID < nvars; varID++ )
{
......
......@@ -202,7 +202,7 @@ void *Ymonpctl(void *process)
{
if ( getmonth(vdates1[month]) != getmonth(vdates2[month]) )
cdoAbort("Verification dates for the month %d of %s and %s are different!",
month, cdoGetStreamName(0).c_str(), cdoStreamName(1));
month, cdoGetStreamName(0).c_str(), cdoGetStreamName(1).c_str());
for ( varID = 0; varID < nvars; varID++ )
{
......
......@@ -212,7 +212,7 @@ void *Yseaspctl(void *process)
{
if ( getmonthday(datetime1[seas].vdate) != getmonthday(datetime2[seas].vdate) )
cdoAbort("Verification dates for the season %d of %s and %s are different!",
seas, cdoGetStreamName(0).c_str(), cdoStreamName(1));
seas, cdoGetStreamName(0).c_str(), cdoGetStreamName(1).c_str());
for ( varID = 0; varID < nvars; varID++ )
{
......
......@@ -662,14 +662,14 @@ void ex_copy_var(int init, nodeType *p2, nodeType *p1)
assert(ngp > 0);
if ( ngp != p2->param.ngp )
cdoAbort("%s: Number of grid points differ (%s[%d] = %s[%d])",
cdoAbort("%s: Number of grid points differ (%s[%zu] = %s[%zu])",
__func__, p2->param.name, p2->param.ngp, p1->param.name, ngp);
size_t nlev = p1->param.nlev;
assert(nlev > 0);
if ( nlev != p2->param.nlev )
cdoAbort("%s: Number of levels differ (%s[%d] = %s[%d])",
cdoAbort("%s: Number of levels differ (%s[%zu] = %s[%zu])",
__func__, p2->param.name, p2->param.nlev, p1->param.name, nlev);
if ( ! init )
......
......@@ -297,7 +297,7 @@ void hsetDefVarLevelBounds(HISTOGRAM_SET *hset, int varID, int levelID, const fi
grid = hset->grids[varID];
if ( grid != field1->grid || grid != field2->grid )
cdoAbort("Grids are different", __func__);
cdoAbort("Grids are different (%s)", __func__);
hists = hset->histograms[varID][levelID];
......@@ -346,7 +346,7 @@ void hsetAddVarLevelValues(HISTOGRAM_SET *hset, int varID, int levelID, const fi
grid = hset->grids[varID];
if ( grid != field->grid )
cdoAbort("Grids are different", __func__);
cdoAbort("Grids are different (%s)", __func__);
hists = hset->histograms[varID][levelID];
......
......@@ -1413,7 +1413,7 @@ void scrip_remap_conserv_weights(remapgrid_t *src_grid, remapgrid_t *tgt_grid, r
/* Prevent infinite loops if integration gets stuck near cell or threshold boundary */
num_subseg++;
if ( num_subseg >= max_subseg )
cdoAbort("Integration stalled: num_subseg exceeded limit (grid1[%d]: lon1=%g lon2=%g lat1=%g lat2=%g)!",
cdoAbort("Integration stalled: num_subseg exceeded limit (grid1[%zu]: lon1=%g lon2=%g lat1=%g lat2=%g)!",
src_cell_add, beglon, endlon, beglat, endlat);
/* Uwe Schulzweida: skip very small regions */
......@@ -1616,7 +1616,7 @@ void scrip_remap_conserv_weights(remapgrid_t *src_grid, remapgrid_t *tgt_grid, r
/* Prevent infinite loops if integration gets stuck near cell or threshold boundary */
num_subseg++;
if ( num_subseg >= max_subseg )
cdoAbort("Integration stalled: num_subseg exceeded limit (grid2[%d]: lon1=%g lon2=%g lat1=%g lat2=%g)!",
cdoAbort("Integration stalled: num_subseg exceeded limit (grid2[%zu]: lon1=%g lon2=%g lat1=%g lat2=%g)!",
tgt_cell_add, beglon, endlon, beglat, endlat);
/* Uwe Schulzweida: skip very small regions */
......
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