FV3 Bundle
ObsWSpeedTLAD.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 "model/ObsWSpeedTLAD.h"
12 
13 #include <vector>
14 
15 #include "eckit/config/Configuration.h"
16 #include "model/GomQG.h"
17 #include "model/ObsBias.h"
18 #include "model/ObsBiasIncrement.h"
19 #include "model/ObsSpaceQG.h"
20 #include "model/ObsVecQG.h"
21 #include "model/QgFortran.h"
22 #include "model/VariablesQG.h"
23 #include "oops/base/Variables.h"
24 #include "oops/util/Logger.h"
25 
26 // -----------------------------------------------------------------------------
27 namespace qg {
28 // -----------------------------------------------------------------------------
29 static ObsOpTLADMaker<ObsWSpeedTLAD> makerWSpeedTL_("WSpeed");
30 // -----------------------------------------------------------------------------
31 
32 ObsWSpeedTLAD::ObsWSpeedTLAD(const ObsSpaceQG & odb, const eckit::Configuration & config)
33  : keyOperWspeed_(0), traj_(), varin_(std::vector<std::string>{"u", "v"})
34 {
35  const eckit::Configuration * configc = &config;
36  qg_wspeed_setup_f90(keyOperWspeed_, &configc);
37  const VariablesQG varqg(varin_);
38  qg_wspeed_gettraj_f90(keyOperWspeed_, odb.nobs(), varqg.toFortran(), traj_.toFortran());
39  oops::Log::trace() << "ObsWSpeedTLAD created" << std::endl;
40 }
41 
42 // -----------------------------------------------------------------------------
43 
45  oops::Log::trace() << "ObsWSpeedTLAD destructed" << std::endl;
46 }
47 
48 // -----------------------------------------------------------------------------
49 
50 void ObsWSpeedTLAD::setTrajectory(const GomQG & gom, const ObsBias &) {
52  oops::Log::trace() << "ObsWSpeedTLAD trajectory was set " << traj_ << std::endl;
53 }
54 
55 // -----------------------------------------------------------------------------
56 
57 void ObsWSpeedTLAD::simulateObsTL(const GomQG & gom, ObsVecQG & ovec,
58  const ObsBiasIncrement & bias) const {
60  traj_.toFortran(), bias.wspd());
61 }
62 
63 // -----------------------------------------------------------------------------
64 
65 void ObsWSpeedTLAD::simulateObsAD(GomQG & gom, const ObsVecQG & ovec,
66  ObsBiasIncrement & bias) const {
68  traj_.toFortran(), bias.wspd());
69 }
70 
71 // -----------------------------------------------------------------------------
72 
73 void ObsWSpeedTLAD::print(std::ostream & os) const {
74  os << "ObsStreamTLAD::print not implemented" << std::endl;
75 }
76 
77 // -----------------------------------------------------------------------------
78 
79 } // namespace qg
void qg_wspeed_gettraj_f90(const F90hop &, const int &, const int *, F90goms &)
GomQG class to handle local model values for QG model.
Definition: GomQG.h:31
ObsWSpeedTLAD(const ObsSpaceQG &, const eckit::Configuration &)
virtual ~ObsWSpeedTLAD()
void print(std::ostream &) const override
void qg_wspeed_settraj_f90(const F90goms &, const F90goms &)
subroutine std(a, mean, stdv, area)
void simulateObsTL(const GomQG &, ObsVecQG &, const ObsBiasIncrement &) const override
static ObsOpTLADMaker< ObsWSpeedTLAD > makerWSpeedTL_("WSpeed")
Class to handle observation bias parameters.
int & toFortran()
Definition: ObsVecQG.h:52
void qg_wspeed_equiv_tl_f90(const F90goms &, const F90ovec &, const F90goms &, const double &)
void setTrajectory(const GomQG &, const ObsBias &) override
Obs Operator.
void qg_wspeed_setup_f90(F90hop &, const eckit::Configuration *const *)
void qg_wspeed_equiv_ad_f90(const F90goms &, const F90ovec &, const F90goms &, double &)
ObsVecQG class to handle vectors in observation space for QG model.
Definition: ObsVecQG.h:27
Wrapper around ObsHelpQG, mostly to hide the factory.
Definition: ObsSpaceQG.h:35
void simulateObsAD(GomQG &, const ObsVecQG &, ObsBiasIncrement &) const override
int & toFortran()
Definition: GomQG.h:59
The namespace for the qg model.