FV3-JEDI
VarChaC2A.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, VarChaC2A>>
26  makerVarChaC2A_("Control2Analysis");
27 // -------------------------------------------------------------------------------------------------
28 VarChaC2A::VarChaC2A(const Geometry & resol, const eckit::Configuration & conf):
29  geom_(new Geometry(resol))
30 {
31  util::Timer timer(classname(), "VarChaC2A");
32  oops::Log::trace() << classname() << " constructor starting" << std::endl;
33  const eckit::Configuration * configc = &conf;
34  fv3jedi_varcha_c2a_create_f90(keyFtnConfig_, geom_->toFortran(), &configc);
35  oops::Log::trace() << classname() << " constructor done" << std::endl;
36 }
37 // -------------------------------------------------------------------------------------------------
39  util::Timer timer(classname(), "~VarChaC2A");
40  oops::Log::trace() << classname() << " destructor starting" << std::endl;
42  oops::Log::trace() << classname() << " destructor done" << std::endl;
43 }
44 // -------------------------------------------------------------------------------------------------
45 void VarChaC2A::changeVar(const State & xin, State & xout) const {
46  util::Timer timer(classname(), "changeVar");
47  oops::Log::trace() << classname() << " changeVar starting" << std::endl;
49  xout.toFortran());
50  xout.validTime() = xin.validTime();
51  oops::Log::trace() << classname() << " changeVar done" << std::endl;
52 }
53 // -------------------------------------------------------------------------------------------------
54 void VarChaC2A::changeVarInverse(const State & xin, State & xout) const {
55  util::Timer timer(classname(), "changeVarInverse");
56  oops::Log::trace() << classname() << " changeVarInverse starting" << std::endl;
58  xout.toFortran());
59  xout.validTime() = xin.validTime();
60  oops::Log::trace() << classname() << " changeVarInverse done" << std::endl;
61 }
62 // -------------------------------------------------------------------------------------------------
63 void VarChaC2A::print(std::ostream & os) const {
64  os << classname() << " variable change";
65 }
66 // -------------------------------------------------------------------------------------------------
67 } // namespace fv3jedi
Traits.h
fv3jedi::VarChaC2A::changeVar
void changeVar(const State &, State &) const
Definition: VarChaC2A.cc:45
Utilities.h
fv3jedi::VarChaC2A::~VarChaC2A
~VarChaC2A()
Definition: VarChaC2A.cc:38
fv3jedi::VarChaC2A::VarChaC2A
VarChaC2A(const Geometry &, const eckit::Configuration &)
Definition: VarChaC2A.cc:28
fv3jedi::VarChaC2A::changeVarInverse
void changeVarInverse(const State &, State &) const
Definition: VarChaC2A.cc:54
fv3jedi::fv3jedi_varcha_c2a_changevarinverse_f90
void fv3jedi_varcha_c2a_changevarinverse_f90(const F90vc_C2A &, const F90geom &, const F90state &, const F90state &)
Geometry.h
fv3jedi::VarChaC2A::classname
static const std::string classname()
Definition: VarChaC2A.h:25
fv3jedi::makerVarChaC2A_
static oops::VariableChangeMaker< Traits, oops::VariableChange< Traits, VarChaC2A > > makerVarChaC2A_("Control2Analysis")
fv3jedi::VarChaC2A::geom_
std::shared_ptr< const Geometry > geom_
Definition: VarChaC2A.h:32
fv3jedi::State::toFortran
int & toFortran()
Definition: State.h:87
fv3jedi::State::validTime
const util::DateTime & validTime() const
Definition: State.h:83
VarChaC2A.h
fv3jedi::Geometry
Geometry handles geometry for FV3JEDI model.
Definition: Geometry.h:41
fv3jedi::State
Definition: State.h:45
fv3jedi::fv3jedi_varcha_c2a_changevar_f90
void fv3jedi_varcha_c2a_changevar_f90(const F90vc_C2A &, const F90geom &, const F90state &, const F90state &)
fv3jedi
Configuration files should be formatted as e.g.
Definition: ErrorCovariance.cc:20
fv3jedi::VarChaC2A::print
void print(std::ostream &) const override
Definition: VarChaC2A.cc:63
fv3jedi::fv3jedi_varcha_c2a_create_f90
void fv3jedi_varcha_c2a_create_f90(const F90vc_C2A &, const F90geom &, const eckit::Configuration *const *)
fv3jedi::VarChaC2A::keyFtnConfig_
F90vc_C2A keyFtnConfig_
Definition: VarChaC2A.h:33
State.h
fv3jedi::fv3jedi_varcha_c2a_delete_f90
void fv3jedi_varcha_c2a_delete_f90(F90vc_C2A &)