Commit 66ecbe7c authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

fieldmer.cc: cleanup.

parent 3a7ca41a
......@@ -33,7 +33,6 @@ Fldrms(void *process)
int index;
int nrecs;
int varID, levelID;
size_t nmiss;
cdoInitialize(process);
......
......@@ -142,16 +142,6 @@ void zonpctl(Field &field1, Field &field2, int p);
// fieldmer.cc
void merfun(const Field &field1, Field &field2, int function);
void mermin(const Field &field1, Field &field2);
void mermax(const Field &field1, Field &field2);
void merrange(const Field &field1, Field &field2);
void mersum(const Field &field1, Field &field2);
void meravgw(const Field &field1, Field &field2);
void mermeanw(const Field &field1, Field &field2);
void merstdw(const Field &field1, Field &field2);
void merstd1w(const Field &field1, Field &field2);
void mervarw(const Field &field1, Field &field2);
void mervar1w(const Field &field1, Field &field2);
void merpctl(Field &field1, Field &field2, int p);
void vfldrms(const Field &field1, const Field &field2, Field &field3);
......
......@@ -19,28 +19,7 @@
#include "cdo_int.h"
#include "percentiles.h"
void
merfun(const Field &field1, Field &field2, int function)
{
// clang-format off
switch (function)
{
case func_min: mermin(field1, field2); break;
case func_max: mermax(field1, field2); break;
case func_range: merrange(field1, field2); break;
case func_sum: mersum(field1, field2); break;
case func_meanw: mermeanw(field1, field2); break;
case func_avgw: meravgw(field1, field2); break;
case func_stdw: merstdw(field1, field2); break;
case func_std1w: merstd1w(field1, field2); break;
case func_varw: mervarw(field1, field2); break;
case func_var1w: mervar1w(field1, field2); break;
default: cdoAbort("function %d not implemented!", function);
}
// clang-format on
}
void
static void
mermin(const Field &field1, Field &field2)
{
size_t rnmiss = 0;
......@@ -71,7 +50,7 @@ mermin(const Field &field1, Field &field2)
field2.nmiss = rnmiss;
}
void
static void
mermax(const Field &field1, Field &field2)
{
size_t rnmiss = 0;
......@@ -102,7 +81,7 @@ mermax(const Field &field1, Field &field2)
field2.nmiss = rnmiss;
}
void
static void
merrange(const Field &field1, Field &field2)
{
size_t rnmiss = 0;
......@@ -133,7 +112,7 @@ merrange(const Field &field1, Field &field2)
field2.nmiss = rnmiss;
}
void
static void
mersum(const Field &field1, Field &field2)
{
size_t rnmiss = 0;
......@@ -164,7 +143,7 @@ mersum(const Field &field1, Field &field2)
field2.nmiss = rnmiss;
}
void
static void
mermeanw(const Field &field1, Field &field2)
{
const double missval = field1.missval;
......@@ -189,7 +168,7 @@ mermeanw(const Field &field1, Field &field2)
field2.nmiss = rnmiss;
}
void
static void
meravgw(const Field &field1, Field &field2)
{
const double missval = field1.missval;
......@@ -246,7 +225,7 @@ prevarsum_merw(const double *restrict array, const double *restrict w, size_t nx
}
}
void
static void
mervarw(const Field &field1, Field &field2)
{
size_t rnmiss = 0;
......@@ -274,7 +253,7 @@ mervarw(const Field &field1, Field &field2)
field2.nmiss = rnmiss;
}
void
static void
mervar1w(const Field &field1, Field &field2)
{
size_t rnmiss = 0;
......@@ -302,7 +281,7 @@ mervar1w(const Field &field1, Field &field2)
field2.nmiss = rnmiss;
}
void
static void
merstdw(const Field &field1, Field &field2)
{
size_t rnmiss = 0;
......@@ -323,7 +302,7 @@ merstdw(const Field &field1, Field &field2)
field2.nmiss = rnmiss;
}
void
static void
merstd1w(const Field &field1, Field &field2)
{
size_t rnmiss = 0;
......@@ -394,3 +373,24 @@ merpctl(Field &field1, Field &field2, int p)
field2.nmiss = rnmiss;
}
void
merfun(const Field &field1, Field &field2, int function)
{
// clang-format off
switch (function)
{
case func_min: mermin(field1, field2); break;
case func_max: mermax(field1, field2); break;
case func_range: merrange(field1, field2); break;
case func_sum: mersum(field1, field2); break;
case func_meanw: mermeanw(field1, field2); break;
case func_avgw: meravgw(field1, field2); break;
case func_stdw: merstdw(field1, field2); break;
case func_std1w: merstd1w(field1, field2); break;
case func_varw: mervarw(field1, field2); break;
case func_var1w: mervar1w(field1, field2); break;
default: cdoAbort("function %d not implemented!", function);
}
// clang-format on
}
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