SOCA
Balance.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 
29  static oops::LinearVariableChangeMaker<Traits,
30  oops::LinearVariableChange<Traits, Balance> >
32 
33  // -----------------------------------------------------------------------------
34  Balance::Balance(const State & bkg,
35  const State & traj,
36  const Geometry & geom,
37  const eckit::Configuration & conf) {
38  oops::Log::trace() << "soca::Balance::setup " << std::endl;
39  const eckit::Configuration * configc = &conf;
40 
41  // Interpolate trajectory to the geom resolution
42  State traj_at_geomres(geom, traj);
43 
44  // Compute Jacobians of the balance wrt traj
46  &configc,
47  traj_at_geomres.toFortran(),
48  geom.toFortran());
49  }
50  // -----------------------------------------------------------------------------
52  oops::Log::trace() << "soca::Balance::delete " << std::endl;
54  }
55  // -----------------------------------------------------------------------------
56  void Balance::multiply(const Increment & dxa, Increment & dxm) const {
57  // dxm = K dxa
58  oops::Log::trace() << "soca::Balance::multiply " << std::endl;
60  }
61  // -----------------------------------------------------------------------------
62  void Balance::multiplyInverse(const Increment & dxm, Increment & dxa) const {
63  // dxa = K^-1 dxm
64  oops::Log::trace() << "soca::Balance::multiplyInverse " << std::endl;
66  }
67  // -----------------------------------------------------------------------------
68  void Balance::multiplyAD(const Increment & dxm, Increment & dxa) const {
69  // dxa = K^T dxm
70  oops::Log::trace() << "soca::Balance::multiplyAD " << std::endl;
72  }
73  // -----------------------------------------------------------------------------
75  Increment & dxm) const {
76  // dxm = (K^-1)^T dxa
77  oops::Log::trace() << "soca::Balance::multiplyInverseAD " << std::endl;
79  }
80  // -----------------------------------------------------------------------------
81  void Balance::print(std::ostream & os) const {
82  os << "SOCA change variable: Balance";
83  }
84  // -----------------------------------------------------------------------------
85 } // namespace soca
Balance(const State &, const State &, const Geometry &, const eckit::Configuration &)
Definition: Balance.cc:34
void multiplyAD(const Increment &, Increment &) const
Definition: Balance.cc:68
void print(std::ostream &) const override
Definition: Balance.cc:81
void multiplyInverseAD(const Increment &, Increment &) const
Definition: Balance.cc:74
void multiplyInverse(const Increment &, Increment &) const
Definition: Balance.cc:62
void multiply(const Increment &, Increment &) const
Perform linear transforms.
Definition: Balance.cc:56
int keyFtnConfig_
Definition: Balance.h:48
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
static oops::LinearVariableChangeMaker< Traits, oops::LinearVariableChange< Traits, Balance > > makerLinearVariableChangeBalance_("BalanceSOCA")
void soca_balance_delete_f90(F90balopmat &)
void soca_balance_multad_f90(const F90balopmat &, const F90balopmat &, F90balopmat &)
void soca_balance_multinv_f90(const F90balopmat &, const F90balopmat &, F90balopmat &)
void soca_balance_multinvad_f90(const F90balopmat &, const F90balopmat &, F90balopmat &)
void soca_balance_mult_f90(const F90balopmat &, const F90balopmat &, F90balopmat &)
void soca_balance_setup_f90(F90balopmat &, const eckit::Configuration *const *, const F90flds &, const F90geom &)