UFO
ProfileAverageTemperature.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_PROFILEAVERAGETEMPERATURE_H_
9 #define UFO_PROFILE_PROFILEAVERAGETEMPERATURE_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 temperature 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  /// The vertical processing of temperature is based on calculating the thickness
35  /// of the model layers (rather than just averaging the temperatures).
36  /// The potential temperature in each layer is converted to temperature
37  /// by multiplying by the Exner pressure.
38  ///
39  /// When the model layer is not completely covered by observations,
40  /// a potential temperature observation-minus-background increment is computed
41  /// using linear interpolation of temperature between the layer boundaries.
42  /// This increment is added to the background value to produce
43  /// the averaged observation value.
45  public:
47 
48  /// Average temperature observations onto model levels and store the results.
49  /// \throws eckit::BadValue if vectors produced by the AveragePressure routine
50  /// are not present.
51  void runCheck(ProfileDataHandler &profileDataHandler) override;
52 
53  /// Fill variables in validator (for comparison with OPS output).
54  void fillValidationData(ProfileDataHolder &profileDataHolder);
55 
56  /// Run this check on the entire sample?
57  bool runOnEntireSample() override {return true;}
58 
59  /// List of names of required GeoVaLs.
60  oops::Variables getGeoVaLNames() override {
61  return oops::Variables({ufo::VariableNames::geovals_potential_temperature});}
62 
63  /// List of names of GeoVaLs used in check validation.
64  oops::Variables getValidationGeoVaLNames() override {
65  return oops::Variables({ufo::VariableNames::geovals_air_temperature,
68  });}
69 
70  private:
71  /// Run check on a profile in the original ObsSpace and
72  /// put the averaged data into the corresponding profile in the extended ObsSpace.
73  void runCheckOnProfiles(ProfileDataHolder &profileOriginal,
74  ProfileDataHolder &profileExtended);
75  };
76 } // namespace ufo
77 
78 #endif // UFO_PROFILE_PROFILEAVERAGETEMPERATURE_H_
Options controlling the operation of the ConventionalProfileProcessing filter.
Profile QC: average temperature observations onto model levels.
bool runOnEntireSample() override
Run this check on the entire sample?
oops::Variables getValidationGeoVaLNames() override
List of names of GeoVaLs used in check validation.
void runCheck(ProfileDataHandler &profileDataHandler) override
oops::Variables getGeoVaLNames() override
List of names of required GeoVaLs.
void runCheckOnProfiles(ProfileDataHolder &profileOriginal, ProfileDataHolder &profileExtended)
ProfileAverageTemperature(const ConventionalProfileProcessingParameters &options)
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_average_air_temperature
static constexpr const char *const geovals_potential_temperature
static constexpr const char *const geovals_average_air_temperature_qcflags
static constexpr const char *const geovals_air_temperature