Go to the documentation of this file.
15 #include "eckit/config/LocalConfiguration.h"
16 #include "eckit/exception/Exceptions.h"
18 #include "oops/base/Variables.h"
19 #include "oops/util/abor1_cpp.h"
20 #include "oops/util/DateTime.h"
21 #include "oops/util/Duration.h"
22 #include "oops/util/Logger.h"
32 geom_(new
Geometry(geom)), vars_(vars), time_(time) {
33 oops::Log::trace() <<
"State::State (from geom, vars and time) starting" << std::endl;
35 oops::Log::trace() <<
"State::State (from geom, vars and time) done" << std::endl;
39 time_(
util::DateTime()) {
40 oops::Log::trace() <<
"State::State (from geom and config) starting" << std::endl;
43 oops::Variables lvars(conf,
"state variables");
49 if (conf.has(
"analytic_init")) {
55 oops::Log::trace() <<
"State::State (from geom and config) done" << std::endl;
59 vars_(other.vars_), time_(other.time_) {
60 oops::Log::trace() <<
"State::State (from geom and other) starting" << std::endl;
63 other.
geom_->toFortran());
64 oops::Log::trace() <<
"State::State (from geom and other) done" << std::endl;
67 State::State(
const State & other): geom_(other.geom_), vars_(other.vars_), time_(other.time_) {
68 oops::Log::trace() <<
"State::State (from other) starting" << std::endl;
71 oops::Log::trace() <<
"State::State (from other) done" << std::endl;
86 other.
geom_->toFortran());
99 const eckit::Configuration * conf = &config;
100 util::DateTime * dtp = &
time_;
105 const eckit::Configuration * conf = &config;
106 util::DateTime * dtp = &
time_;
111 const eckit::Configuration * conf = &config;
112 const util::DateTime * dtp = &
time_;
124 <<
" --------------------------------------------------------------------------------";
125 os << std::endl <<
" State print | number of fields = " << numberFields
126 <<
" | cube sphere face size: C" << cubeSize;
129 const int FieldNameLen = 15;
130 char fieldName[FieldNameLen];
131 std::vector<double> minMaxRms(3);
132 for (
int f = 0; f < numberFields; f++) {
135 std::string fieldNameStr(fieldName);
136 os << std::endl << std::scientific << std::showpos <<
" "
137 << fieldNameStr.substr(0, FieldNameLen-1) <<
": Min = " << minMaxRms[0]
138 <<
", Max = " << minMaxRms[1] <<
", RMS = " << minMaxRms[2]
142 os.unsetf(std::ios_base::floatfield);
146 <<
" --------------------------------------------------------------------------------";
164 oops::Log::trace() <<
"State serialSize starting" << std::endl;
169 nn +=
time_.serialSize();
171 oops::Log::trace() <<
"State serialSize done" << std::endl;
175 oops::Log::trace() <<
"State serialize starting" << std::endl;
177 std::vector<double> v_fld(size_fld, 0);
180 vect.insert(vect.end(), v_fld.begin(), v_fld.end());
183 vect.push_back(-54321.56789);
184 time_.serialize(vect);
186 oops::Log::trace() <<
"State serialize done" << std::endl;
190 oops::Log::trace() <<
"State deserialize starting" << std::endl;
193 ASSERT(vect.at(index) == -54321.56789);
196 time_.deserialize(vect, index);
197 oops::Log::trace() <<
"State deserialize done" << std::endl;
void fv3jedi_state_delete_f90(F90state &)
void fv3jedi_state_getnfieldsncube_f90(const F90state &, int &, int &)
void fv3jedi_state_sersize_f90(const F90state &, int &)
void read(const eckit::Configuration &)
size_t serialSize() const
Serialize and deserialize.
void fv3jedi_state_serialize_f90(const F90state &, const std::size_t &, double[])
void fv3jedi_state_analytic_init_f90(const F90state &, const F90geom &, const eckit::Configuration *const *, util::DateTime *const *)
void fv3jedi_state_change_resol_f90(const F90state &, const F90geom &, const F90state &, const F90geom &)
void fv3jedi_state_deserialize_f90(const F90state &, const std::size_t &, const double[], const std::size_t &)
void changeResolution(const State &xx)
void write(const eckit::Configuration &) const
void fv3jedi_state_norm_f90(const F90state &, double &)
void fv3jedi_state_create_f90(F90state &, const F90geom &, const oops::Variables &)
std::shared_ptr< const Geometry > geom_
void fv3jedi_state_add_incr_f90(const F90geom &, const F90state &, const F90inc &)
void fv3jedi_state_getminmaxrms_f90(const F90state &, int &, const int &, char *, double &)
const util::DateTime & validTime() const
void fv3jedi_state_read_file_f90(const F90geom &, const F90state &, const eckit::Configuration *const *, util::DateTime *const *)
void accumul(const double &, const State &)
const util::DateTime & validTime() const
void serialize(std::vector< double > &) const
Geometry handles geometry for FV3JEDI model.
void print(std::ostream &) const
State & operator=(const State &)
void fv3jedi_state_zero_f90(const F90state &)
void fv3jedi_state_write_file_f90(const F90geom &, const F90state &, const eckit::Configuration *const *, const util::DateTime *const *)
State & operator+=(const Increment &)
void analytic_init(const eckit::Configuration &, const Geometry &)
Configuration files should be formatted as e.g.
void fv3jedi_state_axpy_f90(const F90state &, const double &, const F90state &)
State(const Geometry &, const oops::Variables &, const util::DateTime &)
void deserialize(const std::vector< double > &, size_t &)
void fv3jedi_state_copy_f90(const F90state &, const F90state &)