FV3 Bundle
ObsVecQG.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 QG_MODEL_OBSVECQG_H_
12 #define QG_MODEL_OBSVECQG_H_
13 
14 #include <ostream>
15 #include <string>
16 
17 #include "model/QgFortran.h"
18 #include "oops/util/ObjectCounter.h"
19 #include "oops/util/Printable.h"
20 
21 namespace qg {
22  class ObsSpaceQG;
23 
24 // -----------------------------------------------------------------------------
25 /// ObsVecQG class to handle vectors in observation space for QG model.
26 
27 class ObsVecQG : public util::Printable,
28  private util::ObjectCounter<ObsVecQG> {
29  public:
30  static const std::string classname() {return "qg::ObsVecQG";}
31 
32  explicit ObsVecQG(const ObsSpaceQG &);
33  ObsVecQG(const ObsVecQG &, const bool copy = true);
34  ~ObsVecQG();
35 
36  ObsVecQG & operator = (const ObsVecQG &);
37  ObsVecQG & operator*= (const double &);
38  ObsVecQG & operator+= (const ObsVecQG &);
39  ObsVecQG & operator-= (const ObsVecQG &);
40  ObsVecQG & operator*= (const ObsVecQG &);
41  ObsVecQG & operator/= (const ObsVecQG &);
42 
43  void zero();
44  void axpy(const double &, const ObsVecQG &);
45  void invert();
46  void random();
47  double dot_product_with(const ObsVecQG &) const;
48  double rms() const;
49 
50  unsigned int size() const;
51 
52  int & toFortran() {return keyOvec_;}
53  const int & toFortran() const {return keyOvec_;}
54 
55 // I/O
56  void read(const std::string &);
57  void save(const std::string &) const;
58 
59  private:
60  void print(std::ostream &) const;
61 
62  const ObsSpaceQG & obsdb_;
64 };
65 // -----------------------------------------------------------------------------
66 
67 } // namespace qg
68 
69 #endif // QG_MODEL_OBSVECQG_H_
const ObsSpaceQG & obsdb_
Definition: ObsVecQG.h:62
ObsVecQG & operator=(const ObsVecQG &)
Definition: ObsVecQG.cc:41
void zero()
Definition: ObsVecQG.cc:76
subroutine, public copy(self, rhs)
void read(const std::string &)
Definition: ObsVecQG.cc:109
unsigned int size() const
Definition: ObsVecQG.cc:124
ObsVecQG & operator+=(const ObsVecQG &)
Definition: ObsVecQG.cc:52
void invert()
Definition: ObsVecQG.cc:85
ObsVecQG & operator*=(const double &)
Definition: ObsVecQG.cc:47
void random()
Definition: ObsVecQG.cc:89
int F90ovec
Definition: QgFortran.h:46
ObsVecQG & operator/=(const ObsVecQG &)
Definition: ObsVecQG.cc:70
void print(std::ostream &) const
Definition: ObsVecQG.cc:117
void save(const std::string &) const
Definition: ObsVecQG.cc:113
F90ovec keyOvec_
Definition: ObsVecQG.h:63
static const std::string classname()
Definition: ObsVecQG.h:30
int & toFortran()
Definition: ObsVecQG.h:52
void axpy(const double &, const ObsVecQG &)
Definition: ObsVecQG.cc:80
const int & toFortran() const
Definition: ObsVecQG.h:53
ObsVecQG(const ObsSpaceQG &)
Definition: ObsVecQG.cc:21
double rms() const
Definition: ObsVecQG.cc:100
ObsVecQG & operator-=(const ObsVecQG &)
Definition: ObsVecQG.cc:58
double dot_product_with(const ObsVecQG &) const
Definition: ObsVecQG.cc:93
ObsVecQG class to handle vectors in observation space for QG model.
Definition: ObsVecQG.h:27
Wrapper around ObsHelpQG, mostly to hide the factory.
Definition: ObsSpaceQG.h:35
The namespace for the qg model.