FV3 Bundle
l95/src/lorenz95/ModelBias.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_MODELBIAS_H_
12 #define LORENZ95_MODELBIAS_H_
13 
14 #include <cmath>
15 #include <iostream>
16 #include <string>
17 #include <boost/noncopyable.hpp>
18 
19 #include "oops/util/ObjectCounter.h"
20 #include "oops/util/Printable.h"
21 
22 namespace eckit {
23  class Configuration;
24 }
25 
26 namespace lorenz95 {
27  class Resolution;
28  class ModelBiasCorrection;
29 
30 /// Model error for Lorenz 95 model.
31 /*!
32  * This class is used to manipulate parameters of the model that
33  * can be estimated in the assimilation. This includes model bias for
34  * example but could be used for other parameters to be estimated.
35  */
36 
37 // -----------------------------------------------------------------------------
38 
39 class ModelBias : public util::Printable,
40  private boost::noncopyable,
41  private util::ObjectCounter<ModelBias> {
42  public:
43  static const std::string classname() {return "lorenz95::ModelBias";}
44 
45  ModelBias(const Resolution &, const eckit::Configuration &);
46  ModelBias(const Resolution &, const ModelBias &);
47  ModelBias(const ModelBias &, const bool);
49 
51 
52  const double & bias() const {return bias_;}
53  double & bias() {return bias_;}
54 
55 /// I/O and diagnostics
56  void read(const eckit::Configuration &) {}
57  void write(const eckit::Configuration &) const {}
58  double norm() const {return std::abs(bias_);}
59 
60  private:
61  void print(std::ostream &) const;
62  double bias_;
63  bool active_;
64 };
65 
66 // -----------------------------------------------------------------------------
67 
68 } // namespace lorenz95
69 
70 #endif // LORENZ95_MODELBIAS_H_
ModelBias(const Resolution &, const eckit::Configuration &)
void print(std::ostream &) const
Handles resolution.
Definition: Resolution.h:25
void read(const eckit::Configuration &)
I/O and diagnostics.
static const std::string classname()
void write(const eckit::Configuration &) const
The namespace for the L95 model.
const double & bias() const
Model error for Lorenz 95 model.
ModelBias & operator+=(const ModelBiasCorrection &)