FV3 Bundle
TlmIdQG.cc
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 #include <vector>
12 
13 #include "model/TlmIdQG.h"
14 
15 #include "eckit/config/LocalConfiguration.h"
16 #include "model/GeometryQG.h"
17 #include "model/IncrementQG.h"
19 #include "model/QgFortran.h"
20 #include "model/QgTraits.h"
21 #include "model/StateQG.h"
22 #include "oops/util/abor1_cpp.h"
23 #include "oops/util/DateTime.h"
24 #include "oops/util/Logger.h"
25 
26 namespace qg {
27 // -----------------------------------------------------------------------------
29 // -----------------------------------------------------------------------------
30 TlmIdQG::TlmIdQG(const GeometryQG & resol, const eckit::Configuration & tlConf)
31  : keyConfig_(0), tstep_(), resol_(resol),
32  linvars_(std::vector<std::string>{"x", "q", "u", "v"})
33 {
34  tstep_ = util::Duration(tlConf.getString("tstep"));
35 
36  const eckit::Configuration * configc = &tlConf;
37  qg_setup_f90(&configc, resol_.toFortran(), keyConfig_);
38 
39  oops::Log::trace() << "TlmIdQG created" << std::endl;
40 }
41 // -----------------------------------------------------------------------------
44  oops::Log::trace() << "TlmIdQG destructed" << std::endl;
45 }
46 // -----------------------------------------------------------------------------
47 void TlmIdQG::setTrajectory(const StateQG &, StateQG &, const ModelBias &) {}
48 // -----------------------------------------------------------------------------
50  ASSERT(dx.fields().isForModel(false));
52  oops::Log::debug() << "TlmIdQG::initializeTL" << dx.fields() << std::endl;
53 }
54 // -----------------------------------------------------------------------------
55 void TlmIdQG::stepTL(IncrementQG & dx, const ModelBiasIncrement &) const {
56  dx.updateTime(tstep_);
57 }
58 // -----------------------------------------------------------------------------
59 void TlmIdQG::finalizeTL(IncrementQG & dx) const {
60  oops::Log::debug() << "TlmIdQG::finalizeTL" << dx.fields() << std::endl;
61 }
62 // -----------------------------------------------------------------------------
64  ASSERT(dx.fields().isForModel(false));
65  oops::Log::debug() << "TlmIdQG::initializeAD" << dx.fields() << std::endl;
66 }
67 // -----------------------------------------------------------------------------
69  dx.updateTime(-tstep_);
70 }
71 // -----------------------------------------------------------------------------
72 void TlmIdQG::finalizeAD(IncrementQG & dx) const {
74  oops::Log::debug() << "TlmIdQG::finalizeAD" << dx.fields() << std::endl;
75 }
76 // -----------------------------------------------------------------------------
77 void TlmIdQG::print(std::ostream & os) const {
78  os << "QG IdTLM" << std::endl;
79 }
80 // -----------------------------------------------------------------------------
81 } // namespace qg
void finalizeAD(IncrementQG &) const override
Definition: TlmIdQG.cc:72
int & toFortran()
Definition: FieldsQG.h:96
Model error for the QG model.
void qg_prepare_integration_ad_f90(const F90model &, const F90flds &)
FieldsQG & fields()
Access to fields.
Definition: IncrementQG.h:102
void stepTL(IncrementQG &, const ModelBiasIncrement &) const override
Definition: TlmIdQG.cc:55
subroutine std(a, mean, stdv, area)
int keyConfig_
Definition: TlmIdQG.h:68
util::Duration tstep_
Definition: TlmIdQG.h:69
void print(std::ostream &) const override
Definition: TlmIdQG.cc:77
bool isForModel(const bool &) const
Definition: FieldsQG.cc:213
void setTrajectory(const StateQG &, StateQG &, const ModelBias &) override
Model trajectory computation.
Definition: TlmIdQG.cc:47
logical debug
Definition: mpp.F90:1297
void initializeAD(IncrementQG &) const override
Definition: TlmIdQG.cc:63
void qg_setup_f90(const eckit::Configuration *const *, const F90geom &, F90model &)
void qg_prepare_integration_tl_f90(const F90model &, const F90flds &)
void initializeTL(IncrementQG &) const override
Run TLM and its adjoint.
Definition: TlmIdQG.cc:49
TlmIdQG(const GeometryQG &, const eckit::Configuration &)
Definition: TlmIdQG.cc:30
static oops::LinearModelMaker< QgTraits, TlmIdQG > makerQGIdTLM_("QgIdTLM")
QG model state.
Definition: StateQG.h:50
void stepAD(IncrementQG &, ModelBiasIncrement &) const override
Definition: TlmIdQG.cc:68
void updateTime(const util::Duration &dt)
Definition: IncrementQG.h:94
GeometryQG handles geometry for QG model.
Definition: GeometryQG.h:33
void qg_delete_f90(F90model &)
void finalizeTL(IncrementQG &) const override
Definition: TlmIdQG.cc:59
The namespace for the qg model.
Increment Class: Difference between two states.
Definition: IncrementQG.h:55