FV3 Bundle
StateFV3JEDI.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2017-2018 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 SRC_STATE_STATEFV3JEDI_H_
9 #define SRC_STATE_STATEFV3JEDI_H_
10 
11 #include <ostream>
12 #include <string>
13 
14 #include <boost/scoped_ptr.hpp>
15 
16 #include "oops/base/Variables.h"
17 #include "oops/util/DateTime.h"
18 #include "oops/util/ObjectCounter.h"
19 #include "oops/util/Printable.h"
20 
21 #include "GeometryFV3JEDI.h"
22 #include "IncrementFV3JEDI.h"
23 #include "StateFV3JEDIFortran.h"
24 
25 namespace eckit {
26  class Configuration;
27 }
28 
29 namespace ufo {
30  class GeoVaLs;
31 }
32 
33 namespace ioda {
34  class Locations;
35 }
36 
37 namespace oops {
38  class Variables;
39  class UnstructuredGrid;
40 }
41 
42 namespace fv3jedi {
43  class GeometryFV3JEDI;
44  class IncrementFV3JEDI;
45  class GetValuesTrajFV3JEDI;
46 
47 // FV3JEDI model state
48 
49 // -----------------------------------------------------------------------------
50 class StateFV3JEDI : public util::Printable,
51  private util::ObjectCounter<StateFV3JEDI> {
52  public:
53  static const std::string classname() {return "fv3jedi::StateFV3JEDI";}
54 
55 // Constructor, destructor and basic operators
57  const util::DateTime &);
59  const eckit::Configuration &);
60  StateFV3JEDI(const GeometryFV3JEDI &, const StateFV3JEDI &);
61  StateFV3JEDI(const StateFV3JEDI &);
62  virtual ~StateFV3JEDI();
63 
65  void zero();
66  void accumul(const double &, const StateFV3JEDI &);
67 
68 // Get state values at observation locations
69  void getValues(const ioda::Locations &, const oops::Variables &,
70  ufo::GeoVaLs &) const;
71  void getValues(const ioda::Locations &, const oops::Variables &,
72  ufo::GeoVaLs &, const GetValuesTrajFV3JEDI &) const;
73 
74 // Interpolate state
75  void changeResolution(const StateFV3JEDI & xx);
76 
77 // Interactions with Increment
79 
80 // IO and diagnostics
81  void read(const eckit::Configuration &);
82  void analytic_init(const eckit::Configuration &, const GeometryFV3JEDI &);
83  void write(const eckit::Configuration &) const;
84  double norm() const;
85 
86 // Utilities
87  boost::shared_ptr<const GeometryFV3JEDI> geometry() const {return geom_;}
88 
89  const util::DateTime & time() const {return time_;}
90  util::DateTime & time() {return time_;}
91  const util::DateTime & validTime() const {return time_;}
92  util::DateTime & validTime() {return time_;}
93 
94  int & toFortran() {return keyState_;}
95  const int & toFortran() const {return keyState_;}
96 
97 // Private methods and variables
98  private:
99  void print(std::ostream &) const;
101  boost::shared_ptr<const GeometryFV3JEDI> geom_;
103  util::DateTime time_;
104 };
105 // -----------------------------------------------------------------------------
106 
107 } // namespace fv3jedi
108 
109 #endif // SRC_STATE_STATEFV3JEDI_H_
void print(std::ostream &) const
void accumul(const double &, const StateFV3JEDI &)
util::DateTime & validTime()
Definition: StateFV3JEDI.h:92
void zero()
For accumulator.
void getValues(const ioda::Locations &, const oops::Variables &, ufo::GeoVaLs &) const
Get state values at observation locations.
The namespace for the main oops code.
GeoVaLs: geophysical values at locations.
void analytic_init(const eckit::Configuration &, const GeometryFV3JEDI &)
StateFV3JEDI & operator+=(const IncrementFV3JEDI &)
Interactions with Increments.
void changeResolution(const StateFV3JEDI &xx)
Interpolate full state.
util::DateTime & time()
Definition: StateFV3JEDI.h:90
boost::shared_ptr< const GeometryFV3JEDI > geometry() const
Definition: StateFV3JEDI.h:87
const util::DateTime & time() const
Definition: StateFV3JEDI.h:89
const util::DateTime & validTime() const
Definition: StateFV3JEDI.h:91
StateFV3JEDI & operator=(const StateFV3JEDI &)
Basic operators.
oops::Variables vars_
Definition: StateFV3JEDI.h:102
Locations class to handle locations for IODA.
const int & toFortran() const
Definition: StateFV3JEDI.h:95
StateFV3JEDI(const GeometryFV3JEDI &, const oops::Variables &, const util::DateTime &)
Constructor, destructor.
Definition: StateFV3JEDI.cc:39
void write(const eckit::Configuration &) const
double norm() const
GeometryFV3JEDI handles geometry for FV3JEDI model.
void read(const eckit::Configuration &)
I/O and diagnostics.
static const std::string classname()
Definition: StateFV3JEDI.h:53
util::DateTime time_
Definition: StateFV3JEDI.h:103
boost::shared_ptr< const GeometryFV3JEDI > geom_
Definition: StateFV3JEDI.h:101