13 #include "eckit/config/LocalConfiguration.h"
14 #include "eckit/exception/Exceptions.h"
16 #include "oops/util/Duration.h"
17 #include "oops/util/Logger.h"
31 const oops::Variables & incvars,
32 const util::DateTime & time)
33 : geom_(new
GeometryMPAS(geom)), vars_(incvars), time_(time)
35 oops::Log::trace() <<
"StateMPAS::StateMPAS create." << std::endl;
37 oops::Log::trace() <<
"StateMPAS::StateMPAS created." << std::endl;
41 const eckit::Configuration &
config)
43 time_(
util::DateTime())
45 oops::Log::trace() <<
"StateMPAS::StateMPAS create and read." << std::endl;
49 if (
config.has(
"analytic_init")) {
55 oops::Log::trace() <<
"StateMPAS::StateMPAS created and read in."
61 : geom_(new
GeometryMPAS(resol)), vars_(other.vars_), time_(other.time_)
63 oops::Log::trace() <<
"StateMPAS::StateMPAS create by interpolation."
68 oops::Log::trace() <<
"StateMPAS::StateMPAS created by interpolation."
73 : geom_(other.geom_), vars_(other.vars_), time_(other.time_)
75 oops::Log::trace() <<
"StateMPAS::StateMPAS before copied." << std::endl;
79 oops::Log::trace() <<
"StateMPAS::StateMPAS copied." << std::endl;
84 oops::Log::trace() <<
"StateMPAS::StateMPAS destructed." << std::endl;
99 oops::Log::trace() <<
"StateMPAS changed resolution" << std::endl;
105 oops::Log::trace() <<
"StateMPAS add increment starting" << std::endl;
110 oops::Log::trace() <<
"StateMPAS add increment done" << std::endl;
125 nn +=
time_.serialSize();
135 std::vector<double> vect_field(nn, 0);
137 vect.insert(vect.end(), vect_field.begin(), vect_field.end());
143 time_.serialize(vect);
155 time_.deserialize(vect, index);
166 oops::Log::trace() <<
"StateMPAS analytic init starting" << std::endl;
168 oops::Log::trace() <<
"StateMPAS analytic init done" << std::endl;
177 std::ios oldState(
nullptr);
178 oldState.copyfmt(os);
184 os << std::endl <<
" Valid time: " <<
validTime();
185 os << std::endl <<
" Resolution: nCellsGlobal = " << nc <<
186 ", nFields = " << nf;
187 std::vector<double> zstat(3*nf);
189 os << std::setprecision(9);
190 os << std::scientific;
191 for (
int jj = 0; jj < nf; ++jj) {
192 os << std::endl <<
"Fld=" << jj+1 <<
" Min=" << zstat[3*jj]
193 <<
", Max=" << zstat[3*jj+1] <<
", RMS=" << zstat[3*jj+2]
194 <<
" : " <<
vars_[jj];
198 os.copyfmt(oldState);
227 oops::Variables statevars(
vars_);
GeometryMPAS handles geometry for MPAS model.
Increment Class: Difference between two states.
const util::DateTime & validTime() const
void zero()
For accumulator.
void write(const eckit::Configuration &) const
std::shared_ptr< const GeometryMPAS > geom_
void read(const eckit::Configuration &)
I/O and diagnostics.
void accumul(const double &, const StateMPAS &)
StateMPAS(const GeometryMPAS &, const oops::Variables &, const util::DateTime &)
Constructor, destructor.
void analytic_init(const eckit::Configuration &, const GeometryMPAS &)
void serialize(std::vector< double > &) const override
void print(std::ostream &) const override
size_t serialSize() const override
Serialization.
StateMPAS & operator=(const StateMPAS &)
Basic operators.
void changeResolution(const StateMPAS &xx)
Interpolate full fields.
oops::Variables stateVars()
void deserialize(const std::vector< double > &, size_t &) override
const util::DateTime & validTime() const
StateMPAS & operator+=(const IncrementMPAS &)
Interactions with Increment.
void mpas_state_read_file_f90(const F90state &, const eckit::Configuration &, util::DateTime &)
void mpas_state_zero_f90(const F90state &)
void mpas_state_deserialize_f90(const F90state &, const std::size_t &, const double[], const std::size_t &)
void mpas_state_gpnorm_f90(const F90state &, const int &, double &)
void mpas_state_write_file_f90(const F90state &, const eckit::Configuration &, const util::DateTime &)
void mpas_state_change_resol_f90(const F90state &, const F90state &)
void mpas_state_sizes_f90(const F90state &, int &, int &)
void mpas_state_axpy_f90(const F90state &, const double &, const F90state &)
void mpas_state_serial_size_f90(const F90state &, std::size_t &)
void mpas_state_rms_f90(const F90state &, double &)
void mpas_state_serialize_f90(const F90state &, const std::size_t &, double[])
void mpas_state_copy_f90(const F90state &, const F90state &)
void mpas_state_create_f90(F90state &, const F90geom &, const oops::Variables &, const oops::Variables &)
constexpr double SerializeCheckValue
void mpas_state_analytic_init_f90(const F90state &, const F90geom &, const eckit::Configuration &, util::DateTime &)
void mpas_state_add_incr_f90(const F90state &, const F90inc &)
void mpas_state_delete_f90(F90state &)