11 #ifndef OOPS_INTERFACE_ERRORCOVARIANCE_H_
12 #define OOPS_INTERFACE_ERRORCOVARIANCE_H_
17 #include <boost/noncopyable.hpp>
19 #include "eckit/system/ResourceUsage.h"
26 #include "oops/util/Logger.h"
27 #include "oops/util/ObjectCounter.h"
28 #include "oops/util/Printable.h"
29 #include "oops/util/Timer.h"
48 template <
typename MODEL>
50 public util::Printable,
51 private util::ObjectCounter<ErrorCovariance<MODEL> >,
52 private boost::noncopyable {
61 typedef TParameters_IfAvailableElseFallbackType_t<
64 static const std::string
classname() {
return "oops::ErrorCovariance";}
77 void print(std::ostream &)
const override;
84 template<
typename MODEL>
90 Log::trace() <<
"ErrorCovariance<MODEL>::ErrorCovariance starting" << std::endl;
91 util::Timer timer(
classname(),
"ErrorCovariance");
92 size_t init = eckit::system::ResourceUsage().maxResidentSetSize();
94 parametersOrConfiguration<HasParameters_<Covariance_>::value>(
97 size_t current = eckit::system::ResourceUsage().maxResidentSetSize();
98 this->setObjectSize(current - init);
99 Log::trace() <<
"ErrorCovariance<MODEL>::ErrorCovariance done" << std::endl;
104 template<
typename MODEL>
106 const eckit::Configuration & conf,
115 template<
typename MODEL>
117 Log::trace() <<
"ErrorCovariance<MODEL>::~ErrorCovariance starting" << std::endl;
118 util::Timer timer(classname(),
"~ErrorCovariance");
120 Log::trace() <<
"ErrorCovariance<MODEL>::~ErrorCovariance done" << std::endl;
125 template<
typename MODEL>
127 Log::trace() <<
"ErrorCovariance<MODEL>::doRandomize starting" << std::endl;
128 util::Timer timer(classname(),
"doRandomize");
130 Log::trace() <<
"ErrorCovariance<MODEL>::doRandomize done" << std::endl;
135 template<
typename MODEL>
137 Log::trace() <<
"ErrorCovariance<MODEL>::doMultiply starting" << std::endl;
138 util::Timer timer(classname(),
"doMultiply");
140 Log::trace() <<
"ErrorCovariance<MODEL>::doMultiply done" << std::endl;
145 template<
typename MODEL>
147 Log::trace() <<
"ErrorCovariance<MODEL>::doInverseMultiply starting" << std::endl;
148 util::Timer timer(classname(),
"doInverseMultiply");
150 Log::trace() <<
"ErrorCovariance<MODEL>::doInverseMultiply done" << std::endl;
155 template<
typename MODEL>
157 Log::trace() <<
"ErrorCovariance<MODEL>::print starting" << std::endl;
158 util::Timer timer(classname(),
"print");
160 Log::trace() <<
"ErrorCovariance<MODEL>::print done" << std::endl;
Wrapper for model space error covariances.
ErrorCovariance(const Geometry_ &, const Variables &, const Parameters_ &, const State_ &, const State_ &)
void print(std::ostream &) const override
void doRandomize(Increment_ &) const override
std::unique_ptr< Covariance_ > covariance_
TParameters_IfAvailableElseFallbackType_t< Covariance_, GenericModelSpaceCovarianceParameters< MODEL > > Parameters_
Geometry< MODEL > Geometry_
MODEL::Covariance Covariance_
void doInverseMultiply(const Increment_ &, Increment_ &) const override
virtual ~ErrorCovariance()
Increment< MODEL > Increment_
void doMultiply(const Increment_ &, Increment_ &) const override
static const std::string classname()
A subclass of ModelSpaceCovarianceParametersBase storing the values of all options in a single Config...
Geometry class used in oops; subclass of interface class interface::Geometry.
Increment class used in oops.
State class used in oops; subclass of interface class interface::State.
const Geometry_ & geometry() const
const Increment_ & increment() const
State_ & state()
Accessor.
The namespace for the main oops code.