18 #include "eckit/config/LocalConfiguration.h"
19 #include "eckit/exception/Exceptions.h"
22 #include "oops/util/DateTime.h"
23 #include "oops/util/Duration.h"
24 #include "oops/util/Logger.h"
41 const util::DateTime & vt)
42 : fields_(new
FieldsQG(resol, vars, lbc_, vt))
44 oops::Log::trace() <<
"StateQG::StateQG created." << std::endl;
51 if (file.has(
"state variables")) vars =
oops::Variables(file,
"state variables");
52 oops::Log::trace() <<
"StateQG::StateQG variables: " << vars << std::endl;
54 if (file.has(
"analytic_init")) {
56 }
else if (file.has(
"read_from_file")) {
57 const int read_from_file = file.getInt(
"read_from_file");
58 if (read_from_file == 0) {
60 }
else if (read_from_file == 1) {
68 oops::Log::trace() <<
"StateQG::StateQG created and read in." << std::endl;
72 : fields_(new
FieldsQG(*other.fields_, resol))
75 oops::Log::trace() <<
"StateQG::StateQG created by interpolation." << std::endl;
79 : fields_(new
FieldsQG(*other.fields_))
82 oops::Log::trace() <<
"StateQG::StateQG copied." << std::endl;
86 oops::Log::trace() <<
"StateQG::StateQG destructed." << std::endl;
101 oops::Log::trace() <<
"StateQG interpolated" << std::endl;
126 size_t nn =
fields_->serialSize();
135 fields_->deserialize(vect, index);
139 os << std::endl <<
" Valid time: " <<
validTime();
Class to represent a Fields for the QG model.
GeometryQG handles geometry for QG model.
Increment Class: Difference between two states.
const util::DateTime & validTime() const
FieldsQG & fields()
Access to fields.
void print(std::ostream &) const
void write(const eckit::Configuration &) const
StateQG & operator+=(const IncrementQG &)
Interactions with Increment.
void accumul(const double &, const StateQG &)
StateQG & operator=(const StateQG &)
Basic operators.
void changeResolution(const StateQG &xx)
Interpolate full fields.
const util::DateTime & validTime() const
std::unique_ptr< FieldsQG > fields_
void read(const eckit::Configuration &)
I/O and diagnostics.
void serialize(std::vector< double > &) const
size_t serialSize() const
Serialization.
void deserialize(const std::vector< double > &, size_t &)
StateQG(const GeometryQG &, const oops::Variables &, const util::DateTime &)
Constructor, destructor.
The namespace for the qg model.