FV3-JEDI
VarChaA2M.cc
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2017-2020 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 #include <ostream>
9 #include <string>
10 
11 #include "eckit/config/Configuration.h"
12 
13 #include "oops/interface/VariableChange.h"
14 #include "oops/util/Logger.h"
15 #include "oops/util/Timer.h"
16 
18 #include "fv3jedi/State/State.h"
22 
23 namespace fv3jedi {
24 // -------------------------------------------------------------------------------------------------
25 static oops::VariableChangeMaker<Traits, oops::VariableChange<Traits, VarChaA2M> >
26  makerVarChaA2M_("Analysis2Model");
27 // -------------------------------------------------------------------------------------------------
28 VarChaA2M::VarChaA2M(const Geometry & resol, const eckit::Configuration & conf) :
29 geom_(new Geometry(resol)), conf_(conf)
30 {
31  util::Timer timer(classname(), "VarChaA2M");
32  oops::Log::trace() << classname() << " constructor starting" << std::endl;
33  const eckit::LocalConfiguration * configc = &conf_;
34  fv3jedi_varcha_a2m_create_f90(keyFtnConfig_, geom_->toFortran(), &configc);
35  oops::Log::trace() << classname() << " constructor done" << std::endl;
36 }
37 // -------------------------------------------------------------------------------------------------
39  util::Timer timer(classname(), "~VarChaA2M");
40  oops::Log::trace() << classname() << " destructor starting" << std::endl;
42  oops::Log::trace() << classname() << " destructor done" << std::endl;
43 }
44 // -------------------------------------------------------------------------------------------------
45 void VarChaA2M::changeVar(const State & xin, State & xout) const {
46  util::Timer timer(classname(), "changeVar");
47  oops::Log::trace() << classname() << " changeVar done" << std::endl;
48  util::DateTime * vtime = &xout.validTime();
50  xout.toFortran(), &vtime);
51  xout.validTime() = xin.validTime();
52  oops::Log::trace() << classname() << " changeVar done" << std::endl;
53 }
54 // -------------------------------------------------------------------------------------------------
55 void VarChaA2M::changeVarInverse(const State & xin, State & xout) const {
56  util::Timer timer(classname(), "changeVarInverse");
57  oops::Log::trace() << classname() << " changeVarInverse starting" << std::endl;
58  util::DateTime * vtime = &xout.validTime();
60  xout.toFortran(), &vtime);
61  xout.validTime() = xin.validTime();
62  oops::Log::trace() << classname() << " changeVarInverse done" << std::endl;
63 }
64 // -------------------------------------------------------------------------------------------------
65 void VarChaA2M::print(std::ostream & os) const {
66  os << classname() << " variable change";
67 }
68 // -------------------------------------------------------------------------------------------------
69 } // namespace fv3jedi
Traits.h
fv3jedi::VarChaA2M::changeVarInverse
void changeVarInverse(const State &, State &) const
Definition: VarChaA2M.cc:55
fv3jedi::VarChaA2M::keyFtnConfig_
F90vc_A2M keyFtnConfig_
Definition: VarChaA2M.h:33
Utilities.h
fv3jedi::VarChaA2M::~VarChaA2M
~VarChaA2M()
Definition: VarChaA2M.cc:38
Geometry.h
fv3jedi::makerVarChaA2M_
static oops::VariableChangeMaker< Traits, oops::VariableChange< Traits, VarChaA2M > > makerVarChaA2M_("Analysis2Model")
fv3jedi::VarChaA2M::changeVar
void changeVar(const State &, State &) const
Definition: VarChaA2M.cc:45
VarChaA2M.h
fv3jedi::State::toFortran
int & toFortran()
Definition: State.h:87
fv3jedi::State::validTime
const util::DateTime & validTime() const
Definition: State.h:83
fv3jedi::fv3jedi_varcha_a2m_changevarinverse_f90
void fv3jedi_varcha_a2m_changevarinverse_f90(const F90vc_A2M &, const F90geom &, const F90state &, const F90state &, util::DateTime *const *)
fv3jedi::Geometry
Geometry handles geometry for FV3JEDI model.
Definition: Geometry.h:41
fv3jedi::VarChaA2M::classname
static const std::string classname()
Definition: VarChaA2M.h:25
fv3jedi::fv3jedi_varcha_a2m_delete_f90
void fv3jedi_varcha_a2m_delete_f90(F90vc_A2M &)
fv3jedi::fv3jedi_varcha_a2m_create_f90
void fv3jedi_varcha_a2m_create_f90(const F90vc_A2M &, const F90geom &, const eckit::LocalConfiguration *const *)
fv3jedi::State
Definition: State.h:45
fv3jedi::VarChaA2M::VarChaA2M
VarChaA2M(const Geometry &, const eckit::Configuration &)
Definition: VarChaA2M.cc:28
fv3jedi::VarChaA2M::print
void print(std::ostream &) const override
Definition: VarChaA2M.cc:65
fv3jedi
Configuration files should be formatted as e.g.
Definition: ErrorCovariance.cc:20
fv3jedi::VarChaA2M::conf_
eckit::LocalConfiguration conf_
Definition: VarChaA2M.h:35
fv3jedi::fv3jedi_varcha_a2m_changevar_f90
void fv3jedi_varcha_a2m_changevar_f90(const F90vc_A2M &, const F90geom &, const F90state &, const F90state &, util::DateTime *const *)
fv3jedi::VarChaA2M::geom_
std::shared_ptr< const Geometry > geom_
Definition: VarChaA2M.h:32
State.h