8 #ifndef OOPS_INTERFACE_VARIABLECHANGE_H_
9 #define OOPS_INTERFACE_VARIABLECHANGE_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"
33 template <
typename MODEL>
35 private util::ObjectCounter<VariableChange<MODEL> > {
41 static const std::string
classname() {
return "oops::VariableChange";}
62 void print(std::ostream &)
const override;
64 std::unique_ptr<VariableChangeBase_>
chvar_;
71 template<
typename MODEL>
76 Log::trace() <<
"VariableChange<MODEL>::VariableChange starting" << std::endl;
77 util::Timer timer(
classname(),
"VariableChange");
80 Log::debug() <<
"VariableChange::VariableChange input variables: " << *
varin_ << std::endl;
84 Log::debug() <<
"VariableChange::VariableChange output variables: " << *
varout_ << std::endl;
87 Log::trace() <<
"VariableChange<MODEL>::VariableChange done" << std::endl;
92 template<
typename MODEL>
100 template<
typename MODEL>
102 Log::trace() <<
"VariableChange<MODEL>::~VariableChange starting" << std::endl;
103 util::Timer timer(classname(),
"~VariableChange");
105 Log::trace() <<
"VariableChange<MODEL>::~VariableChange done" << std::endl;
110 template<
typename MODEL>
112 Log::trace() <<
"VariableChange<MODEL>::changeVar starting" << std::endl;
113 util::Timer timer(classname(),
"changeVar");
114 chvar_->changeVar(x1, x2);
115 Log::trace() <<
"VariableChange<MODEL>::changeVar done" << std::endl;
120 template<
typename MODEL>
122 Log::trace() <<
"VariableChange<MODEL>::changeVarInverse starting" << std::endl;
123 util::Timer timer(classname(),
"changeVarInverse");
124 chvar_->changeVarInverse(x1, x2);
125 Log::trace() <<
"VariableChange<MODEL>::changeVarInverse done" << std::endl;
130 template<
typename MODEL>
132 Log::trace() <<
"VariableChange<MODEL>::changeVar starting" << std::endl;
135 this->changeVar(xin, xout);
136 Log::trace() <<
"VariableChange<MODEL>::changeVar done" << std::endl;
142 template<
typename MODEL>
144 Log::trace() <<
"VariableChange<MODEL>::changeVarInverse starting" << std::endl;
147 this->changeVarInverse(xin, xout);
148 Log::trace() <<
"VariableChange<MODEL>::changeVarInverse done" << std::endl;
154 template<
typename MODEL>
156 Log::trace() <<
"VariableChange<MODEL>::print starting" << std::endl;
157 util::Timer timer(classname(),
"print");
159 if (varin_) os << std::endl <<
"Variable change from: " << *varin_;
160 if (varout_) os << std::endl <<
"Variable change to: " << *varout_;
161 if (varin_ || varout_) os << std::endl;
162 Log::trace() <<
"VariableChange<MODEL>::print done" << std::endl;
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...
std::unique_ptr< VariableChangeBase_ > chvar_
void changeVar(const State_ &xin, State_ &xout) const
change variable from state xin to xout
void changeVarInverse(const State_ &xout, State_ &xin) const
inverse of changeVar, change variables back from xout to xin
virtual ~VariableChange()
GenericVariableChangeBase< MODEL > VariableChangeBase_
VariableChange(VariableChange &&)=default
VariableChange & operator=(VariableChange &&)=default
VariableChange(const Geometry_ &, const VariableChangeParametersBase &)
Geometry< MODEL > Geometry_
void print(std::ostream &) const override
static const std::string classname()
std::unique_ptr< Variables > varin_
pointer to the VariableChange implementation
VariableChange(const VariableChange &)=delete
const VariableChange & operator=(const VariableChange &)=delete
std::unique_ptr< Variables > varout_
input variables
Base class of classes storing parameters controlling specific variable changes.
OptionalParameter< Variables > inputVariables
OptionalParameter< Variables > outputVariables
Contains a polymorphic parameter holding an instance of a subclass of VariableChangeParametersBase.
Geometry_ geometry() const
Accessor to geometry associated with this State.
const util::DateTime validTime() const
Accessor to the time of this State.
The namespace for the main oops code.