17 #include "oops/util/abor1_cpp.h" 18 #include "oops/util/DateTime.h" 19 #include "oops/util/dot_product.h" 20 #include "oops/util/Duration.h" 21 #include "oops/util/Logger.h" 41 const util::DateTime &
vt)
42 : fld_(resol), time_(
vt)
45 oops::Log::trace() <<
"IncrementL95::IncrementL95 created." << std::endl;
49 : fld_(resol), time_(dx.time_)
52 oops::Log::trace() <<
"IncrementL95::IncrementL95 created by interpolation." << std::endl;
56 : fld_(dx.fld_), time_(dx.time_)
58 oops::Log::trace() <<
"IncrementL95::IncrementL95 copy-created." << std::endl;
62 oops::Log::trace() <<
"IncrementL95::~IncrementL95 destructed" << std::endl;
116 double zz = dot_product(
fld_, other.
fld_);
135 const std::string filename(config.getString(
"filename"));
136 oops::Log::trace() <<
"IncrementL95::read opening " << filename << std::endl;
137 std::ifstream fin(filename.c_str());
138 if (!fin.is_open()) ABORT(
"IncrementL95::read: Error opening file");
146 const util::DateTime tt(stime);
147 const util::DateTime
tc(config.getString(
"date"));
149 ABORT(
"IncrementL95::read: date and data file inconsistent.");
156 oops::Log::trace() <<
"IncrementL95::read: file closed." << std::endl;
160 std::string dir = config.getString(
"datadir");
161 std::string exp = config.getString(
"exp");
162 std::string
type = config.getString(
"type");
163 std::string filename = dir+
"/"+exp+
"."+
type;
165 const util::DateTime antime(config.getString(
"date"));
166 filename +=
"."+antime.toString();
167 const util::Duration
step =
time_ - antime;
168 filename +=
"."+
step.toString();
170 oops::Log::trace() <<
"IncrementL95::write opening " << filename << std::endl;
171 std::ofstream fout(filename.c_str());
172 if (!fout.is_open()) ABORT(
"IncrementL95::write: Error opening file");
175 fout <<
time_ << std::endl;
180 oops::Log::trace() <<
"IncrementL95::write file closed." << std::endl;
184 os << std::endl <<
" Valid time: " <<
time_;
185 os << std::endl <<
fld_;
void diff(const StateL95 &, const StateL95 &)
Basic operators.
GomL95 class to handle locations for L95 model.
void interp(const LocsL95 &, GomL95 &) const
Interpolate to given location.
double dot_product_with(const IncrementL95 &) const
void ug_coord(oops::UnstructuredGrid &, const int &) const
Unstructured grid.
Increment Class: Difference between two states.
void field_to_ug(oops::UnstructuredGrid &, const int &) const
const util::DateTime & validTime() const
void field_from_ug(const oops::UnstructuredGrid &)
subroutine, public copy(self, rhs)
void diff(const FieldL95 &, const FieldL95 &)
const FieldL95 & getField() const
void interpAD(const LocsL95 &, const GomL95 &)
void getValuesAD(const LocsL95 &, const oops::Variables &, const GomL95 &, const Nothing &)
void dirac(const eckit::Configuration &)
void field_to_ug(oops::UnstructuredGrid &, const int &) const
void getValuesTL(const LocsL95 &, const oops::Variables &, GomL95 &, const Nothing &) const
Get increment values at obs locations.
LocsL95 class to handle locations for L95 model.
void field_from_ug(const oops::UnstructuredGrid &)
The namespace for the main oops code.
void zero()
Linear algebra.
IncrementL95 & operator-=(const IncrementL95 &)
real, dimension(:,:,:), allocatable vt
void ug_coord(oops::UnstructuredGrid &, const int &) const
Unstructured grid.
void dirac(const eckit::Configuration &)
void accumul(const double &, const StateL95 &)
void read(std::ifstream &)
Utilities.
void axpy(const double &, const IncrementL95 &, const bool check=true)
The namespace for the L95 model.
void schur(const FieldL95 &)
subroutine, public step(x, g)
const int & resol() const
Set and get.
IncrementL95 & operator+=(const IncrementL95 &)
void write(const eckit::Configuration &) const
IncrementL95 & operator=(const IncrementL95 &)
void read(const eckit::Configuration &)
Utilities.
void schur_product_with(const IncrementL95 &)
IncrementL95(const Resolution &, const oops::Variables &, const util::DateTime &)
Constructor, destructor.
IncrementL95 & operator*=(const double &)
type(taucoeff_type), save, public tc
void write(std::ofstream &) const
void axpy(const double &, const FieldL95 &)
void print(std::ostream &) const