SOCA
LinearGetValues.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2019-2021 UCAR
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 SOCA_GETVALUES_LINEARGETVALUES_H_
9 #define SOCA_GETVALUES_LINEARGETVALUES_H_
10 
11 #include <memory>
12 #include <ostream>
13 #include <string>
14 
15 #include "oops/util/ObjectCounter.h"
16 #include "oops/util/Printable.h"
17 
18 #include "soca/Fortran.h"
19 
20 #include "ufo/Locations.h"
21 
22 // Forward declarations
23 namespace soca {
24  class Increment;
25  class State;
26  class Model2GeoVaLs;
27  class LinearModel2GeoVaLs;
28 }
29 namespace ufo {
30  class GeoVaLs;
31 }
32 
33 //-----------------------------------------------------------------------------
34 
35 namespace soca {
36 
37  /// SOCA LinearGetValues
38  /*!
39  * LinearGetValues interpolates Increment and State trajectory to observation locations
40  */
41 class LinearGetValues : public util::Printable,
42  private util::ObjectCounter<LinearGetValues> {
43  public:
44  static const std::string classname() {return "soca::LinearGetValues";}
45 
46  /// Constructor, destructor
47  LinearGetValues(const Geometry &, const ufo::Locations &,
48  const eckit::Configuration &);
49  virtual ~LinearGetValues();
50 
51  /// Trajectory for the linearized interpolation
52  void setTrajectory(const State & state,
53  const util::DateTime & t1,
54  const util::DateTime & t2,
55  ufo::GeoVaLs & geovals); // NOLINT
56 
57  /// Forward and backward interpolation
58  void fillGeoVaLsTL(const Increment & inc,
59  const util::DateTime & t1,
60  const util::DateTime & t2,
61  ufo::GeoVaLs & geovals) const; // NOLINT
62  void fillGeoVaLsAD(Increment & inc, // NOLINT
63  const util::DateTime & t1,
64  const util::DateTime & t2,
65  const ufo::GeoVaLs & geovals) const;
66 
67  private:
68  void print(std::ostream &) const;
70  ufo::Locations locs_;
71  std::shared_ptr<const Geometry> geom_;
72  std::unique_ptr<Model2GeoVaLs> model2geovals_;
73  std::unique_ptr<LinearModel2GeoVaLs> linearmodel2geovals_;
74 };
75 // -----------------------------------------------------------------------------
76 
77 } // namespace soca
78 
79 #endif // SOCA_GETVALUES_LINEARGETVALUES_H_
Geometry handles geometry for SOCA model.
Definition: Geometry.h:48
Increment Class: Difference between two states.
Definition: Increment.h:61
SOCA LinearGetValues.
std::unique_ptr< Model2GeoVaLs > model2geovals_
static const std::string classname()
void print(std::ostream &) const
ufo::Locations locs_
void fillGeoVaLsAD(Increment &inc, const util::DateTime &t1, const util::DateTime &t2, const ufo::GeoVaLs &geovals) const
LinearGetValues(const Geometry &, const ufo::Locations &, const eckit::Configuration &)
Constructor, destructor.
std::shared_ptr< const Geometry > geom_
void fillGeoVaLsTL(const Increment &inc, const util::DateTime &t1, const util::DateTime &t2, ufo::GeoVaLs &geovals) const
Forward and backward interpolation.
void setTrajectory(const State &state, const util::DateTime &t1, const util::DateTime &t2, ufo::GeoVaLs &geovals)
Trajectory for the linearized interpolation.
std::unique_ptr< LinearModel2GeoVaLs > linearmodel2geovals_
SOCA model state.
Definition: State.h:48
int F90getval
key type for soca_getvalues_mod::soca_getvalues
Definition: Fortran.h:29
Definition: GetValues.h:27