FV3 Bundle
TlmFV3JEDI.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2017 UCAR
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  */
7 
8 #ifndef SRC_MODEL_TLMFV3JEDI_H_
9 #define SRC_MODEL_TLMFV3JEDI_H_
10 
11 #include <map>
12 #include <ostream>
13 #include <string>
14 
15 #include <boost/noncopyable.hpp>
16 #include <boost/scoped_ptr.hpp>
17 
19 #include "oops/util/Duration.h"
20 #include "oops/util/ObjectCounter.h"
21 #include "oops/util/Printable.h"
22 
23 #include "FV3JEDITraits.h"
24 #include "TlmFV3JEDIFortran.h"
25 
26 // Forward declarations
27 namespace eckit {
28  class Configuration;
29 }
30 
31 namespace fv3jedi {
32 
33 // -----------------------------------------------------------------------------
34 /// FV3JEDI linear model definition.
35 /*!
36  * FV3JEDI linear model definition and configuration parameters.
37  */
38 
39 class TlmFV3JEDI: public oops::LinearModelBase<FV3JEDITraits>,
40  private util::ObjectCounter<TlmFV3JEDI> {
41  public:
42  static const std::string classname() {return "fv3jedi::TlmFV3JEDI";}
43 
44  TlmFV3JEDI(const GeometryFV3JEDI &, const eckit::Configuration &);
45  ~TlmFV3JEDI();
46 
47 /// Model trajectory computation
48  void setTrajectory(const StateFV3JEDI &, StateFV3JEDI &,
49  const ModelBiasFV3JEDI &) override;
50 
51 /// Run TLM and its adjoint
52  void initializeTL(IncrementFV3JEDI &) const override;
54  const override;
55  void finalizeTL(IncrementFV3JEDI &) const override;
56 
57  void initializeAD(IncrementFV3JEDI &) const override;
58  void stepAD(IncrementFV3JEDI &, ModelBiasIncrementFV3JEDI &) const override;
59  void finalizeAD(IncrementFV3JEDI &) const override;
60 
61 /// Other utilities
62  const util::Duration & timeResolution() const override {return tstep_;}
63  const GeometryFV3JEDI & resolution() const {return resol_;}
64  const oops::Variables & variables() const override {return linvars_;}
65 
66  private:
67  void print(std::ostream &) const override;
68  typedef std::map< util::DateTime, int >::iterator trajIter;
69  typedef std::map< util::DateTime, int >::const_iterator trajICst;
70 
71 // Data
73  util::Duration tstep_;
75  std::map< util::DateTime, F90traj> traj_;
78 };
79 // -----------------------------------------------------------------------------
80 
81 } // namespace fv3jedi
82 #endif // SRC_MODEL_TLMFV3JEDI_H_
const oops::Variables linvars_
Definition: TlmFV3JEDI.h:77
void stepTL(IncrementFV3JEDI &, const ModelBiasIncrementFV3JEDI &) const override
Definition: TlmFV3JEDI.cc:79
void initializeAD(IncrementFV3JEDI &) const override
Definition: TlmFV3JEDI.cc:98
TlmFV3JEDI(const GeometryFV3JEDI &, const eckit::Configuration &)
Definition: TlmFV3JEDI.cc:31
const util::Duration & timeResolution() const override
Other utilities.
Definition: TlmFV3JEDI.h:62
void print(std::ostream &) const override
Definition: TlmFV3JEDI.cc:122
const ModelFV3JEDI lrmodel_
Definition: TlmFV3JEDI.h:76
std::map< util::DateTime, int >::iterator trajIter
Definition: TlmFV3JEDI.h:68
Model error for the FV3JEDI model.
util::Duration tstep_
Definition: TlmFV3JEDI.h:73
void initializeTL(IncrementFV3JEDI &) const override
Run TLM and its adjoint.
Definition: TlmFV3JEDI.cc:74
void stepAD(IncrementFV3JEDI &, ModelBiasIncrementFV3JEDI &) const override
Definition: TlmFV3JEDI.cc:103
FV3JEDI linear model definition.
Definition: TlmFV3JEDI.h:39
std::map< util::DateTime, F90traj > traj_
Definition: TlmFV3JEDI.h:75
FV3JEDI model definition.
Definition: ModelFV3JEDI.h:43
std::map< util::DateTime, int >::const_iterator trajICst
Definition: TlmFV3JEDI.h:69
Base class for encapsulation of the linear forecast model.
const GeometryFV3JEDI resol_
Definition: TlmFV3JEDI.h:74
void finalizeAD(IncrementFV3JEDI &) const override
Definition: TlmFV3JEDI.cc:117
const GeometryFV3JEDI & resolution() const
Definition: TlmFV3JEDI.h:63
GeometryFV3JEDI handles geometry for FV3JEDI model.
void finalizeTL(IncrementFV3JEDI &) const override
Definition: TlmFV3JEDI.cc:93
void setTrajectory(const StateFV3JEDI &, StateFV3JEDI &, const ModelBiasFV3JEDI &) override
Model trajectory computation.
Definition: TlmFV3JEDI.cc:55
const oops::Variables & variables() const override
Definition: TlmFV3JEDI.h:64
F90model keyConfig_
Definition: TlmFV3JEDI.h:72
static const std::string classname()
Definition: TlmFV3JEDI.h:42