11 #ifndef OOPS_INTERFACE_INCREMENT_H_ 12 #define OOPS_INTERFACE_INCREMENT_H_ 24 #include "oops/util/DateTime.h" 25 #include "oops/util/Duration.h" 26 #include "oops/util/ObjectCounter.h" 27 #include "oops/util/Printable.h" 28 #include "oops/util/Timer.h" 39 template <
typename MODEL>
41 public util::Printable,
42 private util::ObjectCounter<Increment<MODEL> > {
51 static const std::string
classname() {
return "oops::Increment";}
78 void zero(
const util::DateTime &);
79 void dirac(
const eckit::Configuration &);
91 void read(
const eckit::Configuration &);
92 void write(
const eckit::Configuration &)
const;
104 void print(std::ostream &)
const;
110 template <
typename MODEL>
112 Log::trace() <<
"operator+=(State, Increment) starting" << std::endl;
113 util::Timer timer(
"oops::Increment",
"operator+=(State, Increment)");
115 Log::trace() <<
"operator+=(State, Increment) done" << std::endl;
123 template<
typename MODEL>
125 const util::DateTime &
time) : increment_()
127 Log::trace() <<
"Increment<MODEL>::Increment starting" << std::endl;
128 util::Timer timer(
classname(),
"Increment");
130 Log::trace() <<
"Increment<MODEL>::Increment done" << std::endl;
135 template<
typename MODEL>
139 Log::trace() <<
"Increment<MODEL>::Increment starting" << std::endl;
140 util::Timer timer(
classname(),
"Increment");
142 Log::trace() <<
"Increment<MODEL>::Increment done" << std::endl;
147 template<
typename MODEL>
150 Log::trace() <<
"Increment<MODEL>::Increment copy starting" << std::endl;
151 util::Timer timer(
classname(),
"Increment");
153 Log::trace() <<
"Increment<MODEL>::Increment copy done" << std::endl;
158 template<
typename MODEL>
160 Log::trace() <<
"Increment<MODEL>::~Increment starting" << std::endl;
161 util::Timer timer(classname(),
"~Increment");
163 Log::trace() <<
"Increment<MODEL>::~Increment done" << std::endl;
168 template<
typename MODEL>
171 Log::trace() <<
"Increment<MODEL>::getValuesTL starting" << std::endl;
172 util::Timer timer(classname(),
"getValuesTL");
174 Log::trace() <<
"Increment<MODEL>::getValuesTL done" << std::endl;
179 template<
typename MODEL>
182 Log::trace() <<
"Increment<MODEL>::getValuesAD starting" << std::endl;
183 util::Timer timer(classname(),
"getValuesAD");
185 Log::trace() <<
"Increment<MODEL>::getValuesAD done" << std::endl;
190 template<
typename MODEL>
192 Log::trace() <<
"Increment<MODEL>::diff starting" << std::endl;
193 util::Timer timer(classname(),
"diff");
195 Log::trace() <<
"Increment<MODEL>::diff done" << std::endl;
200 template<
typename MODEL>
202 Log::trace() <<
"Increment<MODEL>::zero starting" << std::endl;
203 util::Timer timer(classname(),
"zero");
205 Log::trace() <<
"Increment<MODEL>::zero done" << std::endl;
210 template<
typename MODEL>
212 Log::trace() <<
"Increment<MODEL>::zero starting" << std::endl;
213 util::Timer timer(classname(),
"zero");
214 increment_->zero(tt);
215 Log::trace() <<
"Increment<MODEL>::zero done" << std::endl;
220 template<
typename MODEL>
222 Log::trace() <<
"Increment<MODEL>::dirac starting" << std::endl;
223 util::Timer timer(classname(),
"dirac");
224 increment_->dirac(config);
225 Log::trace() <<
"Increment<MODEL>::dirac done" << std::endl;
230 template<
typename MODEL>
232 Log::trace() <<
"Increment<MODEL>::operator= starting" << std::endl;
233 util::Timer timer(classname(),
"operator=");
235 Log::trace() <<
"Increment<MODEL>::operator= done" << std::endl;
241 template<
typename MODEL>
243 Log::trace() <<
"Increment<MODEL>::operator+= starting" << std::endl;
244 util::Timer timer(classname(),
"operator+=");
246 Log::trace() <<
"Increment<MODEL>::operator+= done" << std::endl;
252 template<
typename MODEL>
254 Log::trace() <<
"Increment<MODEL>::operator-= starting" << std::endl;
255 util::Timer timer(classname(),
"operator-=");
257 Log::trace() <<
"Increment<MODEL>::operator-= done" << std::endl;
263 template<
typename MODEL>
265 Log::trace() <<
"Increment<MODEL>::operator*= starting" << std::endl;
266 util::Timer timer(classname(),
"operator*=");
268 Log::trace() <<
"Increment<MODEL>::operator*= done" << std::endl;
274 template<
typename MODEL>
276 Log::trace() <<
"Increment<MODEL>::axpy starting" << std::endl;
277 util::Timer timer(classname(),
"axpy");
279 Log::trace() <<
"Increment<MODEL>::axpy done" << std::endl;
284 template<
typename MODEL>
286 Log::trace() <<
"Increment<MODEL>::dot_product_with starting" << std::endl;
287 util::Timer timer(classname(),
"dot_product_with");
288 double zz = increment_->dot_product_with(*dx.
increment_);
289 Log::trace() <<
"Increment<MODEL>::dot_product_with done" << std::endl;
295 template<
typename MODEL>
297 Log::trace() <<
"Increment<MODEL>::schur_product_with starting" << std::endl;
298 util::Timer timer(classname(),
"schur_product_with");
299 increment_->schur_product_with(*dx.
increment_);
300 Log::trace() <<
"Increment<MODEL>::schur_product_with done" << std::endl;
305 template<
typename MODEL>
307 Log::trace() <<
"Increment<MODEL>::random starting" << std::endl;
308 util::Timer timer(classname(),
"random");
309 increment_->random();
310 Log::trace() <<
"Increment<MODEL>::random done" << std::endl;
315 template<
typename MODEL>
317 Log::trace() <<
"Increment<MODEL>::accumul starting" << std::endl;
318 util::Timer timer(classname(),
"accumul");
319 increment_->accumul(zz, xx.
state());
320 Log::trace() <<
"Increment<MODEL>::accumul done" << std::endl;
325 template<
typename MODEL>
327 Log::trace() <<
"Increment<MODEL>::read starting" << std::endl;
328 util::Timer timer(classname(),
"read");
329 increment_->read(
conf);
330 Log::trace() <<
"Increment<MODEL>::read done" << std::endl;
335 template<
typename MODEL>
337 Log::trace() <<
"Increment<MODEL>::write starting" << std::endl;
338 util::Timer timer(classname(),
"write");
339 increment_->write(
conf);
340 Log::trace() <<
"Increment<MODEL>::write done" << std::endl;
345 template<
typename MODEL>
347 Log::trace() <<
"Increment<MODEL>::norm starting" << std::endl;
348 util::Timer timer(classname(),
"norm");
349 double zz = increment_->norm();
350 Log::trace() <<
"Increment<MODEL>::norm done" << std::endl;
356 template<
typename MODEL>
358 Log::trace() <<
"Increment<MODEL>::geometry starting" << std::endl;
359 util::Timer timer(classname(),
"geometry");
361 Log::trace() <<
"Increment<MODEL>::geometry done" << std::endl;
367 template<
typename MODEL>
369 Log::trace() <<
"Increment<MODEL>::ug_coord starting" << std::endl;
370 util::Timer timer(classname(),
"ug_coord");
371 increment_->ug_coord(ug, colocated);
372 Log::trace() <<
"Increment<MODEL>::ug_coord done" << std::endl;
377 template<
typename MODEL>
379 Log::trace() <<
"Increment<MODEL>::field_to_ug starting" << std::endl;
380 util::Timer timer(classname(),
"field_to_ug");
381 increment_->field_to_ug(ug, colocated);
382 Log::trace() <<
"Increment<MODEL>::field_to_ug done" << std::endl;
387 template<
typename MODEL>
389 Log::trace() <<
"Increment<MODEL>::field_from_ug starting" << std::endl;
390 util::Timer timer(classname(),
"field_from_ug");
391 increment_->field_from_ug(ug);
392 Log::trace() <<
"Increment<MODEL>::field_from_ug done" << std::endl;
397 template<
typename MODEL>
399 Log::trace() <<
"Increment<MODEL>::print starting" << std::endl;
400 util::Timer timer(classname(),
"print");
402 Log::trace() <<
"Increment<MODEL>::print done" << std::endl;
409 #endif // OOPS_INTERFACE_INCREMENT_H_ const GeoVaLs_ & geovals() const
Interfacing.
void ug_coord(UnstructuredGrid &, const int &) const
Unstructured grid.
const Increment_ & increment() const
Geometry_ geometry() const
Get geometry.
void getValuesAD(const Locations_ &, const Variables &, const GeoVaLs_ &, const InterpolatorTraj_ &)
subroutine, public copy(self, rhs)
void write(const eckit::Configuration &) const
const util::DateTime validTime() const
Time.
Increment & operator-=(const Increment &)
void zero()
Linear algebra operators.
MODEL::Increment Increment_
Encapsulates the model state.
State_ & state()
Interfacing.
const Locations_ & locations() const
Interfacing.
State< MODEL > & operator+=(State< MODEL > &xx, const Increment< MODEL > &dx)
static const std::string classname()
void updateTime(const util::Duration &dt)
Geometry< MODEL > Geometry_
The namespace for the main oops code.
InterpolatorTraj< MODEL > InterpolatorTraj_
Locations< MODEL > Locations_
void field_to_ug(UnstructuredGrid &, const int &) const
Increment(const Geometry_ &, const Variables &, const util::DateTime &)
Constructor, destructor.
boost::scoped_ptr< Increment_ > increment_
Increment_ & increment()
Interfacing.
double dot_product_with(const Increment &) const
Increment & operator+=(const Increment &)
void axpy(const double &, const Increment &, const bool check=true)
const Geometry_ & geometry() const
Interfacing.
Increment & operator=(const Increment &)
InterpolatorTraj_ & interpolatortraj()
Interfacing.
void accumul(const double &, const State_ &)
Increment & operator*=(const double &)
Increment Class: Difference between two states.
void diff(const State_ &, const State_ &)
Interactions with State.
void read(const eckit::Configuration &)
I/O and diagnostics.
void getValuesTL(const Locations_ &, const Variables &, GeoVaLs_ &, const InterpolatorTraj_ &) const
Get increment values at observation locations.
void print(std::ostream &) const
Abstract base class for quantities.
void dirac(const eckit::Configuration &)
GeoVaLs< MODEL > GeoVaLs_
void field_from_ug(const UnstructuredGrid &)
void schur_product_with(const Increment &)