FV3 Bundle
StateQG.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2009-2016 ECMWF.
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  * In applying this licence, ECMWF does not waive the privileges and immunities
7  * granted to it by virtue of its status as an intergovernmental organisation nor
8  * does it submit to any jurisdiction.
9  */
10 
11 #ifndef QG_MODEL_STATEQG_H_
12 #define QG_MODEL_STATEQG_H_
13 
14 #include <ostream>
15 #include <string>
16 
17 #include <boost/scoped_ptr.hpp>
18 
19 #include "model/FieldsQG.h"
21 #include "oops/base/GridPoint.h"
22 #include "oops/util/DateTime.h"
23 #include "oops/util/ObjectCounter.h"
24 #include "oops/util/Printable.h"
25 
26 namespace eckit {
27  class Configuration;
28 }
29 
30 namespace oops {
31  class UnstructuredGrid;
32  class Variables;
33  class GridPoint;
34 }
35 
36 namespace qg {
37  class GomQG;
38  class LocationsQG;
39  class GeometryQG;
40  class IncrementQG;
41  class Nothing;
42 
43 /// QG model state
44 /*!
45  * A State contains everything that is needed to propagate the state
46  * forward in time.
47  */
48 
49 // -----------------------------------------------------------------------------
50 class StateQG : public util::Printable,
51  private util::ObjectCounter<StateQG> {
52  public:
53  static const std::string classname() {return "qg::StateQG";}
54 
55 /// Constructor, destructor
56  StateQG(const GeometryQG &, const oops::Variables &, const util::DateTime &); // Is it used?
57  StateQG(const GeometryQG &, const oops::Variables &, const eckit::Configuration &);
58  StateQG(const GeometryQG &, const StateQG &);
59  StateQG(const StateQG &);
60  virtual ~StateQG();
61  StateQG & operator=(const StateQG &);
62 
63 /// Get state values at observation locations
64  void getValues(const LocationsQG &, const oops::Variables &, GomQG &) const;
65  void getValues(const LocationsQG &, const oops::Variables &, GomQG &, Nothing &) const;
66 
67 /// Interpolate full fields
68  void changeResolution(const StateQG & xx);
69 
70 /// Interactions with Increment
71  StateQG & operator+=(const IncrementQG &);
72 
73 /// I/O and diagnostics
74  void read(const eckit::Configuration &);
75  void write(const eckit::Configuration &) const;
76  double norm() const {return fields_->norm();}
77  const util::DateTime & validTime() const {return fields_->time();}
78  util::DateTime & validTime() {return fields_->time();}
79 
80 /// Access to fields
81  FieldsQG & fields() {return *fields_;}
82  const FieldsQG & fields() const {return *fields_;}
83 
84  boost::shared_ptr<const GeometryQG> geometry() const {
85  return fields_->geometry();
86  }
87 
88 /// Other
89  void zero();
90  void accumul(const double &, const StateQG &);
91 
93 
94  private:
95  void print(std::ostream &) const;
96  boost::scoped_ptr<FieldsQG> fields_;
97  boost::scoped_ptr<FieldsQG> stash_;
98 };
99 // -----------------------------------------------------------------------------
100 
101 } // namespace qg
102 
103 #endif // QG_MODEL_STATEQG_H_
GomQG class to handle local model values for QG model.
Definition: GomQG.h:31
void getValues(const LocationsQG &, const oops::Variables &, GomQG &) const
Get state values at observation locations.
Definition: StateQG.cc:90
Class to represent a FieldSet for the QG model.
Definition: FieldsQG.h:46
StateQG & operator=(const StateQG &)
Basic operators.
Definition: StateQG.cc:82
void accumul(const double &, const StateQG &)
Definition: StateQG.cc:137
util::DateTime & validTime()
Definition: StateQG.h:78
virtual ~StateQG()
Definition: StateQG.cc:76
const FieldsQG & fields() const
Definition: StateQG.h:82
boost::scoped_ptr< FieldsQG > fields_
Definition: StateQG.h:96
void zero()
Other.
Definition: StateQG.cc:133
StateQG & operator+=(const IncrementQG &)
Interactions with Increment.
Definition: StateQG.cc:109
The namespace for the main oops code.
void print(std::ostream &) const
Definition: StateQG.cc:126
const util::DateTime & validTime() const
Definition: StateQG.h:77
StateQG(const GeometryQG &, const oops::Variables &, const util::DateTime &)
Constructor, destructor.
Definition: StateQG.cc:37
void write(const eckit::Configuration &) const
Definition: StateQG.cc:122
static const std::string classname()
Definition: StateQG.h:53
QG model state.
Definition: StateQG.h:50
FieldsQG & fields()
Access to fields.
Definition: StateQG.h:81
double norm() const
Definition: StateQG.h:76
GeometryQG handles geometry for QG model.
Definition: GeometryQG.h:33
LocationsQG class to handle locations for QG model.
Definition: LocationsQG.h:26
boost::shared_ptr< const GeometryQG > geometry() const
Definition: StateQG.h:84
void changeResolution(const StateQG &xx)
Interpolate full fields.
Definition: StateQG.cc:102
void read(const eckit::Configuration &)
I/O and diagnostics.
Definition: StateQG.cc:118
boost::scoped_ptr< FieldsQG > stash_
Definition: StateQG.h:97
oops::GridPoint getPoint(const GeometryQGIterator &) const
Definition: StateQG.cc:141
The namespace for the qg model.
Increment Class: Difference between two states.
Definition: IncrementQG.h:55