26 const std::vector <float> &pressures =
28 const std::vector <float> &uObs =
30 const std::vector <float> &vObs =
32 std::vector <int> &uFlags =
34 std::vector <int> &NumSamePErrObs =
36 std::vector <int> &NumInterpErrObs =
39 if (!oops::allVectorsSameNonZeroSize(pressures, uObs, vObs, uFlags)) {
40 oops::Log::warning() <<
"At least one vector is the wrong size. "
41 <<
"Check will not be performed." << std::endl;
42 oops::Log::warning() <<
"Vector sizes: "
43 << oops::listOfVectorSizes(pressures, uObs, vObs, uFlags)
51 uInterp_.assign(numProfileLevels, 0.0);
52 vInterp_.assign(numProfileLevels, 0.0);
58 for (
int jlev = 0; jlev < numProfileLevels; ++jlev) {
61 if (pressures[jlev] == pressures[jlevprev] &&
62 (uObs[jlev] != uObs[jlevprev] || vObs[jlev] != vObs[jlevprev])) {
63 float VectDiffSq = std::pow(uObs[jlev] - uObs[jlevprev], 2) +
64 std::pow(vObs[jlev] - vObs[jlevprev], 2);
70 <<
"and significantly different wind speed magnitude for "
71 <<
"levels " << jlevprev <<
" and " << jlev << std::endl;
73 <<
"P = " << pressures[jlevprev] * 0.01 <<
"hPa, uObs = "
74 << uObs[jlevprev] <<
"ms^-1, vObs = "
75 << vObs[jlevprev] <<
"ms^-1" << std::endl;
77 <<
"P = " << pressures[jlev] * 0.01 <<
"hPa, uObs = "
78 << uObs[jlev] <<
"ms^-1, vObs = "
79 << vObs[jlev] <<
"ms^-1" << std::endl;
80 oops::Log::debug() <<
" -> VectDiffSq = " << VectDiffSq <<
"m^2s^-2" << std::endl;
88 if (NumErrors > 0) NumSamePErrObs[0]++;
94 for (
int jlevStd = 0; jlevStd <
NumStd_; ++jlevStd) {
99 float PStd = pressures[jlev];
104 for (
size_t bgidx = 0; bgidx < BigGapsPThresh.size(); ++bgidx) {
105 if (PStd > BigGapsPThresh[bgidx]) {
106 BigGap = BigGaps[bgidx];
111 if (pressures[SigB] - PStd > BigGap ||
112 PStd - pressures[SigA] > BigGap) {
121 uInterp_[jlev] = uObs[SigB] + (uObs[SigA] - uObs[SigB]) * Ratio;
122 vInterp_[jlev] = vObs[SigB] + (vObs[SigA] - vObs[SigB]) * Ratio;
125 float VectDiffSq = std::pow(uObs[jlev] -
uInterp_[jlev], 2) +
126 std::pow(vObs[jlev] -
vInterp_[jlev], 2);
137 oops::Log::debug() <<
" -> Failed wind speed interpolation check for levels " << jlev
138 <<
" (central), " << SigB <<
" (lower) and "
139 << SigA <<
" (upper)" << std::endl;
141 <<
"P = " << pressures[jlev] * 0.01 <<
"hPa, uObs = "
142 << uObs[jlev] <<
"ms^-1, vObs = "
143 << vObs[jlev] <<
"ms^-1, uInterp = " <<
uInterp_[jlev]
144 <<
"ms^-1, vInterp = " <<
vInterp_[jlev] <<
"ms^-1" << std::endl;
145 oops::Log::debug() <<
" -> VectDiffSq = " << VectDiffSq <<
"m^2s^-2" << std::endl;
149 if (NumErrors > 0) NumInterpErrObs[0]++;
Options controlling the operation of the ConventionalProfileProcessing filter.
oops::Parameter< std::vector< float > > UICheck_BigGapsPThresh
oops::Parameter< float > UICheck_BigGapLowP
Big gap (Pa) used at lowest pressures in wind speed interpolation check.
oops::Parameter< float > UICheck_TInterpIdenticalPTolSq
Squared tolerance for identical pressure in wind speed interpolation check (m^2 s^-2)
oops::Parameter< float > UICheck_TInterpTolSq
Squared tolerance for wind speed interpolation check (m^2 s^-2)
oops::Parameter< std::vector< float > > UICheck_BigGaps
Profile QC checker base class.
const float missingValueFloat
Missing value (float)
const ConventionalProfileProcessingParameters & options_
Configurable parameters.
void runCheck(ProfileDataHandler &profileDataHandler) override
Run check.
std::vector< float > vInterp_
Interpolated value of v.
void fillValidationData(ProfileDataHandler &profileDataHandler) override
Fill variables in validator.
ProfileCheckUInterp(const ConventionalProfileProcessingParameters &options)
std::vector< float > uInterp_
Interpolated value of u.
std::vector< int > LevErrors_
Number of failed checks by level.
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)
void set(const std::string &fullname, std::vector< T > &&vec_in)
int getNumProfileLevels() const
Return number of levels to which QC checks should be applied.
Calculate standard levels.
void calcStdLevelsUV(const int numProfileLevels, const std::vector< float > &pressures, const std::vector< float > &uObs, const std::vector< float > &vObs, const std::vector< int > &uFlags)
Calculate standard levels for U and V data.
std::vector< int > StdLev_
Index of standard levels.
std::vector< float > LogP_
Log(Pressure) - used for vertical interpolation.
int NumStd_
Number of standard levels.
std::vector< int > SigBelow_
Significant level below standard level.
std::vector< int > SigAbove_
Significant level above standard level.
int NumSig_
Number of significant levels.
@ InterpolationFlag
Interpolation check flag.
static ProfileCheckMaker< ProfileCheckUInterp > makerProfileCheckUInterp_("UInterp")
static constexpr const char *const qcflags_eastward_wind
static constexpr const char *const LogP
static constexpr const char *const counter_NumSamePErrObs
static constexpr const char *const counter_NumInterpErrObs
static constexpr const char *const LevErrors
static constexpr const char *const uInterp
static constexpr const char *const NumSig
static constexpr const char *const obs_northward_wind
static constexpr const char *const NumStd
static constexpr const char *const obs_eastward_wind
static constexpr const char *const SigBelow
static constexpr const char *const StdLev
static constexpr const char *const vInterp
static constexpr const char *const obs_air_pressure
static constexpr const char *const SigAbove