11 #ifndef OOPS_INTERFACE_STATE_H_ 12 #define OOPS_INTERFACE_STATE_H_ 16 #include <boost/scoped_ptr.hpp> 18 #include "eckit/config/Configuration.h" 27 #include "oops/util/DateTime.h" 28 #include "oops/util/ObjectCounter.h" 29 #include "oops/util/Printable.h" 30 #include "oops/util/Timer.h" 38 template <
typename MODEL>
39 class State :
public util::Printable,
40 private util::ObjectCounter<State<MODEL> > {
41 typedef typename MODEL::State
State_;
49 static const std::string
classname() {
return "oops::State";}
71 void read(
const eckit::Configuration &);
72 void write(
const eckit::Configuration &)
const;
83 void print(std::ostream &)
const;
89 template<
typename MODEL>
91 const util::DateTime &
time) : state_()
93 Log::trace() <<
"State<MODEL>::State starting" << std::endl;
96 Log::trace() <<
"State<MODEL>::State done" << std::endl;
101 template<
typename MODEL>
103 const eckit::Configuration &
conf) : state_()
105 Log::trace() <<
"State<MODEL>::State read starting" << std::endl;
108 Log::trace() <<
"State<MODEL>::State read done" << std::endl;
113 template<
typename MODEL>
116 Log::trace() <<
"State<MODEL>::State interpolated starting" << std::endl;
119 Log::trace() <<
"State<MODEL>::State interpolated done" << std::endl;
124 template<
typename MODEL>
127 Log::trace() <<
"State<MODEL>::State starting copy" << std::endl;
130 Log::trace() <<
"State<MODEL>::State copy done" << std::endl;
135 template<
typename MODEL>
137 Log::trace() <<
"State<MODEL>::~State starting" << std::endl;
138 util::Timer timer(classname(),
"~State");
140 Log::trace() <<
"State<MODEL>::~State done" << std::endl;
145 template<
typename MODEL>
147 Log::trace() <<
"State<MODEL>::operator= starting" << std::endl;
148 util::Timer timer(classname(),
"operator=");
150 Log::trace() <<
"State<MODEL>::operator= done" << std::endl;
156 template<
typename MODEL>
159 Log::trace() <<
"State<MODEL>::getValues starting" << std::endl;
160 util::Timer timer(classname(),
"getValues");
162 Log::trace() <<
"State<MODEL>::getValues done" << std::endl;
167 template<
typename MODEL>
170 Log::trace() <<
"State<MODEL>::getValues traj starting" << std::endl;
171 util::Timer timer(classname(),
"getValues");
173 Log::trace() <<
"State<MODEL>::getValues traj done" << std::endl;
178 template<
typename MODEL>
180 Log::trace() <<
"State<MODEL>::read starting" << std::endl;
181 util::Timer timer(classname(),
"read");
183 Log::trace() <<
"State<MODEL>::read done" << std::endl;
188 template<
typename MODEL>
190 Log::trace() <<
"State<MODEL>::write starting" << std::endl;
191 util::Timer timer(classname(),
"write");
193 Log::trace() <<
"State<MODEL>::write done" << std::endl;
198 template<
typename MODEL>
200 Log::trace() <<
"State<MODEL>::norm starting" << std::endl;
201 util::Timer timer(classname(),
"norm");
202 double zz = state_->norm();
203 Log::trace() <<
"State<MODEL>::norm done" << std::endl;
209 template<
typename MODEL>
211 Log::trace() <<
"State<MODEL>::geometry starting" << std::endl;
212 util::Timer timer(classname(),
"geometry");
214 Log::trace() <<
"State<MODEL>::geometry done" << std::endl;
221 template<
typename MODEL>
223 Log::trace() <<
"State<MODEL>::print starting" << std::endl;
224 util::Timer timer(classname(),
"print");
226 Log::trace() <<
"State<MODEL>::print done" << std::endl;
231 template<
typename MODEL>
233 Log::trace() <<
"State<MODEL>::zero starting" << std::endl;
234 util::Timer timer(classname(),
"zero");
236 Log::trace() <<
"State<MODEL>::zero done" << std::endl;
241 template<
typename MODEL>
243 Log::trace() <<
"State<MODEL>::accumul starting" << std::endl;
244 util::Timer timer(classname(),
"accumul");
245 state_->accumul(zz, *xx.
state_);
246 Log::trace() <<
"State<MODEL>::accumul done" << std::endl;
251 template<
typename MODEL>
253 Log::trace() <<
"State<MODEL>::getPoint starting" << std::endl;
254 util::Timer timer(classname(),
"getPoint");
256 Log::trace() <<
"State<MODEL>::getPoint done" << std::endl;
264 #endif // OOPS_INTERFACE_STATE_H_ boost::scoped_ptr< State_ > state_
const GeoVaLs_ & geovals() const
Interfacing.
InterpolatorTraj< MODEL > InterpolatorTraj_
State & operator=(const State &)
Geometry< MODEL > Geometry_
void getValues(const Locations_ &, const Variables &, GeoVaLs_ &) const
Get state values at observation locations.
State(const Geometry_ &, const Variables &, const util::DateTime &)
Constructor, destructor.
GeometryIterator< MODEL > GeometryIterator_
Encapsulates the model state.
State_ & state()
Interfacing.
const Locations_ & locations() const
Interfacing.
static const std::string classname()
The namespace for the main oops code.
const GeometryIterator_ & geometryiter() const
Interfacing.
const State_ & state() const
GridPoint getPoint(const GeometryIterator_ &iter) const
void accumul(const double &, const State &)
const Geometry_ & geometry() const
Interfacing.
InterpolatorTraj_ & interpolatortraj()
Interfacing.
Locations< MODEL > Locations_
GeoVaLs< MODEL > GeoVaLs_
void read(const eckit::Configuration &)
I/O and diagnostics.
Geometry_ geometry() const
void write(const eckit::Configuration &) const
void print(std::ostream &) const
const util::DateTime validTime() const
Time.