FV3 Bundle
ModelBiasCorrection.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_MODELBIASCORRECTION_H_
12 #define LORENZ95_MODELBIASCORRECTION_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 ModelBias;
25  class ModelBiasCovariance;
26  class Resolution;
27 
28 // -----------------------------------------------------------------------------
29 
30 class ModelBiasCorrection : public util::Printable {
31  public:
32 /// Constructor, destructor
33  ModelBiasCorrection(const Resolution &, const eckit::Configuration &);
34  ModelBiasCorrection(const ModelBiasCorrection &, const bool);
35  ModelBiasCorrection(const ModelBiasCorrection &, const eckit::Configuration &);
37 
38 /// Linear algebra operators
39  void diff(const ModelBias &, const ModelBias &);
40  void zero();
44  ModelBiasCorrection & operator*=(const double);
45  void axpy(const double, const ModelBiasCorrection &);
46  double dot_product_with(const ModelBiasCorrection &) const;
47 
48 /// I/O and diagnostics
49  void read(const eckit::Configuration &) {}
50  void write(const eckit::Configuration &) const {}
51  double norm() const {return std::abs(bias_);}
52 
53  double & bias() {return bias_;}
54  const double & bias() const {return bias_;}
55 
56  private:
58  void print(std::ostream &) const;
59  double bias_;
60  bool active_;
61 };
62 
63 // -----------------------------------------------------------------------------
64 
65 } // namespace lorenz95
66 
67 #endif // LORENZ95_MODELBIASCORRECTION_H_
ModelBiasCorrection(const Resolution &, const eckit::Configuration &)
Constructor, destructor.
ModelBiasCorrection & operator=(const ModelBiasCorrection &)
void diff(const ModelBias &, const ModelBias &)
Linear algebra operators.
Handles resolution.
Definition: Resolution.h:25
void read(const eckit::Configuration &)
I/O and diagnostics.
The namespace for the L95 model.
ModelBiasCorrection & operator*=(const double)
double dot_product_with(const ModelBiasCorrection &) const
Model error for Lorenz 95 model.
ModelBiasCorrection & operator+=(const ModelBiasCorrection &)
ModelBiasCorrection & operator-=(const ModelBiasCorrection &)
void write(const eckit::Configuration &) const
void axpy(const double, const ModelBiasCorrection &)