UFO
ObsSfcPCorrected.cc
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2017-2018 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 
9 
10 #include <ostream>
11 #include <vector>
12 
13 #include "ioda/ObsVector.h"
14 
15 #include "oops/base/Variables.h"
16 
17 #include "ufo/filters/Variables.h"
18 #include "ufo/GeoVaLs.h"
19 #include "ufo/ObsDiagnostics.h"
20 #include "ufo/utils/OperatorUtils.h" // for getOperatorVariables
21 
22 namespace ufo {
23 
24 // -----------------------------------------------------------------------------
26 // -----------------------------------------------------------------------------
27 
28 ObsSfcPCorrected::ObsSfcPCorrected(const ioda::ObsSpace & odb,
29  const eckit::Configuration & config)
30  : ObsOperatorBase(odb, config), keyOper_(0), odb_(odb), varin_()
31 {
32  std::vector<int> operatorVarIndices;
33  getOperatorVariables(config, odb.obsvariables(), operatorVars_, operatorVarIndices);
34 
36  operatorVars_, operatorVarIndices.data(), operatorVarIndices.size(),
37  varin_);
38  oops::Log::trace() << "ObsSfcPCorrected created." << std::endl;
39 }
40 
41 // -----------------------------------------------------------------------------
42 
45  oops::Log::trace() << "ObsSfcPCorrected destructed" << std::endl;
46 }
47 
48 // -----------------------------------------------------------------------------
49 
50 void ObsSfcPCorrected::simulateObs(const GeoVaLs & gv, ioda::ObsVector & ovec,
51  ObsDiagnostics &) const {
52  ufo_sfcpcorrected_simobs_f90(keyOper_, gv.toFortran(), odb_, ovec.nvars(), ovec.nlocs(),
53  ovec.toFortran());
54  oops::Log::trace() << "ObsSfcPCorrected: observation operator run" << std::endl;
55 }
56 
57 // -----------------------------------------------------------------------------
58 
59 void ObsSfcPCorrected::print(std::ostream & os) const {
60  os << "ObsSfcPCorrected::print not implemented";
61 }
62 
63 // -----------------------------------------------------------------------------
64 
65 } // namespace ufo
GeoVaLs: geophysical values at locations.
ObsSfcPCorrected(const ioda::ObsSpace &, const eckit::Configuration &)
oops::Variables operatorVars_
const ioda::ObsSpace & odb_
void print(std::ostream &) const override
oops::Variables varin_
void simulateObs(const GeoVaLs &, ioda::ObsVector &, ObsDiagnostics &) const override
Obs Operator.
Definition: RunCRTM.h:27
void ufo_sfcpcorrected_simobs_f90(const F90hop &, const F90goms &, const ioda::ObsSpace &, const int &, const int &, double &)
void ufo_sfcpcorrected_delete_f90(F90hop &)
static ObsOperatorMaker< ObsSfcPCorrected > makerSfcPCorrected_("SfcPCorrected")
void getOperatorVariables(const eckit::Configuration &conf, const oops::Variables &simulatedVariables, oops::Variables &operatorVariables, std::vector< int > &operatorVariableIndices)
void ufo_sfcpcorrected_setup_f90(F90hop &, const eckit::Configuration &, const oops::Variables &operatorVars, const int *operatorVarIndices, const int numOperatorVarIndices, oops::Variables &requiredVars)
Interface to Fortran UFO sfcpcorrected routines.