Commit 43cba0aa authored by Oliver Heidmann's avatar Oliver Heidmann
Browse files

changed all cdoVerbose inquiries to check for Options::cdoVerbos, fixed includes"

parent d1f91f69
......@@ -770,7 +770,7 @@ get_env_vars(void)
if (atoi(envstr) == 1)
{
CDO_Reset_History = TRUE;
if (cdoVerbose) fprintf(stderr, "CDO_DISABLE_HISTORY = %s\n", envstr);
if (Options::cdoVerbose) fprintf(stderr, "CDO_DISABLE_HISTORY = %s\n", envstr);
}
}
......@@ -780,7 +780,7 @@ get_env_vars(void)
if (atoi(envstr) == 1)
{
CDO_Reset_History = TRUE;
if (cdoVerbose) fprintf(stderr, "CDO_RESET_HISTORY = %s\n", envstr);
if (Options::cdoVerbose) fprintf(stderr, "CDO_RESET_HISTORY = %s\n", envstr);
}
}
......@@ -791,7 +791,7 @@ get_env_vars(void)
if (ival == 0 || ival == 1)
{
CDO_Append_History = ival;
if (cdoVerbose) fprintf(stderr, "CDO_HISTORY_INFO = %s\n", envstr);
if (Options::cdoVerbose) fprintf(stderr, "CDO_HISTORY_INFO = %s\n", envstr);
}
}
......@@ -803,7 +803,7 @@ get_env_vars(void)
if (envstr[0])
{
strncat(CDO_File_Suffix, envstr, sizeof(CDO_File_Suffix) - 1);
if (cdoVerbose) fprintf(stderr, "CDO_FILE_SUFFIX = %s\n", envstr);
if (Options::cdoVerbose) fprintf(stderr, "CDO_FILE_SUFFIX = %s\n", envstr);
}
}
......@@ -813,7 +813,7 @@ get_env_vars(void)
if (atoi(envstr) == 1)
{
strcat(CDO_File_Suffix, "NULL");
if (cdoVerbose) fprintf(stderr, "CDO_DISABLE_FILESUFFIX = %s\n", envstr);
if (Options::cdoVerbose) fprintf(stderr, "CDO_DISABLE_FILESUFFIX = %s\n", envstr);
}
}
......@@ -823,7 +823,7 @@ get_env_vars(void)
if (atoi(envstr) == 1)
{
cdoDiag = TRUE;
if (cdoVerbose) fprintf(stderr, "CDO_DIAG = %s\n", envstr);
if (Options::cdoVerbose) fprintf(stderr, "CDO_DIAG = %s\n", envstr);
}
}
......@@ -834,7 +834,7 @@ get_env_vars(void)
if (ival == 0 || ival == 1)
{
CDO_Use_FFTW = ival;
if (cdoVerbose) fprintf(stderr, "CDO_Use_FFTW = %s\n", envstr);
if (Options::cdoVerbose) fprintf(stderr, "CDO_Use_FFTW = %s\n", envstr);
}
}
......@@ -845,7 +845,7 @@ get_env_vars(void)
if (ival == 0 || ival == 1)
{
CDO_Version_Info = ival;
if (cdoVerbose) fprintf(stderr, "CDO_Version_Info = %s\n", envstr);
if (Options::cdoVerbose) fprintf(stderr, "CDO_Version_Info = %s\n", envstr);
}
}
......@@ -856,7 +856,7 @@ get_env_vars(void)
if (ival == 0 || ival == 1)
{
CDO_Color = ival;
if (cdoVerbose) fprintf(stderr, "CDO_COLOR = %s\n", envstr);
if (Options::cdoVerbose) fprintf(stderr, "CDO_COLOR = %s\n", envstr);
}
}
else if (CDO_Color == FALSE && ITSME)
......@@ -1336,7 +1336,7 @@ parse_options_long(int argc, char *argv[])
case 'u': Options::cdoInteractive = TRUE; break;
case 'V': Version = 1; break;
case 'v':
cdoVerbose = TRUE;
Options::cdoVerbose = TRUE;
_Verbose = 1;
break;
case 'W': /* Warning messages */ _Verbose = 1; break;
......@@ -1810,7 +1810,7 @@ main(int argc, char *argv[])
fprintf(stderr, "Warning: Number of OMP threads is greater than number of Cores=%d!\n", omp_get_num_procs());
if (Threading::ompNumThreads < numThreads)
fprintf(stderr, "Warning: omp_get_max_threads() returns %d!\n", Threading::ompNumThreads);
if (cdoVerbose)
if (Options::cdoVerbose)
{
fprintf(stderr, " OpenMP: num_procs=%d max_threads=%d", omp_get_num_procs(), omp_get_max_threads());
#ifdef HAVE_OPENMP4
......
......@@ -32,6 +32,7 @@ bool cdoCompress = false;
int cdoCompType = CDI_COMPRESS_NONE;
int cdoCompLevel = 0;
bool cdoInteractive = false;
bool cdoVerbose = false;
} // namespace Options
namespace Threading
......
......@@ -31,6 +31,7 @@ extern bool cdoCompress;
extern int cdoCompType;
extern int cdoCompLevel;
extern bool cdoInteractive;
extern bool cdoVerbose;
} // namespace Options
namespace Threading
......
......@@ -15,6 +15,7 @@
GNU General Public License for more details.
*/
#include <cdi.h>
#include "cdoOptions.h"
#include "cdo_int.h"
bool *
......@@ -42,12 +43,12 @@ cdo_read_timestepmask(const char *maskfile, int *n)
nts = 0;
while (streamInqTimestep(streamID, nts)) nts++;
if (cdoVerbose) cdoPrint("%s: counted %i timeSteps in %s", __func__, nts, maskfile);
if (Options::cdoVerbose) cdoPrint("%s: counted %i timeSteps in %s", __func__, nts, maskfile);
streamClose(streamID);
streamID = streamOpenRead(maskfile);
}
else if (cdoVerbose)
else if (Options::cdoVerbose)
cdoPrint("%s: found %i timeSteps in %s", __func__, nts, maskfile);
*n = nts;
......
......@@ -18,6 +18,7 @@
#include <algorithm>
#include <cdi.h>
#include "cdoOptions.h"
#include "cdo_int.h"
#include "util_string.h"
#include "cdo_vlist.h"
......@@ -422,7 +423,7 @@ vlist_read_vct(int vlistID, int *rzaxisIDh, int *rnvct, int *rnhlev, int *rnhlev
int nlevel = zaxisInqSize(zaxisID);
int zaxistype = zaxisInqType(zaxisID);
if (cdoVerbose)
if (Options::cdoVerbose)
cdoPrint("ZAXIS_HYBRID = %d ZAXIS_HYBRID_HALF=%d nlevel=%d mono_level=%d", zaxisInqType(zaxisID) == ZAXIS_HYBRID,
zaxisInqType(zaxisID) == ZAXIS_HYBRID_HALF, nlevel, mono_level);
......@@ -453,7 +454,7 @@ vlist_read_vct(int vlistID, int *rzaxisIDh, int *rnvct, int *rnhlev, int *rnhlev
vct = (double *) Malloc(nvct * sizeof(double));
zaxisInqVct(zaxisID, vct);
if (cdoVerbose)
if (Options::cdoVerbose)
cdoPrint("Detected half-level model definition : nlevel == (nvct/2 - 1) (nlevel: %d, nvct: %d, nhlevf: %d, "
"nhlevh: %d) ",
nlevel, nvct, nhlevf, nhlevh);
......@@ -471,7 +472,7 @@ vlist_read_vct(int vlistID, int *rzaxisIDh, int *rnvct, int *rnhlev, int *rnhlev
vct = (double *) Malloc(nvct * sizeof(double));
zaxisInqVct(zaxisID, vct);
if (cdoVerbose)
if (Options::cdoVerbose)
cdoPrint(
"Detected full-level model definition : nlevel == (nvct/2) (nlevel: %d, nvct: %d, nhlevf: %d, nhlevh: %d) ",
nlevel, nvct, nhlevf, nhlevh);
......@@ -514,7 +515,7 @@ vlist_read_vct(int vlistID, int *rzaxisIDh, int *rnvct, int *rnhlev, int *rnhlev
}
}
if (cdoVerbose)
if (Options::cdoVerbose)
{
for (int i = 0; i < vctsize / 2; i++)
fprintf(stdout, "%5d %25.17f %25.17f\n", i, vct[i], vct[vctsize / 2 + i]);
......@@ -587,7 +588,7 @@ vlist_get_psvarid(int vlistID, int zaxisID)
break;
}
}
if (cdoVerbose && psvarid == -1) cdoWarning("Surface pressure variable not found - %s", psname);
if (Options::cdoVerbose && psvarid == -1) cdoWarning("Surface pressure variable not found - %s", psname);
}
return psvarid;
......
......@@ -72,16 +72,16 @@ get_converter(char *src_unit_str, char *tgt_unit_str, int *rstatus)
status = ut_get_status();
if (status == UT_PARSE)
{
if (cdoVerbose) cdoWarning("Udunits: Couldn't parse unit database!");
if (Options::cdoVerbose) cdoWarning("Udunits: Couldn't parse unit database!");
}
if (status == UT_OPEN_ENV || status == UT_OPEN_DEFAULT || status == UT_OS)
{
if (cdoVerbose) cdoWarning("Udunits: %s", strerror(errno));
if (Options::cdoVerbose) cdoWarning("Udunits: %s", strerror(errno));
}
errno = 0;
if (status != UT_SUCCESS)
{
if (cdoVerbose) cdoWarning("Udunits: Error reading units system!");
if (Options::cdoVerbose) cdoWarning("Udunits: Error reading units system!");
return NULL;
}
}
......@@ -90,7 +90,7 @@ get_converter(char *src_unit_str, char *tgt_unit_str, int *rstatus)
src_unit = ut_parse(ut_read, src_unit_str, UT_ASCII);
if (ut_get_status() != UT_SUCCESS)
{
if (cdoVerbose) cdoWarning("Udunits: Error parsing units: [%s]", src_unit_str);
if (Options::cdoVerbose) cdoWarning("Udunits: Error parsing units: [%s]", src_unit_str);
return NULL;
}
......@@ -98,7 +98,7 @@ get_converter(char *src_unit_str, char *tgt_unit_str, int *rstatus)
tgt_unit = ut_parse(ut_read, tgt_unit_str, UT_ASCII);
if (ut_get_status() != UT_SUCCESS)
{
if (cdoVerbose) cdoWarning("Udunits: Error parsing units: [%s]", tgt_unit_str);
if (Options::cdoVerbose) cdoWarning("Udunits: Error parsing units: [%s]", tgt_unit_str);
return NULL;
}
......@@ -116,7 +116,7 @@ get_converter(char *src_unit_str, char *tgt_unit_str, int *rstatus)
ut_units_converter = ut_get_converter(src_unit, tgt_unit);
if (ut_units_converter == NULL || ut_get_status() != UT_SUCCESS)
{
if (cdoVerbose) cdoWarning("Udunits: Error getting converter from [%s] to [%s]", src_unit_str, tgt_unit_str);
if (Options::cdoVerbose) cdoWarning("Udunits: Error getting converter from [%s] to [%s]", src_unit_str, tgt_unit_str);
}
else
*rstatus = 0;
......@@ -125,14 +125,14 @@ get_converter(char *src_unit_str, char *tgt_unit_str, int *rstatus)
ut_free(src_unit);
if (ut_get_status() != UT_SUCCESS)
{
if (cdoVerbose) cdoWarning("Udunits: Error freeing units [%s]", src_unit_str);
if (Options::cdoVerbose) cdoWarning("Udunits: Error freeing units [%s]", src_unit_str);
return NULL;
}
ut_free(tgt_unit);
if (ut_get_status() != UT_SUCCESS)
{
if (cdoVerbose) cdoWarning("Udunits: Error freeing units [%s]", tgt_unit_str);
if (Options::cdoVerbose) cdoWarning("Udunits: Error freeing units [%s]", tgt_unit_str);
return NULL;
}
......@@ -175,7 +175,7 @@ cdoConvertUnits(void **ut_converter, bool *changeunits, char *units, char *units
{
if (status == -2)
{
if (cdoVerbose) cdoPrint("%s - not converted from [%s] to [%s], units are equal!", name, units_old, units);
if (Options::cdoVerbose) cdoPrint("%s - not converted from [%s] to [%s], units are equal!", name, units_old, units);
}
else if (status == -3)
{
......@@ -187,7 +187,7 @@ cdoConvertUnits(void **ut_converter, bool *changeunits, char *units, char *units
}
else
{
// if ( cdoVerbose )
// if ( Options::cdoVerbose )
{
char buf[64];
cv_get_expression((const cv_converter *) *ut_converter, buf, sizeof(buf), name);
......
......@@ -15,6 +15,7 @@
GNU General Public License for more details.
*/
#include <cdi.h>
#include "cdoOptions.h"
#include "cdo_int.h"
#include "datetime.h"
#include "util_string.h"
......@@ -64,7 +65,7 @@ getTimestatDate(TimeStat *tstat_date)
if (env_date != TimeStat::UNDEF)
{
*tstat_date = env_date;
if (cdoVerbose) cdoPrint("Set CDO_TIMESTAT_DATE to %s", envstr);
if (Options::cdoVerbose) cdoPrint("Set CDO_TIMESTAT_DATE to %s", envstr);
}
}
}
......
......@@ -18,6 +18,7 @@
#include <cmath>
#include <cdi.h>
#include "cdoOptions.h"
#include "cdo_int.h"
#include "field.h"
......@@ -707,7 +708,7 @@ expr_var_var(int init, int oper, nodeType *p1, nodeType *p2)
static void
ex_copy_var(int init, nodeType *p2, nodeType *p1)
{
if (cdoVerbose)
if (Options::cdoVerbose)
cdoPrint("\t%s\tcopy\t%s[L%zu][N%zu] = %s[L%zu][N%zu]", ExIn[init], p2->param.name, p2->param.nlev, p2->param.ngp,
p1->param.name, p2->param.nlev, p2->param.ngp);
......@@ -736,7 +737,7 @@ ex_copy_con(int init, nodeType *p2, nodeType *p1)
{
double cval = p1->u.con.value;
if (cdoVerbose) cdoPrint("\t%s\tcopy\t%s[L%zu][N%zu] = %g", ExIn[init], p2->param.name, p2->param.nlev, p2->param.ngp, cval);
if (Options::cdoVerbose) cdoPrint("\t%s\tcopy\t%s[L%zu][N%zu] = %g", ExIn[init], p2->param.name, p2->param.nlev, p2->param.ngp, cval);
size_t ngp = p2->param.ngp;
assert(ngp > 0);
......@@ -767,7 +768,7 @@ expr(int init, int oper, nodeType *p1, nodeType *p2)
const char *coper = "???";
if (cdoVerbose)
if (Options::cdoVerbose)
{
switch (oper)
{
......@@ -794,28 +795,28 @@ expr(int init, int oper, nodeType *p1, nodeType *p2)
if (p1->type == typeVar && p2->type == typeVar)
{
p = expr_var_var(init, oper, p1, p2);
if (cdoVerbose)
if (Options::cdoVerbose)
cdoPrint("\t%s\tarith\t%s[L%zu][N%zu] = %s %s %s", ExIn[init], p->u.var.nm, p->param.nlev, p->param.ngp, p1->u.var.nm,
coper, p2->u.var.nm);
}
else if (p1->type == typeVar && p2->type == typeCon)
{
p = expr_var_con(init, oper, p1, p2);
if (cdoVerbose)
if (Options::cdoVerbose)
cdoPrint("\t%s\tarith\t%s[L%zu][N%zu] = %s %s %g", ExIn[init], p->u.var.nm, p->param.nlev, p->param.ngp, p1->u.var.nm,
coper, p2->u.con.value);
}
else if (p1->type == typeCon && p2->type == typeVar)
{
p = expr_con_var(init, oper, p1, p2);
if (cdoVerbose)
if (Options::cdoVerbose)
cdoPrint("\t%s\tarith\t%s[L%zu][N%zu] = %g %s %s", ExIn[init], p->u.var.nm, p->param.nlev, p->param.ngp, p1->u.con.value,
coper, p2->u.var.nm);
}
else if (p1->type == typeCon && p2->type == typeCon)
{
p = expr_con_con(oper, p1, p2);
if (cdoVerbose) cdoPrint("\t%s\tarith\t%g = %g %s %g", ExIn[init], p->u.con.value, p1->u.con.value, coper, p2->u.con.value);
if (Options::cdoVerbose) cdoPrint("\t%s\tarith\t%g = %g %s %g", ExIn[init], p->u.con.value, p1->u.con.value, coper, p2->u.con.value);
}
else
cdoAbort("Internal problem!");
......@@ -832,7 +833,7 @@ ex_fun0_con(int init, int funcID, double *data)
int functype = fun_sym_tbl[funcID].type;
if (functype != FT_0) cdoAbort("Function %s not available for constant values!", fun_sym_tbl[funcID].name);
if (cdoVerbose) cdoPrint("\t%s\tfunc\t%s", ExIn[init], fun_sym_tbl[funcID].name);
if (Options::cdoVerbose) cdoPrint("\t%s\tfunc\t%s", ExIn[init], fun_sym_tbl[funcID].name);
nodeType *p = (nodeType *) Calloc(1, sizeof(nodeType));
......@@ -1016,12 +1017,12 @@ ex_fun(int init, int funcID, nodeType *p1)
if (p1->type == typeVar)
{
if (cdoVerbose) cdoPrint("\t%s\tfunc\t%s (%s)", ExIn[init], fun_sym_tbl[funcID].name, p1->u.var.nm);
if (Options::cdoVerbose) cdoPrint("\t%s\tfunc\t%s (%s)", ExIn[init], fun_sym_tbl[funcID].name, p1->u.var.nm);
p = ex_fun_var(init, funcID, p1);
}
else if (p1->type == typeCon)
{
if (cdoVerbose) cdoPrint("\t%s\tfunc\t%s (%g)", ExIn[init], fun_sym_tbl[funcID].name, p1->u.con.value);
if (Options::cdoVerbose) cdoPrint("\t%s\tfunc\t%s (%g)", ExIn[init], fun_sym_tbl[funcID].name, p1->u.con.value);
p = ex_fun_con(funcID, p1);
}
else
......@@ -1354,12 +1355,12 @@ ex_uminus(int init, nodeType *p1)
if (p1->type == typeVar)
{
if (cdoVerbose) cdoPrint("\t%s\tneg\t- (%s)", ExIn[init], p1->u.var.nm);
if (Options::cdoVerbose) cdoPrint("\t%s\tneg\t- (%s)", ExIn[init], p1->u.var.nm);
p = ex_uminus_var(init, p1);
}
else if (p1->type == typeCon)
{
if (cdoVerbose) cdoPrint("\t%s\tneg\t- (%g)", ExIn[init], p1->u.con.value);
if (Options::cdoVerbose) cdoPrint("\t%s\tneg\t- (%g)", ExIn[init], p1->u.con.value);
p = ex_uminus_con(p1);
}
else
......@@ -1427,12 +1428,12 @@ ex_not(int init, nodeType *p1)
if (p1->type == typeVar)
{
if (cdoVerbose) cdoPrint("\t%s\tnot\t! (%s)", ExIn[init], p1->u.var.nm);
if (Options::cdoVerbose) cdoPrint("\t%s\tnot\t! (%s)", ExIn[init], p1->u.var.nm);
p = ex_not_var(init, p1);
}
else if (p1->type == typeCon)
{
if (cdoVerbose) cdoPrint("\t%s\tnot\t! (%g)", ExIn[init], p1->u.con.value);
if (Options::cdoVerbose) cdoPrint("\t%s\tnot\t! (%g)", ExIn[init], p1->u.con.value);
p = ex_not_con(p1);
}
else
......@@ -1446,7 +1447,7 @@ ex_ifelse(int init, nodeType *p1, nodeType *p2, nodeType *p3)
{
if (p1->type == typeCon) cdoAbort("expr?expr:expr: First expression is a constant but must be a variable!");
if (cdoVerbose)
if (Options::cdoVerbose)
{
fprintf(stderr, "cdo expr:\t%s\tifelse\t%s[L%zu][N%zu] ? ", ExIn[init], p1->u.var.nm, p1->param.nlev, p1->param.ngp);
if (p2->type == typeCon)
......
......@@ -15,6 +15,7 @@
*/
#include <cdi.h>
#include "cdoOptions.h"
#include "cdo_int.h"
#include "grid.h"
......@@ -550,7 +551,7 @@ gridGenArea(int gridID, double *area)
cdoAbort("Internal error! Unsupported gridtype: %s", gridNamePtr(gridtype));
}
if (cdoVerbose)
if (Options::cdoVerbose)
{
double total_area = 0;
for (size_t i = 0; i < gridsize; ++i) total_area += area[i];
......
......@@ -19,6 +19,8 @@
#include "cdo_int.h"
#include "grid.h"
#include <cstring>
/*
@Function cdo_define_destagered_grid
@Title Define a de-staggered grid for U and V
......@@ -343,6 +345,7 @@ cdo_define_subgrid_grid(int gridSrcID, int subI0, int subI1, int subJ0, int subJ
cdoAbort("%s() Error; Only LCC grid is supported; use selindexbox!", __func__);
double lon_0, lat_0, lat_1, lat_2, a, rf, xval_0, yval_0, x_0, y_0;
double grid_missval = cdiInqMissval();
gridInqParamLCC(gridSrcID, grid_missval, &lon_0, &lat_0, &lat_1, &lat_2, &a, &rf, &xval_0, &yval_0, &x_0, &y_0);
x_0 = grid_missval;
......
......@@ -221,7 +221,7 @@ gps_create_kdtree(size_t n, const double *restrict lons, const double *restrict
gps->max[j] = max[j];
}
if (cdoVerbose) cdoPrint("BBOX: min=%g/%g/%g max=%g/%g/%g", min[0], min[1], min[2], max[0], max[1], max[2]);
if (Options::cdoVerbose) cdoPrint("BBOX: min=%g/%g/%g max=%g/%g/%g", min[0], min[1], min[2], max[0], max[1], max[2]);
kdTree_t *kdt = kd_buildTree(pointlist, n, min, max, 3, Threading::ompNumThreads);
if (pointlist) Free(pointlist);
......@@ -312,7 +312,7 @@ gps_create_spherepart(size_t n, const double *restrict lons, const double *restr
gps->max[j] = max[j];
}
if (cdoVerbose) cdoPrint("BBOX: min=%g/%g/%g max=%g/%g/%g", min[0], min[1], min[2], max[0], max[1], max[2]);
if (Options::cdoVerbose) cdoPrint("BBOX: min=%g/%g/%g max=%g/%g/%g", min[0], min[1], min[2], max[0], max[1], max[2]);
return (void *) yac_point_sphere_part_search_new(n, gps->coordinates_xyz);
}
......@@ -349,7 +349,7 @@ gps_destroy_spherepart(void *search_container)
static void *
gps_create_full(size_t n, const double *restrict lons, const double *restrict lats)
{
if (cdoVerbose) cdoPrint("Init full grid search: n=%zu", n);
if (Options::cdoVerbose) cdoPrint("Init full grid search: n=%zu", n);
struct gpsFull *full = (struct gpsFull *) Calloc(1, sizeof(struct gpsFull));
......@@ -393,7 +393,7 @@ gridPointSearchCreate(bool xIsCyclic, size_t dims[2], size_t n, const double *lo
gps->plats = lats;
// clang-format off
if (cdoVerbose)
if (Options::cdoVerbose)
{
if (gps->method == PointSearchMethod::kdtree) cdoPrint("Point search method: kdtree");
else if (gps->method == PointSearchMethod::full) cdoPrint("Point search method: full");
......
......@@ -31,11 +31,12 @@
#include <vector>
#include <iostream>
#include <cstring>
#include <cdi.h>
#include "cdo_int.h"
#include "grid.h"
#include "grid_proj.h"
#include "exception.h"
#include "compare.h"
#ifdef HAVE_LIBPROJ
static char *
......@@ -61,6 +62,7 @@ gen_param(const char *fmt, ...)
static void
verify_lcc_parameter(double lon_0, double lat_0, double lat_1, double lat_2, double a, double rf, double x_0, double y_0)
{
double grid_missval = cdiInqMissval();
const char *projection = "lambert_conformal_conic";
if (IS_NOT_EQUAL(a, grid_missval) && a > 1.e10) cdoWarning("%s mapping parameter %s out of bounds!", projection, "earth_radius");
......@@ -96,7 +98,7 @@ proj_lonlat_to_lcc(double missval, double lon_0, double lat_0, double lat_1, dou
params[nbpar++] = gen_param("units=m");
// params[nbpar++] = gen_param("no_defs");
if (cdoVerbose)
if (Options::cdoVerbose)
for (int i = 0; i < nbpar; ++i) cdoPrint("Proj.param[%d] = %s", i + 1, params[i]);
projPJ proj = pj_init(nbpar, &params[0]);
......@@ -149,6 +151,7 @@ lonlat_to_lcc(double missval, double lon_0, double lat_0, double lat_1, double l
int
cdo_lonlat_to_lcc(int gridID, size_t nvals, double *xvals, double *yvals)
{
double grid_missval = cdiInqMissval();
double lon_0, lat_0, lat_1, lat_2, a, rf, xval_0, yval_0, x_0, y_0;
gridInqParamLCC(gridID, grid_missval, &lon_0, &lat_0, &lat_1, &lat_2, &a, &rf, &xval_0, &yval_0, &x_0, &y_0);
......@@ -161,6 +164,7 @@ int
proj_lcc_to_lonlat(double missval, double lon_0, double lat_0, double lat_1, double lat_2, double a, double rf, double x_0,
double y_0, size_t nvals, double *xvals, double *yvals)
{
double grid_missval = cdiInqMissval();
int status = 0;
#ifdef HAVE_LIBPROJ
char *params[20];
......@@ -176,7 +180,7 @@ proj_lcc_to_lonlat(double missval, double lon_0, double lat_0, double lat_1, dou
if (IS_NOT_EQUAL(x_0, grid_missval)) params[nbpar++] = gen_param("x_0=%g", x_0);
if (IS_NOT_EQUAL(y_0, grid_missval)) params[nbpar++] = gen_param("y_0=%g", y_0);
if (cdoVerbose)
if (Options::cdoVerbose)
for (int i = 0; i < nbpar; ++i) cdoPrint("Proj.param[%d] = %s", i + 1, params[i]);
projPJ proj = pj_init(nbpar, &params[0]);
......@@ -229,6 +233,7 @@ lcc_to_lonlat(double missval, double lon_0, double lat_0, double lat_1, double l
int
cdo_lcc_to_lonlat(int gridID, size_t nvals, double *xvals, double *yvals)
{
double grid_missval = cdiInqMissval();
const char *projection = "lambert_conformal_conic";
double lon_0, lat_0, lat_1, lat_2, a, rf, xval_0, yval_0, x_0, y_0;
......@@ -311,7 +316,7 @@ cdo_sinu_to_lonlat(size_t nvals, double *xvals, double *yvals)
params[nbpar++] = gen_param("proj=sinu");
params[nbpar++] = gen_param("ellps=WGS84");
if (cdoVerbose)
if (Options::cdoVerbose)
for (int i = 0; i < nbpar; ++i) cdoPrint("Proj.param[%d] = %s", i + 1, params[i]);
projPJ proj = pj_init(nbpar, params);
......@@ -429,7 +434,7 @@ cdo_laea_to_lonlat(int gridID, size_t nvals, double *xvals, double *yvals)
if (IS_NOT_EQUAL(x_0, 0)) params[nbpar++] = gen_param("x_0=%g", x_0);
if (IS_NOT_EQUAL(y_0, 0)) params[nbpar++] = gen_param("y_0=%g", y_0);
if (cdoVerbose)
if (Options::cdoVerbose)
for (int i = 0; i < nbpar; ++i) cdoPrint("Proj.param[%d] = %s", i + 1, params[i]);
projPJ proj = pj_init(nbpar, &params[0]);
......@@ -479,7 +484,7 @@ cdo_proj_to_lonlat(char *proj4param, size_t nvals, double *xvals, double *yvals)
if (!lend) *cend = ' ';
}
if (cdoVerbose)
if (Options::cdoVerbose)
for (int i = 0; i < nbpar; ++i) cdoPrint("Proj.param[%d] = %s", i + 1, params[i]);
projPJ proj = pj_init(nbpar, &params[0]);
......
......@@ -21,6 +21,7 @@
#include <limits.h>
#include <cdi.h>
#include "cdoOptions.h"
#include "cdo_int.h"
#include "grid.h"
#include "griddes.h"
......
......@@ -25,6 +25,7 @@
#endif
#include <cdi.h>
#include "cdoOptions.h"
#include "cdo_int.h"
#include "griddes.h"
......@@ -46,13 +47,13 @@ obj_info(hid_t loc_id, const char *name, void *objname)
switch (obj_type)
{
case H5G_GROUP:
if (cdoVerbose) cdoPrint("HDF5 object '%s' is a group", name);
if (Options::cdoVerbose) cdoPrint("HDF5 object '%s' is a group", name);
break;
case H5G_DATASET:
if (cdoVerbose) cdoPrint("HDF5 object '%s' is a dataset", name);
if (Options::cdoVerbose) cdoPrint("HDF5 object '%s' is a dataset", name);
break;
case H5G_TYPE:
if (cdoVerbose) cdoPrint("HDF5 object '%s' is a named datatype", name);
if (Options::cdoVerbose) cdoPrint("HDF5 object '%s' is a named datatype", name);
break;
default:
/*cdoAbort(" Unable to identify an object %s", name);*/
......@@ -283,7 +284,7 @@ gridFromH5file(const char *gridfile)
if (rank != 2)
{
// if ( cdoVerbose ) cdoWarning("Unexpected rank = %d!", rank);
// if ( Options::cdoVerbose ) cdoWarning("Unexpected rank = %d!", rank);
goto RETURN;
}
......@@ -435,7 +436,7 @@ gridFromH5file(const char *gridfile)
if (rank != 2)
{
// if ( cdoVerbose ) cdoWarning("Unexpected rank = %d!", rank);
// if ( Options::cdoVerbose ) cdoWarning("Unexpected rank = %d!", rank);
goto RETURN;