Commit b507a665 authored by Oliver Heidmann's avatar Oliver Heidmann
Browse files

refactored cdo string compare functions

parent 416944c3
Pipeline #4501 passed with stages
in 19 minutes and 11 seconds
......@@ -185,18 +185,18 @@ Adisit(void *process)
cdiInqKeyString(vlistID1, varID, CDI_KEY_STDNAME, stdname, &length);
cstrToLowerCase(stdname);
if (cstrIsEqual(varname, "s") || cstrIsEqual(stdname, "sea_water_salinity"))
if (cdo_cmpstr(varname, "s") || cdo_cmpstr(stdname, "sea_water_salinity"))
code = 5;
else if (cstrIsEqual(varname, "t"))
else if (cdo_cmpstr(varname, "t"))
code = 2;
if (operatorID == ADISIT)
{
if (cstrIsEqual(stdname, "sea_water_potential_temperature")) code = 2;
if (cdo_cmpstr(stdname, "sea_water_potential_temperature")) code = 2;
}
else
{
if (cstrIsEqual(stdname, "sea_water_temperature")) code = 2;
if (cdo_cmpstr(stdname, "sea_water_temperature")) code = 2;
}
}
......
......@@ -236,7 +236,7 @@ applyCmorList(PMList &pmlist, int nvars, int vlistID2, std::vector<CmorVar> &var
else if (key == "out_name")
{
const auto outname = parameter2word(value.c_str());
if (!cstrIsEqual(var.name, outname))
if (!cdo_cmpstr(var.name, outname))
{
cdiDefKeyString(vlistID2, varID, CDI_KEY_NAME, outname);
cdiDefAttTxt(vlistID2, varID, "original_name", (int) strlen(var.name), var.name);
......
......@@ -91,18 +91,18 @@ Change_e5slm(void *process)
if (code < 0)
{
// clang-format off
if (cstrIsEqual(name, "SLM") ) code = 172;
else if (cstrIsEqual(name, "ALAKE") ) code = 99;
else if (cstrIsEqual(name, "WS") ) code = 140;
else if (cstrIsEqual(name, "AZ0") ) code = 173;
else if (cstrIsEqual(name, "ALB") ) code = 174;
else if (cstrIsEqual(name, "VGRAT") ) code = 198;
else if (cstrIsEqual(name, "FOREST") ) code = 212;
else if (cstrIsEqual(name, "FAO") ) code = 226;
else if (cstrIsEqual(name, "WSMX") ) code = 229;
else if (cstrIsEqual(name, "GLAC") ) code = 232;
else if (cstrIsEqual(name, "VLTCLIM") ) code = 71;
else if (cstrIsEqual(name, "VGRATCLIM")) code = 70;
if (cdo_cmpstr(name, "SLM") ) code = 172;
else if (cdo_cmpstr(name, "ALAKE") ) code = 99;
else if (cdo_cmpstr(name, "WS") ) code = 140;
else if (cdo_cmpstr(name, "AZ0") ) code = 173;
else if (cdo_cmpstr(name, "ALB") ) code = 174;
else if (cdo_cmpstr(name, "VGRAT") ) code = 198;
else if (cdo_cmpstr(name, "FOREST") ) code = 212;
else if (cdo_cmpstr(name, "FAO") ) code = 226;
else if (cdo_cmpstr(name, "WSMX") ) code = 229;
else if (cdo_cmpstr(name, "GLAC") ) code = 232;
else if (cdo_cmpstr(name, "VLTCLIM") ) code = 71;
else if (cdo_cmpstr(name, "VGRATCLIM")) code = 70;
// clang-format on
}
......
......@@ -157,16 +157,16 @@ Derivepar(void *process)
if (code < 0)
{
// clang-format off
if (sgeopotID == -1 && cstrIsEqual(varname, "geosp")) code = gribcodes.geopot;
else if (psID == -1 && cstrIsEqual(varname, "aps")) code = gribcodes.ps;
else if (psID == -1 && cstrIsEqual(varname, "ps")) code = gribcodes.ps;
else if (lnpsID == -1 && cstrIsEqual(varname, "lsp")) code = gribcodes.lsp;
else if (lnpsID2 == -1 && cstrIsEqual(varname, "lnps")) code = 777;
else if (tempID == -1 && cstrIsEqual(varname, "t")) code = gribcodes.temp;
else if (humID == -1 && cstrIsEqual(varname, "q")) code = gribcodes.hum;
// else if ( geopotID == -1 && cstrIsEqual(stdname, "geopotential_full")) code = gribcodes.geopot;
// else if (cstrIsEqual(varname, "clwc")) code = 246;
// else if (cstrIsEqual(varname, "ciwc")) code = 247;
if (sgeopotID == -1 && cdo_cmpstr(varname, "geosp")) code = gribcodes.geopot;
else if (psID == -1 && cdo_cmpstr(varname, "aps")) code = gribcodes.ps;
else if (psID == -1 && cdo_cmpstr(varname, "ps")) code = gribcodes.ps;
else if (lnpsID == -1 && cdo_cmpstr(varname, "lsp")) code = gribcodes.lsp;
else if (lnpsID2 == -1 && cdo_cmpstr(varname, "lnps")) code = 777;
else if (tempID == -1 && cdo_cmpstr(varname, "t")) code = gribcodes.temp;
else if (humID == -1 && cdo_cmpstr(varname, "q")) code = gribcodes.hum;
// else if ( geopotID == -1 && cdo_cmpstr(stdname, "geopotential_full")) code = gribcodes.geopot;
// else if (cdo_cmpstr(varname, "clwc")) code = 246;
// else if (cdo_cmpstr(varname, "ciwc")) code = 247;
// clang-format on
}
}
......
......@@ -465,7 +465,7 @@ Intlevel(void *process)
{
for (varID = 0; varID < nvars; varID++)
{
if (cstrIsEqual(zvarname.c_str(), varList1[varID].name))
if (cdo_cmpstr(zvarname.c_str(), varList1[varID].name))
{
zvarID = varID;
break;
......
......@@ -727,10 +727,10 @@ VerifyGraphParameters(int num_param, std::vector<std::string> &param_names)
{
for (j = 0; j < graph_param_count; ++j)
{
if (cstrIsEqual(split_str[0], graph_params[j]))
if (cdo_cmpstr(split_str[0], graph_params[j]))
{
found = true;
if (cstrIsEqual(split_str[0], "obsv") || cstrIsEqual(split_str[0], "stat"))
if (cdo_cmpstr(split_str[0], "obsv") || cdo_cmpstr(split_str[0], "stat"))
{
if (cstrIsNumeric(split_str[1]))
syntax = false;
......@@ -742,31 +742,31 @@ VerifyGraphParameters(int num_param, std::vector<std::string> &param_names)
}
}
if (cstrIsEqual(split_str[0], "ymin") || cstrIsEqual(split_str[0], "ymax") || cstrIsEqual(split_str[0], "sigma")
|| cstrIsEqual(split_str[0], "linewidth"))
if (cdo_cmpstr(split_str[0], "ymin") || cdo_cmpstr(split_str[0], "ymax") || cdo_cmpstr(split_str[0], "sigma")
|| cdo_cmpstr(split_str[0], "linewidth"))
{
if (!cstrIsNumeric(split_str[1])) syntax = false;
}
if (cstrIsEqual(split_str[0], "device"))
if (cdo_cmpstr(split_str[0], "device"))
{
if (cstrIsNumeric(split_str[1]))
syntax = false;
else
{
if (cstrIsEqual(split_str[0], "device"))
if (cdo_cmpstr(split_str[0], "device"))
{
if (DBG) fprintf(stderr, "Parameter value '%s'\n", split_str[1]);
if (checkdevice(split_str[1])) syntax = false;
/* Graph not supported in google earth format */
if (cstrIsEqual(split_str[1], "GIF_ANIMATION") || cstrIsEqual(split_str[1], "gif_animation"))
if (cdo_cmpstr(split_str[1], "GIF_ANIMATION") || cdo_cmpstr(split_str[1], "gif_animation"))
{
syntax = false;
fprintf(stderr, "Animation not supported for Graph!\n");
if (DBG) fprintf(stderr, "Parameter value '%s'\n", split_str[1]);
}
if (cstrIsEqual(split_str[1], "KML") || cstrIsEqual(split_str[1], "kml"))
if (cdo_cmpstr(split_str[1], "KML") || cdo_cmpstr(split_str[1], "kml"))
{
syntax = false;
fprintf(stderr, " 'kml' format not supported "
......@@ -778,7 +778,7 @@ VerifyGraphParameters(int num_param, std::vector<std::string> &param_names)
}
/*
if( cstrIsEqual( split_str[0],"xml" ) )
if( cdo_cmpstr( split_str[0],"xml" ) )
{
if( ( fp = fopen( split_str[1],"r") ) == nullptr )
{
......
......@@ -207,29 +207,29 @@ magplot(const char *plotfile, int operatorID, const char *varname, const char *u
sep_char = "=";
split_str_count = cstrSplitWithSeperator(params[i].c_str(), sep_char, &split_str);
if (cstrIsEqual(split_str[0], "min")) fprintf(stderr, "Min Val %g\n", YMIN);
if (cstrIsEqual(split_str[0], "max")) fprintf(stderr, "Max Val %g\n", YMAX);
// if ( cstrIsEqual( split_str[0],"resolution" ) ) fprintf(stderr,"RESOLUTION %g\n",RESOLUTION );
if (cstrIsEqual(split_str[0], "colour")) fprintf(stderr, "COLOUR %s\n", COLOUR);
if (cstrIsEqual(split_str[0], "colour_min")) fprintf(stderr, "COLOUR %s\n", COLOUR_MIN);
if (cstrIsEqual(split_str[0], "colour_max")) fprintf(stderr, "COLOUR %s\n", COLOUR_MAX);
if (cstrIsEqual(split_str[0], "interval")) fprintf(stderr, "INTERVAL %f\n", INTERVAL);
if (cstrIsEqual(split_str[0], "count")) fprintf(stderr, "COUNT %d\n", COUNT);
if (cstrIsEqual(split_str[0], "list"))
if (cdo_cmpstr(split_str[0], "min")) fprintf(stderr, "Min Val %g\n", YMIN);
if (cdo_cmpstr(split_str[0], "max")) fprintf(stderr, "Max Val %g\n", YMAX);
// if ( cdo_cmpstr( split_str[0],"resolution" ) ) fprintf(stderr,"RESOLUTION %g\n",RESOLUTION );
if (cdo_cmpstr(split_str[0], "colour")) fprintf(stderr, "COLOUR %s\n", COLOUR);
if (cdo_cmpstr(split_str[0], "colour_min")) fprintf(stderr, "COLOUR %s\n", COLOUR_MIN);
if (cdo_cmpstr(split_str[0], "colour_max")) fprintf(stderr, "COLOUR %s\n", COLOUR_MAX);
if (cdo_cmpstr(split_str[0], "interval")) fprintf(stderr, "INTERVAL %f\n", INTERVAL);
if (cdo_cmpstr(split_str[0], "count")) fprintf(stderr, "COUNT %d\n", COUNT);
if (cdo_cmpstr(split_str[0], "list"))
{
for (j = 0; j < split_str_count; j++) fprintf(stderr, "LIST %f\n", LEV_LIST[j]);
}
if (cstrIsEqual(split_str[0], "thickness")) fprintf(stderr, "THICKNESS %d\n", THICKNESS);
if (cstrIsEqual(split_str[0], "style")) fprintf(stderr, "STYLE %s\n", STYLE);
if (cstrIsEqual(split_str[0], "device")) fprintf(stderr, "DEVICE %s\n", DEVICE);
if (cstrIsEqual(split_str[0], "step_freq")) fprintf(stderr, "STEP_FREQ %d\n", STEP_FREQ);
if (cstrIsEqual(split_str[0], "lat_min")) fprintf(stderr, "Lat Min Val %g\n", LAT_MIN);
if (cstrIsEqual(split_str[0], "lat_max")) fprintf(stderr, "Lat Max Val %g\n", LAT_MAX);
if (cstrIsEqual(split_str[0], "lon_min")) fprintf(stderr, "Lon Min Val %g\n", LON_MIN);
if (cstrIsEqual(split_str[0], "lon_max")) fprintf(stderr, "Lon Max Val %g\n", LON_MAX);
if (cstrIsEqual(split_str[0], "projection")) fprintf(stderr, "PROJECTION %s\n", PROJECTION);
if (cdo_cmpstr(split_str[0], "thickness")) fprintf(stderr, "THICKNESS %d\n", THICKNESS);
if (cdo_cmpstr(split_str[0], "style")) fprintf(stderr, "STYLE %s\n", STYLE);
if (cdo_cmpstr(split_str[0], "device")) fprintf(stderr, "DEVICE %s\n", DEVICE);
if (cdo_cmpstr(split_str[0], "step_freq")) fprintf(stderr, "STEP_FREQ %d\n", STEP_FREQ);
if (cdo_cmpstr(split_str[0], "lat_min")) fprintf(stderr, "Lat Min Val %g\n", LAT_MIN);
if (cdo_cmpstr(split_str[0], "lat_max")) fprintf(stderr, "Lat Max Val %g\n", LAT_MAX);
if (cdo_cmpstr(split_str[0], "lon_min")) fprintf(stderr, "Lon Min Val %g\n", LON_MIN);
if (cdo_cmpstr(split_str[0], "lon_max")) fprintf(stderr, "Lon Max Val %g\n", LON_MAX);
if (cdo_cmpstr(split_str[0], "projection")) fprintf(stderr, "PROJECTION %s\n", PROJECTION);
Free(split_str);
}
......@@ -605,20 +605,20 @@ verifyPlotParameters(int num_param, const std::vector<std::string> &param_names,
for (j = 0; j < param_count; ++j)
{
if (cstrIsEqual(split_str[0], params[j]))
if (cdo_cmpstr(split_str[0], params[j]))
{
found = true;
if (cstrIsEqual(split_str[0], "colour") || cstrIsEqual(split_str[0], "style")
|| cstrIsEqual(split_str[0], "colour_min") || cstrIsEqual(split_str[0], "colour_max")
|| cstrIsEqual(split_str[0], "RGB") || cstrIsEqual(split_str[0], "colour_triad")
|| cstrIsEqual(split_str[0], "device") || cstrIsEqual(split_str[0], "file_split")
|| cstrIsEqual(split_str[0], "projection"))
if (cdo_cmpstr(split_str[0], "colour") || cdo_cmpstr(split_str[0], "style")
|| cdo_cmpstr(split_str[0], "colour_min") || cdo_cmpstr(split_str[0], "colour_max")
|| cdo_cmpstr(split_str[0], "RGB") || cdo_cmpstr(split_str[0], "colour_triad")
|| cdo_cmpstr(split_str[0], "device") || cdo_cmpstr(split_str[0], "file_split")
|| cdo_cmpstr(split_str[0], "projection"))
{
if (cstrIsNumeric(split_str[1]))
syntax = false;
else
{
if (cstrIsEqual(split_str[0], "RGB") || cstrIsEqual(split_str[0], "file_split"))
if (cdo_cmpstr(split_str[0], "RGB") || cdo_cmpstr(split_str[0], "file_split"))
{
temp_str = strdup(split_str[1]);
cstrToUpperCase(temp_str);
......@@ -626,29 +626,29 @@ verifyPlotParameters(int num_param, const std::vector<std::string> &param_names,
syntax = false;
else
{
if (cstrIsEqual(split_str[0], "RGB"))
if (cdo_cmpstr(split_str[0], "RGB"))
{
isRGB = cstrIsEqual(temp_str, "true");
isRGB = cdo_cmpstr(temp_str, "true");
}
else if (cstrIsEqual(split_str[0], "file_split"))
else if (cdo_cmpstr(split_str[0], "file_split"))
{
FILE_SPLIT = cstrIsEqual(temp_str, "true");
FILE_SPLIT = cdo_cmpstr(temp_str, "true");
}
}
}
else if (cstrIsEqual(split_str[0], "style"))
else if (cdo_cmpstr(split_str[0], "style"))
{
if (checkstyle(split_str[1])) syntax = false;
}
else if (cstrIsEqual(split_str[0], "colour") || cstrIsEqual(split_str[0], "colour_min")
|| cstrIsEqual(split_str[0], "colour_max"))
else if (cdo_cmpstr(split_str[0], "colour") || cdo_cmpstr(split_str[0], "colour_min")
|| cdo_cmpstr(split_str[0], "colour_max"))
{
if (checkcolour(split_str[1]))
syntax = false;
else
{
if (cstrIsEqual(split_str[0], "colour"))
if (cdo_cmpstr(split_str[0], "colour"))
{
temp_str = strdup(split_str[1]);
if (!isRGB)
......@@ -661,7 +661,7 @@ verifyPlotParameters(int num_param, const std::vector<std::string> &param_names,
COLOUR = temp_str;
if (DBG) fprintf(stderr, "COLOUR %s\n", COLOUR);
}
if (cstrIsEqual(split_str[0], "colour_min"))
if (cdo_cmpstr(split_str[0], "colour_min"))
{
temp_str = strdup(split_str[1]);
if (!isRGB)
......@@ -674,7 +674,7 @@ verifyPlotParameters(int num_param, const std::vector<std::string> &param_names,
COLOUR_MIN = temp_str;
if (DBG) fprintf(stderr, "COLOUR %s\n", COLOUR_MIN);
}
if (cstrIsEqual(split_str[0], "colour_max"))
if (cdo_cmpstr(split_str[0], "colour_max"))
{
temp_str = strdup(split_str[1]);
if (!isRGB)
......@@ -689,11 +689,11 @@ verifyPlotParameters(int num_param, const std::vector<std::string> &param_names,
}
}
}
else if (cstrIsEqual(split_str[0], "device"))
else if (cdo_cmpstr(split_str[0], "device"))
{
if (checkdevice(split_str[1])) syntax = false;
}
else if (cstrIsEqual(split_str[0], "colour_triad"))
else if (cdo_cmpstr(split_str[0], "colour_triad"))
{
temp_str = strdup(split_str[1]);
cstrToUpperCase(temp_str);
......@@ -702,44 +702,44 @@ verifyPlotParameters(int num_param, const std::vector<std::string> &param_names,
else
{
if (DBG) fprintf(stderr, "TRIAD check %s!\n", temp_str);
if (cstrIsEqual(temp_str, "CW"))
if (cdo_cmpstr(temp_str, "CW"))
COLOUR_TRIAD = "clockwise";
else
COLOUR_TRIAD = "anti_clockwise";
}
}
else if (cstrIsEqual(split_str[0], "projection"))
else if (cdo_cmpstr(split_str[0], "projection"))
{
if (checkprojection(split_str[1])) syntax = false;
}
}
}
if (cstrIsEqual(split_str[0], "min") || cstrIsEqual(split_str[0], "max") || cstrIsEqual(split_str[0], "lat_min")
|| cstrIsEqual(split_str[0], "lat_max") || cstrIsEqual(split_str[0], "lon_min")
|| cstrIsEqual(split_str[0], "lon_max") || cstrIsEqual(split_str[0], "count")
|| cstrIsEqual(split_str[0], "interval") || cstrIsEqual(split_str[0], "thickness")
|| cstrIsEqual(split_str[0], "resolution") || cstrIsEqual(split_str[0], "step_freq"))
if (cdo_cmpstr(split_str[0], "min") || cdo_cmpstr(split_str[0], "max") || cdo_cmpstr(split_str[0], "lat_min")
|| cdo_cmpstr(split_str[0], "lat_max") || cdo_cmpstr(split_str[0], "lon_min")
|| cdo_cmpstr(split_str[0], "lon_max") || cdo_cmpstr(split_str[0], "count")
|| cdo_cmpstr(split_str[0], "interval") || cdo_cmpstr(split_str[0], "thickness")
|| cdo_cmpstr(split_str[0], "resolution") || cdo_cmpstr(split_str[0], "step_freq"))
{
if (!cstrIsNumeric(split_str[1]))
syntax = false;
else
{
if (cstrIsEqual(split_str[0], "min")) YMIN = atof(split_str[1]);
if (cstrIsEqual(split_str[0], "max")) YMAX = atof(split_str[1]);
if (cstrIsEqual(split_str[0], "count")) COUNT = atoi(split_str[1]);
if (cstrIsEqual(split_str[0], "interval")) INTERVAL = atof(split_str[1]);
if (cstrIsEqual(split_str[0], "thickness")) THICKNESS = atoi(split_str[1]);
if (cstrIsEqual(split_str[0], "resolution")) RESOLUTION = atoi(split_str[1]);
if (cstrIsEqual(split_str[0], "step_freq")) STEP_FREQ = atoi(split_str[1]);
if (cstrIsEqual(split_str[0], "lat_min")) LAT_MIN = atof(split_str[1]);
if (cstrIsEqual(split_str[0], "lat_max")) LAT_MAX = atof(split_str[1]);
if (cstrIsEqual(split_str[0], "lon_min")) LON_MIN = atof(split_str[1]);
if (cstrIsEqual(split_str[0], "lon_max")) LON_MAX = atof(split_str[1]);
if (cdo_cmpstr(split_str[0], "min")) YMIN = atof(split_str[1]);
if (cdo_cmpstr(split_str[0], "max")) YMAX = atof(split_str[1]);
if (cdo_cmpstr(split_str[0], "count")) COUNT = atoi(split_str[1]);
if (cdo_cmpstr(split_str[0], "interval")) INTERVAL = atof(split_str[1]);
if (cdo_cmpstr(split_str[0], "thickness")) THICKNESS = atoi(split_str[1]);
if (cdo_cmpstr(split_str[0], "resolution")) RESOLUTION = atoi(split_str[1]);
if (cdo_cmpstr(split_str[0], "step_freq")) STEP_FREQ = atoi(split_str[1]);
if (cdo_cmpstr(split_str[0], "lat_min")) LAT_MIN = atof(split_str[1]);
if (cdo_cmpstr(split_str[0], "lat_max")) LAT_MAX = atof(split_str[1]);
if (cdo_cmpstr(split_str[0], "lon_min")) LON_MIN = atof(split_str[1]);
if (cdo_cmpstr(split_str[0], "lon_max")) LON_MAX = atof(split_str[1]);
}
}
if (cstrIsEqual(split_str[0], "colour_table"))
if (cdo_cmpstr(split_str[0], "colour_table"))
{
if ((fp = fopen(split_str[1], "r")) == nullptr)
{
......@@ -752,7 +752,7 @@ verifyPlotParameters(int num_param, const std::vector<std::string> &param_names,
}
}
if (cstrIsEqual(split_str[0], "list"))
if (cdo_cmpstr(split_str[0], "list"))
{
sep_char = ";";
split_str_count = cstrSplitWithSeperator(split_str[1], sep_char, &split_str1);
......@@ -779,7 +779,7 @@ verifyPlotParameters(int num_param, const std::vector<std::string> &param_names,
}
}
sep_char = "=";
} /*** if( cstrIsEqual( split_str[0], params[j] ) ) ***/
} /*** if( cdo_cmpstr( split_str[0], params[j] ) ) ***/
} /*** Loop over param count ***/
} /*** ( split_str_count > 1 ) ***/
else
......@@ -877,7 +877,7 @@ checkcolour(char *colour_in)
cstrToLowerCase(colour_in);
for (i = 0; i < STD_COLOUR_COUNT; i++)
{
if (cstrIsEqual(STD_COLOUR_TABLE[i], colour_in)) return 0;
if (cdo_cmpstr(STD_COLOUR_TABLE[i], colour_in)) return 0;
}
cdoWarning("Specified Colour not in Standard colour list, resetting to blue(default colour)!");
return 1;
......@@ -964,7 +964,7 @@ checkstyle(char *style_in)
{
if (DBG) fprintf(stderr, "Input %s ref %s\n", style_in, STYLE_TABLE[i]);
if (cstrIsEqual(STYLE_TABLE[i], style_in))
if (cdo_cmpstr(STYLE_TABLE[i], style_in))
{
found = true;
STYLE = style_in;
......@@ -986,14 +986,14 @@ checkdevice(char *device_in)
{
if (DBG) fprintf(stderr, "Input %s ref %s\n", device_in, DEVICE_TABLE[i]);
if (cstrIsEqual(DEVICE_TABLE[i], device_in))
if (cdo_cmpstr(DEVICE_TABLE[i], device_in))
{
found = true;
DEVICE = device_in;
if (DBG) fprintf(stderr, "DEVICE %s\n", DEVICE);
if (cstrIsEqual("GIF_ANIMATION", device_in) || cstrIsEqual("KML", device_in))
if (cdo_cmpstr("GIF_ANIMATION", device_in) || cdo_cmpstr("KML", device_in))
{
ANIM_FLAG = 1;
STEP_FREQ = 1;
......@@ -1018,7 +1018,7 @@ checkprojection(char *projection_in)
{
if (DBG) fprintf(stderr, "Input %s ref %s\n", projection_in, PROJECTION_TABLE[i]);
if (cstrIsEqual(PROJECTION_TABLE[i], projection_in))
if (cdo_cmpstr(PROJECTION_TABLE[i], projection_in))
{
found = true;
PROJECTION = projection_in;
......
......@@ -91,19 +91,19 @@ magvector(const char *plotfile, int operatorID, const char *varname, long nlon,
split_str_count = cstrSplitWithSeperator(params[i].c_str(), sep_char, &split_str);
(void) split_str_count;
if (cstrIsEqual(split_str[0], "thin_fac"))
if (cdo_cmpstr(split_str[0], "thin_fac"))
{
THIN_FAC = atof(split_str[1]);
if (DBG) fprintf(stderr, "THIN FACTOR %g\n", THIN_FAC);
}
if (cstrIsEqual(split_str[0], "unit_vec"))
if (cdo_cmpstr(split_str[0], "unit_vec"))
{
UNIT_VEC = atof(split_str[1]);
if (DBG) fprintf(stderr, "UNIT VECTOR %g\n", UNIT_VEC);
}
if (cstrIsEqual(split_str[0], "device"))
if (cdo_cmpstr(split_str[0], "device"))
{
temp_str = strdup(split_str[1]);
cstrToUpperCase(temp_str);
......@@ -113,7 +113,7 @@ magvector(const char *plotfile, int operatorID, const char *varname, long nlon,
mag_setc("output_format", DEVICE);
}
if (cstrIsEqual(split_str[0], "step_freq"))
if (cdo_cmpstr(split_str[0], "step_freq"))
{
STEP_FREQ = atoi(split_str[1]);
if (DBG) fprintf(stderr, "STEP FREQ %d\n", STEP_FREQ);
......@@ -240,29 +240,29 @@ VerifyVectorParameters(int num_param, std::vector<std::string> &param_names, int
for (j = 0; j < param_count; ++j)
{
if (cstrIsEqual(split_str[0], params[j]))
if (cdo_cmpstr(split_str[0], params[j]))
{
found = true;
if (cstrIsEqual(split_str[0], "thin_fac") || cstrIsEqual(split_str[0], "unit_vec")
|| cstrIsEqual(split_str[0], "step_freq"))
if (cdo_cmpstr(split_str[0], "thin_fac") || cdo_cmpstr(split_str[0], "unit_vec")
|| cdo_cmpstr(split_str[0], "step_freq"))
{
if (!cstrIsNumeric(split_str[1])) syntax = false;
}
if (cstrIsEqual(split_str[0], "device"))
if (cdo_cmpstr(split_str[0], "device"))
{
if (cstrIsNumeric(split_str[1]))
syntax = false;
else
{
if (cstrIsEqual(split_str[0], "device"))
if (cdo_cmpstr(split_str[0], "device"))
{
if (DBG) fprintf(stderr, "Parameter value '%s'\n", split_str[1]);
if (checkdevice(split_str[1])) syntax = false;
/* Vector not supported in google earth format */
if (cstrIsEqual(split_str[1], "KML") || cstrIsEqual(split_str[1], "kml"))
if (cdo_cmpstr(split_str[1], "KML") || cdo_cmpstr(split_str[1], "kml"))
{
syntax = false;
if (DBG) fprintf(stderr, "Parameter value '%s'\n", split_str[1]);
......@@ -397,14 +397,14 @@ Magvector(void *process)
if (operatorID == VECTOR)
{
if (cstrIsEqual(varname, "var131") || cstrIsEqual(varname, "u")) // U Velocity as per GRIB is var131, as per NC 'u'
if (cdo_cmpstr(varname, "var131") || cdo_cmpstr(varname, "u")) // U Velocity as per GRIB is var131, as per NC 'u'
{
if (DBG) fprintf(stderr, "Found U VEL in Varname %s\n", varname);
cdoReadRecord(streamID, uarray.data(), &nmiss);
if (nmiss) cdoSetNAN(vlistInqVarMissval(vlistID, varID), gridsize, uarray.data());
found++;
}
if (cstrIsEqual(varname, "var132") || cstrIsEqual(varname, "v")) // V Velocity as per GRIB is var132, as per NC 'v'
if (cdo_cmpstr(varname, "var132") || cdo_cmpstr(varname, "v")) // V Velocity as per GRIB is var132, as per NC 'v'
{
if (DBG) fprintf(stderr, "Found V VEL in Varname %s\n", varname);
cdoReadRecord(streamID, varray.data(), &nmiss);
......
......@@ -95,7 +95,7 @@ find_name(int vlistID, char *name)
for (int varID = 0; varID < nvars; ++varID)
{
vlistInqVarName(vlistID, varID, varname);
if (cstrIsEqual(name, varname)) return varID;
if (cdo_cmpstr(name, varname)) return varID;
}
return CDI_UNDEFID;
......
......@@ -164,17 +164,17 @@ Pressure(void *process)
cstrToLowerCase(varname);
// ECHAM ECMWF
if (cstrIsEqual(varname, "geosp") || cstrIsEqual(varname, "z"))
if (cdo_cmpstr(varname, "geosp") || cdo_cmpstr(varname, "z"))
code = 129;
else if (cstrIsEqual(varname, "st") || cstrIsEqual(varname, "t"))
else if (cdo_cmpstr(varname, "st") || cdo_cmpstr(varname, "t"))
code = 130;
else if (cstrIsEqual(varname, "aps") || cstrIsEqual(varname, "sp"))
else if (cdo_cmpstr(varname, "aps") || cdo_cmpstr(varname, "sp"))
code = 134;
else if (cstrIsEqual(varname, "ps"))
else if (cdo_cmpstr(varname, "ps"))
code = 134;
else if (cstrIsEqual(varname, "lsp") || cstrIsEqual(varname, "lnsp"))
else if (cdo_cmpstr(varname, "lsp") || cdo_cmpstr(varname, "lnsp"))
code = 152;
/* else if (cstrIsEqual(varname, "geopoth") == 0 ) code = 156; */
/* else if (cdo_cmpstr(varname, "geopoth") == 0 ) code = 156; */
}
if (mode == ModelMode::ECHAM)
......
......@@ -377,11 +377,11 @@ Remapeta(void *process)
{
// ECHAM ECMWF
// clang-format off
if (sgeopotID == -1 && (cstrIsEqual(varname, "geosp") || cstrIsEqual(varname, "z"))) code = 129;
else if (tempID == -1 && (cstrIsEqual(varname, "st") || cstrIsEqual(varname, "t"))) code = 130;
else if (psID == -1 && (cstrIsEqual(varname, "aps") || cstrIsEqual(varname, "ps"))) code = 134;
else if (lnpsID == -1 && (cstrIsEqual(varname, "lsp") || cstrIsEqual(varname, "lnsp"))) code = 152;
else if (sqID == -1 && (cstrIsEqual(varname, "q"))) code = 133;
if (sgeopotID == -1 && (cdo_cmpstr(varname, "geosp") || cdo_cmpstr(varname, "z"))) code = 129;
else if (tempID == -1 && (cdo_cmpstr(varname, "st") || cdo_cmpstr(varname, "t"))) code = 130;
else if (psID == -1 && (cdo_cmpstr(varname, "aps") || cdo_cmpstr(varname, "ps"))) code = 134;
else if (lnpsID == -1 && (cdo_cmpstr(varname, "lsp") || cdo_cmpstr(varname, "lnsp"))) code = 152;
else if (sqID == -1 && (cdo_cmpstr(varname, "q"))) code = 133;
// clang-format on
}
}
......
......@@ -72,7 +72,7 @@ Replace(void *process)
{
for (varID1 = 0; varID1 < nvars1; varID1++)
{