Go to the documentation of this file.
9 #ifndef OOPS_INTERFACE_MODEL_H_
10 #define OOPS_INTERFACE_MODEL_H_
15 #include <boost/noncopyable.hpp>
21 #include "oops/util/Duration.h"
22 #include "oops/util/Logger.h"
23 #include "oops/util/Printable.h"
24 #include "oops/util/Timer.h"
51 template <
typename MODEL>
52 class Model :
public util::Printable,
53 private boost::noncopyable,
54 private util::ObjectCounter<Model<MODEL> > {
61 static const std::string
classname() {
return "oops::Model";}
86 void print(std::ostream &)
const;
94 template<
typename MODEL>
98 Log::trace() <<
"Model<MODEL>::Model starting" << std::endl;
100 Log::info() <<
"Model configuration is:" << params << std::endl;
102 Log::trace() <<
"Model<MODEL>::Model done" << std::endl;
107 template<
typename MODEL>
114 template<
typename MODEL>
116 Log::trace() <<
"Model<MODEL>::~Model starting" << std::endl;
117 util::Timer timer(classname(),
"~Model");
119 Log::trace() <<
"Model<MODEL>::~Model done" << std::endl;
124 template<
typename MODEL>
126 const util::Duration & len,
128 Log::trace() <<
"Model<MODEL>::forecast starting" << std::endl;
130 const util::DateTime end(xx.
validTime() + len);
131 Log::info() <<
"Model:forecast: forecast starting: " << xx << std::endl;
132 this->initialize(xx);
133 post.
initialize(xx, end, model_->timeResolution());
136 this->step(xx, maux);
141 Log::info() <<
"Model:forecast: forecast finished: " << xx << std::endl;
144 Log::trace() <<
"Model<MODEL>::forecast done" << std::endl;
149 template<
typename MODEL>
151 Log::trace() <<
"Model<MODEL>::initialize starting" << std::endl;
152 util::Timer timer(classname(),
"initialize");
153 model_->initialize(xx.
state());
154 Log::trace() <<
"Model<MODEL>::initialize done" << std::endl;
159 template<
typename MODEL>
161 Log::trace() <<
"Model<MODEL>::step starting" << std::endl;
162 util::Timer timer(classname(),
"step");
164 Log::trace() <<
"Model<MODEL>::step done" << std::endl;
169 template<
typename MODEL>
171 Log::trace() <<
"Model<MODEL>::finalize starting" << std::endl;
172 util::Timer timer(classname(),
"finalize");
173 model_->finalize(xx.
state());
174 Log::trace() <<
"Model<MODEL>::finalize done" << std::endl;
179 template<
typename MODEL>
181 Log::trace() <<
"Model<MODEL>::print starting" << std::endl;
182 util::Timer timer(classname(),
"print");
184 Log::trace() <<
"Model<MODEL>::print done" << std::endl;
191 #endif // OOPS_INTERFACE_MODEL_H_
ModelBase< MODEL > ModelBase_
Base class for the forecasting model Defines the interfaces for a forecast model.
const util::DateTime validTime() const
Time.
The namespace for the main oops code.
void process(const FLDS &xx)
ModelAuxControl< MODEL > ModelAux_
std::unique_ptr< ModelBase_ > model_
Pointer to the Model implementation.
void finalize(const FLDS &xx)
static const std::string classname()
const util::Duration & timeResolution() const
Time step for running Model's forecast in oops (frequency with which the State will be updated)
void finalize(State_ &) const
Forecast finalization; called after each forecast run.
Geometry< MODEL > Geometry_
void print(std::ostream &) const
Print, used in logging.
State_ & state()
Interfacing.
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...
void step(State_ &, const ModelAux_ &) const
Forecast "step", called during forecast run; updates state to the next time.
Model(const Geometry_ &, const ModelParametersBase &)
void initialize(const FLDS &xx, const util::DateTime &end, const util::Duration &step)
Geometry class used in oops; subclass of interface class above.
const oops::Variables & variables() const
Model variables (only used in 4DVar)
Contains a polymorphic parameter holding an instance of a subclass of ModelParametersBase.
Base class for classes storing model-specific parameters.
Encapsulates the model state.
Control model post processing.
const ModelAuxControl_ & modelauxcontrol() const
Interfacing.
void initialize(State_ &) const
Forecast initialization, called before every forecast run.
Encapsulates the nonlinear forecast model Note: to see methods that need to be implemented in the for...