Go to the documentation of this file.
19 :
ProfileCheckBase(options, profileIndices, profileDataHandler, profileCheckValidator),
29 const std::vector <float> &pressures =
31 const std::vector <float> &tObs =
33 const std::vector <float> &tBkg =
35 const std::vector <float> &zObs =
37 const std::vector <float> &zBkg =
39 std::vector <int> &tFlags =
41 std::vector <int> &zFlags =
43 std::vector <int> &NumAnyErrors =
45 std::vector <int> &Num925Miss =
47 std::vector <int> &Num100Miss =
49 std::vector <int> &NumStdMiss =
51 std::vector <int> &NumHydErrObs =
53 std::vector <int> &NumIntHydErrors =
55 const std::vector <float> &tObsCorrection =
57 std::vector <float> &zObsCorrection =
60 if (!oops::allVectorsSameNonZeroSize(pressures, tObs, tBkg, zObs, zBkg, tFlags, zFlags,
61 tObsCorrection, zObsCorrection)) {
62 oops::Log::warning() <<
"At least one vector is the wrong size. "
63 <<
"Check will not be performed." << std::endl;
64 oops::Log::warning() <<
"Vector sizes: "
65 << oops::listOfVectorSizes(pressures, tObs, tBkg, zObs, zBkg, tFlags,
66 zFlags, tObsCorrection, zObsCorrection)
71 std::vector <float> tObsFinal;
74 calcStdLevels(numLevelsToCheck, pressures, tObsFinal, tFlags);
86 for (
int jlevstd = 1; jlevstd <
NumStd_; ++jlevstd) {
88 int jlevB =
StdLev_[jlevstd - 1];
91 if (
IndStd_[jlevstd - 1] == -1) {
92 if (std::fabs(pressures[jlevB] - pressures[jlev]) >
110 <<
"P = " << pressures[jlev] * 0.01 <<
"hPa, tObs = "
114 <<
"P = " << pressures[jlevB] * 0.01 <<
"hPa, tObs = "
120 <<
"IndStd[" << jlevstd - 1 <<
"] = "
121 <<
IndStd_[jlevstd - 1] << std::endl;
126 D_[jlevstd] =
DC_[jlevstd] *
127 (tObsFinal[jlevB] + tObsFinal[jlev]);
131 float DB =
DC_[jlevstd] * (1.0 + TRatio) *
133 float DA =
DC_[jlevstd] * (1.0 / TRatio + 1.0) *
140 ETol_[jlevstd] = std::max(std::min(
ETol_[jlevstd], ETolMax), ETolMin);
141 E_[jlevstd] = zObs[jlev] - zObs[jlevB] -
D_[jlevstd];
142 if (std::fabs(
E_[jlevstd]) >
ETol_[jlevstd]) {
152 oops::Log::debug() <<
" -> removed interpolation flag on level " << jlevB << std::endl;
161 for (
int jlevstd = 2; jlevstd <
NumStd_; ++jlevstd) {
163 if (eckit::types::is_approximately_equal(
DC_[jlevstd - 1], 0.0f) ||
164 eckit::types::is_approximately_equal(
DC_[jlevstd], 0.0f))
continue;
166 int jlevB =
StdLev_[jlevstd - 1];
179 << jlev <<
" and " << jlevB << std::endl;
191 float EDC1 =
E_[jlevstd - 1] *
DC_[jlevstd];
192 float EDC2 =
E_[jlevstd] *
DC_[jlevstd - 1];
193 float MinAbsEDC = std::min(std::fabs(EDC1), std::fabs(EDC2));
195 *
DC_[jlevstd] *
DC_[jlevstd - 1];
196 float AbsEDCDiff = std::fabs(EDC1 - EDC2);
198 *
DC_[jlevstd] *
DC_[jlevstd - 1];
200 float MinAbsE = std::min(std::fabs(
E_[jlevstd - 1]), std::fabs(
E_[jlevstd]));
203 if (jlevstd <
NumStd_ - 1) ENext =
E_[jlevstd + 1];
206 if ((std::fabs(
E_[jlevstd - 1] +
E_[jlevstd]) <=
209 (std::fabs(
E_[jlevstd - 1] +
E_[jlevstd]) <=
213 oops::Log::debug() <<
" -> Failed hydrostatic check (height error) on level "
214 << jlevB << std::endl;
217 float Corr = 0.5 * (
E_[jlevstd] -
E_[jlevstd - 1]);
218 float CorrApp = 100.0 * std::round(Corr / 100.0);
221 <<
"hPa, zObs = " << zObs[jlevB] <<
"m, "
222 <<
"Z Correction? " << Corr <<
"m"
223 <<
", rounded = " << CorrApp <<
"m" << std::endl;
224 if (CorrApp != 0.0) {
227 zObsCorrection[jlevB] = CorrApp;
228 oops::Log::debug() <<
" -> Uncorrected zObs: " << zObs[jlevB] <<
"m" << std::endl;
231 << zObs[jlevB] + zObsCorrection[jlevB] <<
"m" << std::endl;
239 std::fabs(
E_[jlevstd - 1] +
E_[jlevstd] + ENext) <=
247 oops::Log::debug() <<
" -> Failed hydrostatic check (height error) on levels "
248 << jlevB <<
" and " << jlev << std::endl;
250 float Corr = -
E_[jlevstd - 1];
251 oops::Log::debug() <<
" -> P = " << pressures[jlevB] * 0.01 <<
"hPa, zObs = "
252 << zObs[jlevB] <<
"m, "
253 <<
"Z Correction? " << Corr <<
"m" << std::endl;
255 oops::Log::debug() <<
" -> P = " << pressures[jlev] * 0.01 <<
"hPa, zObs = "
256 << zObs[jlev] <<
"m, "
257 <<
"Z Correction? " << Corr <<
"m" << std::endl;
261 AbsEDCDiff <= CorrDiffThreshDC &&
262 MinAbsEDC >= CorrMinThreshDC) {
267 oops::Log::debug() <<
" -> Failed hydrostatic check (temperature error) on level "
268 << jlevB << std::endl;
271 float Corr1 =
E_.at(jlevstd - 1) /
DC_.at(jlevstd - 1);
272 float Corr2 =
E_.at(jlevstd) /
DC_.at(jlevstd);
273 float Corr = 0.5 * (Corr1 + Corr2);
274 oops::Log::debug() <<
" -> P = " << pressures[jlevB] * 0.01 <<
"hPa, tObs = "
276 <<
"T Correction? " << Corr <<
"C, "
277 <<
" Corr1, Corr2 = "
278 << Corr1 <<
"C, " << Corr2 <<
"C , DC[" << jlevstd - 1
279 <<
"], DC[" << jlevstd <<
"] = "
280 <<
DC_[jlevstd - 1] <<
", " <<
DC_[jlevstd]
290 NumIntHydErrors[0]++;
292 << SigB <<
" " << SigA << std::endl;
304 <<
"(bottom level error in T or Z) on level " << L1 << std::endl;
311 <<
"? P = " << pressures[L1] * 0.01 <<
"hPa, zObs = "
312 << zObs[L1] <<
"m, zBkg = " << zBkg[L1]
314 << zObs[L1] +
E_[jlevstd - 1] <<
"m" << std::endl;
322 <<
"(error in all subsequent heights) on level "
323 << jlevB << std::endl;
325 }
else if (
HydError_[jlevstd - 1] == 3) {
330 <<
"(T and/or Z error) on level " << jlevB << std::endl;
340 <<
"(top level error in T or Z) on level " << jlev << std::endl;
345 for (
int jlevstd = 0; jlevstd <
NumStd_; ++jlevstd) {
350 <<
"P = " << pressures[jlev] * 0.01 <<
"hPa, tObs = "
353 <<
"zObs = " << zObs[jlev] <<
"m, zBkg = " << zBkg[jlev] <<
"m, "
354 <<
"D = " <<
D_[jlevstd] <<
", E = " <<
E_[jlevstd]
355 <<
", ETol = " <<
ETol_[jlevstd] <<
", DC = " <<
DC_[jlevstd]
356 <<
", HydDesc = " <<
HydDesc_[HydType] <<
" " << std::endl;
static constexpr const char *const counter_NumAnyErrors
oops::Parameter< float > HCheck_ESumNextThresh
std::vector< float > LogP_
Log(Pressure) - used for vertical interpolation.
oops::Parameter< float > HCheck_CorrThresh
Retrieve and store data for individual profiles. To do this, first the vector of values in the entire...
const ProfileIndices & profileIndices_
Indices of profile's observations in the entire sample.
oops::Parameter< float > HCheck_EThresh
std::vector< int > StdLev_
Index of standard levels.
Determine indices of observations making up individual profiles. The indices are computed with respec...
ProfileDataHandler & profileDataHandler_
Profile data handler.
static constexpr const char *const HydError
int getNumLevelsToCheck() const
Return number of levels to which QC checks should be applied.
oops::Parameter< float > HCheck_SurfacePThresh
Surface P threshold for hydrostatic check (Pa)
static constexpr const char *const hofx_geopotential_height
static constexpr double t0c
oops::Parameter< float > HCheck_MinAbsEThreshT
std::vector< float > ETol_
Thickness tolerance.
Profile QC check validator.
Calculate standard levels.
static constexpr const char *const counter_NumHydErrObs
oops::Parameter< float > HCheck_EThreshB
static constexpr const char *const ETol
oops::Parameter< float > HCheck_MinAbsEThreshLarger
int Ind925_
Standard level index closest to 925 hPa.
std::vector< int > IndStd_
Indices of standard levels.
void calcStdLevels(const int numLevelsToCheck, const std::vector< float > &pressures, const std::vector< float > &tObs, const std::vector< int > &tFlags)
Calculate standard levels.
static constexpr const char *const qcflags_geopotential_height
Profile QC checker base class.
const ProfileConsistencyCheckParameters & options_
Configurable parameters.
int NumStd_
Number of standard levels.
static constexpr double rd_over_g
static constexpr const char *const counter_Num925Miss
oops::Parameter< float > HCheck_CorrDiffThresh
ProfileCheckHydrostatic(const ProfileConsistencyCheckParameters &options, const ProfileIndices &profileIndices, ProfileDataHandler &profileDataHandler, ProfileCheckValidator &profileCheckValidator)
oops::Parameter< float > HCheck_MinAbsEThresh
static constexpr const char *const obs_air_pressure
std::vector< std::string > HydDesc_
Hydrostatic error descriptions.
const float missingValueFloat
Missing value (float)
oops::Parameter< bool > HCheck_CorrectZ
Correct zObs in the hydrostatic check?
static constexpr const char *const E
static constexpr const char *const D
std::vector< float > D_
Thickness calculated from temepature.
oops::Parameter< float > HCheck_ESumThreshLarger
static constexpr const char *const hofx_air_temperature
oops::Parameter< float > HCheck_ETolMaxPThresh
std::vector< int > HydError_
Hydrostatic flag by level.
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 obscorrection_geopotential_height
std::vector< float > DC_
Constant in thickness calculation.
int Ind100_
Standard level index closest to 100 hPa.
static constexpr double rd_over_cp
oops::Parameter< float > HCheck_ETolMax
std::vector< int > SigBelow_
Significant level below standard level.
void correctVector(const std::vector< T > &v1, const std::vector< T > &v2, std::vector< T > &vout)
Apply correction to vector of values.
std::vector< float > E_
Thickness 'error'.
static constexpr const char *const obscorrection_air_temperature
@ HydrostaticFlag
Hydrostatic check flag.
static constexpr const char *const obs_geopotential_height
oops::Parameter< float > HCheck_CorrMinThresh
static constexpr const char *const qcflags_air_temperature
void fillValidator() override
Fill variables in validator.
@ FinalRejectFlag
Final QC flag.
oops::Parameter< float > HCheck_ETolMaxLarger
@ InterpolationFlag
Interpolation check flag.
void findHCheckStdLevs()
Compute indices of particular standard levels for the hydrostatic check.
std::vector< int > SigAbove_
Significant level above standard level.
std::vector< T > & get(const std::string &fullname)
static constexpr const char *const counter_Num100Miss
static constexpr const char *const obs_air_temperature
void set(const std::string &fullname, std::vector< T > &&vec_in)
oops::Parameter< float > HCheck_ESumThresh
oops::Parameter< float > HCheck_ETolMin
void runCheck() override
Run check.
@ DataCorrectFlag
Eg sign correction.
oops::Parameter< std::vector< std::string > > HydDesc
Hydrostatic error descriptions.
oops::Parameter< float > HCheck_ETolMult
static constexpr const char *const counter_NumIntHydErrors
@ SurfaceLevelFlag
Surface Level.
static ProfileCheckMaker< ProfileCheckHydrostatic > makerProfileCheckHydrostatic_("Hydrostatic")