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