UFO
ObsBackgroundErrorVertInterp.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2021 Met Office UK
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_BACKGROUNDERRORVERTINTERP_OBSBACKGROUNDERRORVERTINTERP_H_
9 #define UFO_BACKGROUNDERRORVERTINTERP_OBSBACKGROUNDERRORVERTINTERP_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 #include "oops/util/parameters/OptionalParameter.h"
19 #include "oops/util/parameters/Parameter.h"
20 #include "oops/util/parameters/RequiredParameter.h"
21 
22 #include "ufo/filters/Variable.h"
23 #include "ufo/ObsOperatorBase.h"
26 
27 /// Forward declarations
28 namespace ioda {
29  class ObsSpace;
30  class ObsVector;
31 }
32 
33 namespace ufo {
34  class GeoVaLs;
35  class Locations;
36  class ObsDiagnostics;
37 
38 /// \brief Options controlling the ObsBackgroundErrorVertInterp observation operator.
41 
42  public:
43  /// Simulated variables whose background errors may be calculated by this operator.
44  /// If not specified, defaults to the list of all simulated variables in the ObsSpace.
45  oops::OptionalParameter<std::vector<Variable>> variables{"variables", this};
46 
47  /// Name of the ufo variable (from the `MetaData` group) storing the vertical coordinate of
48  /// observation locations.
49  oops::RequiredParameter<std::string> observationVerticalCoordinate{
50  "observation vertical coordinate", this};
51 
52  /// Name of the GeoVaL storing the interpolation levels of background errors.
53  oops::RequiredParameter<std::string> verticalCoordinate{"vertical coordinate", this};
54 };
55 
56 /// \brief An observation operator calculating ObsDiagnostics representing vertically interpolated
57 /// background errors of simulated variables.
58 ///
59 /// It should be used as a component of the `Composite` observation operator (with another
60 /// component handling the calculation of model equivalents of observations). It populates all
61 /// requested ObsDiagnostics called `<var>_background_error`, where `<var>` is the name of a
62 /// simulated variable, by vertically interpolating the `<var>_background_error` GeoVaL at the
63 /// observation locations. Element (i, j) of this GeoVaL is interpreted as the background error
64 /// estimate of variable `<var>` at the ith observation location and the vertical position read from
65 /// the (i, j)th element of the GeoVaL specified in the `interpolation level` option of the
66 /// ObsOperator.
67 ///
68 /// If the `variables` option is present, the operator does not calculate the background errors
69 /// of all simulated variables in the ObsSpace, but only those listed in the `variables` option.
70 ///
71 /// See ObsBackgroundErrorVertInterpParameters for the description of YAML configuration options
72 /// accepted by this operator.
73 ///
74 /// Example configuration:
75 ///
76 /// obs operator:
77 /// name: Composite
78 /// components:
79 /// # operator used to evaluate H(x)
80 /// - name: VertInterp
81 /// vertical coordinate: geopotential_height # coordinate used for obs value interpolation
82 /// # operator used to evaluate background errors
83 /// - name: BackgroundErrorVertInterp
84 /// # vertical coordinate of observation locations
85 /// observation vertical coordinate: geopotential_height
86 /// # GeoVaL storing interpolation levels of background errors
87 /// vertical coordinate: background_error_geopotential_height
88 ///
90  private util::ObjectCounter<ObsBackgroundErrorVertInterp> {
91  public:
92  /// The type of parameters accepted by the constructor of this operator.
93  /// This typedef is used by the ObsOperatorFactory.
95 
96  static const std::string classname() {return "ufo::ObsBackgroundErrorVertInterp";}
97 
98  ObsBackgroundErrorVertInterp(const ioda::ObsSpace &, const Parameters_ &);
99 
101 
102  void simulateObs(const GeoVaLs &, ioda::ObsVector &, ObsDiagnostics &) const override;
103 
104  const oops::Variables & requiredVars() const override;
105 
106  oops::Variables simulatedVars() const override;
107 
108  private:
109  void print(std::ostream &) const override;
110 
111  private:
112  const ioda::ObsSpace& odb_;
114  oops::Variables requiredVars_;
115 };
116 
117 } // namespace ufo
118 
119 #endif // UFO_BACKGROUNDERRORVERTINTERP_OBSBACKGROUNDERRORVERTINTERP_H_
GeoVaLs: geophysical values at locations.
An observation operator calculating ObsDiagnostics representing vertically interpolated background er...
void print(std::ostream &) const override
const oops::Variables & requiredVars() const override
Operator input required from Model.
oops::Variables simulatedVars() const override
List of variables simulated by this operator.
void simulateObs(const GeoVaLs &, ioda::ObsVector &, ObsDiagnostics &) const override
Obs Operator.
ObsBackgroundErrorVertInterp(const ioda::ObsSpace &, const Parameters_ &)
ObsBackgroundErrorVertInterpParameters Parameters_
Options controlling the ObsBackgroundErrorVertInterp observation operator.
oops::RequiredParameter< std::string > verticalCoordinate
Name of the GeoVaL storing the interpolation levels of background errors.
oops::RequiredParameter< std::string > observationVerticalCoordinate
oops::OptionalParameter< std::vector< Variable > > variables
Base class of classes storing configuration parameters of specific observation operators and linear o...
Forward declarations.
Definition: ObsAodExt.h:25
Definition: RunCRTM.h:27