13 #include "eckit/exception/Exceptions.h"
15 #include "oops/util/Logger.h"
39 for (
const auto&
check : checks) {
40 if (
check ==
"Basic") {
41 }
else if (
check ==
"SamePDiffT") {
46 }
else if (
check ==
"Sign") {
51 }
else if (
check ==
"UnstableLayer") {
58 }
else if (
check ==
"Interpolation") {
74 }
else if (
check ==
"Hydrostatic") {
88 }
else if (
check ==
"UInterp" ||
check ==
"UInterpAlternative") {
103 }
else if (
check ==
"RH") {
120 }
else if (
check ==
"Time") {
124 }
else if (
check ==
"PermanentReject") {
131 }
else if (
check.find(
"Background") != std::string::npos) {
148 }
else if (
check ==
"Pressure") {
153 }
else if (
check ==
"AveragePressure") {
161 }
else if (
check ==
"AverageTemperature") {
168 }
else if (
check ==
"AverageWindSpeed") {
177 }
else if (
check ==
"AverageRelativeHumidity") {
188 template <
typename T>
198 << val1 <<
", " << val2 + offset << std::endl;
204 template <
typename T>
206 const std::vector <T> &vec1,
207 const std::vector <T> &vec2,
213 if (oops::anyVectorEmpty(vec1, vec2))
216 oops::Log::debug() <<
"Vector of " << desc <<
" in OPS output is empty" << std::endl;
218 oops::Log::debug() <<
"Vector of " << desc <<
" in this code is empty" << std::endl;
222 const size_t vecsize = std::min(vec1.size(), vec2.size());
223 for (
size_t jvec = 0; jvec < vecsize; ++jvec) {
226 <<
"(OPS, this code): " << vec1[jvec] <<
", "
227 << vec2[jvec] + offset << std::endl;
236 oops::Log::debug() <<
" Comparing values against OPS equivalents..." << std::endl;
246 std::string groupname;
248 std::string varname_OPS =
"OPS_" + valueToCompare_int;
249 if (groupname ==
"Counters") {
254 varname_OPS =
"OPS_" + varname +
"@MetaData";
258 const std::vector <int> &values_thiscode =
259 profileDataHandler.
get<
int>(valueToCompare_int);
260 const std::vector <int> &values_OPS =
261 profileDataHandler.
get<
int>(varname_OPS);
269 offset = comparison_offsets_it->second;
273 if (groupname ==
"Counters" && varname !=
"NumAnyErrors")
278 if (groupname ==
"Counters") {
285 if (!oops::anyVectorEmpty(values_OPS, values_thiscode))
286 compareOutput(valueToCompare_int, values_OPS[0], values_thiscode[0],
290 <<
"because multiple processors are in use." << std::endl;
293 compareOutput(valueToCompare_int, values_OPS, values_thiscode,
298 if (groupname ==
"Counters" && varname !=
"NumAnyErrors")
304 const std::vector <float> &values_thiscode =
305 profileDataHandler.
get<
float>(valueToCompare_float);
306 const std::vector <float> &values_OPS =
307 profileDataHandler.
get<
float>(
"OPS_" + valueToCompare_float);
308 compareOutput(valueToCompare_float, values_OPS, values_thiscode,
Options controlling the operation of the ConventionalProfileProcessing filter.
oops::Parameter< float > Comparison_Tol
Tolerance for absolute difference comparisions.
oops::Parameter< std::vector< std::string > > Checks
List of checks to perform.
std::map< std::string, int > comparison_offsets_
std::set< std::string > valuesToCompare_int_
Integer values to compare.
const ConventionalProfileProcessingParameters & options_
Configurable parameters.
ProfileCheckValidator(const ConventionalProfileProcessingParameters &options)
int nMismatches_
Number of mismatches between this code and OPS (separate for each profile).
std::map< std::string, int > cumulativeCounters_
Counters that are accumulated across profiles.
std::set< std::string > valuesToCompare_float_
Float values to compare.
void validate(ProfileDataHandler &profileDataHandler, size_t commSize)
Validate check results against OPS values.
bool differenceWithinTol(const T A, const T B, const float tol=1e-10) const
Determine difference between two values within a certain tolerance.
void compareOutput(const std::string &desc, const T val1, const T val2, const int offset, const float tol, int &n)
Compare values with specified offset and tolerance.
Retrieve and store data for individual profiles. To do this, first the vector of values in the entire...
std::vector< T > & get(const std::string &fullname)
subroutine check(action, status)
void splitVarGroup(const std::string &vargrp, std::string &var, std::string &grp)
static constexpr const char *const rhbk
static constexpr const char *const ETol
static constexpr const char *const qcflags_observation_report
static constexpr const char *const qcflags_eastward_wind
static constexpr const char *const counter_TotHFlags
static constexpr const char *const pge_geopotential_height
static constexpr const char *const modellevels_ExnerP_derived
static constexpr const char *const tInterp
static constexpr const char *const counter_TotLFlags
static constexpr const char *const LogP
static constexpr const char *const counter_NumSamePErrObs
static constexpr const char *const counter_NumGapsU
static constexpr const char *const counter_NumGapsUWP
static constexpr const char *const counter_NumInterpErrObs
static constexpr const char *const bigPgaps_derived
static constexpr const char *const FlagH
static constexpr const char *const LevErrors
static constexpr const char *const counter_NumInterpErrors
static constexpr const char *const modellevels_average_eastward_wind_derived
static constexpr const char *const counter_NumAnyErrors
static constexpr const char *const counter_NumHydErrObs
static constexpr const char *const pge_relative_humidity
static constexpr const char *const HydError
static constexpr const char *const qcflags_northward_wind
static constexpr const char *const PBottom
static constexpr const char *const modellevels_logP_derived
static constexpr const char *const counter_NumSuperadiabat
static constexpr const char *const Temp
static constexpr const char *const qcflags_relative_humidity
static constexpr const char *const modellevels_average_eastward_wind_qcflags
static constexpr const char *const rh
static constexpr const char *const pge_northward_wind
static constexpr const char *const modellevels_average_northward_wind_qcflags
static constexpr const char *const uInterp
static constexpr const char *const NumSig
static constexpr const char *const modellevels_average_relative_humidity_derived
static constexpr const char *const counter_TotCFlags
static constexpr const char *const LogP_derived
static constexpr const char *const pgebd_northward_wind
static constexpr const char *const DC
static constexpr const char *const td
static constexpr const char *const NumStd
static constexpr const char *const Indx
static constexpr const char *const modellevels_logP_rho_derived
static constexpr const char *const Press
static constexpr const char *const pge_air_temperature
static constexpr const char *const SigBelow
static constexpr const char *const counter_NumStdMiss
static constexpr const char *const modellevels_ExnerP_rho_derived
static constexpr const char *const pgebd_air_temperature
static constexpr const char *const counter_NumSignChange
static constexpr const char *const StdLev
static constexpr const char *const vInterp
static constexpr const char *const modellevels_air_temperature_derived
static constexpr const char *const modellevels_average_relative_humidity_qcflags
static constexpr const char *const counter_NumGapsT
static constexpr const char *const counter_Num100Miss
static constexpr const char *const obs_air_pressure
static constexpr const char *const qcflags_air_temperature
static constexpr const char *const modellevels_average_air_temperature_derived
static constexpr const char *const pgebd_eastward_wind
static constexpr const char *const modellevels_average_northward_wind_derived
static constexpr const char *const SigAbove
static constexpr const char *const pge_eastward_wind
static constexpr const char *const counter_Num925Miss
static constexpr const char *const counter_NumIntHydErrors
static constexpr const char *const modellevels_average_air_temperature_qcflags
static constexpr const char *const counter_TotHProfs
static constexpr const char *const qcflags_geopotential_height
static constexpr const char *const counter_NumGapsRH
static constexpr const char *const IndStd
static constexpr const char *const tbk
static constexpr const char *const counter_TotCProfs
static constexpr const char *const pgebd_relative_humidity