FV3 Bundle
GomL95.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2009-2016 ECMWF.
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  * In applying this licence, ECMWF does not waive the privileges and immunities
7  * granted to it by virtue of its status as an intergovernmental organisation nor
8  * does it submit to any jurisdiction.
9  */
10 
11 #ifndef LORENZ95_GOML95_H_
12 #define LORENZ95_GOML95_H_
13 
14 #include <ostream>
15 #include <string>
16 #include <vector>
17 
18 #include "eckit/config/Configuration.h"
19 #include "oops/util/ObjectCounter.h"
20 #include "oops/util/Printable.h"
21 
22 namespace oops {
23  class Variables;
24 }
25 
26 namespace lorenz95 {
27  class LocsL95;
28  class ObsTable;
29 
30 /// GomL95 class to handle locations for L95 model.
31 
32 class GomL95 : public util::Printable,
33  private util::ObjectCounter<GomL95> {
34  public:
35  static const std::string classname() {return "lorenz95::GomL95";}
36 
37  GomL95(const LocsL95 &, const oops::Variables &);
38  GomL95(const eckit::Configuration &, const oops::Variables &);
39  explicit GomL95(const GomL95 &);
40  ~GomL95();
41 
42  void abs();
43  void zero();
44  void random();
45  double norm() const;
46  GomL95 & operator*=(const double &);
47  GomL95 & operator+=(const GomL95 &);
48  GomL95 & operator-=(const GomL95 &);
49  GomL95 & operator/=(const GomL95 &);
50  double dot_product_with(const GomL95 &) const;
51  void read(const eckit::Configuration &);
52  void analytic_init(const LocsL95 &, const eckit::Configuration &);
53  void write(const eckit::Configuration &) const;
54  void print(std::ostream &) const;
55 
56  size_t size() const {return size_;}
57  const double & operator[](const int ii) const {return locval_[ii];}
58  double & operator[](const int ii) {return locval_[ii];}
59  int getindx(const int il) const {return iobs_[il];}
60  int & current() const {return current_;}
61 
62  private:
63  size_t size_;
64  std::vector<int> iobs_;
65  std::vector<double> locval_;
66  mutable int current_;
67 };
68 
69 } // namespace lorenz95
70 
71 #endif // LORENZ95_GOML95_H_
GomL95 class to handle locations for L95 model.
Definition: GomL95.h:32
int getindx(const int il) const
Definition: GomL95.h:59
size_t size_
Definition: GomL95.h:63
static const std::string classname()
Definition: GomL95.h:35
GomL95 & operator*=(const double &)
double & operator[](const int ii)
Definition: GomL95.h:58
void print(std::ostream &) const
std::vector< int > iobs_
Definition: GomL95.h:64
LocsL95 class to handle locations for L95 model.
Definition: LocsL95.h:28
GomL95(const LocsL95 &, const oops::Variables &)
The namespace for the main oops code.
void analytic_init(const LocsL95 &, const eckit::Configuration &)
GomL95 analytic initialization.
GomL95 & operator-=(const GomL95 &)
The namespace for the L95 model.
const double & operator[](const int ii) const
Definition: GomL95.h:57
void read(const eckit::Configuration &)
std::vector< double > locval_
Definition: GomL95.h:65
size_t size() const
Definition: GomL95.h:56
double dot_product_with(const GomL95 &) const
void write(const eckit::Configuration &) const
GomL95 & operator/=(const GomL95 &)
int & current() const
Definition: GomL95.h:60
GomL95 & operator+=(const GomL95 &)