11 #ifndef OOPS_ASSIMILATION_JQTERMTLAD_H_
12 #define OOPS_ASSIMILATION_JQTERMTLAD_H_
21 #include "oops/util/DateTime.h"
22 #include "oops/util/Duration.h"
28 template <
typename MODEL>
46 const util::Duration &)
override {}
51 const util::Duration &)
override {}
61 std::unique_ptr<Increment_>
mxi_;
62 std::unique_ptr<Increment_>
xi_;
67 template <
typename MODEL>
69 : commTime_(comm), xtraj_(), mxi_(), xi_()
71 Log::trace() <<
"JqTermTLAD::JqTermTLAD" << std::endl;
76 template <
typename MODEL>
78 Log::trace() <<
"JqTermTLAD::doFinalizeTraj start" << std::endl;
79 xtraj_.reset(
new State_(xx));
80 Log::trace() <<
"JqTermTLAD::doFinalizeTraj done" << std::endl;
120 template <
typename MODEL>
122 Log::trace() <<
"JqTermTLAD::getMxi" << std::endl;
129 template <
typename MODEL>
131 Log::trace() <<
"JqTermTLAD::doFinalizeTL start" << std::endl;
132 Log::debug() <<
"JqTermTLAD::doFinalizeTL MPI size " << commTime_.size() << std::endl;
133 Log::debug() <<
"JqTermTLAD::doFinalizeTL MPI rank " << commTime_.rank() << std::endl;
134 size_t mytime = commTime_.rank();
135 if (mytime + 1 < commTime_.size())
oops::mpi::send(commTime_, dx, mytime+1, 2468);
136 Log::trace() <<
"JqTermTLAD::doFinalizeTL done" << std::endl;
141 template <
typename MODEL>
143 Log::trace() <<
"JqTermTLAD::computeModelErrorTL start" << std::endl;
145 Log::debug() <<
"JqTermTLAD::computeModelErrorTL MPI size " << commTime_.size() << std::endl;
146 Log::debug() <<
"JqTermTLAD::computeModelErrorTL MPI rank " << commTime_.rank() << std::endl;
147 size_t mytime = commTime_.rank();
153 Log::info() <<
"JqTermTLAD: x_i - M(x_i)" << dx << std::endl;
154 Log::trace() <<
"JqTermTLAD::computeModelErrorTL done" << std::endl;
159 template <
typename MODEL>
161 Log::trace() <<
"JqTermTLAD::setupAD start" << std::endl;
162 size_t mytime = commTime_.rank();
164 Log::trace() <<
"JqTermTLAD::setupAD done" << std::endl;
169 template <
typename MODEL>
171 const util::Duration &) {
172 Log::trace() <<
"JqTermTLAD::doFirstAD start" << std::endl;
173 size_t mytime = commTime_.rank();
174 if (mytime + 1 < commTime_.size()) {
179 Log::trace() <<
"JqTermTLAD::doFirstAD done" << std::endl;
Increment class used in oops.
void computeModelErrorTL(Increment_ &)
void doProcessingTraj(const State_ &) override
JqTermTLAD(const eckit::mpi::Comm &)
void doFinalizeTraj(const State_ &) override
void setupAD(const Increment_ &dx)
std::unique_ptr< Increment_ > mxi_
std::unique_ptr< State_ > xtraj_
void doFirstAD(Increment_ &, const util::DateTime &, const util::Duration &) override
void doProcessingTL(const Increment_ &) override
Increment< MODEL > Increment_
void doLastAD(Increment_ &) override
const eckit::mpi::Comm & commTime_
std::unique_ptr< Increment_ > xi_
void doInitializeTraj(const State_ &, const util::DateTime &, const util::Duration &) override
void doInitializeTL(const Increment_ &, const util::DateTime &, const util::Duration &) override
void doFinalizeTL(const Increment_ &) override
void doProcessingAD(Increment_ &) override
Handles post-processing of model fields related to cost function.
State class used in oops; subclass of interface class interface::State.
void send(const eckit::mpi::Comm &comm, const SERIALIZABLE &sendobj, const int dest, const int tag)
Extend eckit Comm for Serializable oops objects.
void receive(const eckit::mpi::Comm &comm, SERIALIZABLE &recvobj, const int source, const int tag)
The namespace for the main oops code.