OOPS
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 ObsTableView &, const eckit::Configuration & conf)
24  : bias_(0.0), active_(false), geovars_(), hdiags_()
25 {
26  oops::Log::trace() << "ObsBias::ObsBias conf is:" << conf << std::endl;
27  if (conf.has("obs bias")) {
28  const eckit::LocalConfiguration biasconf(conf, "obs bias");
29  if (biasconf.has("bias")) {
30  bias_ = biasconf.getDouble("bias");
31  active_ = true;
32  oops::Log::info() << "ObsBias::ObsBias created, bias = " << bias_ << std::endl;
33  }
34  }
35 }
36 // -----------------------------------------------------------------------------
37 ObsBias::ObsBias(const ObsBias & other, const bool copy)
38  : bias_(0.0), active_(other.active_),
39  geovars_(other.geovars_), hdiags_(other.hdiags_) {
40  if (active_ && copy) bias_ = other.bias_;
41 }
42 // -----------------------------------------------------------------------------
44  if (active_) bias_ += dx.value();
45  return *this;
46 }
47 // -----------------------------------------------------------------------------
49  if (active_) bias_ = rhs.bias_;
50  return *this;
51 }
52 // -----------------------------------------------------------------------------
53 void ObsBias::print(std::ostream & os) const {
54  if (active_) {os << std::endl << "ObsBias = " << bias_;}
55 }
56 // -----------------------------------------------------------------------------
57 } // namespace lorenz95
lorenz95::ObsBias
Class to handle observation bias parameters.
Definition: l95/src/lorenz95/ObsBias.h:36
lorenz95::ObsBias::bias_
double bias_
Definition: l95/src/lorenz95/ObsBias.h:61
lorenz95::ObsBias::ObsBias
ObsBias(const ObsTableView &, const eckit::Configuration &)
Definition: l95/src/lorenz95/ObsBias.cc:23
lorenz95::ObsBias::operator+=
ObsBias & operator+=(const ObsBiasCorrection &)
Definition: l95/src/lorenz95/ObsBias.cc:43
ObsBias.h
lorenz95::ObsBias::active_
bool active_
Definition: l95/src/lorenz95/ObsBias.h:62
lorenz95::ObsBiasCorrection::value
double & value()
Definition: ObsBiasCorrection.h:56
lorenz95::ObsBias::operator=
ObsBias & operator=(const ObsBias &)
Definition: l95/src/lorenz95/ObsBias.cc:48
ObsBiasCorrection.h
lorenz95::ObsBias::print
void print(std::ostream &) const
Definition: l95/src/lorenz95/ObsBias.cc:53
lorenz95::ObsTableView
A Simple Observation Data Handler.
Definition: ObsTableView.h:38
lorenz95
The namespace for the L95 model.
Definition: l95/src/lorenz95/AnalyticInit.cc:17
lorenz95::ObsBiasCorrection
Definition: ObsBiasCorrection.h:32