FV3 Bundle
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 #include <boost/scoped_ptr.hpp>
20 
22 #include "oops/base/Variables.h"
23 #include "oops/util/Duration.h"
24 #include "oops/util/ObjectCounter.h"
25 #include "oops/util/Printable.h"
26 
27 #include "model/ModelQG.h"
28 #include "model/QgFortran.h"
29 #include "model/QgTraits.h"
30 
31 // Forward declarations
32 namespace eckit {
33  class Configuration;
34 }
35 
36 namespace qg {
37 // -----------------------------------------------------------------------------
38 /// QG linear model definition.
39 /*!
40  * QG linear model definition and configuration parameters.
41  */
42 
43 class TlmQG: public oops::LinearModelBase<QgTraits>,
44  private util::ObjectCounter<TlmQG> {
45  public:
46  static const std::string classname() {return "qg::TlmQG";}
47 
48  TlmQG(const GeometryQG &, const eckit::Configuration &);
49  ~TlmQG();
50 
51 /// Model trajectory computation
52  void setTrajectory(const StateQG &, StateQG &, const ModelBias &) override;
53 
54 /// Run TLM and its adjoint
55  void initializeTL(IncrementQG &) const override;
56  void stepTL(IncrementQG &, const ModelBiasIncrement &) const override;
57  void finalizeTL(IncrementQG &) const override;
58 
59  void initializeAD(IncrementQG &) const override;
60  void stepAD(IncrementQG &, ModelBiasIncrement &) 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, F90traj> traj_;
80 };
81 // -----------------------------------------------------------------------------
82 
83 } // namespace qg
84 #endif // QG_MODEL_TLMQG_H_
void stepTL(IncrementQG &, const ModelBiasIncrement &) const override
Definition: TlmQG.cc:75
Model error for the QG model.
static const std::string classname()
Definition: TlmQG.h:46
void print(std::ostream &) const override
Definition: TlmQG.cc:115
const GeometryQG resol_
Definition: TlmQG.h:76
const ModelQG lrmodel_
Definition: TlmQG.h:78
~TlmQG()
Definition: TlmQG.cc:44
const util::Duration & timeResolution() const override
Other utilities.
Definition: TlmQG.h:64
QG linear model definition.
Definition: TlmQG.h:43
std::map< util::DateTime, int >::iterator trajIter
Definition: TlmQG.h:70
void initializeAD(IncrementQG &) const override
Definition: TlmQG.cc:92
F90model keyConfig_
Definition: TlmQG.h:74
const GeometryQG & resolution() const
Definition: TlmQG.h:65
QG model definition.
Definition: ModelQG.h:45
void initializeTL(IncrementQG &) const override
Run TLM and its adjoint.
Definition: TlmQG.cc:69
const oops::Variables linvars_
Definition: TlmQG.h:79
void stepAD(IncrementQG &, ModelBiasIncrement &) const override
Definition: TlmQG.cc:97
Base class for encapsulation of the linear forecast model.
void finalizeTL(IncrementQG &) const override
Definition: TlmQG.cc:88
QG model state.
Definition: StateQG.h:50
void setTrajectory(const StateQG &, StateQG &, const ModelBias &) override
Model trajectory computation.
Definition: TlmQG.cc:52
GeometryQG handles geometry for QG model.
Definition: GeometryQG.h:33
TlmQG(const GeometryQG &, const eckit::Configuration &)
Definition: TlmQG.cc:31
util::Duration tstep_
Definition: TlmQG.h:75
std::map< util::DateTime, int >::const_iterator trajICst
Definition: TlmQG.h:71
const oops::Variables & variables() const override
Definition: TlmQG.h:66
std::map< util::DateTime, F90traj > traj_
Definition: TlmQG.h:77
The namespace for the qg model.
void finalizeAD(IncrementQG &) const override
Definition: TlmQG.cc:110
int F90model
Definition: QgFortran.h:30
Increment Class: Difference between two states.
Definition: IncrementQG.h:55