SOCA
GridGen.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2017-2021 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 MAINS_GRIDGEN_H_
9 #define MAINS_GRIDGEN_H_
10 
11 #include <string>
12 
13 #include "soca/Traits.h"
14 
15 #include "soca/Geometry/Geometry.h"
16 #include "soca/Model/Model.h"
17 
18 #include "eckit/config/LocalConfiguration.h"
19 #include "eckit/mpi/Comm.h"
20 #include "oops/base/PostProcessor.h"
21 #include "oops/mpi/mpi.h"
22 #include "oops/runs/Application.h"
23 
24 namespace soca {
25 
26  class GridGen : public oops::Application {
27  public:
28  explicit GridGen(const eckit::mpi::Comm & comm = oops::mpi::world())
29  : Application(comm) {}
30  static const std::string classname() {return "soca::GridGen";}
31 
32  int execute(const eckit::Configuration & fullConfig) const {
33  // Setup resolution
34  const eckit::LocalConfiguration geomconfig(fullConfig, "geometry");
35  const Geometry geom(geomconfig, this->getComm());
36 
37  // Generate model grid
38  geom.gridgen();
39 
40  return 0;
41  }
42  // -----------------------------------------------------------------------------
43  private:
44  std::string appname() const {
45  return "soca::GridGen<";
46  }
47  // -----------------------------------------------------------------------------
48  };
49 
50 } // namespace soca
51 #endif // MAINS_GRIDGEN_H_
Geometry handles geometry for SOCA model.
Definition: Geometry.h:48
void gridgen() const
Definition: Geometry.cc:70
int execute(const eckit::Configuration &fullConfig) const
Definition: GridGen.h:32
GridGen(const eckit::mpi::Comm &comm=oops::mpi::world())
Definition: GridGen.h:28
static const std::string classname()
Definition: GridGen.h:30
std::string appname() const
Definition: GridGen.h:44