OOPS
GeometryQG.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2009-2016 ECMWF.
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  * In applying this licence, ECMWF does not waive the privileges and immunities
7  * granted to it by virtue of its status as an intergovernmental organisation nor
8  * does it submit to any jurisdiction.
9  */
10 
11 #ifndef QG_MODEL_GEOMETRYQG_H_
12 #define QG_MODEL_GEOMETRYQG_H_
13 
14 #include <memory>
15 #include <ostream>
16 #include <string>
17 #include <vector>
18 
19 #include "atlas/field.h"
20 #include "atlas/functionspace.h"
21 
22 #include "eckit/mpi/Comm.h"
23 
24 #include "oops/util/ObjectCounter.h"
25 #include "oops/util/parameters/Parameter.h"
26 #include "oops/util/parameters/Parameters.h"
27 #include "oops/util/parameters/RequiredParameter.h"
28 #include "oops/util/Printable.h"
29 
30 #include "oops/qg/GeometryQGIterator.h"
31 #include "oops/qg/QgFortran.h"
32 
33 namespace qg {
34 
35 class GeometryQgParameters : public oops::Parameters {
36  OOPS_CONCRETE_PARAMETERS(GeometryQgParameters, Parameters)
37 
38  public:
39  /// Domain size
40  oops::RequiredParameter<int> nx{"nx", this};
41  oops::RequiredParameter<int> ny{"ny", this};
42  /// Depths
43  oops::RequiredParameter<std::vector<float>> depths{"depths", this};
44  /// Heating option (AS: should it be in geometry or model?)
45  oops::Parameter<bool> heating{"heating", true, this};
46 };
47 
48 class GeometryQGIterator;
49 
50 // -----------------------------------------------------------------------------
51 /// GeometryQG handles geometry for QG model.
52 
53 class GeometryQG : public util::Printable,
54  private util::ObjectCounter<GeometryQG> {
55  public:
57 
58  static const std::string classname() {return "qg::GeometryQG";}
59 
60  GeometryQG(const GeometryQgParameters &, const eckit::mpi::Comm &);
61  GeometryQG(const GeometryQG &);
62  ~GeometryQG();
63 
64  const F90geom & toFortran() const {return keyGeom_;}
65 
66  GeometryQGIterator begin() const;
67  GeometryQGIterator end() const;
68  std::vector<double> verticalCoord(std::string &) const;
69  const eckit::mpi::Comm & getComm() const {return comm_;}
70  atlas::FunctionSpace * atlasFunctionSpace() const {return atlasFunctionSpace_.get();}
71  atlas::FieldSet * atlasFieldSet() const {return atlasFieldSet_.get();}
72 
73  private:
75  void print(std::ostream &) const;
77  const eckit::mpi::Comm & comm_;
78  std::unique_ptr<atlas::functionspace::PointCloud> atlasFunctionSpace_;
79  std::unique_ptr<atlas::FieldSet> atlasFieldSet_;
80 };
81 // -----------------------------------------------------------------------------
82 
83 } // namespace qg
84 
85 #endif // QG_MODEL_GEOMETRYQG_H_
qg
The namespace for the qg model.
Definition: qg/model/AnalyticInit.cc:13
qg::GeometryQG::~GeometryQG
~GeometryQG()
Definition: GeometryQG.cc:65
qg::F90geom
int F90geom
Definition: QgFortran.h:43
qg::GeometryQG::GeometryQG
GeometryQG(const GeometryQgParameters &, const eckit::mpi::Comm &)
Definition: GeometryQG.cc:27
qg::GeometryQG::atlasFieldSet
atlas::FieldSet * atlasFieldSet() const
Definition: GeometryQG.h:71
qg::GeometryQG::atlasFunctionSpace_
std::unique_ptr< atlas::functionspace::PointCloud > atlasFunctionSpace_
Definition: GeometryQG.h:78
qg::GeometryQgParameters::ny
oops::RequiredParameter< int > ny
Definition: GeometryQG.h:41
qg::GeometryQgParameters::nx
oops::RequiredParameter< int > nx
Domain size.
Definition: GeometryQG.h:40
qg::GeometryQG::atlasFunctionSpace
atlas::FunctionSpace * atlasFunctionSpace() const
Definition: GeometryQG.h:70
qg::GeometryQG::atlasFieldSet_
std::unique_ptr< atlas::FieldSet > atlasFieldSet_
Definition: GeometryQG.h:79
qg::GeometryQG::end
GeometryQGIterator end() const
Definition: GeometryQG.cc:73
qg::GeometryQG::toFortran
const F90geom & toFortran() const
Definition: GeometryQG.h:64
qg::GeometryQgParameters::heating
oops::Parameter< bool > heating
Heating option (AS: should it be in geometry or model?)
Definition: GeometryQG.h:45
qg::GeometryQG::classname
static const std::string classname()
Definition: GeometryQG.h:58
qg::GeometryQG::Parameters_
GeometryQgParameters Parameters_
Definition: GeometryQG.h:56
qg::GeometryQGIterator
Definition: GeometryQGIterator.h:33
qg::GeometryQG::begin
GeometryQGIterator begin() const
Definition: GeometryQG.cc:69
qg::GeometryQG::getComm
const eckit::mpi::Comm & getComm() const
Definition: GeometryQG.h:69
qg::GeometryQG::comm_
const eckit::mpi::Comm & comm_
Definition: GeometryQG.h:77
qg::GeometryQG::keyGeom_
F90geom keyGeom_
Definition: GeometryQG.h:76
qg::GeometryQgParameters
Definition: GeometryQG.h:35
qg::GeometryQG::print
void print(std::ostream &) const
Definition: GeometryQG.cc:104
qg::GeometryQG::operator=
GeometryQG & operator=(const GeometryQG &)
qg::GeometryQG::verticalCoord
std::vector< double > verticalCoord(std::string &) const
Definition: GeometryQG.cc:83
qg::GeometryQG
GeometryQG handles geometry for QG model.
Definition: GeometryQG.h:54
qg::GeometryQgParameters::depths
oops::RequiredParameter< std::vector< float > > depths
Depths.
Definition: GeometryQG.h:43