11 #ifndef OOPS_ASSIMILATION_INCREMENTALASSIMILATION_H_
12 #define OOPS_ASSIMILATION_INCREMENTALASSIMILATION_H_
17 #include "eckit/config/Configuration.h"
25 #include "oops/util/Logger.h"
26 #include "oops/util/printRunStats.h"
30 template<
typename MODEL,
typename OBS>
32 const eckit::Configuration & config) {
37 util::printRunStats(
"IncrementalAssimilation start");
40 std::vector<eckit::LocalConfiguration> iterconfs;
41 config.get(
"iterations", iterconfs);
42 const unsigned int nouter = iterconfs.size();
43 Log::info() <<
"Running incremental assimilation with " << nouter
44 <<
" outer iterations." << std::endl;
47 eckit::LocalConfiguration minConf(config,
"minimizer");
48 minConf.set(
"nouter",
static_cast<const int>(nouter));
51 for (
unsigned jouter = 0; jouter < nouter; ++jouter) {
52 iterconfs[jouter].set(
"iteration",
static_cast<int>(jouter));
54 Log::info() <<
"IncrementalAssimilation: Configuration for outer iteration "
55 << jouter <<
":" << std::endl << iterconfs[jouter] << std::endl;
56 util::printRunStats(
"IncrementalAssimilation iteration " + std::to_string(jouter));
60 if (iterconfs[jouter].
has(
"prints")) {
61 const eckit::LocalConfiguration prtConfig(iterconfs[jouter],
"prints");
67 util::printRunStats(
"IncrementalAssimilation linearize " + std::to_string(jouter));
70 std::unique_ptr<CtrlInc_> dx(minim->minimize(iterconfs[jouter]));
78 util::printRunStats(
"IncrementalAssimilation end");
void addIncrement(CtrlVar_ &, const CtrlInc_ &, PostProcessor< Increment_ > post=PostProcessor< Increment_ >()) const
double linearize(const CtrlVar_ &, const eckit::Configuration &, PostProcessor< State_ > post=PostProcessor< State_ >())
void resetLinearization()
A Minimizer knows how to minimize a cost function.
Control model post processing.
void enrollProcessor(PostBase_ *pp)
State class used in oops; subclass of interface class interface::State.
Handles writing-out of forecast fields.
logical function has(this, var)
The namespace for the main oops code.
int IncrementalAssimilation(ControlVariable< MODEL, OBS > &xx, CostFunction< MODEL, OBS > &J, const eckit::Configuration &config)