FV3 Bundle
GeoVaLsWriter.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2017-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_BASE_GEOVALSWRITER_H_
9 #define OOPS_BASE_GEOVALSWRITER_H_
10 
11 #include "eckit/config/LocalConfiguration.h"
12 #include "oops/base/FilterBase.h"
13 #include "oops/interface/GeoVaLs.h"
16 #include "oops/util/dot_product.h"
17 #include "oops/util/Logger.h"
18 
19 namespace oops {
20 
21 // -----------------------------------------------------------------------------
22 
23 template <typename MODEL>
24 class GeoVaLsWriter : public FilterBase<MODEL> {
28 
29  public:
30  explicit GeoVaLsWriter(const eckit::Configuration & conf) : conf_(conf) {}
32 
33  void priorFilter(const ObsSpace_ &) const override {}
34  void postFilter(const GeoVaLs_ & gv, const ObsVector_ &, const ObsSpace_ &) const override {
35  const double zz = sqrt(dot_product(gv, gv));
36  Log::debug() << "GeoVaLsWriter norm = " << zz << std::endl;
37  gv.write(conf_);
38  }
39 
40  private:
41  const eckit::LocalConfiguration conf_;
42  void print(std::ostream &) const override;
43 };
44 
45 // -----------------------------------------------------------------------------
46 
47 template <typename MODEL>
48 void GeoVaLsWriter<MODEL>::print(std::ostream & os) const {
49  os << "GeoVaLsWriter " << conf_;
50 }
51 
52 // -----------------------------------------------------------------------------
53 
54 } // namespace oops
55 
56 #endif // OOPS_BASE_GEOVALSWRITER_H_
Base class for QC filters applied to observations.
Definition: FilterBase.h:29
void postFilter(const GeoVaLs_ &gv, const ObsVector_ &, const ObsSpace_ &) const override
Definition: GeoVaLsWriter.h:34
const eckit::LocalConfiguration conf_
Definition: GeoVaLsWriter.h:41
void print(std::ostream &) const override
Definition: GeoVaLsWriter.h:48
Definition: conf.py:1
GeoVaLsWriter(const eckit::Configuration &conf)
Definition: GeoVaLsWriter.h:30
The namespace for the main oops code.
logical debug
Definition: mpp.F90:1297
void write(const eckit::Configuration &) const
GeoVaLs< MODEL > GeoVaLs_
Definition: GeoVaLsWriter.h:25
void priorFilter(const ObsSpace_ &) const override
Definition: GeoVaLsWriter.h:33
ObsVector< MODEL > ObsVector_
Definition: GeoVaLsWriter.h:27
ObservationSpace< MODEL > ObsSpace_
Definition: GeoVaLsWriter.h:26