8 #ifndef OOPS_INTERFACE_CHANGEVARIABLES_H_
9 #define OOPS_INTERFACE_CHANGEVARIABLES_H_
14 #include "eckit/config/LocalConfiguration.h"
19 #include "oops/util/Logger.h"
20 #include "oops/util/ObjectCounter.h"
21 #include "oops/util/Printable.h"
22 #include "oops/util/Timer.h"
29 template <
typename MODEL>
31 private util::ObjectCounter<ChangeVariables<MODEL> > {
37 static const std::string
classname() {
return "oops::ChangeVariables";}
53 void print(std::ostream &)
const override;
55 std::unique_ptr<VariableChange_>
chvar_;
60 template<
typename MODEL>
65 Log::trace() <<
"ChangeVariables<MODEL>::ChangeVariables starting" << std::endl;
68 eckit::LocalConfiguration chconf(conf);
69 if (!chconf.has(
"variable change")) chconf.set(
"variable change",
"default");
70 chconf.set(
"input variables", varin.
variables());
71 chconf.set(
"output variables", varout.
variables());
73 Log::trace() <<
"ChangeVariables<MODEL>::ChangeVariables done" << std::endl;
78 template<
typename MODEL>
80 Log::trace() <<
"ChangeVariables<MODEL>::~ChangeVariables starting" << std::endl;
83 Log::trace() <<
"ChangeVariables<MODEL>::~ChangeVariables done" << std::endl;
88 template<
typename MODEL>
90 Log::trace() <<
"ChangeVariables<MODEL>::changeVar starting" << std::endl;
92 chvar_->changeVar(x1, x2);
93 Log::trace() <<
"ChangeVariables<MODEL>::changeVar done" << std::endl;
98 template<
typename MODEL>
100 Log::trace() <<
"ChangeVariables<MODEL>::changeVarInverse starting" << std::endl;
102 chvar_->changeVarInverse(x1, x2);
103 Log::trace() <<
"ChangeVariables<MODEL>::changeVarInverse done" << std::endl;
108 template<
typename MODEL>
110 Log::trace() <<
"ChangeVariables<MODEL>::print starting" << std::endl;
113 Log::trace() <<
"ChangeVariables<MODEL>::print done" << std::endl;
Encapsulates the nonlinear variable change There should not be a factory for ChangeVariable,...
void changeVarInverse(const State_ &xout, State_ &xin) const
inverse of changeVar, change variables back from xout to xin
const ChangeVariables & operator=(const ChangeVariables &)=delete
Geometry< MODEL > Geometry_
ChangeVariables & operator=(ChangeVariables &&)=default
std::unique_ptr< VariableChange_ > chvar_
ChangeVariables(ChangeVariables &&)=default
ChangeVariables(const eckit::Configuration &, const Geometry_ &, const Variables &, const Variables &)
ChangeVariables(const ChangeVariables &)=delete
void changeVar(const State_ &xin, State_ &xout) const
change variable from state xin to xout
static const std::string classname()
virtual ~ChangeVariables()
VariableChange< MODEL > VariableChange_
void print(std::ostream &) const override
Geometry class used in oops; subclass of interface class interface::Geometry.
State class used in oops; subclass of interface class interface::State.
Encapsulates the nonlinear variable change Note: to see methods that need to be implemented in the im...
const std::vector< std::string > & variables() const
The namespace for the main oops code.