Go to the documentation of this file.
8 #include "ufo/GeoVaLs.h"
13 #include "eckit/config/Configuration.h"
14 #include "eckit/exception/Exceptions.h"
16 #include "oops/base/Variables.h"
17 #include "oops/util/Logger.h"
20 #include "ufo/Locations.h"
28 : keyGVL_(-1), comm_(comm)
30 oops::Log::trace() <<
"GeoVaLs default constructor starting" << std::endl;
32 oops::Log::trace() <<
"GeoVaLs default constructor end" << std::endl;
47 : keyGVL_(-1), vars_(vars), comm_(locs.getComm())
49 oops::Log::trace() <<
"GeoVaLs contructor starting" << std::endl;
51 oops::Log::trace() <<
"GeoVaLs contructor key = " <<
keyGVL_ << std::endl;
61 const ioda::ObsSpace & obspace,
62 const oops::Variables & vars)
63 : keyGVL_(-1), vars_(vars), comm_(obspace.comm())
65 oops::Log::trace() <<
"GeoVaLs constructor config starting" << std::endl;
69 oops::Log::trace() <<
"GeoVaLs contructor config key = " <<
keyGVL_ << std::endl;
78 : keyGVL_(-1), vars_(other.vars_), comm_(other.comm_)
80 oops::Log::trace() <<
"GeoVaLs copy one GeoVaLs constructor starting" << std::endl;
82 int fort_index = index + 1;
84 oops::Log::trace() <<
"GeoVaLs copy one GeoVaLs constructor key = " <<
keyGVL_ << std::endl;
90 : keyGVL_(-1), vars_(other.vars_), comm_(other.comm_)
92 oops::Log::trace() <<
"GeoVaLs copy constructor starting" << std::endl;
95 oops::Log::trace() <<
"GeoVaLs copy constructor key = " <<
keyGVL_ << std::endl;
100 oops::Log::trace() <<
"GeoVaLs destructor starting" << std::endl;
102 oops::Log::trace() <<
"GeoVaLs destructor done" << std::endl;
107 oops::Log::trace() <<
"GeoVaLs::zero starting" << std::endl;
109 oops::Log::trace() <<
"GeoVaLs::zero done" << std::endl;
114 oops::Log::trace() <<
"GeoVaLs::reorderzdir starting" << std::endl;
116 vardir.size(), vardir.c_str());
117 oops::Log::trace() <<
"GeoVaLs::reorderzdir done" << std::endl;
122 oops::Log::trace() <<
"GeoVaLs::rms starting" << std::endl;
125 oops::Log::trace() <<
"GeoVaLs::rms done" << std::endl;
131 oops::Log::trace() <<
"GeoVaLs::normalizerms starting" << std::endl;
134 double zz = temp_gval.
rms();
135 oops::Log::trace() <<
"GeoVaLs::normalizerms done" << std::endl;
141 oops::Log::trace() <<
"GeoVaLs::random starting" << std::endl;
143 oops::Log::trace() <<
"GeoVaLs::random done" << std::endl;
148 oops::Log::trace() <<
"GeoVaLs::operator*= starting" << std::endl;
150 oops::Log::trace() <<
"GeoVaLs::operator*= done" << std::endl;
156 oops::Log::trace() <<
"GeoVaLs::operator*= starting" << std::endl;
159 oops::Log::trace() <<
"vals, nlocs = " << vals.size() <<
" " << nlocs << std::endl;
160 ASSERT(vals.size() == nlocs);
162 oops::Log::trace() <<
"GeoVaLs::operator*= done" << std::endl;
168 oops::Log::trace() <<
"GeoVaLs::operator= starting" << std::endl;
170 oops::Log::trace() <<
"GeoVaLs::operator= done" << std::endl;
176 oops::Log::trace() <<
"GeoVaLs::operator+= starting" << std::endl;
178 oops::Log::trace() <<
"GeoVaLs::operator+= done" << std::endl;
184 oops::Log::trace() <<
"GeoVaLs::operator-= starting" << std::endl;
186 oops::Log::trace() <<
"GeoVaLs::operator-= done" << std::endl;
192 oops::Log::trace() <<
"GeoVaLs::operator*= starting" << std::endl;
194 oops::Log::trace() <<
"GeoVaLs::operator*= done" << std::endl;
200 oops::Log::trace() <<
"GeoVaLs::dot_product_with starting" << std::endl;
203 oops::Log::trace() <<
"GeoVaLs::dot_product_with done" << std::endl;
209 oops::Log::trace() <<
"GeoVaLs::split GeoVaLs into 2" << std::endl;
211 oops::Log::trace() <<
"GeoVaLs::split GeoVaLs into 2" << std::endl;
217 oops::Log::trace() <<
"GeoVaLs::merge 2 GeoVaLs" << std::endl;
219 oops::Log::trace() <<
"GeoVaLs::merge 2 GeoVaLs" << std::endl;
226 double zmin, zmax, zrms;
228 os <<
"GeoVaLs: variables = " <<
vars_ << std::endl;
229 for (
size_t jv = 0; jv <
vars_.size(); ++jv) {
232 os <<
"GeoVaLs: nobs= " << nn <<
" " <<
vars_[jv] <<
" Min=" << zmin <<
", Max=" << zmax
233 <<
", RMS=" << zrms << std::endl;
252 << std::setprecision(4)
253 << mxval <<
" for observation = " << iobs
254 <<
" and variable = " << ivar << std::endl;
260 oops::Log::trace() <<
"GeoVaLs::nlevs starting" << std::endl;
263 oops::Log::trace() <<
"GeoVaLs::nlevs done" << std::endl;
268 void GeoVaLs::get(std::vector<float> & vals,
const std::string & var)
const {
269 oops::Log::trace() <<
"GeoVaLs::get 2D starting" << std::endl;
272 ASSERT(vals.size() == nlocs);
274 oops::Log::trace() <<
"GeoVaLs::get 2D done" << std::endl;
278 void GeoVaLs::get(std::vector<float> & vals,
const std::string & var,
const int lev)
const {
279 oops::Log::trace() <<
"GeoVaLs::get starting" << std::endl;
282 ASSERT(vals.size() == nlocs);
284 oops::Log::trace() <<
"GeoVaLs::get done" << std::endl;
288 void GeoVaLs::get(std::vector<double> & vals,
const std::string & var,
const int lev)
const {
289 oops::Log::trace() <<
"GeoVaLs::get starting" << std::endl;
292 ASSERT(vals.size() == nlocs);
294 oops::Log::trace() <<
"GeoVaLs::get done" << std::endl;
298 void GeoVaLs::put(
const std::vector<double> & vals,
const std::string & var,
const int lev)
const {
299 oops::Log::trace() <<
"GeoVaLs::put starting" << std::endl;
302 ASSERT(vals.size() == nlocs);
304 oops::Log::trace() <<
"GeoVaLs::get done" << std::endl;
309 const ioda::ObsSpace & obspace) {
310 oops::Log::trace() <<
"GeoVaLs::read starting" << std::endl;
312 oops::Log::trace() <<
"GeoVaLs::read done" << std::endl;
317 oops::Log::trace() <<
"GeoVaLs::write starting" << std::endl;
319 oops::Log::trace() <<
"GeoVaLs::write done" << std::endl;
void split(GeoVaLs &, GeoVaLs &) const
Split two GeoVaLs.
void random()
Randomize GeoVaLs.
void ufo_geovals_dotprod_f90(const F90goms &, const F90goms &, double &, const eckit::mpi::Comm &)
void ufo_geovals_random_f90(const F90goms &)
void ufo_geovals_get_f90(const F90goms &, const int &, const char *, const int &, const int &, float &)
void ufo_geovals_putdouble_f90(const F90goms &, const int &, const char *, const int &, const int &, const double &)
void ufo_geovals_schurmult_f90(const F90goms &, const F90goms &)
void ufo_geovals_default_constr_f90(F90goms &)
Interface to Fortran UFO GeoVals routines.
void ufo_geovals_assign_f90(const F90goms &, const F90goms &)
void reorderzdir(const std::string &, const std::string &)
Reorder GeoVaLs in vertical dimension based on vertical coordinate variable.
const eckit::mpi::Comm & comm_
void zero()
Zero out the GeoVaLs.
Locations class to handle locations for UFO.
void ufo_geovals_nlevs_f90(const F90goms &, const int &, const char *, int &)
void ufo_geovals_reorderzdir_f90(const F90goms &, const int &, const char *, const int &, const char *)
void ufo_geovals_merge_f90(const F90goms &, const F90goms &, const F90goms &)
void get(std::vector< float > &, const std::string &) const
Return all values for a specific 2D variable.
void ufo_geovals_maxloc_f90(const F90goms &, double &, int &, int &)
void ufo_geovals_diff_f90(const F90goms &, const F90goms &)
GeoVaLs & operator-=(const GeoVaLs &)
Subtract another GeoVaLs.
void ufo_geovals_scalmult_f90(const F90goms &, const double &)
void ufo_geovals_minmaxavg_f90(const F90goms &, int &, int &, double &, double &, double &)
double normalizedrms(const GeoVaLs &) const
Calculate normalized rms.
GeoVaLs & operator=(const GeoVaLs &)
Copy operator.
void ufo_geovals_copy_f90(const F90goms &, F90goms &)
GeoVaLs(const eckit::mpi::Comm &)
Default constructor - does not allocate fields.
void ufo_geovals_setup_f90(F90goms &, const F90locs &, const oops::Variables &)
void ufo_geovals_getdouble_f90(const F90goms &, const int &, const char *, const int &, const int &, double &)
void put(const std::vector< double > &, const std::string &, const int) const
Put values for a specific variable and level.
void ufo_geovals_profmult_f90(const F90goms &, const int &, const float &)
GeoVaLs & operator+=(const GeoVaLs &)
Add another GeoVaLs.
void ufo_geovals_normalize_f90(const F90goms &, const F90goms &)
void ufo_geovals_read_file_f90(const F90goms &, const eckit::Configuration &, const ioda::ObsSpace &, const oops::Variables &)
GeoVaLs: geophysical values at locations.
void ufo_geovals_write_file_f90(const F90goms &, const eckit::Configuration &, const eckit::mpi::Comm &)
void ufo_geovals_delete_f90(F90goms &)
void write(const eckit::Configuration &) const
Write GeoVaLs to the file.
void ufo_geovals_get2d_f90(const F90goms &, const int &, const char *, const int &, float &)
void ufo_geovals_nlocs_f90(const F90goms &, size_t &)
double rms() const
Calculate rms.
void print(std::ostream &) const
Output GeoVaLs to a stream.
void ufo_geovals_copy_one_f90(F90goms &, const F90goms &, int &)
void ufo_geovals_split_f90(const F90goms &, const F90goms &, const F90goms &)
void read(const eckit::Configuration &, const ioda::ObsSpace &)
Read GeoVaLs from the file.
size_t nlevs(const std::string &var) const
Return number of levels for a specified variable.
void merge(const GeoVaLs &, const GeoVaLs &)
Merge two GeoVaLs.
void ufo_geovals_rms_f90(const F90goms &, double &)
double dot_product_with(const GeoVaLs &) const
Scalar product of two GeoVaLs.
GeoVaLs & operator*=(const double)
Multiply by a constant scalar.
void ufo_geovals_zero_f90(const F90goms &)
void ufo_geovals_add_f90(const F90goms &, const F90goms &)