SOCA
BkgErrFilt.cc
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2017-2021 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 <ostream>
9 #include <string>
10 
11 #include "eckit/config/Configuration.h"
12 
13 #include "oops/interface/LinearVariableChange.h"
14 #include "oops/util/Logger.h"
15 
16 #include "soca/Geometry/Geometry.h"
18 #include "soca/State/State.h"
19 #include "soca/Traits.h"
22 
23 using oops::Log;
24 
25 namespace soca {
26 
27  // -----------------------------------------------------------------------------
28  static oops::LinearVariableChangeMaker<Traits,
29  oops::LinearVariableChange<Traits, BkgErrFilt> >
31 
32  // -----------------------------------------------------------------------------
34  const State & traj,
35  const Geometry & geom,
36  const eckit::Configuration & conf) {
37  const eckit::Configuration * configc = &conf;
38 
39  // Interpolate trajectory to the geom resolution
40  State traj_at_geomres(geom, traj);
41 
42  // Setup background error filter
44  &configc,
45  traj_at_geomres.toFortran(),
46  geom.toFortran());
47  }
48  // -----------------------------------------------------------------------------
51  }
52  // -----------------------------------------------------------------------------
53  void BkgErrFilt::multiply(const Increment & dxa, Increment & dxm) const {
54  // dxm = K dxa
56  }
57  // -----------------------------------------------------------------------------
59  Increment & dxa) const {
60  dxa = dxm;
61  }
62  // -----------------------------------------------------------------------------
63  void BkgErrFilt::multiplyAD(const Increment & dxm, Increment & dxa) const {
64  // dxa = K^T dxm
66  }
67  // -----------------------------------------------------------------------------
69  Increment & dxm) const {
70  dxm = dxa;
71  }
72  // -----------------------------------------------------------------------------
73  void BkgErrFilt::print(std::ostream & os) const {
74  os << "SOCA change variable";
75  }
76  // -----------------------------------------------------------------------------
77 } // namespace soca
void multiplyAD(const Increment &, Increment &) const
Definition: BkgErrFilt.cc:63
void multiplyInverse(const Increment &, Increment &) const
Definition: BkgErrFilt.cc:58
void multiplyInverseAD(const Increment &, Increment &) const
Definition: BkgErrFilt.cc:68
void print(std::ostream &) const override
Definition: BkgErrFilt.cc:73
void multiply(const Increment &, Increment &) const
Perform linear transforms.
Definition: BkgErrFilt.cc:53
BkgErrFilt(const State &, const State &, const Geometry &, const eckit::Configuration &)
Definition: BkgErrFilt.cc:33
Geometry handles geometry for SOCA model.
Definition: Geometry.h:48
int & toFortran()
Definition: Geometry.h:61
Increment Class: Difference between two states.
Definition: Increment.h:61
int & toFortran()
Definition: Increment.h:112
SOCA model state.
Definition: State.h:48
int & toFortran()
Definition: State.h:88
void soca_bkgerrfilt_setup_f90(F90balopmat &, const eckit::Configuration *const *, const F90flds &, const F90geom &)
void soca_bkgerrfilt_mult_f90(const F90balopmat &, const F90flds &, F90flds &)
static oops::LinearVariableChangeMaker< Traits, oops::LinearVariableChange< Traits, BkgErrFilt > > makerLinearVariableChangeBkgErrFilt_("BkgErrFILT")
void soca_bkgerrfilt_delete_f90(F90balopmat &)