21 #include "atlas/field.h"
23 #include "eckit/config/Configuration.h"
24 #include "eckit/config/LocalConfiguration.h"
32 #include "oops/util/DateTime.h"
33 #include "oops/util/Logger.h"
39 const bool & lbc,
const util::DateTime & time):
40 geom_(new
GeometryQG(geom)), vars_(vars), lbc_(lbc), time_(time)
46 : geom_(other.geom_), vars_(other.vars_), lbc_(other.lbc_), time_(other.time_)
55 : geom_(other.geom_), vars_(other.vars_), lbc_(other.lbc_), time_(other.time_)
62 : geom_(new
GeometryQG(geom)), vars_(other.vars_), lbc_(other.lbc_), time_(other.time_)
69 : geom_(other.geom_), vars_(vars), lbc_(other.lbc_), time_(other.time_)
185 os << std::endl <<
" Resolution = " << nx <<
", " << ny <<
", " << nz;
188 std::vector<std::string> var{
"Streamfunction :",
189 "Potential vorticity :",
192 "Streamfunction LBC :",
193 "Potential vorticity LBC:"};
194 std::vector<int> vpresent(6);
195 std::vector<double> vmin(6);
196 std::vector<double> vmax(6);
197 std::vector<double> vrms(6);
199 for (
int jj = 0; jj < 6; ++jj) {
200 if (vpresent[jj] == 1) {
201 std::ios_base::fmtflags f(os.flags());
202 os << std::endl <<
" " << var[jj] << std::scientific << std::setprecision(4)
203 <<
" Min=" << std::setw(12) << vmin[jj]
204 <<
", Max=" << std::setw(12) << vmax[jj]
205 <<
", RMS=" << std::setw(12) << vrms[jj];
225 for (
unsigned int ii = 0; ii <
vars_.
size(); ii++) {
228 int lenvalues = std::accumulate(varlens.begin(), varlens.end(), 0);
229 std::vector<double> values(lenvalues);
235 const std::vector<double> vals = x.
getVals();
243 size_t nn = nx * ny * nz;
245 nn += 2 * (nx + 1) * nz;
247 nn +=
time_.serialSize();
255 std::vector<double> v_fld(size_fld, 0);
259 vect.insert(vect.end(), v_fld.begin(), v_fld.end());
262 time_.serialize(vect);
266 int indexInt =
static_cast<int>(index);
268 index =
static_cast<size_t>(indexInt);
269 time_.deserialize(vect, index);
const std::vector< double > & getVals() const
Class to represent a Fields for the QG model.
FieldsQG & operator*=(const double &)
void toAtlas(atlas::FieldSet *) const
void deserialize(const std::vector< double > &, size_t &) override
FieldsQG & operator=(const FieldsQG &)
FieldsQG & operator-=(const FieldsQG &)
void add(const FieldsQG &)
void print(std::ostream &) const override
void fromAtlas(atlas::FieldSet *)
void analytic_init(const eckit::Configuration &)
void serialize(std::vector< double > &) const override
void setAtlas(atlas::FieldSet *) const
void setLocal(const oops::LocalIncrement &, const GeometryQGIterator &)
void write(const eckit::Configuration &) const
bool isForModel(const bool &) const
const oops::Variables vars_
FieldsQG & operator+=(const FieldsQG &)
void schur_product_with(const FieldsQG &)
oops::LocalIncrement getLocal(const GeometryQGIterator &) const
void axpy(const double &, const FieldsQG &)
std::shared_ptr< const GeometryQG > geom_
void read(const eckit::Configuration &)
FieldsQG(const GeometryQG &, const oops::Variables &, const bool &, const util::DateTime &)
void changeResolution(const FieldsQG &)
void dirac(const eckit::Configuration &)
double dot_product_with(const FieldsQG &) const
void diff(const FieldsQG &, const FieldsQG &)
size_t serialSize() const override
Serialization.
const util::DateTime & time() const
GeometryQG handles geometry for QG model.
const F90iter & toFortran() const
The namespace for the qg model.
void qg_fields_create_f90(F90flds &, const F90geom &, const oops::Variables &, const bool &)
void qg_fields_self_add_f90(const F90flds &, const F90flds &)
void qg_fields_diff_incr_f90(const F90flds &, const F90flds &, const F90flds &)
void qg_fields_self_sub_f90(const F90flds &, const F90flds &)
void qg_fields_set_atlas_f90(const F90flds &, const oops::Variables &, atlas::field::FieldSetImpl *)
void qg_fields_axpy_f90(const F90flds &, const double &, const F90flds &)
void qg_fields_random_f90(const F90flds &, const oops::Variables &)
void qg_fields_getpoint_f90(const F90flds &, const F90iter &, const int &, double &)
void qg_fields_rms_f90(const F90flds &, double &)
void qg_fields_add_incr_f90(const F90flds &, const F90flds &)
void qg_fields_change_resol_f90(const F90flds &, const F90flds &)
void qg_fields_write_file_f90(const F90flds &, const eckit::Configuration &, const util::DateTime &)
void qg_fields_ones_f90(const F90flds &)
void qg_fields_to_atlas_f90(const F90flds &, const oops::Variables &, atlas::field::FieldSetImpl *)
void qg_fields_delete_f90(F90flds &)
void qg_fields_lbc_f90(const F90flds &, int &)
void qg_fields_create_from_other_f90(F90flds &, const F90flds &, const F90geom &)
void qg_fields_analytic_init_f90(const F90flds &, const eckit::Configuration &, util::DateTime &)
void qg_fields_copy_f90(const F90flds &, const F90flds &)
void qg_fields_from_atlas_f90(const F90flds &, const oops::Variables &, atlas::field::FieldSetImpl *)
void qg_fields_zero_f90(const F90flds &)
void qg_fields_self_schur_f90(const F90flds &, const F90flds &)
void qg_fields_sizes_f90(const F90flds &, int &, int &, int &)
void qg_fields_dirac_f90(const F90flds &, const eckit::Configuration &)
void qg_fields_self_mul_f90(const F90flds &, const double &)
void qg_fields_setpoint_f90(const F90flds &, const F90iter &, const int &, const double &)
void qg_fields_read_file_f90(const F90flds &, const eckit::Configuration &, util::DateTime &)
void qg_fields_gpnorm_f90(const F90flds &, int[], double[], double[], double[])
void qg_fields_serialize_f90(const F90flds &, const int &, double[])
void qg_fields_dot_prod_f90(const F90flds &, const F90flds &, double &)
void qg_fields_deserialize_f90(const F90flds &, const int &, const double[], int &)