14 #include "ioda/ObsVector.h"
16 #include "oops/base/Variables.h"
17 #include "oops/util/DateTime.h"
18 #include "oops/util/Duration.h"
19 #include "oops/util/Logger.h"
21 #include "ufo/GeoVaLs.h"
22 #include "ufo/Locations.h"
23 #include "ufo/ObsDiagnostics.h"
34 const eckit::Configuration & config)
37 odb,
eckit::LocalConfiguration(config,
"obs operator"))),
40 oops::Log::trace() <<
"ObsTimeOper creating" << std::endl;
42 util::DateTime windowBegin(
odb_.windowStart());
43 util::DateTime windowEnd(
odb_.windowEnd());
45 util::Duration windowSub;
46 windowSub = util::Duration(config.getString(
"windowSub"));
47 util::Duration window = windowEnd - windowBegin;
49 if (window == windowSub) {
50 ABORT(
"Time Interpolation of obs not implemented when assimilation window = subWindow");
52 oops::Log::trace() <<
"ObsTimeOper created" << std::endl;
58 oops::Log::trace() <<
"ObsTimeOper destructed" << std::endl;
65 const util::DateTime & t2)
const {
66 oops::Log::trace() <<
"entered ObsOperatorTime::locations" << std::endl;
68 util::DateTime t0, t3, stateTime;
69 util::Duration initial_dt, windowSub;
71 util::DateTime windowBegin(
odb_.windowStart());
72 util::DateTime windowEnd(
odb_.windowEnd());
76 std::unique_ptr<Locations> locs;
77 std::unique_ptr<Locations> locs2;
78 if ((t1 == windowBegin) && (t2 == windowEnd)) {
80 locs = std::unique_ptr<Locations>(
new Locations(
odb_, t1, t2));
84 if ((t1 == windowBegin) || (t2 == windowEnd))
85 windowSub = initial_dt * 2;
87 windowSub = initial_dt;
89 t0 = t1 - (windowSub/2);
90 t3 = t2 + (windowSub/2);
91 stateTime = t1 + initial_dt/2;
93 if (t1 == windowBegin) {
95 stateTime = windowBegin;
97 if (t2 == windowEnd) {
99 stateTime = windowEnd;
102 if ((t1 == windowBegin) && (t2 != windowEnd)) {
104 locs = std::unique_ptr<Locations>(
new Locations(
odb_, stateTime, t3));
105 }
else if ((t1 != windowBegin) && (t2 == windowEnd)) {
107 locs = std::unique_ptr<Locations>(
new Locations(
odb_, stateTime, stateTime));
109 locs2 = std::unique_ptr<Locations>(
new Locations(
odb_, t0, stateTime));
113 locs = std::unique_ptr<Locations>(
new Locations(
odb_, stateTime, t3));
114 locs2 = std::unique_ptr<Locations>(
new Locations(
odb_, t0, stateTime));
125 oops::Log::trace() <<
"ObsTimeOper: simulateObs entered" << std::endl;
127 oops::Log::trace() << gv << std::endl;
132 oops::Log::trace() << gv1 << std::endl;
133 oops::Log::trace() << gv2 << std::endl;
140 oops::Log::trace() <<
"ObsTimeOper: simulateObs exit " << std::endl;
146 os <<
"ObsTimeOper::print not implemented";