FV3 Bundle
ufo/src/ufo/GeoVaLs.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2017-2018 UCAR
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  */
7 
8 #ifndef UFO_GEOVALS_H_
9 #define UFO_GEOVALS_H_
10 
11 #include <ostream>
12 #include <string>
13 
14 #include "Fortran.h"
15 #include "FortranGeoVals.h"
16 #include "oops/base/Variables.h"
17 #include "oops/util/ObjectCounter.h"
18 #include "oops/util/Printable.h"
19 
20 namespace eckit {
21  class Configuration;
22 }
23 
24 namespace ioda {
25  class Locations;
26 }
27 
28 namespace ufo {
29 
30 /// GeoVaLs: geophysical values at locations
31 
32 class GeoVaLs : public util::Printable,
33  private util::ObjectCounter<GeoVaLs> {
34  public:
35  static const std::string classname() {return "ufo::GeoVaLs";}
36 
37  GeoVaLs(const ioda::Locations &, const oops::Variables &);
38  GeoVaLs(const eckit::Configuration &, const oops::Variables &);
39  GeoVaLs(const GeoVaLs &);
40 
41 // explicit GeoVaLs(): keyGVL_(0) {}
42 // explicit GeoVaLs(int & fgvl): keyGVL_(fgvl) {}
43 
44  ~GeoVaLs();
45 
46  void abs();
47  void zero();
48  void random();
49  double norm() const;
50  GeoVaLs & operator = (const GeoVaLs &);
51  GeoVaLs & operator*=(const double);
52  GeoVaLs & operator += (const GeoVaLs &);
53  GeoVaLs & operator -= (const GeoVaLs &);
54  GeoVaLs & operator /= (const GeoVaLs &);
55  double dot_product_with(const GeoVaLs & other) const;
56  void read(const eckit::Configuration &);
57  void analytic_init(const ioda::Locations &, const eckit::Configuration &);
58  void write(const eckit::Configuration &) const;
59 
60  int & toFortran() {return keyGVL_;}
61  const int & toFortran() const {return keyGVL_;}
62 
63  private:
64  void print(std::ostream &) const;
65 
68 };
69 
70 } // namespace ufo
71 
72 #endif // UFO_GEOVALS_H_
void random()
Definition: GeoVaLs.cc:102
void abs()
Absolute value.
Definition: GeoVaLs.cc:92
void zero()
Definition: GeoVaLs.cc:87
GeoVaLs & operator=(const GeoVaLs &)
Definition: GeoVaLs.cc:111
GeoVaLs: geophysical values at locations.
GeoVaLs & operator-=(const GeoVaLs &)
Definition: GeoVaLs.cc:121
static const std::string classname()
void read(const eckit::Configuration &)
Definition: GeoVaLs.cc:172
const int & toFortran() const
double dot_product_with(const GeoVaLs &other) const
Definition: GeoVaLs.cc:137
GeoVaLs & operator+=(const GeoVaLs &)
Definition: GeoVaLs.cc:116
void analytic_init(const ioda::Locations &, const eckit::Configuration &)
Analytic initialization for GeoVaLs.
Definition: GeoVaLs.cc:78
Locations class to handle locations for IODA.
oops::Variables vars_
void write(const eckit::Configuration &) const
Definition: GeoVaLs.cc:178
void print(std::ostream &) const
Definition: GeoVaLs.cc:143
GeoVaLs(const ioda::Locations &, const oops::Variables &)
Definition: GeoVaLs.cc:23
GeoVaLs & operator*=(const double)
Definition: GeoVaLs.cc:106
GeoVaLs & operator/=(const GeoVaLs &)
GeoVaLs normalization.
Definition: GeoVaLs.cc:132
double norm() const
Definition: GeoVaLs.cc:96