FV3 Bundle
l95/src/lorenz95/ObsBias.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/ObsBias.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 ObsBias::ObsBias(const eckit::Configuration & conf) : bias_(0.0), active_(false)
24 {
25  oops::Log::trace() << "ObsBias::ObsBias conf is:" << conf << std::endl;
26  if (conf.has("bias")) {
27  bias_ = conf.getDouble("bias");
28  active_ = true;
29  oops::Log::info() << "ObsBias::ObsBias created, bias = " << bias_ << std::endl;
30  }
31 }
32 // -----------------------------------------------------------------------------
33 ObsBias::ObsBias(const ObsBias & other, const bool copy)
34  : bias_(0.0), active_(other.active_)
35 {
36  if (active_ && copy) bias_ = other.bias_;
37 }
38 // -----------------------------------------------------------------------------
40  if (active_) bias_ += dx.value();
41  return *this;
42 }
43 // -----------------------------------------------------------------------------
44 void ObsBias::print(std::ostream & os) const {
45  if (active_) {os << std::endl << "ObsBias = " << bias_;}
46 }
47 // -----------------------------------------------------------------------------
48 } // namespace lorenz95
ObsBias & operator+=(const ObsBiasCorrection &)
Class to handle observation bias parameters.
subroutine, public copy(self, rhs)
Definition: conf.py:1
integer(long), parameter false
subroutine, public info(self)
The namespace for the L95 model.
void print(std::ostream &) const
ObsBias(const eckit::Configuration &)