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 
17  : ProfileCheckBase(options)
18  {}
19 
21  {
22  oops::Log::debug() << " Permanent rejection check" << std::endl;
23 
24  const size_t numProfileLevels = profileDataHandler.getNumProfileLevels();
25  const bool ModelLevels = options_.modellevels.value();
26  std::vector <int> &tFlags =
27  profileDataHandler.get<int>(ufo::VariableNames::qcflags_air_temperature);
28  std::vector <int> &rhFlags =
29  profileDataHandler.get<int>(ufo::VariableNames::qcflags_relative_humidity);
30  std::vector <int> &uFlags =
31  profileDataHandler.get<int>(ufo::VariableNames::qcflags_eastward_wind);
32  std::vector <int> &vFlags =
33  profileDataHandler.get<int>(ufo::VariableNames::qcflags_northward_wind);
34  std::vector <int> &zFlags =
36  std::vector <int> &ReportFlags =
37  profileDataHandler.get<int>(ufo::VariableNames::qcflags_observation_report);
38 
39  if (ReportFlags.empty()) {
40  oops::Log::debug() << "ReportFlags vector is empty. "
41  << "Permanent rejection check will not be performed." << std::endl;
42  return;
43  }
44 
45  // Set PermRejectFlag on individual elements if whole report has PermReject.
46  for (int jlev = 0; jlev < numProfileLevels; ++jlev) {
49  tFlags, rhFlags, uFlags, vFlags, zFlags);
50  }
51  }
52 
53  // Set FinalRejectFlag on individual elements if a variety of criteria
54  // are met on model-level data.
55  if (ModelLevels) {
56  for (int jlev = 0; jlev < numProfileLevels; ++jlev) {
63  tFlags, rhFlags, uFlags, vFlags, zFlags);
64  }
65  }
66  }
67  }
68 } // namespace ufo
Options controlling the operation of the ConventionalProfileProcessing filter.
oops::Parameter< bool > modellevels
Have the observation and model values been averaged onto model levels?
Profile QC checker base class.
const ConventionalProfileProcessingParameters & options_
Configurable parameters.
void SetQCFlag(const int &flag, const size_t &jlev, std::vector< T > &vec)
ProfileCheckPermanentReject(const ConventionalProfileProcessingParameters &options)
void runCheck(ProfileDataHandler &profileDataHandler) override
Run check.
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)
int getNumProfileLevels() const
Return number of levels to which QC checks should be applied.
@ SurplusReport
(Near) duplicate data
@ TrackRejectReport
Failed track check.
@ FinalRejectReport
One of flags 1-6 set.
@ PermRejectReport
Blacklisted data.
@ OutOfAreaReport
Outside analysis area/time.
@ FinalRejectFlag
Final QC flag.
@ PermRejectFlag
Blacklisted data.
Definition: RunCRTM.h:27
static ProfileCheckMaker< ProfileCheckPermanentReject > makerProfileCheckPermanentReject_("PermanentReject")
static constexpr const char *const qcflags_observation_report
Definition: VariableNames.h:98
static constexpr const char *const qcflags_eastward_wind
static constexpr const char *const qcflags_northward_wind
static constexpr const char *const qcflags_relative_humidity
static constexpr const char *const qcflags_air_temperature
Definition: VariableNames.h:99
static constexpr const char *const qcflags_geopotential_height