FV3 Bundle
ObsBiasCorrection.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_OBSBIASCORRECTION_H_
12 #define LORENZ95_OBSBIASCORRECTION_H_
13 
14 #include <cmath>
15 #include <iostream>
16 
17 #include "oops/util/Printable.h"
18 
19 namespace eckit {
20  class Configuration;
21 }
22 
23 namespace lorenz95 {
24  class ObsBias;
25 
26 // -----------------------------------------------------------------------------
27 
28 class ObsBiasCorrection : public util::Printable {
29  public:
30 /// Constructor, destructor
32  explicit ObsBiasCorrection(const eckit::Configuration &);
33  ObsBiasCorrection(const ObsBiasCorrection &, const bool copy = true);
34  ObsBiasCorrection(const ObsBiasCorrection &, const eckit::Configuration &);
36 
37 /// Linear algebra operators
38  void diff(const ObsBias &, const ObsBias &);
39  void zero();
43  ObsBiasCorrection & operator*=(const double);
44  void axpy(const double, const ObsBiasCorrection &);
45  double dot_product_with(const ObsBiasCorrection &) const;
46 
47 /// I/O and diagnostics
48  void read(const eckit::Configuration &) {}
49  void write(const eckit::Configuration &) const {}
50  double norm() const {return std::abs(bias_);}
51 
52  double & value() {return bias_;}
53  const double & value() const {return bias_;}
54 
55  private:
56  void print(std::ostream &) const;
57  double bias_;
58  bool active_;
59 };
60 
61 // -----------------------------------------------------------------------------
62 
63 } // namespace lorenz95
64 
65 #endif // LORENZ95_OBSBIASCORRECTION_H_
Class to handle observation bias parameters.
subroutine, public copy(self, rhs)
double dot_product_with(const ObsBiasCorrection &) const
void write(const eckit::Configuration &) const
ObsBiasCorrection()
Constructor, destructor.
ObsBiasCorrection & operator-=(const ObsBiasCorrection &)
void read(const eckit::Configuration &)
I/O and diagnostics.
const double & value() const
The namespace for the L95 model.
ObsBiasCorrection & operator=(const ObsBiasCorrection &)
void axpy(const double, const ObsBiasCorrection &)
void diff(const ObsBias &, const ObsBias &)
Linear algebra operators.
ObsBiasCorrection & operator*=(const double)
ObsBiasCorrection & operator+=(const ObsBiasCorrection &)