MPAS-JEDI
LinearGetValues.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2020 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 #pragma once
9 
10 #include <fstream>
11 #include <map>
12 #include <memory>
13 #include <ostream>
14 #include <string>
15 #include <vector>
16 
17 #include "eckit/exception/Exceptions.h"
18 
19 #include "oops/util/DateTime.h"
20 #include "oops/util/Logger.h"
21 #include "oops/util/ObjectCounter.h"
22 #include "oops/util/Printable.h"
23 #include "oops/util/Timer.h"
24 
25 #include "ufo/GeoVaLs.h"
26 #include "ufo/Locations.h"
27 
29 
30 // -----------------------------------------------------------------------------
31 
32 namespace ufo {
33  class GeoVaLs;
34  class Locations;
35 }
36 
37 namespace mpas {
38  class GeometryMPAS;
39  class IncrementMPAS;
40  class StateMPAS;
41  class VarChaModel2GeoVars;
42  class LinVarChaModel2GeoVars;
43 
44 // -----------------------------------------------------------------------------
45 
46 class LinearGetValues : public util::Printable,
47  private util::ObjectCounter<LinearGetValues> {
48  public:
49  static const std::string classname() {return "mpas::LinearGetValues";}
50 
51  LinearGetValues(const GeometryMPAS &, const ufo::Locations &,
52  const eckit::Configuration &);
53  virtual ~LinearGetValues();
54 
55  void setTrajectory(const StateMPAS & state, const util::DateTime & t1,
56  const util::DateTime & t2, ufo::GeoVaLs & geovals);
57  void fillGeoVaLsTL(const IncrementMPAS & inc, const util::DateTime & t1,
58  const util::DateTime & t2, ufo::GeoVaLs & geovals) const;
59  void fillGeoVaLsAD(IncrementMPAS & inc, const util::DateTime & t1,
60  const util::DateTime & t2,
61  const ufo::GeoVaLs & geovals) const;
62 
63  private:
64  const LinVarChaModel2GeoVars * getLinVarCha(const util::DateTime &) const;
65 
66  typedef std::map< util::DateTime, LinVarChaModel2GeoVars * >::iterator lvcIter;
67  typedef std::map< util::DateTime, LinVarChaModel2GeoVars * >::const_iterator lvcIterCnst;
68 
69  void print(std::ostream &) const;
71  ufo::Locations locs_;
72  std::shared_ptr<const GeometryMPAS> geom_;
73  std::map< util::DateTime, LinVarChaModel2GeoVars * > linearmodel2geovars_;
74  std::unique_ptr<VarChaModel2GeoVars> model2geovars_;
75 };
76 
77 // -----------------------------------------------------------------------------
78 
79 } // namespace mpas
GeometryMPAS handles geometry for MPAS model.
Definition: GeometryMPAS.h:37
Increment Class: Difference between two states.
Definition: IncrementMPAS.h:57
LinearGetValues(const GeometryMPAS &, const ufo::Locations &, const eckit::Configuration &)
std::map< util::DateTime, LinVarChaModel2GeoVars * >::const_iterator lvcIterCnst
std::unique_ptr< VarChaModel2GeoVars > model2geovars_
std::map< util::DateTime, LinVarChaModel2GeoVars * > linearmodel2geovars_
std::shared_ptr< const GeometryMPAS > geom_
static const std::string classname()
void setTrajectory(const StateMPAS &state, const util::DateTime &t1, const util::DateTime &t2, ufo::GeoVaLs &geovals)
ufo::Locations locs_
F90lineargetvalues keyLinearGetValues_
std::map< util::DateTime, LinVarChaModel2GeoVars * >::iterator lvcIter
void fillGeoVaLsTL(const IncrementMPAS &inc, const util::DateTime &t1, const util::DateTime &t2, ufo::GeoVaLs &geovals) const
void print(std::ostream &) const
const LinVarChaModel2GeoVars * getLinVarCha(const util::DateTime &) const
void fillGeoVaLsAD(IncrementMPAS &inc, const util::DateTime &t1, const util::DateTime &t2, const ufo::GeoVaLs &geovals) const
MPAS model state.
Definition: StateMPAS.h:51
int F90lineargetvalues
Definition: Fortran.h:58
Definition: GetValues.h:35