18 #include "eckit/config/Configuration.h" 
   19 #include "eckit/exception/Exceptions.h" 
   30 #include "oops/util/abor1_cpp.h" 
   31 #include "oops/util/DateTime.h" 
   32 #include "oops/util/Duration.h" 
   33 #include "oops/util/Logger.h" 
   34 #include "oops/util/stringFunctions.h" 
   39 namespace sf = util::stringfunctions;
 
   47                    const util::DateTime & vt)
 
   48   : fld_(resol), time_(vt), vars_(vars)
 
   50   oops::Log::trace() << 
"StateL95::StateL95 created" << std::endl;
 
   54   : fld_(resol), time_(conf.getString(
"date")), vars_({
"x"})
 
   56   oops::Log::trace() << 
"StateL95::StateL95 conf " << conf << std::endl;
 
   57   if (conf.has(
"filename")) {
 
   62   oops::Log::trace() << 
"StateL95::StateL95 created and read in." << std::endl;
 
   66   : fld_(resol), time_(xx.time_), vars_(xx.vars_)
 
   69   oops::Log::trace() << 
"StateL95::StateL95 created by interpolation." << std::endl;
 
   73   : fld_(xx.fld_), time_(xx.time_), vars_(xx.vars_)
 
   75   oops::Log::trace() << 
"StateL95::StateL95 copy-created." << std::endl;
 
   79   oops::Log::trace() << 
"StateL95::StateL95 destructed." << std::endl;
 
  102   std::string filename(config.getString(
"filename"));
 
  103   sf::swapNameMember(config, filename);
 
  104   oops::Log::trace() << 
"StateL95::read opening " << filename << std::endl;
 
  105   std::ifstream fin(filename.c_str());
 
  106   if (!fin.is_open()) ABORT(
"StateL95::read: Error opening file: " + filename);
 
  114   const util::DateTime tt(stime);
 
  116     ABORT(
"StateL95::read: date and data file inconsistent.");
 
  122   oops::Log::trace() << 
"StateL95::read: file closed." << std::endl;
 
  126   std::string dir = config.getString(
"datadir");
 
  127   std::string exp = config.getString(
"exp");
 
  128   std::string type = config.getString(
"type");
 
  129   std::string filename = dir+
"/"+exp+
"."+type;
 
  132     std::string memb = config.getString(
"member");
 
  133     filename += 
"."+memb;
 
  136   if (type == 
"fc" || type == 
"ens") {
 
  137     const util::DateTime antime(config.getString(
"date"));
 
  138     filename += 
"."+antime.toString();
 
  139     const util::Duration step = 
time_ - antime;
 
  140     filename += 
"."+step.toString();
 
  144     filename += 
"."+
time_.toString();
 
  147   if (type == 
"krylov") {
 
  148     std::string iter = config.getString(
"iteration");
 
  149     filename += 
"."+iter+
"."+
time_.toString();
 
  152   sf::swapNameMember(config, filename);
 
  154   oops::Log::trace() << 
"StateL95::write opening " << filename << std::endl;
 
  155   std::ofstream fout(filename.c_str());
 
  156   if (!fout.is_open()) ABORT(
"StateL95::write: Error opening file: " + filename);
 
  159   fout << 
time_ << std::endl;
 
  164   oops::Log::trace() << 
"StateL95::write file closed." << std::endl;
 
  168   os << std::endl << 
" Valid time: " << 
time_;
 
  169   os << std::endl << 
fld_;
 
  187   nn += 
time_.serialSize();
 
  192   vect.push_back(1001.0);
 
  194   vect.push_back(2002.0);
 
  195   time_.serialize(vect);
 
  196   vect.push_back(3003.0);
 
  201   ASSERT(vect.at(index) == 1001.0);
 
  204   ASSERT(vect.at(index) == 2002.0);
 
  206   time_.deserialize(vect, index);
 
  207   ASSERT(vect.at(index) == 3003.0);
 
void write(std::ofstream &) const
 
const int & resol() const
Set and get.
 
void deserialize(const std::vector< double > &, size_t &) override
 
void axpy(const double &, const FieldL95 &)
 
void zero()
Linear algebra.
 
void serialize(std::vector< double > &) const override
 
void read(std::ifstream &)
Utilities.
 
size_t serialSize() const override
Serialize and deserialize.
 
Increment Class: Difference between two states.
 
const util::DateTime & validTime() const
 
const FieldL95 & getField() const
Access to data.
 
void accumul(const double &, const StateL95 &)
 
void zero()
For accumulator.
 
StateL95(const Resolution &, const oops::Variables &, const util::DateTime &)
Constructor, destructor.
 
size_t serialSize() const
Serialize and deserialize.
 
void read(const eckit::Configuration &)
Utilities.
 
StateL95 & operator+=(const IncrementL95 &)
Interactions with increments.
 
void write(const eckit::Configuration &) const
 
void deserialize(const std::vector< double > &, size_t &)
 
void serialize(std::vector< double > &) const
 
void print(std::ostream &) const
 
StateL95 & operator=(const StateL95 &)
Basic operators.
 
The namespace for the L95 model.
 
The namespace for the main oops code.