UFO
TropopauseEstimate.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2020 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 UFO_FILTERS_OBSFUNCTIONS_TROPOPAUSEESTIMATE_H_
9 #define UFO_FILTERS_OBSFUNCTIONS_TROPOPAUSEESTIMATE_H_
10 
11 #include <string>
12 #include <vector>
13 
14 #include "ioda/ObsDataVector.h"
15 
16 #include "oops/util/parameters/Parameter.h"
17 #include "oops/util/parameters/RequiredParameter.h"
18 
21 #include "ufo/filters/Variables.h"
23 
24 namespace ufo {
25 
26 ///
27 /// \brief Two optional parameters permit overriding default tropopause pressure at the
28 /// equator and poles (linear interp between). The optional save (default=false)
29 /// option can be used to save calculated tropopause estimate to the output file.
30 /// By default (convert_p2z=false), the output is tropopause pressure, but this
31 /// optional argument can convert the answer from pressure to height using the ICAO
32 /// standard atmosphere approximation.
33 ///
34 class TropopauseEstimateParameters : public oops::Parameters {
35  OOPS_CONCRETE_PARAMETERS(TropopauseEstimateParameters, Parameters)
36 
37  public:
38  /// Default: The tropopause near the equator is located at a constant pressure level (135 hPa)
39  /// in a belt from 15 S to 15 N and increases linearly to the poles to 360 hPa.
40  oops::Parameter<float> tropo_equator{"tropo_equator", 13500.0f, this};
41  oops::Parameter<float> tropo_pole{"tropo_pole", 36000.0f, this};
42  oops::Parameter<bool> convert_p2z{"convert_p2z", false, this};
43  oops::Parameter<bool> save{"save", false, this};
44 };
45 
46 // -----------------------------------------------------------------------------
47 
48 /// \brief Create a first-guess estimate of the tropopause pressure that is based
49 /// on latitude with some adjustment for day-of-year. An optional parameter
50 /// can convert the final answer from pressure to height (convert_p2z: true).
51 /// The conversion is ultra simple approximation of ICAO std. atmosphere because
52 /// the code is making a tropopause *estimate* only. Additional options can
53 /// alter the default tropopause pressure at equator (135 hPa) and poles (360 hPa).
54 /// The code in this method is crude and purely designed for estimating the tropopause
55 /// when lacking a model-derived estimate that may otherwise arrive via GeoVaLs.
56 ///
57 /// ~~~
58 ///
59 /// ### Sample YAML configuration
60 /// - filter: Difference Check
61 /// filter variables:
62 /// - name: eastward_wind
63 /// - name: northward_wind
64 /// reference: TropopauseEstimate@ObsFunction
65 /// # options: # These options will not work yet with Difference Check
66 /// # - tropo_equator: 13000 # 130 hPa
67 /// # - tropo_pole: 37000 # 370 hPa
68 /// value: air_pressure@MetaData
69 /// minvalue: -5000 # 50 hPa above tropopause level, negative p-diff
70 ///
71 class TropopauseEstimate : public ObsFunctionBase<float> {
72  public:
73  static const std::string classname() {return "TropopauseEstimate";}
74 
75  explicit TropopauseEstimate(const eckit::LocalConfiguration &
76  = eckit::LocalConfiguration());
77  ~TropopauseEstimate();
78 
79  void compute(const ObsFilterData &, ioda::ObsDataVector<float> &) const;
80  const ufo::Variables & requiredVariables() const;
81  private:
82  ufo::Variables invars_;
83  TropopauseEstimateParameters options_;
84 };
85 
86 // -----------------------------------------------------------------------------
87 
88 } // namespace ufo
89 
90 #endif // UFO_FILTERS_OBSFUNCTIONS_TROPOPAUSEESTIMATE_H_
Two optional parameters permit overriding default tropopause pressure at the equator and poles (linea...
oops::Parameter< float > tropo_equator
oops::Parameter< float > tropo_pole
oops::Parameter< bool > convert_p2z
Definition: RunCRTM.h:27