MPAS-JEDI
GeometryMPAS.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2017 UCAR
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  */
7 
8 #ifndef MPASJEDI_GEOMETRYMPAS_H_
9 #define MPASJEDI_GEOMETRYMPAS_H_
10 
11 #include <memory>
12 #include <ostream>
13 #include <string>
14 #include <vector>
15 
16 #include "eckit/mpi/Comm.h"
17 
18 #include "atlas/field.h"
19 #include "atlas/functionspace.h"
20 
21 #include "oops/base/Variables.h"
22 #include "oops/util/ObjectCounter.h"
23 #include "oops/util/Printable.h"
24 
25 #include "mpasjedi/Fortran.h"
26 
27 namespace eckit {
28  class Configuration;
29 }
30 
31 namespace mpas {
32 
33 // -----------------------------------------------------------------------------
34 /// GeometryMPAS handles geometry for MPAS model.
35 
36 class GeometryMPAS : public util::Printable,
37  private util::ObjectCounter<GeometryMPAS> {
38  public:
39  static const std::string classname() {return "mpas::GeometryMPAS";}
40 
41  GeometryMPAS(const eckit::Configuration &, const eckit::mpi::Comm &);
42  GeometryMPAS(const GeometryMPAS &);
43  ~GeometryMPAS();
44 
45  F90geom & toFortran() {return keyGeom_;}
46  const F90geom & toFortran() const {return keyGeom_;}
47  const eckit::mpi::Comm & getComm() const {return comm_;}
48 
49  atlas::FunctionSpace * atlasFunctionSpace() const
50  {return atlasFunctionSpace_.get();}
51  atlas::FieldSet * atlasFieldSet() const
52  {return atlasFieldSet_.get();}
53 
54  bool isEqual(const GeometryMPAS &) const;
55 
56  std::vector<size_t> variableSizes(const oops::Variables &) const;
57 
58  private:
60  void print(std::ostream &) const;
62  const eckit::mpi::Comm & comm_;
63  std::unique_ptr<atlas::functionspace::PointCloud> atlasFunctionSpace_;
64  std::unique_ptr<atlas::FieldSet> atlasFieldSet_;
65 };
66 // -----------------------------------------------------------------------------
67 
68 } // namespace mpas
69 
70 #endif // MPASJEDI_GEOMETRYMPAS_H_
GeometryMPAS handles geometry for MPAS model.
Definition: GeometryMPAS.h:37
std::unique_ptr< atlas::FieldSet > atlasFieldSet_
Definition: GeometryMPAS.h:64
std::vector< size_t > variableSizes(const oops::Variables &) const
Definition: GeometryMPAS.cc:73
const eckit::mpi::Comm & comm_
Definition: GeometryMPAS.h:62
std::unique_ptr< atlas::functionspace::PointCloud > atlasFunctionSpace_
Definition: GeometryMPAS.h:63
static const std::string classname()
Definition: GeometryMPAS.h:39
GeometryMPAS & operator=(const GeometryMPAS &)
const eckit::mpi::Comm & getComm() const
Definition: GeometryMPAS.h:47
F90geom & toFortran()
Definition: GeometryMPAS.h:45
GeometryMPAS(const eckit::Configuration &, const eckit::mpi::Comm &)
Definition: GeometryMPAS.cc:20
atlas::FunctionSpace * atlasFunctionSpace() const
Definition: GeometryMPAS.h:49
void print(std::ostream &) const
Definition: GeometryMPAS.cc:82
bool isEqual(const GeometryMPAS &) const
Definition: GeometryMPAS.cc:65
atlas::FieldSet * atlasFieldSet() const
Definition: GeometryMPAS.h:51
const F90geom & toFortran() const
Definition: GeometryMPAS.h:46
Definition: Fortran.h:17
int F90geom
Definition: Fortran.h:32