11 #ifndef OOPS_INTERFACE_MODELAUXINCREMENT_H_ 12 #define OOPS_INTERFACE_MODELAUXINCREMENT_H_ 17 #include <boost/scoped_ptr.hpp> 21 #include "oops/util/Logger.h" 22 #include "oops/util/ObjectCounter.h" 23 #include "oops/util/Printable.h" 24 #include "oops/util/Timer.h" 34 template <
typename MODEL>
36 private util::ObjectCounter<ModelAuxIncrement<MODEL> > {
42 static const std::string
classname() {
return "oops::ModelAuxIncrement";}
65 void read(
const eckit::Configuration &);
66 void write(
const eckit::Configuration &)
const;
70 void print(std::ostream &)
const;
71 boost::scoped_ptr<ModelAuxIncrement_>
aux_;
76 template <
typename MODEL>
79 Log::trace() <<
"operator+=(ModelAuxControl, ModelAuxIncrement) starting" << std::endl;
80 util::Timer timer(
"oops::ModelAuxIncrement",
"operator+=ModelAuxControl");
82 Log::trace() <<
"operator+=(ModelAuxControl, ModelAuxIncrement) done" << std::endl;
88 template<
typename MODEL>
90 const eckit::Configuration &
conf) : aux_()
92 Log::trace() <<
"ModelAuxIncrement<MODEL>::ModelAuxIncrement starting" << std::endl;
93 util::Timer timer(
classname(),
"ModelAuxIncrement");
95 Log::trace() <<
"ModelAuxIncrement<MODEL>::ModelAuxIncrement done" << std::endl;
98 template<
typename MODEL>
100 const bool copy) : aux_()
102 Log::trace() <<
"ModelAuxIncrement<MODEL>::ModelAuxIncrement copy starting" << std::endl;
103 util::Timer timer(
classname(),
"ModelAuxIncrement");
105 Log::trace() <<
"ModelAuxIncrement<MODEL>::ModelAuxIncrement copy done" << std::endl;
108 template<
typename MODEL>
110 const eckit::Configuration &
conf) : aux_()
112 Log::trace() <<
"ModelAuxIncrement<MODEL>::ModelAuxIncrement interpolated starting" << std::endl;
113 util::Timer timer(
classname(),
"ModelAuxIncrement");
115 Log::trace() <<
"ModelAuxIncrement<MODEL>::ModelAuxIncrement interpolated done" << std::endl;
118 template<
typename MODEL>
120 Log::trace() <<
"ModelAuxIncrement<MODEL>::~ModelAuxIncrement starting" << std::endl;
121 util::Timer timer(classname(),
"~ModelAuxIncrement");
123 Log::trace() <<
"ModelAuxIncrement<MODEL>::~ModelAuxIncrement done" << std::endl;
126 template<
typename MODEL>
128 Log::trace() <<
"ModelAuxIncrement<MODEL>::diff starting" << std::endl;
129 util::Timer timer(classname(),
"diff");
131 Log::trace() <<
"ModelAuxIncrement<MODEL>::diff done" << std::endl;
134 template<
typename MODEL>
136 Log::trace() <<
"ModelAuxIncrement<MODEL>::zero starting" << std::endl;
137 util::Timer timer(classname(),
"zero");
139 Log::trace() <<
"ModelAuxIncrement<MODEL>::zero done" << std::endl;
142 template<
typename MODEL>
144 Log::trace() <<
"ModelAuxIncrement<MODEL>::operator= starting" << std::endl;
145 util::Timer timer(classname(),
"operator=");
147 Log::trace() <<
"ModelAuxIncrement<MODEL>::operator= done" << std::endl;
151 template<
typename MODEL>
153 Log::trace() <<
"ModelAuxIncrement<MODEL>::operator+= starting" << std::endl;
154 util::Timer timer(classname(),
"operator+=");
156 Log::trace() <<
"ModelAuxIncrement<MODEL>::operator+= done" << std::endl;
160 template<
typename MODEL>
162 Log::trace() <<
"ModelAuxIncrement<MODEL>::operator-= starting" << std::endl;
163 util::Timer timer(classname(),
"operator-=");
165 Log::trace() <<
"ModelAuxIncrement<MODEL>::operator-= done" << std::endl;
169 template<
typename MODEL>
171 Log::trace() <<
"ModelAuxIncrement<MODEL>::operator*= starting" << std::endl;
172 util::Timer timer(classname(),
"operator*=");
174 Log::trace() <<
"ModelAuxIncrement<MODEL>::operator*= done" << std::endl;
178 template<
typename MODEL>
180 Log::trace() <<
"ModelAuxIncrement<MODEL>::axpy starting" << std::endl;
181 util::Timer timer(classname(),
"axpy");
182 aux_->axpy(zz, *dx.
aux_);
183 Log::trace() <<
"ModelAuxIncrement<MODEL>::axpy done" << std::endl;
186 template<
typename MODEL>
188 Log::trace() <<
"ModelAuxIncrement<MODEL>::dot_product_with starting" << std::endl;
189 util::Timer timer(classname(),
"dot_product_with");
190 double zz = aux_->dot_product_with(*dx.
aux_);
191 Log::trace() <<
"ModelAuxIncrement<MODEL>::dot_product_with done" << std::endl;
195 template<
typename MODEL>
197 Log::trace() <<
"ModelAuxIncrement<MODEL>::read starting" << std::endl;
198 util::Timer timer(classname(),
"read");
200 Log::trace() <<
"ModelAuxIncrement<MODEL>::read done" << std::endl;
203 template<
typename MODEL>
205 Log::trace() <<
"ModelAuxIncrement<MODEL>::write starting" << std::endl;
206 util::Timer timer(classname(),
"write");
208 Log::trace() <<
"ModelAuxIncrement<MODEL>::write done" << std::endl;
211 template<
typename MODEL>
213 Log::trace() <<
"ModelAuxIncrement<MODEL>::norm starting" << std::endl;
214 util::Timer timer(classname(),
"norm");
215 double zz = aux_->norm();
216 Log::trace() <<
"ModelAuxIncrement<MODEL>::norm done" << std::endl;
220 template<
typename MODEL>
222 Log::trace() <<
"ModelAuxIncrement<MODEL>::print starting" << std::endl;
223 util::Timer timer(classname(),
"print");
225 Log::trace() <<
"ModelAuxIncrement<MODEL>::print done" << std::endl;
231 #endif // OOPS_INTERFACE_MODELAUXINCREMENT_H_ void read(const eckit::Configuration &)
I/O and diagnostics.
double dot_product_with(const ModelAuxIncrement &) const
ModelAuxIncrement & operator*=(const double &)
Geometry< MODEL > Geometry_
subroutine, public copy(self, rhs)
void diff(const ModelAuxControl_ &, const ModelAuxControl_ &)
Linear algebra operators.
State< MODEL > & operator+=(State< MODEL > &xx, const Increment< MODEL > &dx)
The namespace for the main oops code.
ModelAuxControl< MODEL > ModelAuxControl_
ModelAuxIncrement(const Geometry_ &, const eckit::Configuration &)
Constructor, destructor.
ModelAuxIncrement & operator=(const ModelAuxIncrement &)
void write(const eckit::Configuration &) const
void axpy(const double &, const ModelAuxIncrement &)
const ModelAuxControl_ & modelauxcontrol() const
Interfacing.
static const std::string classname()
const Geometry_ & geometry() const
Interfacing.
const ModelAuxIncrement_ & modelauxincrement() const
Interfacing.
void print(std::ostream &) const
ModelAuxIncrement & operator-=(const ModelAuxIncrement &)
ModelAuxIncrement_ & modelauxincrement()
MODEL::ModelAuxIncrement ModelAuxIncrement_
boost::scoped_ptr< ModelAuxIncrement_ > aux_
ModelAuxIncrement & operator+=(const ModelAuxIncrement &)