FV3 Bundle
src/lorenz95/ModelBias.cc
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 #include "lorenz95/ModelBias.h"
12 
13 #include <iostream>
14 #include <string>
15 
16 #include "eckit/config/Configuration.h"
18 #include "oops/util/Logger.h"
19 
20 // -----------------------------------------------------------------------------
21 namespace lorenz95 {
22 // -----------------------------------------------------------------------------
23 ModelBias::ModelBias(const Resolution &, const eckit::Configuration & conf)
24  : bias_(0.0), active_(false)
25 {
26  oops::Log::trace() << "ModelBias::ModelBias conf is:" << conf << std::endl;
27  if (conf.has("bias")) {
28  bias_ = conf.getDouble("bias");
29  active_ = true;
30  }
31 }
32 // -----------------------------------------------------------------------------
33 ModelBias::ModelBias(const Resolution &, const ModelBias & other)
34  : bias_(0.0), active_(other.active_)
35 {
36  if (active_) bias_ = other.bias_;
37 }
38 // -----------------------------------------------------------------------------
39 ModelBias::ModelBias(const ModelBias & other, const bool copy)
40  : bias_(0.0), active_(other.active_)
41 {
42  if (active_ && copy) bias_ = other.bias_;
43 }
44 // -----------------------------------------------------------------------------
46  if (active_) bias_ += dx.bias();
47  return *this;
48 }
49 // -----------------------------------------------------------------------------
50 void ModelBias::print(std::ostream & os) const {
51  if (active_) {os << std::endl << "ModelBias = " << bias_;}
52 }
53 // -----------------------------------------------------------------------------
54 } // namespace lorenz95
subroutine, public copy(self, rhs)
ModelBias(const Resolution &, const eckit::Configuration &)
void print(std::ostream &) const
Definition: conf.py:1
integer(long), parameter false
Handles resolution.
Definition: Resolution.h:25
The namespace for the L95 model.
Model error for Lorenz 95 model.
ModelBias & operator+=(const ModelBiasCorrection &)