8 #ifndef OOPS_RUNS_HOFX3D_H_
9 #define OOPS_RUNS_HOFX3D_H_
16 #include "eckit/config/LocalConfiguration.h"
31 #include "oops/util/ConfigFunctions.h"
32 #include "oops/util/DateTime.h"
33 #include "oops/util/Duration.h"
34 #include "oops/util/Logger.h"
58 instantiateObsFilterFactory<OBS>();
59 instantiateVariableChangeFactory<MODEL>();
64 int execute(
const eckit::Configuration & fullConfig)
const {
66 const util::Duration winlen(fullConfig.getString(
"window length"));
67 const util::DateTime winbgn(fullConfig.getString(
"window begin"));
68 const util::DateTime winend(winbgn + winlen);
69 Log::info() <<
"Observation window from " << winbgn <<
" to " << winend << std::endl;
72 const eckit::LocalConfiguration geometryConfig(fullConfig,
"geometry");
76 const eckit::LocalConfiguration stateConfig(fullConfig,
"state");
77 Log::info() <<
"State configuration is:" << stateConfig << std::endl;
78 State_ xx(geometry, stateConfig);
79 Log::test() <<
"State: " << xx << std::endl;
82 const eckit::LocalConfiguration obsConfig(fullConfig,
"observations");
84 ObsAux_ obsaux(obspaces, obsConfig);
92 Log::debug() <<
"HofX3D: Required hofx size = " << hofx.
requiredVars().size() << std::endl;
95 Log::debug() <<
"HofX3D: Required vars size = " << vars.
size() << std::endl;
96 for (
size_t jj = 0; jj < vars.size(); ++jj) {
97 Log::debug() <<
"HofX3D: Required vars:" << vars[jj] << std::endl;
100 Log::debug() <<
"HofX3D: Required variables:" << geovars << std::endl;
101 eckit::LocalConfiguration chvarconf;
107 std::vector<eckit::LocalConfiguration> getValuesConfig =
108 util::vectoriseAndFilter(obsConfig,
"get values");
111 for (
size_t jj = 0; jj < obspaces.
size(); ++jj) {
112 GetValues_ getvals(geometry, *locations[jj], getValuesConfig[jj]);
113 geovals.emplace_back(
new GeoVaLs_(*locations[jj], vars[jj],
115 getvals.
fillGeoVaLs(zz, winbgn, winend, *geovals[jj]);
124 Log::test() <<
"H(x): " << std::endl << yobs <<
"End H(x)" << std::endl;
133 return "oops::HofX3D<" + MODEL::name() +
", " + OBS::name() +
">";
const eckit::mpi::Comm & getComm() const
Computes observation operator (from GeoVaLs), applies bias correction and runs QC filters.
void saveObsErrors(const std::string &) const
save obs error variances (modified in QC) to ObsSpaces
void initialize(const ObsAuxCtrls_ &, const int iteration=0)
Initializes variables, obs bias, obs filters (could be different for different iterations.
const LocationsVec_ & locations() const
accessor to the locations
Observations_ compute(const GeoVaLsVec_ &)
Computes H(x) from the filled in GeoVaLs.
void saveQcFlags(const std::string &) const
save QC flags to ObsSpaces
const VariablesVec_ & requiredVars() const
accessor to variables required from the model
Encapsulates the nonlinear variable change There should not be a factory for ChangeVariable,...
void changeVar(const State_ &xin, State_ &xout) const
change variable from state xin to xout
Geometry class used in oops; subclass of interface class interface::Geometry.
Gets values from model State to observation locations (fills GeoVaLs)
void fillGeoVaLs(const State_ &, const util::DateTime &, const util::DateTime &, GeoVaLs_ &) const
Get state values at observation locations.
int execute(const eckit::Configuration &fullConfig) const
GetValues< MODEL, OBS > GetValues_
std::vector< std::unique_ptr< Locations_ > > LocationsVec_
std::vector< Variables > VariablesVec_
Geometry< MODEL > Geometry_
HofX3D(const eckit::mpi::Comm &comm=oops::mpi::world())
ChangeVariables< MODEL > ChangeVariables_
Observations< OBS > Observations_
ObsAuxControls< OBS > ObsAux_
Locations< OBS > Locations_
std::vector< std::unique_ptr< GeoVaLs_ > > GeoVaLsVec_
CalcHofX< OBS > CalcHofX_
ObsSpaces< OBS > ObsSpaces_
std::string appname() const
Locations of observations for observation operator.
Holds a vector of ObsAuxControl.
void save() const
Save files.
std::size_t size() const
Access.
void save(const std::string &) const
Save/read observations values.
State class used in oops; subclass of interface class interface::State.
std::vector< size_t > variableSizes(const Variables &) const
const util::DateTime validTime() const
Accessor to the time of this State.
const Variables & variables() const
Accessor to variables associated with this State.
const eckit::mpi::Comm & world()
Default communicator with all MPI tasks (ie MPI_COMM_WORLD)
The namespace for the main oops code.