OOPS
TlmQG.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_TLMQG_H_
12 #define QG_MODEL_TLMQG_H_
13 
14 #include <map>
15 #include <ostream>
16 #include <string>
17 
18 #include <boost/noncopyable.hpp>
19 
20 #include "oops/base/Variables.h"
22 #include "oops/util/Duration.h"
23 #include "oops/util/ObjectCounter.h"
24 #include "oops/util/Printable.h"
25 
26 #include "oops/qg/ModelQG.h"
27 #include "oops/qg/QgFortran.h"
28 #include "oops/qg/QgTraits.h"
29 
30 // Forward declarations
31 namespace eckit {
32  class Configuration;
33 }
34 
35 namespace qg {
36 // -----------------------------------------------------------------------------
37 /// QG linear model definition.
38 /*!
39  * QG linear model definition and configuration parameters.
40  */
41 
42 class TlmQG: public oops::interface::LinearModelBase<QgTraits>,
43  private util::ObjectCounter<TlmQG> {
44  public:
45  static const std::string classname() {return "qg::TlmQG";}
46 
47  TlmQG(const GeometryQG &, const eckit::Configuration &);
48  ~TlmQG();
49 
50  /// Prepare model integration
51  void initializeTL(IncrementQG &) const override;
52  void initializeAD(IncrementQG &) const override;
53 
54  /// Model integration
55  void stepTL(IncrementQG &, const ModelBiasIncrement &) const override;
56  void stepAD(IncrementQG &, ModelBiasIncrement &) const override;
57  void setTrajectory(const StateQG &, StateQG &, const ModelBias &) override;
58 
59  /// Finish model integration
60  void finalizeTL(IncrementQG &) const override;
61  void finalizeAD(IncrementQG &) const override;
62 
63 /// Other utilities
64  const util::Duration & timeResolution() const override {return tstep_;}
65  const GeometryQG & resolution() const {return resol_;}
66  const oops::Variables & variables() const override {return linvars_;}
67 
68  private:
69  void print(std::ostream &) const override;
70  typedef std::map< util::DateTime, int >::iterator trajIter;
71  typedef std::map< util::DateTime, int >::const_iterator trajICst;
72 
73 // Data
75  util::Duration tstep_;
77  std::map< util::DateTime, F90flds> traj_;
80 };
81 // -----------------------------------------------------------------------------
82 
83 } // namespace qg
84 #endif // QG_MODEL_TLMQG_H_
Base class for MODEL-specific implementations of the LinearModel interface. interface::LinearModelBas...
GeometryQG handles geometry for QG model.
Definition: GeometryQG.h:58
Increment Class: Difference between two states.
Definition: IncrementQG.h:64
Model error for the QG model.
QG model definition.
Definition: ModelQG.h:60
QG model state.
Definition: StateQG.h:42
QG linear model definition.
Definition: TlmQG.h:43
void print(std::ostream &) const override
Print, used in logging.
Definition: TlmQG.cc:109
const util::Duration & timeResolution() const override
Other utilities.
Definition: TlmQG.h:64
void initializeTL(IncrementQG &) const override
Prepare model integration.
Definition: TlmQG.cc:65
oops::Variables linvars_
Definition: TlmQG.h:79
void stepTL(IncrementQG &, const ModelBiasIncrement &) const override
Model integration.
Definition: TlmQG.cc:70
std::map< util::DateTime, int >::iterator trajIter
Definition: TlmQG.h:70
void finalizeTL(IncrementQG &) const override
Finish model integration.
Definition: TlmQG.cc:83
const GeometryQG resol_
Definition: TlmQG.h:76
void setTrajectory(const StateQG &, StateQG &, const ModelBias &) override
Definition: TlmQG.cc:58
F90model keyConfig_
Definition: TlmQG.h:74
void stepAD(IncrementQG &, ModelBiasIncrement &) const override
Definition: TlmQG.cc:92
std::map< util::DateTime, F90flds > traj_
Definition: TlmQG.h:77
~TlmQG()
Definition: TlmQG.cc:50
TlmQG(const GeometryQG &, const eckit::Configuration &)
Definition: TlmQG.cc:36
void initializeAD(IncrementQG &) const override
Definition: TlmQG.cc:87
std::map< util::DateTime, int >::const_iterator trajICst
Definition: TlmQG.h:71
void finalizeAD(IncrementQG &) const override
Definition: TlmQG.cc:105
const ModelQG lrmodel_
Definition: TlmQG.h:78
const oops::Variables & variables() const override
LinearModel variables (only used in 4DVar)
Definition: TlmQG.h:66
const GeometryQG & resolution() const
Definition: TlmQG.h:65
static const std::string classname()
Definition: TlmQG.h:45
util::Duration tstep_
Definition: TlmQG.h:75
Definition: FieldL95.h:22
The namespace for the qg model.
int F90model
Definition: QgFortran.h:45