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 
11 
12 #include "ioda/ObsSpace.h"
13 
14 namespace ufo {
15 
17 
18 // -----------------------------------------------------------------------------
19 
20 Constant::Constant(const Parameters_ & parameters, const oops::Variables & vars)
21  : PredictorBase(parameters, vars) {
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 = out.nlocs();
31  const std::size_t nvars = out.nvars();
32  for (std::size_t jloc = 0; jloc < nlocs; ++jloc) {
33  for (std::size_t jvar = 0; jvar < nvars; ++jvar) {
34  out[jloc*nvars+jvar] = 1.0;
35  }
36  }
37 }
38 
39 // -----------------------------------------------------------------------------
40 
41 } // namespace ufo
void compute(const ioda::ObsSpace &, const GeoVaLs &, const ObsDiagnostics &, ioda::ObsVector &) const override
compute the predictor
Definition: Constant.cc:26
Constant(const Parameters_ &, const oops::Variables &)
Definition: Constant.cc:20
GeoVaLs: geophysical values at locations.
integer function nlocs(this)
Return the number of observational locations in this Locations object.
Definition: RunCRTM.h:27
static PredictorMaker< Constant > makerFuncConstant_("constant")