FV3 Bundle
IncrementFV3JEDI.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 SRC_INCREMENT_INCREMENTFV3JEDI_H_
9 #define SRC_INCREMENT_INCREMENTFV3JEDI_H_
10 
11 #include <ostream>
12 #include <string>
13 
14 #include <boost/scoped_ptr.hpp>
15 #include <boost/shared_ptr.hpp>
16 
17 #include "GeometryFV3JEDI.h"
18 #include "StateFV3JEDI.h"
21 #include "oops/base/Variables.h"
22 #include "oops/util/DateTime.h"
23 #include "oops/util/dot_product.h"
24 #include "oops/util/Duration.h"
25 #include "oops/util/ObjectCounter.h"
26 #include "oops/util/Printable.h"
27 
28 namespace eckit {
29  class Configuration;
30 }
31 
32 namespace ufo {
33  class GeoVaLs;
34 }
35 
36 namespace ioda {
37  class Locations;
38 }
39 
40 namespace oops {
41  class Variables;
42  class UnstructuredGrid;
43 }
44 
45 namespace fv3jedi {
46  class ModelBiasIncrementFV3JEDI;
47  class ErrorCovarianceFV3JEDI;
48  class StateFV3JEDI;
49  class GetValuesTrajFV3JEDI;
50 
51 // FV3JEDI increment
52 
53 // -----------------------------------------------------------------------------
54 
56  public util::Printable,
57  private util::ObjectCounter<IncrementFV3JEDI> {
58  public:
59  static const std::string classname() {return "fv3jedi::IncrementFV3JEDI";}
60 
61 /// Constructor, destructor
63  const util::DateTime &);
65  IncrementFV3JEDI(const IncrementFV3JEDI &, const bool);
67  virtual ~IncrementFV3JEDI();
68 
69 /// Basic operators
70  void diff(const StateFV3JEDI &, const StateFV3JEDI &);
71  void zero();
72  void zero(const util::DateTime &);
76  IncrementFV3JEDI & operator*=(const double &);
77  void axpy(const double &, const IncrementFV3JEDI &, const bool check = true);
78  double dot_product_with(const IncrementFV3JEDI &) const;
80  void random();
81  void dirac(const eckit::Configuration &);
82 
83 /// Get increment values at observation locations
84  void getValuesTL(const ioda::Locations &, const oops::Variables &,
85  ufo::GeoVaLs &, const GetValuesTrajFV3JEDI &) const;
86  void getValuesAD(const ioda::Locations &, const oops::Variables &,
87  const ufo::GeoVaLs &, const GetValuesTrajFV3JEDI &);
88 
89 /// Unstructured grid
90  void ug_coord(oops::UnstructuredGrid &, const int &) const;
91  void field_to_ug(oops::UnstructuredGrid &, const int &) const;
93 
94 /// I/O and diagnostics
95  void read(const eckit::Configuration &);
96  void write(const eckit::Configuration &) const;
97  double norm() const;
98 
99  void updateTime(const util::Duration & dt) {time_ += dt;}
100 
101 /// Other
102  void accumul(const double &, const StateFV3JEDI &);
103  void jnormgrad(const StateFV3JEDI &, const eckit::Configuration &);
104 
105 // Utilities
106  boost::shared_ptr<const GeometryFV3JEDI> geometry() const {return geom_;}
107 
108  const util::DateTime & time() const {return time_;}
109  util::DateTime & time() {return time_;}
110  const util::DateTime & validTime() const {return time_;}
111  util::DateTime & validTime() {return time_;}
112 
113  int & toFortran() {return keyInc_;}
114  const int & toFortran() const {return keyInc_;}
115 
116 // Private methods and variables
117  private:
118  void print(std::ostream &) const;
120  boost::shared_ptr<const GeometryFV3JEDI> geom_;
122  util::DateTime time_;
123 };
124 // -----------------------------------------------------------------------------
125 
126 } // namespace fv3jedi
127 
128 #endif // SRC_INCREMENT_INCREMENTFV3JEDI_H_
IncrementFV3JEDI(const GeometryFV3JEDI &, const oops::Variables &, const util::DateTime &)
Constructor, destructor.
util::DateTime & validTime()
void jnormgrad(const StateFV3JEDI &, const eckit::Configuration &)
void dirac(const eckit::Configuration &)
IncrementFV3JEDI & operator+=(const IncrementFV3JEDI &)
void accumul(const double &, const StateFV3JEDI &)
Other.
static const std::string classname()
void getValuesTL(const ioda::Locations &, const oops::Variables &, ufo::GeoVaLs &, const GetValuesTrajFV3JEDI &) const
Get increment values at observation locations.
void read(const eckit::Configuration &)
I/O and diagnostics.
IncrementFV3JEDI & operator=(const IncrementFV3JEDI &)
void field_from_ug(const oops::UnstructuredGrid &)
void schur_product_with(const IncrementFV3JEDI &)
void field_to_ug(oops::UnstructuredGrid &, const int &) const
The namespace for the main oops code.
GeoVaLs: geophysical values at locations.
const int & toFortran() const
void ug_coord(oops::UnstructuredGrid &, const int &) const
Unstructured grid.
boost::shared_ptr< const GeometryFV3JEDI > geometry() const
void print(std::ostream &) const
double dot_product_with(const IncrementFV3JEDI &) const
IncrementFV3JEDI & operator-=(const IncrementFV3JEDI &)
const util::DateTime & time() const
void axpy(const double &, const IncrementFV3JEDI &, const bool check=true)
Locations class to handle locations for IODA.
void write(const eckit::Configuration &) const
void getValuesAD(const ioda::Locations &, const oops::Variables &, const ufo::GeoVaLs &, const GetValuesTrajFV3JEDI &)
IncrementFV3JEDI & operator*=(const double &)
GeometryFV3JEDI handles geometry for FV3JEDI model.
Abstract base class for quantities.
boost::shared_ptr< const GeometryFV3JEDI > geom_
void updateTime(const util::Duration &dt)
void diff(const StateFV3JEDI &, const StateFV3JEDI &)
Basic operators.
const util::DateTime & validTime() const