11 #ifndef OOPS_BASE_OBSERVERTLAD_H_
12 #define OOPS_BASE_OBSERVERTLAD_H_
17 #include "eckit/config/Configuration.h"
28 #include "oops/util/DateTime.h"
34 template <
typename MODEL,
typename OBS>
75 template <
typename MODEL,
typename OBS>
77 : obsconfig_(conf), obspace_(obsdb),
78 hoptlad_(obspace_, conf.
has(
"linear obs operator") ?
79 eckit::LocalConfiguration(conf,
"linear obs operator") :
80 eckit::LocalConfiguration(conf,
"obs operator")),
81 getvals_(), locations_(), winbgn_(obsdb.windowStart()), winend_(obsdb.windowEnd()),
82 ybias_(nullptr), init_(false)
84 Log::trace() <<
"ObserverTLAD::ObserverTLAD" << std::endl;
87 template <
typename MODEL,
typename OBS>
88 std::shared_ptr<GetValueTLAD<MODEL, OBS>>
90 Log::trace() <<
"ObserverTLAD::initializeTraj start" << std::endl;
94 ObsOperator_ hop(obspace_, eckit::LocalConfiguration(obsconfig_,
"obs operator"));
97 eckit::LocalConfiguration gvconf(obsconfig_.has(
"linear get values") ?
98 eckit::LocalConfiguration(obsconfig_,
"linear get values") :
99 (obsconfig_.has(
"get values") ?
100 eckit::LocalConfiguration(obsconfig_,
"get values") :
101 eckit::LocalConfiguration(obsconfig_,
"")));
106 geovars += ybias_->requiredVars();
108 getvals_.reset(
new GetValTLAD_(gvconf, geom, winbgn_, winend_,
109 *locations_, geovars, hoptlad_.requiredVars()));
112 Log::trace() <<
"ObserverTLAD::initializeTraj done" << std::endl;
116 template <
typename MODEL,
typename OBS>
118 Log::trace() <<
"ObserverTLAD::finalizeTraj start" << std::endl;
122 std::unique_ptr<GeoVaLs_> geovals = getvals_->finalize();
125 hoptlad_.setTrajectory(*geovals, *ybias_);
128 Log::trace() <<
"ObserverTLAD::finalizeTraj done" << std::endl;
131 template <
typename MODEL,
typename OBS>
133 Log::trace() <<
"ObserverTLAD::initializeTL" << std::endl;
137 template <
typename MODEL,
typename OBS>
139 Log::trace() <<
"ObserverTLAD::finalizeTL start" << std::endl;
142 std::unique_ptr<GeoVaLs_> geovals = getvals_->finalize();
145 hoptlad_.simulateObsTL(*geovals, ydeptl, ybiastl);
147 Log::trace() <<
"ObserverTLAD::finalizeTL done" << std::endl;
150 template <
typename MODEL,
typename OBS>
151 std::shared_ptr<GetValueTLAD<MODEL, OBS>>
153 Log::trace() <<
"ObserverTLAD::initializeAD start" << std::endl;
156 std::unique_ptr<GeoVaLs_> geovals(
new GeoVaLs_(*locations_, hoptlad_.requiredVars(),
158 hoptlad_.simulateObsAD(*geovals, ydepad, ybiasad);
161 getvals_->setAD(geovals);
163 Log::trace() <<
"ObserverTLAD::initializeAD done" << std::endl;
167 template <
typename MODEL,
typename OBS>
169 getvals_->finalizeAD();
170 Log::trace() <<
"ObserverTLAD::finalizeAD done" << std::endl;
Geometry class used in oops; subclass of interface class interface::Geometry.
TLAD of filling GeoVaLs with requested variables at requested locations during model run.
Locations of observations for observation operator.
const Variables & requiredVars() const
Other.
Locations_ locations() const
Computes observation equivalent TL and AD to/from increments.
std::shared_ptr< GetValTLAD_ > initializeTraj(const Geometry_ &, const ObsAuxCtrl_ &)
ObsSpace< OBS > ObsSpace_
ObsAuxIncrement< OBS > ObsAuxIncr_
void finalizeTL(const ObsAuxIncr_ &, ObsVector_ &)
std::shared_ptr< GetValTLAD_ > initializeAD(const ObsVector_ &, ObsAuxIncr_ &)
ObsOperator< OBS > ObsOperator_
GetValueTLAD< MODEL, OBS > GetValTLAD_
ObsVector< OBS > ObsVector_
Locations< OBS > Locations_
std::vector< size_t > linvars_sizes_
std::unique_ptr< Locations_ > locations_
ObsAuxControl< OBS > ObsAuxCtrl_
std::shared_ptr< GetValTLAD_ > initializeTL()
const ObsSpace_ & obspace_
std::shared_ptr< GetValTLAD_ > getvals_
const ObsAuxCtrl_ * ybias_
Geometry< MODEL > Geometry_
ObserverTLAD(const ObsSpace_ &, const eckit::Configuration &)
eckit::LocalConfiguration obsconfig_
LinearObsOperator< OBS > LinearObsOperator_
LinearObsOperator_ hoptlad_
std::vector< size_t > variableSizes(const Variables &) const
logical function has(this, var)
The namespace for the main oops code.