OOPS
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"
17
#include "
lorenz95/ModelBiasCorrection.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
// -----------------------------------------------------------------------------
45
ModelBias
&
ModelBias::operator+=
(
const
ModelBiasCorrection
& dx) {
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
lorenz95::ModelBias::active_
bool active_
Definition:
l95/src/lorenz95/ModelBias.h:62
lorenz95::ModelBias
Model error for Lorenz 95 model.
Definition:
l95/src/lorenz95/ModelBias.h:41
lorenz95::ModelBias::print
void print(std::ostream &) const
Definition:
ModelBias.cc:50
lorenz95::Resolution
Handles resolution.
Definition:
Resolution.h:42
lorenz95::ModelBias::ModelBias
ModelBias(const Resolution &, const eckit::Configuration &)
Definition:
ModelBias.cc:23
ModelBiasCorrection.h
lorenz95::ModelBiasCorrection::bias
double & bias()
Definition:
ModelBiasCorrection.h:56
lorenz95::ModelBias::operator+=
ModelBias & operator+=(const ModelBiasCorrection &)
Definition:
ModelBias.cc:45
lorenz95::ModelBiasCorrection
Definition:
ModelBiasCorrection.h:33
lorenz95::ModelBias::bias_
double bias_
Definition:
l95/src/lorenz95/ModelBias.h:61
ModelBias.h
lorenz95
The namespace for the L95 model.
Definition:
l95/src/lorenz95/AnalyticInit.cc:17
fv3-bundle
oops
l95
src
lorenz95
ModelBias.cc
Generated on Sun Oct 25 2020 12:42:57 for OOPS by
1.8.18