UFO
ObsExample.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 
12 #include "ioda/ObsVector.h"
13 
14 #include "oops/base/Variables.h"
15 
16 #include "ufo/GeoVaLs.h"
17 #include "ufo/ObsDiagnostics.h"
18 
19 namespace ufo {
20 
21 // -----------------------------------------------------------------------------
23 // -----------------------------------------------------------------------------
24 
25 ObsExample::ObsExample(const ioda::ObsSpace & odb,
26  const eckit::Configuration & config)
27  : ObsOperatorBase(odb, config), keyOper_(0), odb_(odb), varin_()
28 {
29  ufo_example_setup_f90(keyOper_, config, odb.obsvariables(), varin_);
30  oops::Log::trace() << "ObsExample created." << std::endl;
31 }
32 
33 // -----------------------------------------------------------------------------
34 
37  oops::Log::trace() << "ObsExample destructed" << std::endl;
38 }
39 
40 // -----------------------------------------------------------------------------
41 
42 void ObsExample::simulateObs(const GeoVaLs & gv, ioda::ObsVector & ovec,
43  ObsDiagnostics &) const {
44  ufo_example_simobs_f90(keyOper_, gv.toFortran(), odb_, ovec.nvars(), ovec.nlocs(),
45  ovec.toFortran());
46  oops::Log::trace() << "ObsExample: observation operator run" << std::endl;
47 }
48 
49 // -----------------------------------------------------------------------------
50 
51 void ObsExample::print(std::ostream & os) const {
52  os << "ObsExample::print not implemented";
53 }
54 
55 // -----------------------------------------------------------------------------
56 
57 } // namespace ufo
ufo::ObsExample::simulateObs
void simulateObs(const GeoVaLs &, ioda::ObsVector &, ObsDiagnostics &) const override
Obs Operator.
Definition: ObsExample.cc:42
ufo
Definition: RunCRTM.h:27
ufo::ObsOperatorBase
Base class for observation operators.
Definition: ObsOperatorBase.h:37
ufo::GeoVaLs::toFortran
int & toFortran()
Definition: src/ufo/GeoVaLs.h:80
ufo::ObsExample::ObsExample
ObsExample(const ioda::ObsSpace &, const eckit::Configuration &)
Definition: ObsExample.cc:25
ufo::ufo_example_setup_f90
void ufo_example_setup_f90(F90hop &, const eckit::Configuration &, const oops::Variables &, oops::Variables &)
Interface to Fortran UFO example routines.
ufo::ObsDiagnostics
Definition: src/ufo/ObsDiagnostics.h:35
ufo::ObsExample::keyOper_
F90hop keyOper_
Definition: ObsExample.h:55
ufo::ObsExample::~ObsExample
virtual ~ObsExample()
Definition: ObsExample.cc:35
ufo::ObsOperatorMaker
Definition: ObsOperatorBase.h:78
ufo::makerExample_
static ObsOperatorMaker< ObsExample > makerExample_("Example")
ufo::GeoVaLs
GeoVaLs: geophysical values at locations.
Definition: src/ufo/GeoVaLs.h:39
ufo::ObsExample::print
void print(std::ostream &) const override
Definition: ObsExample.cc:51
ufo::ufo_example_delete_f90
void ufo_example_delete_f90(F90hop &)
ufo::ufo_example_simobs_f90
void ufo_example_simobs_f90(const F90hop &, const F90goms &, const ioda::ObsSpace &, const int &, const int &, double &)
ufo::ObsExample::varin_
oops::Variables varin_
Definition: ObsExample.h:57
ufo::ObsExample::odb_
const ioda::ObsSpace & odb_
Definition: ObsExample.h:56
ObsExample.h