UFO
Constant.cc
Go to the documentation of this file.
1
/*
2
* (C) Copyright 2020 UCAR
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
*/
7
8
#include <string>
9
10
#include "
ufo/predictors/Constant.h
"
11
12
#include "ioda/ObsSpace.h"
13
14
namespace
ufo
{
15
16
static
PredictorMaker<Constant>
makerFuncConstant_
(
"constant"
);
17
18
// -----------------------------------------------------------------------------
19
20
Constant::Constant
(
const
eckit::Configuration &
conf
,
const
std::vector<int> & jobs)
21
:
PredictorBase
(
conf
, jobs) {
22
}
23
24
// -----------------------------------------------------------------------------
25
26
void
Constant::compute
(
const
ioda::ObsSpace & odb,
27
const
GeoVaLs
&,
28
const
ObsDiagnostics
&,
29
ioda::ObsVector & out)
const
{
30
const
std::size_t nlocs = odb.nlocs();
31
32
// assure shape of out
33
ASSERT(out.nlocs() == nlocs);
34
35
const
std::size_t njobs =
jobs_
.size();
36
for
(std::size_t jl = 0; jl < nlocs; ++jl) {
37
for
(std::size_t jb = 0; jb < njobs; ++jb) {
38
out[jl*njobs+jb] = 1.0;
39
}
40
}
41
}
42
43
// -----------------------------------------------------------------------------
44
45
}
// namespace ufo
ufo::Constant::compute
void compute(const ioda::ObsSpace &, const GeoVaLs &, const ObsDiagnostics &, ioda::ObsVector &) const override
compute the predictor
Definition:
Constant.cc:26
ufo::makerFuncConstant_
static PredictorMaker< Constant > makerFuncConstant_("constant")
ufo
Definition:
RunCRTM.h:27
ufo::PredictorMaker
Definition:
PredictorBase.h:89
ufo::ObsDiagnostics
Definition:
src/ufo/ObsDiagnostics.h:35
ufo::Constant::Constant
Constant(const eckit::Configuration &, const std::vector< int > &)
Definition:
Constant.cc:20
ufo::PredictorBase
Base class for computing predictors.
Definition:
PredictorBase.h:38
ufo::GeoVaLs
GeoVaLs: geophysical values at locations.
Definition:
src/ufo/GeoVaLs.h:39
ufo::PredictorBase::jobs_
const std::vector< int > jobs_
jobs(channels)
Definition:
PredictorBase.h:60
Constant.h
conf
Definition:
conf.py:1
fv3-bundle
ufo
src
ufo
predictors
Constant.cc
Generated on Sat Oct 24 2020 19:14:54 for UFO by
1.8.18