FV3 Bundle
EstimateParams.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 OOPS_RUNS_ESTIMATEPARAMS_H_
12 #define OOPS_RUNS_ESTIMATEPARAMS_H_
13 
14 #include <sstream>
15 #include <string>
16 
17 #include <boost/scoped_ptr.hpp>
18 
19 #include "eckit/config/Configuration.h"
21 #include "oops/runs/Application.h"
22 #include "oops/util/Logger.h"
23 
24 namespace oops {
25 
26 template <typename MODEL> class EstimateParams : public Application {
28 
29  public:
30 // -----------------------------------------------------------------------------
31  static const std::string classname() {return "oops::EstimateParams";}
33  instantiateCovarFactory<MODEL>();
34  }
35 // -----------------------------------------------------------------------------
36  virtual ~EstimateParams() {}
37 // -----------------------------------------------------------------------------
38  int execute(const eckit::Configuration & fullConfig) const {
39  util::Timer timer(classname(), "write");
40 
41  // Setup parameters
42  Parameters_ param(fullConfig);
43 
44  // Estimate parameters
45  param.estimate();
46 
47  // Write parameters
48  param.write();
49 
50  return 0;
51  }
52 // -----------------------------------------------------------------------------
53  private:
54  std::string appname() const {
55  return "oops::EstimateParams<" + MODEL::name() + ">";
56  }
57 // -----------------------------------------------------------------------------
58 };
59 
60 } // namespace oops
61 #endif // OOPS_RUNS_ESTIMATEPARAMS_H_
ParametersBUMP< MODEL > Parameters_
BUMP diagnostics.
character(len=32) name
The namespace for the main oops code.
std::string appname() const
static const std::string classname()
int execute(const eckit::Configuration &fullConfig) const