UFO
ObsProfileAverage.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2021 UK 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_OBSPROFILEAVERAGE_H_
9 #define UFO_PROFILE_OBSPROFILEAVERAGE_H_
10 
11 #include <memory>
12 #include <ostream>
13 #include <string>
14 #include <vector>
15 
16 #include "oops/base/Variables.h"
17 #include "oops/util/ObjectCounter.h"
18 
19 #include "ufo/ObsOperatorBase.h"
20 
23 
24 /// Forward declarations
25 namespace eckit {
26  class Configuration;
27 }
28 
29 namespace ioda {
30  class ObsSpace;
31  class ObsVector;
32 }
33 
34 namespace ufo {
35  class GeoVaLs;
36  class Locations;
37  class ObsDiagnostics;
38 
39 /// \brief Observation operator for profile averaging.
40 ///
41 /// This observation operator produces H(x) vectors which correspond to vertically-averaged
42 /// profiles. The algorithm determines the locations at which reported-level profiles
43 /// intersect each model pressure level. The intersections are found by stepping through the
44 /// observation locations from the lowest-altitude value upwards. For each model level,
45 /// the location of the observation whose pressure is larger than, and closest to, the model
46 /// pressure is recorded. The \p<vertical coordinate> parameter controls the model pressure
47 /// GeoVaLs that are used in this procedure.
48 /// If there are no observations in a model level, which can occur for (e.g.) sondes reporting in
49 /// low-frequency TAC format, the location corresponding to the last filled level is used.
50 /// (If there are some model levels closer to the surface than the lowest-altitude observation,
51 /// the location of the lowest observation is used for these levels.)
52 ///
53 /// This procedure is iterated multiple times in order to account for the fact that model pressures
54 /// can be slanted close to the Earth's surface.
55 /// The number of iterations is configured with the \p<number of intersection iterations> parameter.
56 ///
57 /// Having obtained the profile boundaries, values of model pressure and any simulated variables
58 /// are obtained as in the locations that were determined in the procedure above.
59 /// This produces a single column of model values which are used as the H(x) variable.
60 /// In essence, this operator converts a set of GeoVaLs to what is referred to as a 'CX column'
61 /// in OPS terminology.
62 ///
63 /// In order for this operator to work correctly the ObsSpace must have been extended as in
64 /// the following yaml snippet:
65 ///
66 /// - obs space:
67 /// extension:
68 /// average profiles onto model levels: 71
69 ///
70 /// (where 71 can be replaced by the length of the air_pressure_levels GeoVaL).
71 /// The H(x) values are placed in the extended section of the ObsSpace.
72 /// Note that, unlike what may be expected for an observation operator, averaging of the model
73 /// values across each layer is not performed; a single model value is used in each case.
74 /// This follows what is used in OPS. Alternatives could be considered in the future.
75 ///
76 /// A comparison with OPS is be performed if the option \p<compare with OPS> is set to true.
77 /// This checks values of the locations and pressure values associated with the slant path.
78 /// All other comparisons are performed with the standard 'vector ref' option in the yaml file.
79 ///
80 /// This operator also accepts an optional `variables` parameter, which controls which ObsSpace
81 /// variables will be simulated. This option should only be set if this operator is used as a
82 /// component of the Composite operator. If `variables` is not set, the operator will simulate
83 /// all ObsSpace variables. Please see the documentation of the Composite operator for further
84 /// details.
86  private util::ObjectCounter<ObsProfileAverage> {
87  public:
88  static const std::string classname() {return "ufo::ObsProfileAverage";}
89 
90  ObsProfileAverage(const ioda::ObsSpace &, const eckit::Configuration &);
91  ~ObsProfileAverage() override;
92 
93  void simulateObs(const GeoVaLs &, ioda::ObsVector &, ObsDiagnostics &) const override;
94 
95  const oops::Variables & requiredVars() const override { return data_.requiredVars(); }
96 
97  oops::Variables simulatedVars() const override { return data_.simulatedVars(); }
98 
99  private:
100  void print(std::ostream &) const override;
101 
102  private:
103  /// ObsSpace.
104  const ioda::ObsSpace& odb_;
105 
106  /// Data handler for the ProfileAverage operator and TL/AD code.
108 };
109 
110 // -----------------------------------------------------------------------------
111 
112 } // namespace ufo
113 #endif // UFO_PROFILE_OBSPROFILEAVERAGE_H_
GeoVaLs: geophysical values at locations.
Data handling class for the ProfileAverage observation operator and TL/AD code.
const oops::Variables & requiredVars() const
Return required variables for the operator.
const oops::Variables & simulatedVars() const
Return simulated variables for the operator.
Observation operator for profile averaging.
ObsProfileAverageData data_
Data handler for the ProfileAverage operator and TL/AD code.
void simulateObs(const GeoVaLs &, ioda::ObsVector &, ObsDiagnostics &) const override
Obs Operator.
void print(std::ostream &) const override
oops::Variables simulatedVars() const override
List of variables simulated by this operator.
static const std::string classname()
ObsProfileAverage(const ioda::ObsSpace &, const eckit::Configuration &)
const oops::Variables & requiredVars() const override
Operator input required from Model.
const ioda::ObsSpace & odb_
ObsSpace.
Forward declarations.
Definition: ObsAodExt.h:21
Forward declarations.
Definition: ObsAodExt.h:25
Definition: RunCRTM.h:27