UFO
ObsBackgroundErrorIdentity.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_BACKGROUNDERRORIDENTITY_OBSBACKGROUNDERRORIDENTITY_H_
9 #define UFO_BACKGROUNDERRORIDENTITY_OBSBACKGROUNDERRORIDENTITY_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 
21 #include "ufo/filters/Variable.h"
22 #include "ufo/ObsOperatorBase.h"
25 
26 /// Forward declarations
27 namespace ioda {
28  class ObsSpace;
29  class ObsVector;
30 }
31 
32 namespace ufo {
33  class GeoVaLs;
34  class Locations;
35  class ObsDiagnostics;
36 
37 /// \brief Options controlling the ObsBackgroundErrorIdentity observation operator.
40 
41  public:
42  /// Simulated variables whose background errors may be calculated by this operator.
43  /// If not specified, defaults to the list of all simulated variables in the ObsSpace.
44  oops::OptionalParameter<std::vector<Variable>> variables{"variables", this};
45 };
46 
47 /// \brief An observation operator calculating ObsDiagnostics representing single-level
48 /// background errors of simulated variables.
49 ///
50 /// It should be used as a component of the `Composite` observation operator (with another
51 /// component handling the calculation of model equivalents of observation). It populates all
52 /// requested ObsDiagnostics called `<var>_background_error`, where `<var>` is the name of a
53 /// simulated variable, by copying the `<var>_background_error` GeoVaL at the observation
54 /// locations.
55 ///
56 /// If the `variables` option is present, the operator does not calculate the background errors
57 /// of all simulated variables in the ObsSpace, but only those listed in the `variables` option.
58 ///
59 /// See ObsBackgroundErrorIdentityParameters for the description of YAML configuration options
60 /// accepted by this operator.
61 ///
62 /// Example configuration:
63 ///
64 /// obs operator:
65 /// name: Composite
66 /// components:
67 /// # operator used to evaluate H(x)
68 /// - name: identity
69 /// vertical coordinate: geopotential_height # coordinate used for obs value interpolation
70 /// # operator used to evaluate background errors
71 /// - name: BackgroundErrorIdentity
73  private util::ObjectCounter<ObsBackgroundErrorIdentity> {
74  public:
75  /// The type of parameters accepted by the constructor of this operator.
76  /// This typedef is used by the ObsOperatorFactory.
78 
79  static const std::string classname() {return "ufo::ObsBackgroundErrorIdentity";}
80 
81  ObsBackgroundErrorIdentity(const ioda::ObsSpace &, const Parameters_ &);
82 
84 
85  void simulateObs(const GeoVaLs &, ioda::ObsVector &, ObsDiagnostics &) const override;
86 
87  const oops::Variables & requiredVars() const override;
88 
89  oops::Variables simulatedVars() const override;
90 
91  private:
92  void print(std::ostream &) const override;
93 
94  private:
95  const ioda::ObsSpace& odb_;
97  oops::Variables requiredVars_;
98 };
99 
100 } // namespace ufo
101 
102 #endif // UFO_BACKGROUNDERRORIDENTITY_OBSBACKGROUNDERRORIDENTITY_H_
GeoVaLs: geophysical values at locations.
An observation operator calculating ObsDiagnostics representing single-level background errors of sim...
const oops::Variables & requiredVars() const override
Operator input required from Model.
void print(std::ostream &) const override
ObsBackgroundErrorIdentity(const ioda::ObsSpace &, const Parameters_ &)
ObsBackgroundErrorIdentityParameters Parameters_
void simulateObs(const GeoVaLs &, ioda::ObsVector &, ObsDiagnostics &) const override
Obs Operator.
oops::Variables simulatedVars() const override
List of variables simulated by this operator.
Options controlling the ObsBackgroundErrorIdentity observation operator.
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