12 #ifndef OOPS_BASE_LOCALIZATION_H_
13 #define OOPS_BASE_LOCALIZATION_H_
18 #include <boost/noncopyable.hpp>
24 #include "oops/util/Logger.h"
25 #include "oops/util/ObjectCounter.h"
26 #include "oops/util/Printable.h"
27 #include "oops/util/Timer.h"
43 template <
typename MODEL>
45 private boost::noncopyable,
46 private util::ObjectCounter<Localization<MODEL> > {
52 static const std::string
classname() {
return "oops::Localization";}
56 const eckit::Configuration & conf);
68 void print(std::ostream &)
const override;
71 std::unique_ptr<LocBase_>
loc_;
76 template<
typename MODEL>
78 const eckit::Configuration & conf)
81 Log::trace() <<
"Localization<MODEL>::Localization done" << std::endl;
86 template<
typename MODEL>
88 Log::trace() <<
"Localization<MODEL>::~Localization starting" << std::endl;
89 util::Timer timer(classname(),
"~Localization");
91 Log::trace() <<
"Localization<MODEL>::~Localization done" << std::endl;
96 template <
typename MODEL>
98 Log::trace() <<
"Localization<MODEL>::randomize starting" << std::endl;
99 util::Timer timer(classname(),
"randomize");
100 const eckit::mpi::Comm & comm = dx.
timeComm();
101 static int tag = 23456;
102 size_t nslots = comm.size();
103 int mytime = comm.rank();
115 for (
size_t jj = 1; jj < nslots; ++jj) {
120 Log::trace() <<
"Localization<MODEL>::randomize done" << std::endl;
125 template <
typename MODEL>
127 Log::trace() <<
"Localization<MODEL>::multiply starting" << std::endl;
128 util::Timer timer(classname(),
"multiply");
129 const eckit::mpi::Comm & comm = dx.
timeComm();
130 static int tag = 23456;
131 size_t nslots = comm.size();
132 int mytime = comm.rank();
156 for (
size_t jj = 1; jj < nslots; ++jj) {
159 dx.
axpy(1.0, dxtmp,
false);
166 for (
size_t jj = 1; jj < nslots; ++jj) {
172 Log::trace() <<
"Localization<MODEL>::multiply done" << std::endl;
177 template <
typename MODEL>
179 Log::trace() <<
"Localization<MODEL>::print starting" << std::endl;
180 util::Timer timer(classname(),
"print");
182 Log::trace() <<
"Localization<MODEL>::print done" << std::endl;
Geometry class used in oops; subclass of interface class interface::Geometry.
Increment class used in oops.
const eckit::mpi::Comm & timeComm() const
Accessor to the time communicator.
Base class for generic implementations of model-space localization. Use this class as a base class fo...
Abstract model-space localization class used by high level algorithms and applications.
static const std::string classname()
virtual void randomize(Increment_ &dx) const
Localization(const Geometry_ &geometry, const eckit::Configuration &conf)
Set up Localization for geometry, configured with conf.
Geometry< MODEL > Geometry_
Increment< MODEL > Increment_
LocalizationBase< MODEL > LocBase_
virtual void multiply(Increment_ &dx) const
void print(std::ostream &) const override
Print, used in logging.
std::unique_ptr< LocBase_ > loc_
Pointer to the Localization implementation.
void axpy(const double &w, const Increment &dx, const bool check=true)
void updateTime(const util::Duration &dt)
Updates this Increment's valid time by dt (used in PseudoModel)
void zero()
Zero out this Increment.
const util::DateTime validTime() const
Accessor to the time of this Increment.
void send(const eckit::mpi::Comm &comm, const SERIALIZABLE &sendobj, const int dest, const int tag)
Extend eckit Comm for Serializable oops objects.
void receive(const eckit::mpi::Comm &comm, SERIALIZABLE &recvobj, const int source, const int tag)
The namespace for the main oops code.