OOPS
ModelQG.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2009-2016 ECMWF.
3  * (C) Copyright 2020-2020 UCAR.
4  *
5  * This software is licensed under the terms of the Apache Licence Version 2.0
6  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
7  * In applying this licence, ECMWF does not waive the privileges and immunities
8  * granted to it by virtue of its status as an intergovernmental organisation nor
9  * does it submit to any jurisdiction.
10  */
11 
12 #ifndef QG_MODEL_MODELQG_H_
13 #define QG_MODEL_MODELQG_H_
14 
15 #include <ostream>
16 #include <string>
17 #include <vector>
18 
20 #include "oops/base/Variables.h"
22 #include "oops/util/Duration.h"
23 #include "oops/util/ObjectCounter.h"
24 #include "oops/util/parameters/Parameter.h"
25 #include "oops/util/parameters/Parameters.h"
26 #include "oops/util/parameters/RequiredParameter.h"
27 
28 #include "oops/qg/GeometryQG.h"
29 #include "oops/qg/QgFortran.h"
30 #include "oops/qg/QgTraits.h"
31 
32 
33 namespace qg {
34  class ModelBias;
35  class FieldsQG;
36  class StateQG;
37 
38 // -----------------------------------------------------------------------------
39 
41  OOPS_CONCRETE_PARAMETERS(ModelQgParameters, ModelParametersBase)
42 
43  public:
44  /// Model time step
45  oops::RequiredParameter<util::Duration> tstep{"tstep", this};
46 
48  return oops::Variables({"x"});
49  }
50 };
51 
52 
53 // -----------------------------------------------------------------------------
54 /// QG model definition.
55 /*!
56  * QG nonlinear model definition and configuration parameters.
57  */
58 
59 class ModelQG: public oops::interface::ModelBase<QgTraits>,
60  private util::ObjectCounter<ModelQG> {
61  public:
63 
64  static const std::string classname() {return "qg::ModelQG";}
65 
66  ModelQG(const GeometryQG &, const ModelQgParameters &);
67  ~ModelQG();
68 
69 /// Prepare model integration
70  void initialize(StateQG &) const;
71 
72 /// Model integration
73  void step(StateQG &, const ModelBias &) const;
74  int saveTrajectory(StateQG &, const ModelBias &) const;
75 
76 /// Finish model integration
77  void finalize(StateQG &) const;
78 
79 /// Utilities
80  const util::Duration & timeResolution() const {return params_.tstep;}
81  const oops::Variables & variables() const {return vars_;}
82 
83  private:
84  void print(std::ostream &) const;
89 };
90 // -----------------------------------------------------------------------------
91 
92 } // namespace qg
93 #endif // QG_MODEL_MODELQG_H_
Base class for classes storing model-specific parameters.
Base class for MODEL-specific implementations of the Model interface. interface::ModelBase overrides ...
GeometryQG handles geometry for QG model.
Definition: GeometryQG.h:58
Model error for the QG model.
QG model definition.
Definition: ModelQG.h:60
ModelQgParameters params_
Definition: ModelQG.h:86
int saveTrajectory(StateQG &, const ModelBias &) const
Definition: ModelQG.cc:61
const oops::Variables & variables() const
Model variables (only used in 4DVar)
Definition: ModelQG.h:81
F90model keyConfig_
Definition: ModelQG.h:85
const oops::Variables vars_
Definition: ModelQG.h:88
void print(std::ostream &) const
Print; used for logging.
Definition: ModelQG.cc:72
const util::Duration & timeResolution() const
Utilities.
Definition: ModelQG.h:80
void initialize(StateQG &) const
Prepare model integration.
Definition: ModelQG.cc:43
void finalize(StateQG &) const
Finish model integration.
Definition: ModelQG.cc:56
ModelQG(const GeometryQG &, const ModelQgParameters &)
Definition: ModelQG.cc:29
static const std::string classname()
Definition: ModelQG.h:64
ModelQgParameters Parameters_
Definition: ModelQG.h:62
void step(StateQG &, const ModelBias &) const
Model integration.
Definition: ModelQG.cc:48
const GeometryQG geom_
Definition: ModelQG.h:87
oops::Variables variables() const
Definition: ModelQG.h:47
oops::RequiredParameter< util::Duration > tstep
Model time step.
Definition: ModelQG.h:45
QG model state.
Definition: StateQG.h:42
The namespace for the qg model.
int F90model
Definition: QgFortran.h:45