SOCA
GetValues.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_GETVALUES_H_
9 #define SOCA_GETVALUES_GETVALUES_H_
10 
11 #include <memory>
12 #include <ostream>
13 #include <string>
14 
15 #include "soca/Fortran.h"
16 
17 #include "oops/util/ObjectCounter.h"
18 #include "oops/util/Printable.h"
19 
20 #include "ufo/Locations.h"
21 
22 // Forward declarations
23 namespace oops {
24  class Variables;
25 }
26 
27 namespace ufo {
28  class GeoVaLs;
29 }
30 namespace soca {
31  class Geometry;
32  class State;
33  class Model2GeoVaLs;
34 }
35 
36 //-----------------------------------------------------------------------------
37 
38 namespace soca {
39 
40  /// SOCA GetValues
41  /*!
42  * GetValues: interpolate State to observation locations
43  */
44 class GetValues : public util::Printable,
45  private util::ObjectCounter<GetValues> {
46  public:
47  static const std::string classname() {return "soca::GetValues";}
48 
49 /// saves all locations locs to use during filling GeoVaLs
50  GetValues(const Geometry &, const ufo::Locations & locs,
51  const eckit::Configuration & config);
52  virtual ~GetValues();
53 
54  /// fills in geovals for all observations in the timeframe (t1, t2],
55  /// geovals are interpolated trilinearly from state at the nearest gridpoints
56  void fillGeoVaLs(const State &,
57  const util::DateTime & t1,
58  const util::DateTime & t2,
59  ufo::GeoVaLs &) const;
60 
61  /// Read interpolated GeoVaLs at observation location
62  void getValuesFromFile(const ufo::Locations &,
63  const oops::Variables &,
64  ufo::GeoVaLs &) const;
65 
66  private:
67  void print(std::ostream &) const;
69  ufo::Locations locs_;
70  std::shared_ptr<const Geometry> geom_;
71  std::unique_ptr<Model2GeoVaLs> model2geovals_;
72 };
73 // -----------------------------------------------------------------------------
74 
75 } // namespace soca
76 
77 #endif // SOCA_GETVALUES_GETVALUES_H_
Geometry handles geometry for SOCA model.
Definition: Geometry.h:48
SOCA GetValues.
Definition: GetValues.h:45
void fillGeoVaLs(const State &, const util::DateTime &t1, const util::DateTime &t2, ufo::GeoVaLs &) const
Get state values at observation locations.
Definition: GetValues.cc:44
virtual ~GetValues()
Definition: GetValues.cc:37
std::shared_ptr< const Geometry > geom_
Definition: GetValues.h:70
ufo::Locations locs_
Definition: GetValues.h:69
void getValuesFromFile(const ufo::Locations &, const oops::Variables &, ufo::GeoVaLs &) const
Read interpolated GeoVaLs at observation location.
Definition: GetValues.cc:81
static const std::string classname()
Definition: GetValues.h:47
GetValues(const Geometry &, const ufo::Locations &locs, const eckit::Configuration &config)
saves all locations locs to use during filling GeoVaLs
Definition: GetValues.cc:29
std::unique_ptr< Model2GeoVaLs > model2geovals_
Definition: GetValues.h:71
F90getval keyGetValues_
Definition: GetValues.h:68
void print(std::ostream &) const
Definition: GetValues.cc:103
SOCA model state.
Definition: State.h:48
Definition: Geometry.h:38
int F90getval
key type for soca_getvalues_mod::soca_getvalues
Definition: Fortran.h:29
Definition: GetValues.h:27