16 #include "oops/base/Variables.h"
17 #include "oops/util/ObjectCounter.h"
18 #include "oops/util/Printable.h"
39 private util::ObjectCounter<GeoVaLs> {
41 static const std::string
classname() {
return "ufo::GeoVaLs";}
43 GeoVaLs(std::shared_ptr<const ioda::Distribution>,
const oops::Variables &);
47 const std::vector<size_t> &
nlevs);
49 GeoVaLs(
const eckit::Configuration &,
const ioda::ObsSpace &,
50 const oops::Variables &);
77 void allocate(
const int & nlev,
const oops::Variables & vars);
80 void reorderzdir(
const std::string &,
const std::string &);
85 bool has(
const std::string & var)
const {
return vars_.has(var);}
88 size_t nlevs(
const std::string & var)
const;
90 void get(std::vector<double> &,
const std::string & var)
const;
92 void get(std::vector<float> &,
const std::string & var)
const;
94 void get(std::vector<int> &,
const std::string & var)
const;
97 void getAtLevel(std::vector<double> &,
const std::string &,
const int)
const;
99 void getAtLevel(std::vector<float> &,
const std::string &,
const int)
const;
101 void getAtLevel(std::vector<int> &,
const std::string &,
const int)
const;
104 void getAtLocation(std::vector<double> &,
const std::string &,
const int)
const;
106 void getAtLocation(std::vector<float> &,
const std::string &,
const int)
const;
108 void getAtLocation(std::vector<int> &,
const std::string &,
const int)
const;
111 void putAtLevel(
const std::vector<double> & vals,
const std::string & var,
const int lev)
const;
113 void putAtLevel(
const std::vector<float> & vals,
const std::string & var,
const int lev)
const;
115 void putAtLevel(
const std::vector<int> & vals,
const std::string & var,
const int lev)
const;
118 void putAtLocation(
const std::vector<double> & vals,
const std::string & var,
119 const int loc)
const;
121 void putAtLocation(
const std::vector<float> & vals,
const std::string & var,
const int loc)
const;
123 void putAtLocation(
const std::vector<int> & vals,
const std::string & var,
const int loc)
const;
125 void read(
const eckit::Configuration &,
const ioda::ObsSpace &);
126 void write(
const eckit::Configuration &)
const;
127 size_t nlocs()
const;
133 void print(std::ostream &)
const;
137 std::shared_ptr<const ioda::Distribution>
dist_;
GeoVaLs: geophysical values at locations.
GeoVaLs & operator+=(const GeoVaLs &)
Add another GeoVaLs.
size_t nlevs(const std::string &var) const
Return number of levels for a specified variable.
bool has(const std::string &var) const
std::shared_ptr< const ioda::Distribution > dist_
const int & toFortran() const
void split(GeoVaLs &, GeoVaLs &) const
Split two GeoVaLs.
void zero()
Zero out the GeoVaLs.
void print(std::ostream &) const
Output GeoVaLs to a stream.
void reorderzdir(const std::string &, const std::string &)
Reorder GeoVaLs in vertical dimension based on vertical coordinate variable.
GeoVaLs & operator*=(const double)
Multiply by a constant scalar.
double dot_product_with(const GeoVaLs &) const
Scalar product of two GeoVaLs.
void write(const eckit::Configuration &) const
Write GeoVaLs to the file.
double rms() const
Calculate rms.
GeoVaLs(std::shared_ptr< const ioda::Distribution >, const oops::Variables &)
Deprecated default constructor - does not allocate fields.
void getAtLevel(std::vector< double > &, const std::string &, const int) const
Get GeoVaLs at a specified level.
void putAtLocation(const std::vector< double > &vals, const std::string &var, const int loc) const
Put GeoVaLs for double variable var at location loc.
size_t nlocs() const
Return the number of geovals.
GeoVaLs & operator-=(const GeoVaLs &)
Subtract another GeoVaLs.
void read(const eckit::Configuration &, const ioda::ObsSpace &)
Read GeoVaLs from the file.
const oops::Variables & getVars() const
void allocate(const int &nlev, const oops::Variables &vars)
Deprecated method. Allocates GeoVaLs for vars variables with nlev number of levels.
double normalizedrms(const GeoVaLs &) const
Calculate normalized rms.
void get(std::vector< double > &, const std::string &var) const
Get 2D GeoVaLs for variable var (fails for 3D GeoVaLs)
void merge(const GeoVaLs &, const GeoVaLs &)
Merge two GeoVaLs.
void putAtLevel(const std::vector< double > &vals, const std::string &var, const int lev) const
Put GeoVaLs for double variable var at level lev.
void random()
Randomize GeoVaLs.
void getAtLocation(std::vector< double > &, const std::string &, const int) const
Get GeoVaLs at a specified location.
GeoVaLs & operator=(const GeoVaLs &)
Copy operator.
static const std::string classname()
Locations class to handle simple lat-lon-time locations.