Commit 53acc6c5 authored by Oliver Heidmann's avatar Oliver Heidmann
Browse files

changed all cdoVerbose inquiries to check for Options::cdoVerbose

parent e347807b
......@@ -23,6 +23,7 @@
*/
#include <cdi.h>
#include "cdoOptions.h"
#include "cdo_int.h"
#include "pstream_int.h"
......@@ -228,7 +229,7 @@ Adisit(void *process)
else
for (i = 0; i < nlevel; ++i) pressure[i] /= 10;
if (cdoVerbose)
if (Options::cdoVerbose)
{
cdoPrint("Level Pressure");
for (i = 0; i < nlevel; ++i) cdoPrint("%5d %g", i + 1, pressure[i]);
......
......@@ -2407,7 +2407,7 @@ Afterburner(void *process)
struct Control *globs = (struct Control *) Malloc(sizeof(struct Control));
after_control_init(globs);
globs->Verbose = cdoVerbose;
globs->Verbose = Options::cdoVerbose;
if (operatorArgc() == 1)
{
......
......@@ -28,6 +28,7 @@
*/
#include <cdi.h>
#include "cdoOptions.h"
#include "cdo_int.h"
#include "pstream_int.h"
......@@ -87,8 +88,8 @@ Arith(void *process)
int vlistIDx1 = vlistID1;
int vlistIDx2 = vlistID2;
if (cdoVerbose) vlistPrint(vlistID1);
if (cdoVerbose) vlistPrint(vlistID2);
if (Options::cdoVerbose) vlistPrint(vlistID1);
if (Options::cdoVerbose) vlistPrint(vlistID2);
int taxisID1 = vlistInqTaxis(vlistID1);
int taxisID2 = vlistInqTaxis(vlistID2);
......@@ -165,7 +166,7 @@ Arith(void *process)
varnmiss2.resize(nlevels2);
}
if (cdoVerbose) cdoPrint("Number of timesteps: file1 %d, file2 %d", ntsteps1, ntsteps2);
if (Options::cdoVerbose) cdoPrint("Number of timesteps: file1 %d, file2 %d", ntsteps1, ntsteps2);
if (filltype == FILL_NONE)
{
......
......@@ -26,6 +26,7 @@
*/
#include <cdi.h>
#include "cdoOptions.h"
#include "cdo_int.h"
#include "calendar.h"
......@@ -62,7 +63,7 @@ dayofyear(int calendar, int64_t vdate, int vtime)
doy += (day - 1);
doy += (second + minute * 60 + hour * 3600) / 86400.;
if (cdoVerbose) cdoPrint("vdate, vtime, dpy, doy: %d %d %d %g", vdate, vtime, dpy, doy);
if (Options::cdoVerbose) cdoPrint("vdate, vtime, dpy, doy: %d %d %d %g", vdate, vtime, dpy, doy);
return doy;
}
......@@ -135,7 +136,7 @@ Arithdays(void *process)
rconst = days_per_year(calendar, year);
}
if (cdoVerbose) cdoPrint("calendar %d year %d month %d result %g", calendar, year, month, rconst);
if (Options::cdoVerbose) cdoPrint("calendar %d year %d month %d result %g", calendar, year, month, rconst);
for (int recID = 0; recID < nrecs; recID++)
{
......
......@@ -23,6 +23,7 @@
*/
#include <cdi.h>
#include "cdoOptions.h"
#include "cdo_int.h"
#include "pstream_int.h"
......@@ -119,7 +120,7 @@ Arithlat(void *process)
else
for (size_t i = 0; i < gridsize; ++i) scale[i] = 1. / cos(scale[i]);
if (cdoVerbose)
if (Options::cdoVerbose)
for (unsigned i = 0; i < 10; ++i) cdoPrint("coslat %3d %g", i + 1, scale[i]);
}
......
......@@ -103,7 +103,7 @@ CDIread(void *process)
cdoInitialize(process);
if (cdoVerbose) cdoPrint("parameter: <nruns>");
if (Options::cdoVerbose) cdoPrint("parameter: <nruns>");
if (operatorArgc() > 1) cdoAbort("Too many arguments!");
......@@ -112,7 +112,7 @@ CDIread(void *process)
if (nruns < 0) nruns = 0;
if (nruns > 99) nruns = 99;
if (cdoVerbose) cdoPrint("nruns : %d", nruns);
if (Options::cdoVerbose) cdoPrint("nruns : %d", nruns);
// vlistDefNtsteps(vlistID, 1);
......@@ -160,7 +160,7 @@ CDIread(void *process)
}
}
if (cdoVerbose)
if (Options::cdoVerbose)
{
tw = timer_val(timer_read) - t0;
t0 = timer_val(timer_read);
......
......@@ -71,7 +71,7 @@ CDIwrite(void *process)
cdoInitialize(process);
if (cdoVerbose) cdoPrint("parameter: <nruns, <grid, <nlevs, <ntimesteps, <nvars>>>>>");
if (Options::cdoVerbose) cdoPrint("parameter: <nruns, <grid, <nlevs, <ntimesteps, <nvars>>>>>");
if (operatorArgc() > 5) cdoAbort("Too many arguments!");
......@@ -103,7 +103,7 @@ CDIwrite(void *process)
zaxisDefLevels(zaxisID, &levels[0]);
}
if (cdoVerbose)
if (Options::cdoVerbose)
{
cdoPrint("nruns : %d", nruns);
cdoPrint("gridsize : %zu", gridsize);
......@@ -207,7 +207,7 @@ CDIwrite(void *process)
}
}
if (cdoVerbose)
if (Options::cdoVerbose)
{
tw = timer_val(timer_write) - t0;
t0 = timer_val(timer_write);
......
This diff is collapsed.
......@@ -283,7 +283,7 @@ apply_cmorlist(list_t *pmlist, int nvars, int vlistID2, std::vector<CmorVar> &va
{
var.lfactor = true;
var.factor = parameter2double(value);
if (cdoVerbose) cdoPrint("%s - scale factor %g", varname, var.factor);
if (Options::cdoVerbose) cdoPrint("%s - scale factor %g", varname, var.factor);
}
else if (STR_IS_EQ(key, "missval") || STR_IS_EQ(key, "missing_value"))
{
......@@ -291,7 +291,7 @@ apply_cmorlist(list_t *pmlist, int nvars, int vlistID2, std::vector<CmorVar> &va
double missval_old = vlistInqVarMissval(vlistID2, varID);
if (!DBL_IS_EQUAL(missval, missval_old))
{
if (cdoVerbose) cdoPrint("%s - change missval from %g to %g", varname, missval_old, missval);
if (Options::cdoVerbose) cdoPrint("%s - change missval from %g to %g", varname, missval_old, missval);
var.changemissval = true;
var.missval_old = missval_old;
vlistDefVarMissval(vlistID2, varID, missval);
......@@ -324,7 +324,7 @@ apply_cmorlist(list_t *pmlist, int nvars, int vlistID2, std::vector<CmorVar> &va
}
else
{
if (cdoVerbose) cdoPrint("Attribute %s:%s not supported!", varname, key);
if (Options::cdoVerbose) cdoPrint("Attribute %s:%s not supported!", varname, key);
}
}
......
......@@ -136,7 +136,7 @@ CMOR_table(void *process)
if (operatorArgc() != 1) cdoAbort("Too few arguments!");
const char *filename = operatorArgv()[0];
if (cdoVerbose) cdoPrint("Parse file: %s", filename);
if (Options::cdoVerbose) cdoPrint("Parse file: %s", filename);
FILE *fp = fopen(filename, "r");
if (fp == NULL) cdoAbort("Open failed on: %s\n", filename);
......
......@@ -55,7 +55,7 @@ Cat(void *process)
for (int indf = 0; indf < nfiles; ++indf)
{
if (cdoVerbose) cdoPrint("Process file: %s", cdoGetStreamName(indf));
if (Options::cdoVerbose) cdoPrint("Process file: %s", cdoGetStreamName(indf));
if (cdoTimer) tw0 = timer_val(timer_cat);
int streamID1 = cdoStreamOpenRead(cdoStreamName(indf));
......@@ -92,7 +92,7 @@ Cat(void *process)
}
else
{
if (cdoVerbose) cdoPrint("Output file doesn't exist, creating: %s", cdoGetStreamName(nfiles));
if (Options::cdoVerbose) cdoPrint("Output file doesn't exist, creating: %s", cdoGetStreamName(nfiles));
streamID2 = cdoStreamOpenWrite(cdoStreamName(nfiles), cdoFiletype());
......@@ -126,7 +126,7 @@ Cat(void *process)
while ((nrecs = cdoStreamInqTimestep(streamID1, tsID1)))
{
double fstatus = (ntsteps > 1) ? indf + (tsID1 + 1.) / ntsteps : indf + 1.;
if (!cdoVerbose) progressStatus(0, 1, fstatus / nfiles);
if (!Options::cdoVerbose) progressStatus(0, 1, fstatus / nfiles);
taxisCopyTimestep(taxisID2, taxisID1);
......
......@@ -150,7 +150,7 @@ Change(void *process)
for (varID = 0; varID < nvars; varID++)
{
int param = vlistInqVarParam(vlistID2, varID);
if (cdoVerbose)
if (Options::cdoVerbose)
{
int pnum, pcat, pdis;
cdiDecodeParam(param, &pnum, &pcat, &pdis);
......
......@@ -183,14 +183,14 @@ genGrid(int ngrids, int nfiles, std::vector<ensfileType> &ef, bool ginit, int ig
}
}
if (cdoVerbose && lregular)
if (Options::cdoVerbose && lregular)
for (int fileID = 0; fileID < nfiles; fileID++) printf("1 %d %g %g \n", xyinfo[fileID].id, xyinfo[fileID].x, xyinfo[fileID].y);
if (lregular)
{
qsort(xyinfo, nfiles, sizeof(xyinfoType), cmpx);
if (cdoVerbose)
if (Options::cdoVerbose)
for (int fileID = 0; fileID < nfiles; fileID++)
printf("2 %d %g %g \n", xyinfo[fileID].id, xyinfo[fileID].x, xyinfo[fileID].y);
......@@ -199,7 +199,7 @@ genGrid(int ngrids, int nfiles, std::vector<ensfileType> &ef, bool ginit, int ig
else
qsort(xyinfo, nfiles, sizeof(xyinfoType), cmpxy_gt);
if (cdoVerbose)
if (Options::cdoVerbose)
for (int fileID = 0; fileID < nfiles; fileID++)
printf("3 %d %g %g \n", xyinfo[fileID].id, xyinfo[fileID].x, xyinfo[fileID].y);
......@@ -227,7 +227,7 @@ genGrid(int ngrids, int nfiles, std::vector<ensfileType> &ef, bool ginit, int ig
for (long i = 0; i < nx; ++i) xsize2 += xsize[xyinfo[i].id];
long ysize2 = 0;
for (long j = 0; j < ny; ++j) ysize2 += ysize[xyinfo[j * nx].id];
if (cdoVerbose) cdoPrint("xsize2 %ld ysize2 %ld", xsize2, ysize2);
if (Options::cdoVerbose) cdoPrint("xsize2 %ld ysize2 %ld", xsize2, ysize2);
std::vector<double> xvals2, yvals2;
std::vector<double> xbounds2, ybounds2;
......@@ -412,7 +412,7 @@ Collgrid(void *process)
{
char **argnames = operatorArgv() + noff;
if (cdoVerbose)
if (Options::cdoVerbose)
for (int i = 0; i < nsel; i++) fprintf(stderr, "name %d = %s\n", i + 1, argnames[i]);
std::vector<bool> selfound(nsel);
......@@ -458,7 +458,7 @@ Collgrid(void *process)
int vlistID2 = vlistCreate();
cdoVlistCopyFlag(vlistID2, vlistID1);
/*
if ( cdoVerbose )
if ( Options::cdoVerbose )
{
vlistPrint(vlistID1);
vlistPrint(vlistID2);
......@@ -545,7 +545,7 @@ Collgrid(void *process)
for (int recID = 0; recID < nrecs0; recID++)
{
pstreamInqRecord(ef[0].streamID, &varID, &levelID);
if (cdoVerbose && tsID == 0) printf(" tsID, recID, varID, levelID %d %d %d %d\n", tsID, recID, varID, levelID);
if (Options::cdoVerbose && tsID == 0) printf(" tsID, recID, varID, levelID %d %d %d %d\n", tsID, recID, varID, levelID);
for (int fileID = 1; fileID < nfiles; fileID++)
{
......@@ -557,7 +557,7 @@ Collgrid(void *process)
{
int varID2 = vlistFindVar(vlistID2, varID);
int levelID2 = vlistFindLevel(vlistID2, varID, levelID);
if (cdoVerbose && tsID == 0) printf("varID %d %d levelID %d %d\n", varID, varID2, levelID, levelID2);
if (Options::cdoVerbose && tsID == 0) printf("varID %d %d levelID %d %d\n", varID, varID2, levelID, levelID2);
double missval = vlistInqVarMissval(vlistID2, varID2);
for (size_t i = 0; i < gridsize2; i++) array2[i] = missval;
......
......@@ -269,7 +269,7 @@ void
readcmd(const char *prompt, char *line, int size)
{
fputs(prompt, stdout);
if (cdoVerbose)
if (Options::cdoVerbose)
{
char memstring[32] = { "" };
size_t memmax = getPeakRSS();
......
......@@ -115,7 +115,7 @@ Comp(void *process)
double *arrayx1 = array1.data();
double *arrayx2 = array2.data();
if (cdoVerbose) cdoPrint("Number of timesteps: file1 %d, file2 %d", ntsteps1, ntsteps2);
if (Options::cdoVerbose) cdoPrint("Number of timesteps: file1 %d, file2 %d", ntsteps1, ntsteps2);
if (filltype == FILL_NONE)
{
......
......@@ -94,7 +94,7 @@ Cond(void *process)
std::vector<double> array2(gridsize);
std::vector<double> array3(gridsize);
if (cdoVerbose) cdoPrint("Number of timesteps: file1 %d, file2 %d", ntsteps1, ntsteps2);
if (Options::cdoVerbose) cdoPrint("Number of timesteps: file1 %d, file2 %d", ntsteps1, ntsteps2);
if (filltype == FILL_NONE)
{
......
......@@ -92,7 +92,7 @@ Cond2(void *process)
std::vector<double> array3(gridsize);
std::vector<double> array4(gridsize);
if (cdoVerbose) cdoPrint("Number of timesteps: file1 %d, file2 %d, file3 %d", ntsteps1, ntsteps2, vlistNtsteps(vlistID3));
if (Options::cdoVerbose) cdoPrint("Number of timesteps: file1 %d, file2 %d, file3 %d", ntsteps1, ntsteps2, vlistNtsteps(vlistID3));
if (filltype == FILL_NONE)
{
......
......@@ -78,7 +78,7 @@ Copy(void *process)
int tsID2 = 0;
for (int indf = 0; indf < nfiles; indf++)
{
if (cdoVerbose) cdoPrint("Process file: %s", cdoGetStreamName(indf));
if (Options::cdoVerbose) cdoPrint("Process file: %s", cdoGetStreamName(indf));
int streamID1 = cdoStreamOpenRead(cdoStreamName(indf));
......
......@@ -73,7 +73,7 @@ Deltime(void *process)
}
}
if (cdoVerbose) cdoPrint("delete day %d%s", dday, cmons[dmon]);
if (Options::cdoVerbose) cdoPrint("delete day %d%s", dday, cmons[dmon]);
int streamID1 = cdoStreamOpenRead(cdoStreamName(0));
......@@ -109,7 +109,7 @@ Deltime(void *process)
{
nfound++;
copytimestep = false;
if (cdoVerbose) cdoPrint("Delete %4.4d-%2.2d-%2.2d at timestep %d", year, month, day, tsID + 1);
if (Options::cdoVerbose) cdoPrint("Delete %4.4d-%2.2d-%2.2d at timestep %d", year, month, day, tsID + 1);
}
else
copytimestep = true;
......
......@@ -78,7 +78,7 @@ Derivepar(void *process)
int nhlevf = 0;
double *vct = vlist_hybrid_vct(vlistID1, &zaxisIDh, &nvct, &nhlevf);
if (cdoVerbose)
if (Options::cdoVerbose)
for (i = 0; i < nvct / 2; ++i) cdoPrint("vct: %5d %25.17f %25.17f", i, vct[i], vct[nvct / 2 + i]);
if (zaxisIDh == -1) cdoAbort("No 3D variable with hybrid sigma pressure coordinate found!");
......@@ -96,7 +96,7 @@ Derivepar(void *process)
}
}
if (cdoVerbose && useTable) cdoPrint("Using code tables!");
if (Options::cdoVerbose && useTable) cdoPrint("Using code tables!");
for (varID = 0; varID < nvars; varID++)
{
......@@ -142,7 +142,7 @@ Derivepar(void *process)
echam_gribcodes(&gribcodes);
}
if (cdoVerbose) cdoPrint("Mode = %d Center = %d Param = %s", static_cast<int>(mode), instNum, paramstr);
if (Options::cdoVerbose) cdoPrint("Mode = %d Center = %d Param = %s", static_cast<int>(mode), instNum, paramstr);
if (code <= 0 || code == 255)
{
......@@ -191,7 +191,7 @@ Derivepar(void *process)
if (gridInqType(gridID) == GRID_SPECTRAL) cdoAbort("Spectral data unsupported!");
}
if (cdoVerbose)
if (Options::cdoVerbose)
{
cdoPrint("Found:");
if (tempID != -1) cdoPrint(" %s", var_stdname(air_temperature));
......@@ -254,7 +254,7 @@ Derivepar(void *process)
presID = psID;
}
if (cdoVerbose)
if (Options::cdoVerbose)
{
if (presID == lnpsID)
cdoPrint("using LOG(%s)", var_stdname(surface_air_pressure));
......
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