OOPS
ModelL95.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_MODELL95_H_
12 #define LORENZ95_MODELL95_H_
13 
14 #include <ostream>
15 #include <string>
16 
17 #include "eckit/config/Configuration.h"
18 #include "oops/base/Variables.h"
20 #include "oops/util/DateTime.h"
21 #include "oops/util/Duration.h"
22 #include "oops/util/ObjectCounter.h"
23 #include "oops/util/parameters/Parameters.h"
24 #include "oops/util/parameters/RequiredParameter.h"
25 #include "oops/util/Printable.h"
26 
27 #include "lorenz95/L95Traits.h"
28 #include "lorenz95/Resolution.h"
29 
30 namespace lorenz95 {
31  class FieldL95;
32  class ModelBias;
33  class ModelTrajectory;
34  class StateL95;
35 
36 // -----------------------------------------------------------------------------
37 
39  OOPS_CONCRETE_PARAMETERS(ModelL95Parameters, ModelParametersBase)
40 
41  public:
42  oops::RequiredParameter<util::Duration> tstep{"tstep", this};
43  oops::RequiredParameter<double> f{"f", this};
44 };
45 
46 /// Lorenz 95 model configuration and computations.
47 
48 // -----------------------------------------------------------------------------
49 
50 class ModelL95 : public oops::interface::ModelBase<L95Traits>,
51  private util::ObjectCounter<ModelL95> {
52  public:
54 
55  static const std::string classname() {return "lorenz95::ModelL95";}
56 
57  ModelL95(const Resolution &, const ModelL95Parameters &);
58  ~ModelL95();
59 
60 // Run the forecast
61  void initialize(StateL95 &) const;
62  void step(StateL95 &, const ModelBias &) const;
63  void finalize(StateL95 &) const;
64  void stepRK(FieldL95 &, const ModelBias &, ModelTrajectory &) const;
65 
66 // Information and diagnostics
67  const util::Duration & timeResolution() const {return tstep_;}
68  const oops::Variables & variables() const {return vars_;}
69 
70  private:
71  void print(std::ostream &) const;
72  void tendencies(const FieldL95 &, const double &, FieldL95 &) const;
73 
74 // Data
76  const double f_;
77  const util::Duration tstep_;
78  const double dt_;
80 };
81 
82 // -----------------------------------------------------------------------------
83 
84 } // namespace lorenz95
85 
86 #endif // LORENZ95_MODELL95_H_
Class to represent fields for the L95 model.
Definition: FieldL95.h:34
Model error for Lorenz 95 model.
Lorenz 95 model configuration and computations.
Definition: ModelL95.h:51
const Resolution resol_
Definition: ModelL95.h:75
const double dt_
Definition: ModelL95.h:78
const util::Duration tstep_
Definition: ModelL95.h:77
const oops::Variables vars_
Definition: ModelL95.h:79
void finalize(StateL95 &) const
Definition: ModelL95.cc:47
static const std::string classname()
Definition: ModelL95.h:55
void initialize(StateL95 &) const
Definition: ModelL95.cc:46
const oops::Variables & variables() const
Model variables (only used in 4DVar)
Definition: ModelL95.h:68
void print(std::ostream &) const
Print; used for logging.
Definition: ModelL95.cc:116
const util::Duration & timeResolution() const
Time step for running Model's forecast in oops (frequency with which the State will be updated)
Definition: ModelL95.h:67
void tendencies(const FieldL95 &, const double &, FieldL95 &) const
Definition: ModelL95.cc:94
void step(StateL95 &, const ModelBias &) const
Definition: ModelL95.cc:49
ModelL95Parameters Parameters_
Definition: ModelL95.h:53
void stepRK(FieldL95 &, const ModelBias &, ModelTrajectory &) const
Definition: ModelL95.cc:56
ModelL95(const Resolution &, const ModelL95Parameters &)
Definition: ModelL95.cc:31
const double f_
Definition: ModelL95.h:76
oops::RequiredParameter< util::Duration > tstep
Definition: ModelL95.h:42
oops::RequiredParameter< double > f
Definition: ModelL95.h:43
L95 model trajectory.
Handles resolution.
Definition: Resolution.h:43
L95 model state.
Definition: StateL95.h:53
Base class for classes storing model-specific parameters.
Base class for MODEL-specific implementations of the Model interface. interface::ModelBase overrides ...
The namespace for the L95 model.