FV3 Bundle
StateL95.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 LORENZ95_STATEL95_H_
12 #define LORENZ95_STATEL95_H_
13 
14 #include <ostream>
15 #include <string>
16 
17 #include "lorenz95/FieldL95.h"
18 #include "lorenz95/Resolution.h"
19 
20 #include "oops/util/DateTime.h"
21 #include "oops/util/Duration.h"
22 #include "oops/util/ObjectCounter.h"
23 #include "oops/util/Printable.h"
24 
25 namespace eckit {
26  class Configuration;
27 }
28 
29 namespace oops {
30  class UnstructuredGrid;
31  class Variables;
32 }
33 
34 namespace lorenz95 {
35  class GomL95;
36  class IncrementL95;
37  class LocsL95;
38  class ModelBias;
39  class ModelL95;
40  class ModelTrajectory;
41  class Nothing;
42 
43 /// L95 model state
44 /*!
45  * A State contains everything that is needed to propagate the state
46  * forward in time.
47  */
48 
49 // -----------------------------------------------------------------------------
50 class StateL95 : public util::Printable,
51  private util::ObjectCounter<StateL95> {
52  public:
53  static const std::string classname() {return "lorenz95::StateL95";}
54 
55 /// Constructor, destructor
56  StateL95(const Resolution &, const oops::Variables &, const util::DateTime &);
57  StateL95(const Resolution &, const oops::Variables &, const eckit::Configuration &);
58  StateL95(const Resolution &, const StateL95 &);
59  StateL95(const StateL95 &);
60  virtual ~StateL95();
61  StateL95 & operator=(const StateL95 &);
62 
63 /// Get state values at obs locations
64  void getValues(const LocsL95 &, const oops::Variables &, GomL95 &) const;
65  void getValues(const LocsL95 &, const oops::Variables &, GomL95 &, Nothing &) const;
66 
67 /// Interactions with increments
68  StateL95 & operator+=(const IncrementL95 &);
69 
70 // Utilities
71  const FieldL95 & getField() const {return fld_;}
72  FieldL95 & getField() {return fld_;}
73  boost::shared_ptr<const Resolution> geometry() const {
74  boost::shared_ptr<const Resolution> geom(new Resolution(fld_.resol()));
75  return geom;
76  }
77 
78  void read(const eckit::Configuration &);
79  void write(const eckit::Configuration &) const;
80  double norm () const {return fld_.rms();}
81  const util::DateTime & validTime() const {return time_;}
82  util::DateTime & validTime() {return time_;}
83 
84 // For accumulator
85  void zero();
86  void accumul(const double &, const StateL95 &);
87 
88  private:
89  void print(std::ostream &) const;
91  util::DateTime time_;
92 };
93 // -----------------------------------------------------------------------------
94 
95 } // namespace lorenz95
96 
97 #endif // LORENZ95_STATEL95_H_
GomL95 class to handle locations for L95 model.
Definition: GomL95.h:32
boost::shared_ptr< const Resolution > geometry() const
Definition: StateL95.h:73
Increment Class: Difference between two states.
Definition: IncrementL95.h:51
const util::DateTime & validTime() const
Definition: StateL95.h:81
const FieldL95 & getField() const
Definition: StateL95.h:71
StateL95(const Resolution &, const oops::Variables &, const util::DateTime &)
Constructor, destructor.
void zero()
For accumulator.
double norm() const
Definition: StateL95.h:80
FieldL95 fld_
Definition: StateL95.h:90
static const std::string classname()
Definition: StateL95.h:53
LocsL95 class to handle locations for L95 model.
Definition: LocsL95.h:28
Handles resolution.
Definition: Resolution.h:25
The namespace for the main oops code.
double rms() const
Definition: FieldL95.cc:192
util::DateTime time_
Definition: StateL95.h:91
StateL95 & operator+=(const IncrementL95 &)
Interactions with increments.
void print(std::ostream &) const
The namespace for the L95 model.
StateL95 & operator=(const StateL95 &)
Basic operators.
const int & resol() const
Set and get.
Definition: FieldL95.h:66
void getValues(const LocsL95 &, const oops::Variables &, GomL95 &) const
Get state values at obs locations.
void write(const eckit::Configuration &) const
void accumul(const double &, const StateL95 &)
L95 model state.
Definition: StateL95.h:50
void read(const eckit::Configuration &)
Utilities.
FieldL95 & getField()
Definition: StateL95.h:72
util::DateTime & validTime()
Definition: StateL95.h:82
Class to represent fields for the L95 model.
Definition: FieldL95.h:36