11 #ifndef OOPS_RUNS_EXTERNALDFI_H_
12 #define OOPS_RUNS_EXTERNALDFI_H_
17 #include "eckit/config/LocalConfiguration.h"
18 #include "eckit/exception/Exceptions.h"
30 #include "oops/util/DateTime.h"
31 #include "oops/util/Duration.h"
32 #include "oops/util/Logger.h"
48 int execute(
const eckit::Configuration & fullConfig)
const {
50 const eckit::LocalConfiguration resolConfig(fullConfig,
"geometry");
54 const eckit::LocalConfiguration modelConfig(fullConfig,
"model");
55 const Model_ model(resol, modelConfig);
58 const eckit::LocalConfiguration initialConfig(fullConfig,
"initial condition");
59 State_ xx(resol, initialConfig);
60 Log::test() <<
"Initial state: " << xx << std::endl;
63 const ModelAux_ moderr(resol, fullConfig.getSubConfiguration(
"model aux control"));
66 const util::Duration fclength(fullConfig.getString(
"forecast length"));
67 const util::DateTime bgndate(xx.
validTime());
68 const util::DateTime enddate(bgndate + fclength);
69 Log::info() <<
"Running forecast from " << bgndate <<
" to " << enddate << std::endl;
74 eckit::LocalConfiguration prtConf;
75 fullConfig.get(
"prints", prtConf);
81 const eckit::LocalConfiguration dfiConf(fullConfig,
"dfi");
82 const util::Duration dfispan(dfiConf.getString(
"filter_span"));
83 const util::DateTime dfitime(bgndate+dfispan/2);
84 const Variables vars(dfiConf,
"filtered variables");
85 std::shared_ptr< WeightedMean<MODEL, State_> >
90 model.
forecast(xx, moderr, dfispan, pp);
93 std::unique_ptr<State_> xdfi(pdfi->releaseMean());
94 Log::test() <<
"Filtered state: " << *xdfi << std::endl;
97 const eckit::LocalConfiguration outConfig(fullConfig,
"output");
101 const util::Duration fclen = fclength - dfispan/2;
102 if (fclength < util::Duration(0))
103 throw eckit::BadParameter(
"DFI: filter span longer than forecast");
105 model.
forecast(zz, moderr, fclen, post);
106 Log::test() <<
"Final state: " << zz << std::endl;
113 return "oops::ExternalDFI<" + MODEL::name() +
">";
const eckit::mpi::Comm & getComm() const
ModelAuxControl< MODEL > ModelAux_
int execute(const eckit::Configuration &fullConfig) const
std::string appname() const
Geometry< MODEL > Geometry_
ExternalDFI(const eckit::mpi::Comm &comm=oops::mpi::world())
Geometry class used in oops; subclass of interface class interface::Geometry.
Auxiliary state related to model (could be e.g. model bias), not used at the moment.
Abstract nonlinear forecast model used by high level algorithms and applications.
void forecast(State_ &xx, const ModelAux_ &, const util::Duration &len, PostProcessor< State_ > &post) const
Run the forecast from state xx for len time, with post postprocessors Does not need to be implemented...
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.
Handles writing-out of forecast fields.
Compute time average of states or increments during model run.
const util::DateTime validTime() const
Accessor to the time of this State.
const eckit::mpi::Comm & world()
Default communicator with all MPI tasks (ie MPI_COMM_WORLD)
The namespace for the main oops code.