Commit 319756e8 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Fldstat: optional parameter weights failed (bug fix)

parent d4b69438
Pipeline #5144 passed with stages
in 16 minutes and 59 seconds
2020-11-12 Uwe Schulzweida
* Fldstat: optional parameter weights failed (bug fix)
* Wind: check that numLPE is > 0 (bug fix)
2020-10-29 Uwe Schulzweida
......
......@@ -85,7 +85,7 @@ print_location_LL(int operfunc, int vlistID, int varID, int levelID, int gridID,
}
static void
fldstatGetParameter(bool *weights)
fldstatGetParameter(bool &useweights)
{
const auto pargc = operatorArgc();
if (pargc)
......@@ -105,7 +105,7 @@ fldstatGetParameter(bool *weights)
const auto &value = kv.values[0];
if (key == "weights")
*weights = parameter2bool(value);
useweights = parameter2bool(value);
else
cdoAbort("Invalid parameter key >%s<!", key.c_str());
}
......@@ -146,6 +146,7 @@ Fldstat(void *process)
const auto operatorID = cdoOperatorID();
const auto operfunc = cdoOperatorF1(operatorID);
const bool needWeights = cdoOperatorF2(operatorID) != 0;
bool useweights = true;
double pn = 0;
if (operfunc == func_pctl)
......@@ -153,13 +154,15 @@ Fldstat(void *process)
operatorInputArg("percentile number");
pn = parameter2double(cdoOperatorArgv(0));
}
else if (needWeights)
{
fldstatGetParameter(useweights);
}
else
{
operatorCheckArgc(0);
}
bool useweights = true;
if (needWeights) fldstatGetParameter(&useweights);
const auto streamID1 = cdoOpenRead(0);
......
Markdown is supported
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