11 #ifndef OOPS_ASSIMILATION_JQTERMTLAD_H_ 12 #define OOPS_ASSIMILATION_JQTERMTLAD_H_ 21 #include "oops/util/DateTime.h" 22 #include "oops/util/Duration.h" 25 template<
typename MODEL>
class Increment4D;
29 template <
typename MODEL>
30 class JqTermTLAD :
public PostBaseTLAD<MODEL> {
49 const util::Duration &)
override {}
54 const util::Duration &)
override {}
63 std::vector<Increment_>
mxi_;
64 std::vector<Increment_>
xi_;
71 template <
typename MODEL>
73 : jq_(nsub), mxi_(), xi_(), nsubwin_(nsub), current_(0)
75 Log::trace() <<
"JqTermTLAD::JqTermTLAD" << std::endl;
80 template <
typename MODEL>
82 Log::trace() <<
"JqTermTLAD::doFinalizeTraj start" << std::endl;
84 Log::trace() <<
"JqTermTLAD::doFinalizeTraj done" << std::endl;
89 template <
typename MODEL>
91 Log::trace() <<
"JqTermTLAD::computeModelErrorTraj start" << std::endl;
92 jq_.computeModelError(fg, dx);
93 Log::trace() <<
"JqTermTLAD::computeModelErrorTraj done" << std::endl;
98 template <
typename MODEL>
100 Log::trace() <<
"JqTermTLAD::doFinalizeTL start" << std::endl;
101 if (mxi_.size() < nsubwin_ - 1) mxi_.push_back(dx);
102 Log::trace() <<
"JqTermTLAD::doFinalizeTL done" << std::endl;
107 template <
typename MODEL>
109 Log::trace() <<
"JqTermTLAD::computeModelErrorTL start" << std::endl;
111 for (
unsigned jsub = 1; jsub < nsubwin_; ++jsub) {
112 dx[jsub] -= mxi_[jsub-1];
113 Log::info() <<
"JqTermTLAD: x_" << jsub <<
" - M(x_" << jsub-1 <<
")" << dx[jsub] << std::endl;
116 Log::trace() <<
"JqTermTLAD::computeModelErrorTL done" << std::endl;
121 template <
typename MODEL>
123 Log::trace() <<
"JqTermTLAD::setupAD start" << std::endl;
125 for (
unsigned jsub = 0; jsub < nsubwin_; ++jsub) {
126 xi_.push_back(dx[jsub]);
129 Log::trace() <<
"JqTermTLAD::setupAD done" << std::endl;
134 template <
typename MODEL>
136 const util::Duration &) {
137 Log::trace() <<
"JqTermTLAD::doFirstAD start" << std::endl;
138 ASSERT(current_ >= 0);
139 ASSERT(current_ <= nsubwin_);
140 if (current_ < xi_.size()) {
144 Log::trace() <<
"JqTermTLAD::doFirstAD done" << std::endl;
151 #endif // OOPS_ASSIMILATION_JQTERMTLAD_H_ Increment4D< MODEL > Increment4D_
void doLastAD(Increment_ &) override
void doFirstAD(Increment_ &, const util::DateTime &, const util::Duration &) override
void doInitializeTL(const Increment_ &, const util::DateTime &, const util::Duration &) override
GeneralizedDepartures * releaseOutputFromTL() override
Return TL dual space output.
void doFinalizeTraj(const State_ &) override
void doProcessingTL(const Increment_ &) override
void setupAD(const Increment4D_ &dx)
Encapsulates the model state.
The namespace for the main oops code.
void computeModelErrorTraj(const State4D_ &, Increment4D_ &)
void doInitializeTraj(const State_ &, const util::DateTime &, const util::Duration &) override
subroutine, public info(self)
Increment< MODEL > Increment_
void doProcessingTraj(const State_ &) override
void doProcessingAD(Increment_ &) override
JqTermTLAD(unsigned nsub)
std::vector< Increment_ > mxi_
Increment Class: Difference between two states.
std::vector< Increment_ > xi_
void doFinalizeTL(const Increment_ &) override
Abstract base class for quantities.
State4D< MODEL > State4D_
void computeModelErrorTL(Increment4D_ &)