16 #include "eckit/config/Configuration.h" 27 #include "oops/util/abor1_cpp.h" 28 #include "oops/util/DateTime.h" 29 #include "oops/util/Duration.h" 30 #include "oops/util/Logger.h" 42 const util::DateTime &
vt)
43 : fld_(resol), time_(
vt)
45 oops::Log::trace() <<
"StateL95::StateL95 created" << std::endl;
49 const eckit::Configuration &
conf)
50 : fld_(resol), time_(
conf.getString(
"date"))
52 oops::Log::trace() <<
"StateL95::StateL95 conf " <<
conf << std::endl;
53 if (
conf.has(
"filename")) {
58 oops::Log::trace() <<
"StateL95::StateL95 created and read in." << std::endl;
62 : fld_(resol), time_(xx.time_)
65 oops::Log::trace() <<
"StateL95::StateL95 created by interpolation." << std::endl;
69 : fld_(xx.fld_), time_(xx.time_)
71 oops::Log::trace() <<
"StateL95::StateL95 copy-created." << std::endl;
75 oops::Log::trace() <<
"StateL95::StateL95 destructed." << std::endl;
108 const std::string filename(config.getString(
"filename"));
109 oops::Log::trace() <<
"StateL95::read opening " << filename << std::endl;
110 std::ifstream fin(filename.c_str());
111 if (!fin.is_open()) ABORT(
"StateL95::read: Error opening file");
119 const util::DateTime tt(stime);
121 ABORT(
"StateL95::read: date and data file inconsistent.");
127 oops::Log::trace() <<
"StateL95::read: file closed." << std::endl;
131 std::string dir = config.getString(
"datadir");
132 std::string exp = config.getString(
"exp");
133 std::string
type = config.getString(
"type");
134 std::string filename = dir+
"/"+exp+
"."+
type;
137 std::string memb = config.getString(
"member");
138 filename +=
"."+memb;
141 if (
type ==
"fc" ||
type ==
"ens") {
142 const util::DateTime antime(config.getString(
"date"));
143 filename +=
"."+antime.toString();
144 const util::Duration
step =
time_ - antime;
145 filename +=
"."+
step.toString();
149 filename +=
"."+
time_.toString();
152 oops::Log::trace() <<
"StateL95::write opening " << filename << std::endl;
153 std::ofstream fout(filename.c_str());
154 if (!fout.is_open()) ABORT(
"StateL95::write: Error opening file");
157 fout <<
time_ << std::endl;
162 oops::Log::trace() <<
"StateL95::write file closed." << std::endl;
166 os << std::endl <<
" Valid time: " <<
time_;
167 os << std::endl <<
fld_;
GomL95 class to handle locations for L95 model.
void interp(const LocsL95 &, GomL95 &) const
Interpolate to given location.
Increment Class: Difference between two states.
StateL95(const Resolution &, const oops::Variables &, const util::DateTime &)
Constructor, destructor.
void zero()
For accumulator.
LocsL95 class to handle locations for L95 model.
The namespace for the main oops code.
void zero()
Linear algebra.
const FieldL95 & getField() const
Access to data.
StateL95 & operator+=(const IncrementL95 &)
Interactions with increments.
real, dimension(:,:,:), allocatable vt
void print(std::ostream &) const
void read(std::ifstream &)
Utilities.
The namespace for the L95 model.
StateL95 & operator=(const StateL95 &)
Basic operators.
subroutine, public step(x, g)
const int & resol() const
Set and get.
void getValues(const LocsL95 &, const oops::Variables &, GomL95 &) const
Get state values at obs locations.
void generate(const eckit::Configuration &)
void write(const eckit::Configuration &) const
void accumul(const double &, const StateL95 &)
void read(const eckit::Configuration &)
Utilities.
const util::DateTime & validTime() const
void write(std::ofstream &) const
void axpy(const double &, const FieldL95 &)