11 #ifndef OOPS_ASSIMILATION_COSTJB3D_H_ 12 #define OOPS_ASSIMILATION_COSTJB3D_H_ 15 #include <boost/scoped_ptr.hpp> 17 #include "eckit/config/LocalConfiguration.h" 26 #include "oops/util/DateTime.h" 27 #include "oops/util/dot_product.h" 28 #include "oops/util/Duration.h" 29 #include "oops/util/Logger.h" 32 template<
typename MODEL>
class ControlIncrement;
33 template<
typename MODEL>
class JqTerm;
59 const util::Duration &,
const State_ &);
91 unsigned int nstates()
const override {
return 1;}
96 boost::scoped_ptr< ModelSpaceCovarianceBase<MODEL> >
B_;
99 boost::scoped_ptr<const Geometry_>
resol_;
100 boost::scoped_ptr<const util::DateTime>
time_;
101 const eckit::LocalConfiguration
conf_;
109 template<
typename MODEL>
113 : xb_(
xb), B_(), winLength_(
len), controlvars_(ctlvars), resol_(), time_(),
114 conf_(config,
"Covariance")
116 Log::trace() <<
"CostJb3D constructed." << std::endl;
121 template<
typename MODEL>
125 time_.reset(
new util::DateTime(fg[0].validTime()));
131 template<
typename MODEL>
139 template<
typename MODEL>
147 template<
typename MODEL>
149 B_->multiply(dxin[0], dxout[0]);
154 template<
typename MODEL>
156 Log::warning() <<
"*** B inverse might not always exist ***" << std::endl;
157 B_->inverseMultiply(dxin[0], dxout[0]);
158 Log::warning() <<
"*** B inverse might not always exist ***" << std::endl;
163 template<
typename MODEL>
165 B_->randomize(dx[0]);
170 template<
typename MODEL>
181 #endif // OOPS_ASSIMILATION_COSTJB3D_H_
void randomize(Increment4D_ &) const override
Randomize.
boost::scoped_ptr< ModelSpaceCovarianceBase< MODEL > > B_
integer, parameter, public warning
void Bminv(const Increment4D_ &, Increment4D_ &) const override
JqTermTLAD< MODEL > * initializeJqAD(const Increment4D_ &) const override
Empty AD Jq observer.
void diff(const State4D_ &, const State4D_ &)
Linear algebra operators.
Encapsulates the model state.
boost::scoped_ptr< const util::DateTime > time_
const Variables controlvars_
ControlIncrement< MODEL > CtrlInc_
The namespace for the main oops code.
State4D< MODEL > State4D_
Increment4D< MODEL > Increment4D_
JqTerm< MODEL > * initializeJq() const override
Empty Jq observer.
unsigned int nstates() const override
Create new increment (set to 0).
void addGradient(const Increment4D_ &, Increment4D_ &, Increment4D_ &) const override
Add Jb gradient.
Increment< MODEL > Increment_
void computeIncrement(const State4D_ &, const State4D_ &, Increment4D_ &) const override
Get increment from state (usually first guess).
const util::Duration winLength_
Increment_ * newStateIncrement(const unsigned int) const override
Jb Cost Function Base Class.
JqTermTLAD< MODEL > * initializeJqTLAD() const override
Increment Class: Difference between two states.
virtual ~CostJb3D()
Destructor.
Geometry< MODEL > Geometry_
bool checkStatesNumber(const unsigned int nn) const
Get model space control variable.
boost::scoped_ptr< const Geometry_ > resol_
const eckit::LocalConfiguration conf_
JqTermTLAD< MODEL > * initializeJqTL() const override
Empty TL Jq observer.
CostJb3D(const eckit::Configuration &, const Geometry_ &, const Variables &, const util::Duration &, const State_ &)
Construct .
void linearize(const State4D_ &, const Geometry_ &) override
Linearize before the linear computations.
void Bmult(const Increment4D_ &, Increment4D_ &) const override
Multiply by and .