OOPS
qg/model/ObsBias.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_OBSBIAS_H_
12 #define QG_MODEL_OBSBIAS_H_
13 
14 #include <array>
15 #include <iostream>
16 #include <string>
17 #include <boost/noncopyable.hpp>
18 
20 #include "oops/base/Variables.h"
21 #include "oops/util/ObjectCounter.h"
22 #include "oops/util/Printable.h"
23 
24 namespace qg {
25  class ObsBiasIncrement;
26  class ObsSpaceQG;
27 
28 /// Class to handle observation bias parameters.
29 
30 // -----------------------------------------------------------------------------
31 
32 class ObsBias : public util::Printable,
33  private boost::noncopyable,
34  private util::ObjectCounter<ObsBias> {
35  public:
37 
38  static const unsigned int ntypes = 4;
39  static const std::string classname() {return "qg::ObsBias";}
40 
41  ObsBias(const ObsSpaceQG &, const Parameters_ &);
42  ObsBias(const ObsBias &, const bool);
43  ~ObsBias() {}
44 
46  ObsBias & operator=(const ObsBias &);
47 
48 /// I/O and diagnostics
49  void read(const Parameters_ &) {}
50  void write(const Parameters_ &) const {}
51  double norm() const;
52 
53  const double & operator[](const unsigned int ii) const {return bias_[ii];}
54 
55  /// Other
56  const oops::Variables & requiredVars() const {return geovars_;}
57  const oops::Variables & requiredHdiagnostics() const {return hdiags_;}
58 
59  const double & stream() const {return bias_[0];}
60  const double & wind() const {return bias_[1];}
61  const double & wspd() const {return bias_[3];}
62 
63  private:
64  void print(std::ostream &) const;
65  std::array<double, ntypes> bias_;
66  bool active_;
69 };
70 
71 // -----------------------------------------------------------------------------
72 
73 } // namespace qg
74 
75 #endif // QG_MODEL_OBSBIAS_H_
Class to handle observation bias parameters.
const double & wspd() const
void read(const Parameters_ &)
I/O and diagnostics.
void print(std::ostream &) const
const double & wind() const
double norm() const
ObsBias & operator+=(const ObsBiasIncrement &)
std::array< double, ntypes > bias_
const double & stream() const
ObsBias & operator=(const ObsBias &)
const oops::Variables & requiredVars() const
Other.
const oops::Variables hdiags_
static const std::string classname()
const oops::Variables & requiredHdiagnostics() const
ObsBias(const ObsSpaceQG &, const Parameters_ &)
const oops::Variables geovars_
ObsBiasParameters Parameters_
void write(const Parameters_ &) const
const double & operator[](const unsigned int ii) const
static const unsigned int ntypes
ObsSpace for QG model.
Definition: ObsSpaceQG.h:81
The namespace for the qg model.