8 #ifndef OOPS_RUNS_RTPP_H_
9 #define OOPS_RUNS_RTPP_H_
14 #include "eckit/config/LocalConfiguration.h"
21 #include "oops/util/Logger.h"
43 int execute(
const eckit::Configuration & fullConfig)
const {
45 const eckit::LocalConfiguration geometryConfig(fullConfig,
"geometry");
49 const eckit::LocalConfiguration bgConfig(fullConfig,
"background");
50 const eckit::LocalConfiguration anConfig(fullConfig,
"analysis");
51 const float factor = fullConfig.getFloat(
"factor");
56 const size_t nens = bgens.
size();
57 ASSERT(nens == anens.
size());
60 if (fullConfig.has(
"analysis variables"))
61 anvars =
Variables(fullConfig,
"analysis variables");
67 Log::test() <<
"Background member 1:" << bgens[0] << std::endl;
68 Log::test() <<
"Analysis member 1:" << anens[0] << std::endl;
71 for (
size_t jj = 0; jj < nens; ++jj) {
73 Increment_ pertTot(geometry, anvars, anens[jj].validTime());
78 pert.
diff(bgens[jj], bg_mean);
79 pertTot.
axpy(factor, pert);
81 pert.
diff(anens[jj], an_mean);
82 pertTot.
axpy((1.0 - factor), pert);
88 anens[jj].accumul(1.0, an_mean);
93 Log::test() <<
"Updated Analysis member 1:" << anens[0] << std::endl;
96 an_mean = anens.
mean();
97 Log::test() <<
"Analysis mean:" << an_mean << std::endl;
98 eckit::LocalConfiguration outConfig(fullConfig,
"output");
99 outConfig.set(
"member", 0);
100 an_mean.
write(outConfig);
104 for (
size_t jj=0; jj < nens; ++jj) {
106 outConfig.set(
"member", mymember);
107 anens[jj].write(outConfig);
117 return "oops::RTPP<" + MODEL::name() +
">";
const eckit::mpi::Comm & getComm() const
Geometry class used in oops; subclass of interface class interface::Geometry.
Increment class used in oops.
Application for relaxation to prior perturbation (RTPP) inflation.
int execute(const eckit::Configuration &fullConfig) const
std::string appname() const
Geometry< MODEL > Geometry_
StateEnsemble< MODEL > StateEnsemble_
RTPP(const eckit::mpi::Comm &comm=oops::mpi::world())
Increment< MODEL > Increment_
const Variables & variables() const
Information.
size_t size() const
Accessors.
State_ mean() const
calculate ensemble mean
State class used in oops; subclass of interface class interface::State.
void axpy(const double &w, const Increment &dx, const bool check=true)
void diff(const State_ &state1, const State_ &state2)
Set this Increment to be difference between state1 and state2.
void zero()
Zero out this Increment.
void write(const eckit::Configuration &) const
Write this State out to file.
const eckit::mpi::Comm & world()
Default communicator with all MPI tasks (ie MPI_COMM_WORLD)
The namespace for the main oops code.