MPAS-JEDI
VarChaModel2GeoVars.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/util/Logger.h"
14 #include "oops/util/Timer.h"
15 
16 #include "mpasjedi/GeometryMPAS.h"
17 #include "mpasjedi/MPASTraits.h"
18 #include "mpasjedi/StateMPAS.h"
20 
21 namespace mpas {
22 // -------------------------------------------------------------------------------------------------
23 static oops::VariableChangeMaker<MPASTraits, VarChaModel2GeoVars>
24  makerVarChaModel2GeoVars_("Model2GeoVars");
25 static oops::VariableChangeMaker<MPASTraits, VarChaModel2GeoVars>
26  makerVarChaDefault_("default");
27 // -------------------------------------------------------------------------------------------------
29  const eckit::Configuration & config) : geom_(new GeometryMPAS(geom)) {
30  util::Timer timer(classname(), "VarChaModel2GeoVars");
31  oops::Log::trace() << classname() << " constructor starting" << std::endl;
33  oops::Log::trace() << classname() << " constructor done" << std::endl;
34 }
35 // -------------------------------------------------------------------------------------------------
37  util::Timer timer(classname(), "~VarChaModel2GeoVars");
38  oops::Log::trace() << classname() << " destructor starting" << std::endl;
40  oops::Log::trace() << classname() << " destructor done" << std::endl;
41 }
42 // -------------------------------------------------------------------------------------------------
43 void VarChaModel2GeoVars::changeVar(const StateMPAS & xin, StateMPAS & xout) const {
44  util::Timer timer(classname(), "changeVar");
45  oops::Log::trace() << classname() << " changeVar starting" << std::endl;
47  xout.toFortran());
48  xout.validTime() = xin.validTime();
49  oops::Log::trace() << classname() << " changeVar done" << std::endl;
50 }
51 // -------------------------------------------------------------------------------------------------
53  util::Timer timer(classname(), "changeVarInverse");
54  oops::Log::trace() << classname() << " changeVarInverse starting" << std::endl;
55  xout = xin;
56  xout.validTime() = xin.validTime();
57  oops::Log::trace() << classname() << " changeVarInverse done" << std::endl;
58 }
59 // -------------------------------------------------------------------------------------------------
60 void VarChaModel2GeoVars::print(std::ostream & os) const {
61  os << classname() << " variable change";
62 }
63 // -------------------------------------------------------------------------------------------------
64 } // namespace mpas
GeometryMPAS handles geometry for MPAS model.
Definition: GeometryMPAS.h:37
MPAS model state.
Definition: StateMPAS.h:51
int & toFortran()
Definition: StateMPAS.h:94
const util::DateTime & validTime() const
Definition: StateMPAS.h:89
VarChaModel2GeoVars(const GeometryMPAS &, const eckit::Configuration &)
void changeVar(const StateMPAS &, StateMPAS &) const override
void changeVarInverse(const StateMPAS &, StateMPAS &) const override
static const std::string classname()
std::shared_ptr< const GeometryMPAS > geom_
void print(std::ostream &) const override
Definition: config.py:1
void mpasjedi_vc_model2geovars_delete_f90(F90vc_M2G &)
static oops::VariableChangeMaker< MPASTraits, VarChaModel2GeoVars > makerVarChaDefault_("default")
void mpasjedi_vc_model2geovars_changevar_f90(const F90vc_M2G &, const F90geom &, const F90state &, const F90state &)
void mpasjedi_vc_model2geovars_create_f90(const F90vc_M2G &, const F90geom &, const eckit::Configuration &)
static oops::VariableChangeMaker< MPASTraits, VarChaModel2GeoVars > makerVarChaModel2GeoVars_("Model2GeoVars")