UFO
ProfileCheckPermanentReject.cc
Go to the documentation of this file.
1 /*
2  * (C) Crown copyright 2020, Met Office
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  */
7 
9 
10 namespace ufo {
11 
12  static ProfileCheckMaker<ProfileCheckPermanentReject>
14 
16  (const ProfileConsistencyCheckParameters &options,
17  const ProfileIndices &profileIndices,
18  ProfileDataHandler &profileDataHandler,
19  ProfileCheckValidator &profileCheckValidator)
20  : ProfileCheckBase(options, profileIndices, profileDataHandler, profileCheckValidator)
21  {}
22 
24  {
25  oops::Log::debug() << " Permanent rejection check" << std::endl;
26 
27  const size_t numLevelsToCheck = profileIndices_.getNumLevelsToCheck();
28  const bool ModelLevels = options_.modellevels.value();
29  std::vector <int> &tFlags =
31  std::vector <int> &rhFlags =
33  std::vector <int> &uFlags =
35  std::vector <int> &vFlags =
37  std::vector <int> &zFlags =
39  std::vector <int> &ReportFlags =
41 
42  if (ReportFlags.empty()) {
43  oops::Log::debug() << "ReportFlags vector is empty. "
44  << "Permanent rejection check will not be performed." << std::endl;
45  return;
46  }
47 
48  // Set PermRejectFlag on individual elements if whole report has PermReject.
49  for (int jlev = 0; jlev < numLevelsToCheck; ++jlev) {
51  for (auto flags : {&tFlags, &rhFlags, &uFlags, &vFlags, &zFlags})
52  if (!flags->empty()) (*flags)[jlev] |= ufo::MetOfficeQCFlags::Elem::PermRejectFlag;
53  }
54  }
55 
56  // Set FinalRejectFlag on individual elements if a variety of criteria
57  // are met on model-level data.
58  if (ModelLevels) {
59  for (int jlev = 0; jlev < numLevelsToCheck; ++jlev) {
65  for (auto flags : {&tFlags, &rhFlags, &uFlags, &vFlags, &zFlags})
66  if (!flags->empty()) (*flags)[jlev] |= ufo::MetOfficeQCFlags::Elem::FinalRejectFlag;
67  }
68  }
69  }
70  }
71 } // namespace ufo
ufo::ProfileDataHandler
Retrieve and store data for individual profiles. To do this, first the vector of values in the entire...
Definition: ProfileDataHandler.h:40
ufo::MetOfficeQCFlags::PermRejectFlag
@ PermRejectFlag
Blacklisted data.
Definition: MetOfficeQCFlags.h:57
ufo::ProfileCheckBase::profileIndices_
const ProfileIndices & profileIndices_
Indices of profile's observations in the entire sample.
Definition: ProfileCheckBase.h:74
ufo::ProfileIndices
Determine indices of observations making up individual profiles. The indices are computed with respec...
Definition: ProfileIndices.h:39
ufo::ProfileCheckBase::profileDataHandler_
ProfileDataHandler & profileDataHandler_
Profile data handler.
Definition: ProfileCheckBase.h:77
ufo::ProfileIndices::getNumLevelsToCheck
int getNumLevelsToCheck() const
Return number of levels to which QC checks should be applied.
Definition: ProfileIndices.h:52
ufo::VariableNames::qcflags_northward_wind
static constexpr const char *const qcflags_northward_wind
Definition: VariableNames.h:96
ufo::ProfileCheckValidator
Profile QC check validator.
Definition: ProfileCheckValidator.h:27
ufo_radiancerttov_utils_mod::debug
logical, public debug
Definition: ufo_radiancerttov_utils_mod.F90:100
ufo::VariableNames::qcflags_eastward_wind
static constexpr const char *const qcflags_eastward_wind
Definition: VariableNames.h:95
ufo::VariableNames::qcflags_observation_report
static constexpr const char *const qcflags_observation_report
Definition: VariableNames.h:91
ufo::makerProfileCheckPermanentReject_
static ProfileCheckMaker< ProfileCheckPermanentReject > makerProfileCheckPermanentReject_("PermanentReject")
ufo::ProfileCheckPermanentReject::runCheck
void runCheck() override
Run check.
Definition: ProfileCheckPermanentReject.cc:23
ufo::VariableNames::qcflags_relative_humidity
static constexpr const char *const qcflags_relative_humidity
Definition: VariableNames.h:93
ProfileCheckPermanentReject.h
ufo::VariableNames::qcflags_geopotential_height
static constexpr const char *const qcflags_geopotential_height
Definition: VariableNames.h:94
ufo
Definition: RunCRTM.h:27
ufo::ProfileConsistencyCheckParameters::modellevels
oops::Parameter< bool > modellevels
Have the observation and model values been averaged onto model levels?
Definition: ProfileConsistencyCheckParameters.h:54
ufo::ProfileCheckBase
Profile QC checker base class.
Definition: ProfileCheckBase.h:40
ufo::ProfileCheckBase::options_
const ProfileConsistencyCheckParameters & options_
Configurable parameters.
Definition: ProfileCheckBase.h:71
ufo::MetOfficeQCFlags::OutOfAreaReport
@ OutOfAreaReport
Outside analysis area/time.
Definition: MetOfficeQCFlags.h:29
ufo::MetOfficeQCFlags::TrackRejectReport
@ TrackRejectReport
Failed track check.
Definition: MetOfficeQCFlags.h:32
ufo::MetOfficeQCFlags::PermRejectReport
@ PermRejectReport
Blacklisted data.
Definition: MetOfficeQCFlags.h:27
ufo::ProfileConsistencyCheckParameters
Options controlling the operation of the ProfileConsistencyChecks filter.
Definition: ProfileConsistencyCheckParameters.h:33
ufo::ProfileCheckPermanentReject::ProfileCheckPermanentReject
ProfileCheckPermanentReject(const ProfileConsistencyCheckParameters &options, const ProfileIndices &profileIndices, ProfileDataHandler &profileDataHandler, ProfileCheckValidator &profileCheckValidator)
Definition: ProfileCheckPermanentReject.cc:16
ufo::VariableNames::qcflags_air_temperature
static constexpr const char *const qcflags_air_temperature
Definition: VariableNames.h:92
ufo::MetOfficeQCFlags::FinalRejectReport
@ FinalRejectReport
One of flags 1-6 set.
Definition: MetOfficeQCFlags.h:26
ufo::MetOfficeQCFlags::FinalRejectFlag
@ FinalRejectFlag
Final QC flag.
Definition: MetOfficeQCFlags.h:54
ufo::ProfileDataHandler::get
std::vector< T > & get(const std::string &fullname)
Definition: ProfileDataHandler.h:53
ufo::MetOfficeQCFlags::SurplusReport
@ SurplusReport
(Near) duplicate data
Definition: MetOfficeQCFlags.h:28