FV3 Bundle
StaticBInit.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2018 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 OOPS_RUNS_STATICBINIT_H_
9 #define OOPS_RUNS_STATICBINIT_H_
10 
11 #include <string>
12 
13 #include "eckit/config/LocalConfiguration.h"
16 #include "oops/base/Variables.h"
18 #include "oops/interface/State.h"
19 #include "oops/runs/Application.h"
20 
21 namespace oops {
22 
23  template <typename MODEL> class StaticBInit : public Application {
27 
28  public:
29  // -----------------------------------------------------------------------------
31  instantiateCovarFactory<MODEL>();
32  }
33  // -----------------------------------------------------------------------------
34  virtual ~StaticBInit() {}
35  // -----------------------------------------------------------------------------
36  int execute(const eckit::Configuration & fullConfig) const {
37  // Setup resolution
38  const eckit::LocalConfiguration resolConfig(fullConfig, "Geometry");
39  const Geometry_ resol(resolConfig);
40 
41  // Setup variables
42  const eckit::LocalConfiguration varConfig(fullConfig, "Variables");
43  const Variables vars(varConfig);
44 
45  // Setup background state
46  const eckit::LocalConfiguration bkgconf(fullConfig, "State");
47  State_ xx(resol, vars, bkgconf);
48 
49  // Initialize static B matrix
50  const eckit::LocalConfiguration covarconf(fullConfig, "Covariance");
51  boost::scoped_ptr< Covariance_ >
52  Bmat(CovarianceFactory<MODEL>::create(covarconf, resol, vars, xx, xx));
53 
54  return 0;
55  }
56  // -----------------------------------------------------------------------------
57  private:
58  std::string appname() const {
59  return "oops::StaticBInit<" + MODEL::name() + ">";
60  }
61  // -----------------------------------------------------------------------------
62  };
63 
64 } // namespace oops
65 
66 #endif // OOPS_RUNS_STATICBINIT_H_
Encapsulates the model state.
character(len=32) name
int execute(const eckit::Configuration &fullConfig) const
Definition: StaticBInit.h:36
The namespace for the main oops code.
Geometry< MODEL > Geometry_
Definition: StaticBInit.h:25
State< MODEL > State_
Definition: StaticBInit.h:26
virtual ~StaticBInit()
Definition: StaticBInit.h:34
Abstract base class for model space error covariances.
ModelSpaceCovarianceBase< MODEL > Covariance_
Definition: StaticBInit.h:24
std::string appname() const
Definition: StaticBInit.h:58