UFO
ProfileAverageRelativeHumidity.h
Go to the documentation of this file.
1 /*
2  * (C) Crown copyright 2021, 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 
8 #ifndef UFO_PROFILE_PROFILEAVERAGERELATIVEHUMIDITY_H_
9 #define UFO_PROFILE_PROFILEAVERAGERELATIVEHUMIDITY_H_
10 
11 #include <algorithm>
12 #include <cmath>
13 #include <vector>
14 
18 
19 namespace ioda {
20  class ObsSpace;
21 }
22 
23 namespace ufo {
24  class ConventionalProfileProcessingParameters;
25 }
26 
27 namespace ufo {
28 
29  /// \brief Profile QC: average relative humidity observations onto model levels.
30  ///
31  /// Vectors produced by the AveragePressure routine must be present
32  /// otherwise the exception eckit::BadValue will be thrown.
33  ///
34  /// By default, relative humidities are interpolated onto model layer boundaries rather than
35  /// averaged across layers in order to avoid unwanted smoothing.
36  /// This behaviour can be controlled with the \p AvgRH_Interp option.
37  ///
38  /// The interpolated/averaged relative humidity values are rejected at any layer where
39  /// the averaged temperature value is less than or equal to the threshold \p AvgRH_AvgTThreshold.
40  /// This threshold can be modified to an instrument-dependent value with the
41  /// parameter \p AvgRH_InstrTThresholds, which is a map between WMO sonde instrument codes
42  /// and the associated temperature thresholds.
44  public:
46 
47  /// Average relative humidity observations onto model levels and store the results.
48  /// \throws eckit::BadValue if vectors produced by the AveragePressure routine
49  /// are not present.
50  void runCheck(ProfileDataHandler &profileDataHandler) override;
51 
52  /// Fill variables in validator (for comparison with OPS output).
53  void fillValidationData(ProfileDataHolder &profileDataHolder);
54 
55  /// Run this check on the entire sample?
56  bool runOnEntireSample() override {return true;}
57 
58  /// List of names of required GeoVaLs.
59  oops::Variables getGeoVaLNames() override {
60  return oops::Variables({ufo::VariableNames::geovals_relative_humidity});}
61 
62  /// List of names of GeoVaLs used in check validation.
63  oops::Variables getValidationGeoVaLNames() override {
66  });}
67 
68  private:
69  /// Run check on a profile in the original ObsSpace and
70  /// put the averaged data into the corresponding profile in the extended ObsSpace.
71  void runCheckOnProfiles(ProfileDataHolder &profileOriginal,
72  ProfileDataHolder &profileExtended);
73  };
74 } // namespace ufo
75 
76 #endif // UFO_PROFILE_PROFILEAVERAGERELATIVEHUMIDITY_H_
Options controlling the operation of the ConventionalProfileProcessing filter.
Profile QC: average relative humidity observations onto model levels.
void runCheck(ProfileDataHandler &profileDataHandler) override
ProfileAverageRelativeHumidity(const ConventionalProfileProcessingParameters &options)
oops::Variables getGeoVaLNames() override
List of names of required GeoVaLs.
oops::Variables getValidationGeoVaLNames() override
List of names of GeoVaLs used in check validation.
bool runOnEntireSample() override
Run this check on the entire sample?
void runCheckOnProfiles(ProfileDataHolder &profileOriginal, ProfileDataHolder &profileExtended)
void fillValidationData(ProfileDataHolder &profileDataHolder)
Fill variables in validator (for comparison with OPS output).
Profile QC checker base class.
Retrieve and store data for individual profiles. To do this, first the vector of values in the entire...
Profile data holder class.
Forward declarations.
Definition: ObsAodExt.h:25
Definition: RunCRTM.h:27
static constexpr const char *const geovals_relative_humidity
static constexpr const char *const geovals_average_relative_humidity
static constexpr const char *const geovals_average_relative_humidity_qcflags