Go to the documentation of this file.
13 #include "eckit/exception/Exceptions.h"
15 #include "oops/util/Logger.h"
26 profileDataHandler_(profileDataHandler)
40 for (
const auto&
check : checks) {
41 if (
check ==
"Basic") {
42 }
else if (
check ==
"SamePDiffT") {
47 }
else if (
check ==
"Sign") {
52 }
else if (
check ==
"UnstableLayer") {
59 }
else if (
check ==
"Interpolation") {
75 }
else if (
check ==
"Hydrostatic") {
89 }
else if (
check ==
"UInterp") {
104 }
else if (
check ==
"RH") {
121 }
else if (
check ==
"Time") {
125 }
else if (
check ==
"PermanentReject") {
132 }
else if (
check.find(
"Background") != std::string::npos) {
155 template <
typename T>
165 << val1 <<
", " << val2 + offset << std::endl;
171 template <
typename T>
173 const std::vector <T> &vec1,
174 const std::vector <T> &vec2,
180 if (oops::anyVectorEmpty(vec1, vec2))
183 oops::Log::debug() <<
"Vector of " << desc <<
" in OPS output is empty" << std::endl;
185 oops::Log::debug() <<
"Vector of " << desc <<
" in this code is empty" << std::endl;
189 const size_t vecsize = std::min(vec1.size(), vec2.size());
190 for (
size_t jvec = 0; jvec < vecsize; ++jvec) {
193 <<
"(OPS, this code): " << vec1[jvec] <<
", "
194 << vec2[jvec] + offset << std::endl;
202 oops::Log::debug() <<
" Comparing values against OPS equivalents..." << std::endl;
212 std::string groupname;
214 std::string varname_OPS =
"OPS_" + valueToCompare_int;
215 if (groupname ==
"Counters") {
220 varname_OPS =
"OPS_" + varname +
"@MetaData";
224 const std::vector <int> &values_thiscode =
226 const std::vector <int> &values_OPS =
235 offset = comparison_offsets_it->second;
239 if (groupname ==
"Counters" && varname !=
"NumAnyErrors")
244 if (groupname ==
"Counters") {
245 if (!oops::anyVectorEmpty(values_OPS, values_thiscode))
246 compareOutput(valueToCompare_int, values_OPS[0], values_thiscode[0],
249 compareOutput(valueToCompare_int, values_OPS, values_thiscode,
254 if (groupname ==
"Counters" && varname !=
"NumAnyErrors")
260 const std::vector <float> &values_thiscode =
262 const std::vector <float> &values_OPS =
264 compareOutput(valueToCompare_float, values_OPS, values_thiscode,
static constexpr const char *const counter_NumAnyErrors
ProfileDataHandler & profileDataHandler_
Profile data handler.
Retrieve and store data for individual profiles. To do this, first the vector of values in the entire...
std::map< std::string, int > cumulativeCounters_
Counters that are accumulated across profiles.
static constexpr const char *const pgebd_air_temperature
int nMismatches_
Number of mismatches between this code and OPS (separate for each profile).
static constexpr const char *const HydError
static constexpr const char *const StdLev
bool differenceWithinTol(const T A, const T B, const float tol=1e-10) const
Determine difference between two values within a certain tolerance.
subroutine check(action, status)
static constexpr const char *const pgebd_relative_humidity
static constexpr const char *const IndStd
void splitVarGroup(const std::string &vargrp, std::string &var, std::string &grp)
static constexpr const char *const qcflags_northward_wind
ProfileCheckValidator(const ProfileConsistencyCheckParameters &options, ProfileDataHandler &profileDataHandler)
static constexpr const char *const pge_northward_wind
const ProfileConsistencyCheckParameters & options_
Configurable parameters.
oops::Parameter< std::vector< std::string > > Checks
List of checks to perform.
static constexpr const char *const tbk
static constexpr const char *const qcflags_eastward_wind
static constexpr const char *const PBottom
static constexpr const char *const counter_NumHydErrObs
static constexpr const char *const ETol
std::set< std::string > valuesToCompare_float_
Float values to compare.
static constexpr const char *const pge_geopotential_height
static constexpr const char *const Temp
static constexpr const char *const qcflags_relative_humidity
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.
static constexpr const char *const LogP
static constexpr const char *const pge_air_temperature
static constexpr const char *const vInterp
static constexpr const char *const counter_TotCFlags
static constexpr const char *const qcflags_geopotential_height
static constexpr const char *const LevErrors
static constexpr const char *const SigBelow
static constexpr const char *const counter_TotLFlags
static constexpr const char *const counter_NumSamePErrObs
std::map< std::string, int > comparison_offsets_
static constexpr const char *const counter_Num925Miss
static constexpr const char *const td
static constexpr const char *const uInterp
static constexpr const char *const Press
static constexpr const char *const tInterp
std::set< std::string > valuesToCompare_int_
Integer values to compare.
static constexpr const char *const DC
static constexpr const char *const counter_NumStdMiss
Options controlling the operation of the ProfileConsistencyChecks filter.
static constexpr const char *const counter_TotHProfs
static constexpr const char *const counter_TotCProfs
static constexpr const char *const rhbk
static constexpr const char *const counter_NumInterpErrObs
static constexpr const char *const counter_NumInterpErrors
static constexpr const char *const counter_NumSuperadiabat
static constexpr const char *const counter_NumSignChange
static constexpr const char *const NumStd
void validate()
Validate check results against OPS values.
static constexpr const char *const pge_eastward_wind
static constexpr const char *const qcflags_air_temperature
static constexpr const char *const counter_TotHFlags
static constexpr const char *const pgebd_northward_wind
static constexpr const char *const Indx
static constexpr const char *const FlagH
std::vector< T > & get(const std::string &fullname)
static constexpr const char *const counter_Num100Miss
static constexpr const char *const SigAbove
static constexpr const char *const pge_relative_humidity
static constexpr const char *const pgebd_eastward_wind
oops::Parameter< float > Comparison_Tol
Tolerance for absolute difference comparisions.
static constexpr const char *const NumSig
static constexpr const char *const pgebd_geopotential_height
static constexpr const char *const counter_NumIntHydErrors
static constexpr const char *const rh