11 #ifndef OOPS_ASSIMILATION_DRMINIMIZER_H_
12 #define OOPS_ASSIMILATION_DRMINIMIZER_H_
19 #include "eckit/config/Configuration.h"
26 #include "oops/util/dot_product.h"
27 #include "oops/util/formats.h"
28 #include "oops/util/Logger.h"
60 const double,
const double,
61 const int,
const double) = 0;
65 std::vector<CtrlInc_>
dxh_;
71 template<
typename MODEL,
typename OBS>
74 int ninner = config.getInt(
"ninner");
75 double gnreduc = config.getDouble(
"gradient norm reduction");
77 bool runOnlineAdjTest = config.getBool(
"online diagnostics.online adj test",
false);
80 gradJb_.reset(
new CtrlInc_(J_.jb().resolution(), *gradJb_));
82 gradJb_.reset(
new CtrlInc_(J_.jb()));
85 Log::info() << std::endl;
86 Log::info() << classname() <<
": max iter = " << ninner
87 <<
", requested norm reduction = " << gnreduc << std::endl;
91 const HtRinvH_ HtRinvH(J_, runOnlineAdjTest);
96 J_.computeGradientFG(rhs);
97 J_.jb().addGradientFG(rhs, *gradJb_);
99 Log::info() << classname() <<
" rhs" << rhs << std::endl;
108 const double costJ0Jb = costJ0Jb_;
109 const double costJ0JoJc = J_.getCostJoJc();
112 double reduc = this->solve(*dx, dxh, rhs, B, HtRinvH, costJ0Jb, costJ0JoJc, ninner, gnreduc);
114 Log::test() << classname() <<
": reduction in residual norm = " << reduc << std::endl;
115 Log::info() << classname() <<
" output increment:" << *dx << std::endl;
122 costJ0Jb_ += 0.5 * dot_product(*dx, dxh);
123 for (
unsigned int jouter = 1; jouter < dxh_.size(); ++jouter) {
125 costJ0Jb_ += dot_product(*dx, dxhtmp);
135 #endif // OOPS_ASSIMILATION_DRMINIMIZER_H_