13 #include "eckit/config/LocalConfiguration.h" 23 #include "oops/util/abor1_cpp.h" 24 #include "oops/util/DateTime.h" 25 #include "oops/util/Duration.h" 26 #include "oops/util/Logger.h" 33 : resol_(resol), tstep_(
util::Duration(tlConf.getString(
"tstep"))),
34 dt_(tstep_.toSeconds()/432000.0), traj_(),
35 lrmodel_(resol_,
eckit::LocalConfiguration(tlConf,
"trajectory")),
39 oops::Log::trace() <<
"TLML95::TLML95 created" << std::endl;
46 oops::Log::trace() <<
"TLML95::~TLML95 destructed" << std::endl;
60 if (itra ==
traj_.end()) {
61 oops::Log::error() <<
"TLML95: trajectory not available at time " << tt << std::endl;
62 ABORT(
"TLML95: trajectory not available");
99 const double zt = 1.0/6.0;
112 const double zt = 1.0/6.0;
141 for (
int jj = 0; jj < nn; ++jj) {
145 if (jm2 < 0) jm2 += nn;
146 if (jm1 < 0) jm1 += nn;
147 if (jp1 >= nn) jp1 -= nn;
148 const double dxdt = - xx[jm2] * xtraj[jm1] - xtraj[jm2] * xx[jm1]
149 + xx[jm1] * xtraj[jp1] + xtraj[jm1] * xx[jp1]
159 for (
int jj = 0; jj < nn; ++jj) {
163 if (jm2 < 0) jm2 += nn;
164 if (jm1 < 0) jm1 += nn;
165 if (jp1 >= nn) jp1 -= nn;
166 const double dxdt =
dt_ * dx[jj];
167 xx[jm2] -= dxdt * xtraj[jm1];
168 xx[jm1] -= dxdt * xtraj[jm2];
169 xx[jm1] += dxdt * xtraj[jp1];
170 xx[jp1] += dxdt * xtraj[jm1];
177 os <<
"TLML95: resol = " <<
resol_ <<
", tstep = " <<
tstep_;
178 os <<
"L95 Model Trajectory, nstep=" <<
traj_.size() <<
"\n";
179 typedef std::map< util::DateTime, ModelTrajectory * >::const_iterator
trajICst;
180 if (
traj_.size() > 0) {
181 os <<
"L95 Model Trajectory: times are:";
183 os <<
" " << jtra->first;
void stepAD(IncrementL95 &, ModelBiasCorrection &) const override
const util::Duration tstep_
Increment Class: Difference between two states.
void stepRK(FieldL95 &, const ModelBias &, ModelTrajectory &) const
const util::DateTime & validTime() const
std::map< util::DateTime, ModelTrajectory *>::const_iterator trajICst
const FieldL95 & getField() const
void tendenciesAD(FieldL95 &, double &, const FieldL95 &, const FieldL95 &) const
void finalizeAD(IncrementL95 &) const override
const ModelTrajectory * getTrajectory(const util::DateTime &) const
void tendenciesTL(const FieldL95 &, const double &, const FieldL95 &, FieldL95 &) const
const FieldL95 & get(const int) const
Get trajectory.
void zero()
Linear algebra.
const FieldL95 & getField() const
Access to data.
void finalizeTL(IncrementL95 &) const override
std::map< util::DateTime, ModelTrajectory *>::iterator trajIter
subroutine, public info(self)
void stepTL(IncrementL95 &, const ModelBiasCorrection &) const override
The namespace for the L95 model.
void print(std::ostream &) const override
void setTrajectory(const StateL95 &, StateL95 &, const ModelBias &) override
Model trajectory computation.
std::map< util::DateTime, ModelTrajectory *> traj_
Model error for Lorenz 95 model.
void initializeTL(IncrementL95 &) const override
Run TLM and its adjoint.
void initializeAD(IncrementL95 &) const override
const util::DateTime & validTime() const
TLML95(const Resolution &, const eckit::Configuration &)
static oops::LinearModelMaker< L95Traits, TLML95 > makerTLML95_("L95TLM")
void axpy(const double &, const FieldL95 &)
Class to represent fields for the L95 model.