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