UFO
CLWRetMW.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2019 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_CLWRETMW_H_
9 #define UFO_FILTERS_OBSFUNCTIONS_CLWRETMW_H_
10 
11 #include <string>
12 #include <vector>
13 
14 #include "oops/util/parameters/OptionalParameter.h"
15 #include "oops/util/parameters/Parameter.h"
16 #include "oops/util/parameters/Parameters.h"
17 #include "oops/util/parameters/RequiredParameter.h"
18 
21 #include "ufo/filters/Variables.h"
22 
23 namespace ufo {
24 
25 ///
26 /// \brief Options applying to the retrieval of cloud liquid water from 23.8 GHz and
27 // 31.4 GHz channels.
28 ///
29 class CLWRetMWParameters : public oops::Parameters {
30  OOPS_CONCRETE_PARAMETERS(CLWRetMWParameters, Parameters)
31 
32  public:
33  /// channel number corresponding to 23.8 GHz to which the retrieval
34  /// of cloud liquid water applies
35  /// Example: AMSU-A channel numbers used in cloud liquid water retrieval
36  /// clwret_channels: 1
37  oops::OptionalParameter<int> ch238{"clwret_ch238", this};
38 
39  /// channel number corresponding to 31.4 GHz to which the retrieval
40  /// of cloud liquid water applies
41  /// Example: AMSU-A channel numbers used in cloud liquid water retrieval
42  /// clwret_channels: 2
43  oops::OptionalParameter<int> ch314{"clwret_ch314", this};
44 
45  /// Names of the data group used to retrieve the cloud liquid water
46  /// Example: get retrieved CLW from observation and simulated observation respectively
47  /// clwret_types: [ObsValue, HofX]
48  /// Example: get retrieved CLW from observation or simulated observation only
49  /// clwret_types: [ObsValue]
50  /// clwret_types: [HofX]
51  oops::RequiredParameter<std::vector<std::string>> varGroup{"clwret_types", this};
52 
53  /// Name of the data group to which the bias correction is applied (default is HofX)
54  /// Example: add bias corretion to simulated observation
55  /// bias_application: HofX
56  /// Example: add bias corretion to observation
57  /// bias_application: ObsValue
58  oops::Parameter<std::string> addBias{"bias_application", "HofX", this};
59 
60  /// Name of the bias correction group used to replace the default group (default is ObsBiasData)
61  /// Example: use observation bias correction values from GSI
62  /// test_bias: GsiObsBias
63  oops::Parameter<std::string> testBias{"test_bias", "ObsBiasData", this};
64 
65  /// Cloud index CIret_37v37h_diff:
66  /// 1.0 - (Tb_37v - Tb_37h)/(Tb_37v_clr - Tb_37h_clr), which is used in
67  /// all-sky DA. Tb_37v_clr and Tb_37h_clr for calculated Tb at 37V and 37H GHz from model values
68  /// assuming in clear-sky condition. Tb_37v and Tb_37h are Tb observations at 37 V and 37H GHz.
69  oops::OptionalParameter<int> ch37h{"clwret_ch37h", this};
70  oops::OptionalParameter<int> ch37v{"clwret_ch37v", this};
71 
72  /// For retrieving AMSR2 cloud liquid water.
73  oops::OptionalParameter<int> ch18h{"clwret_ch18h", this};
74  oops::OptionalParameter<int> ch18v{"clwret_ch18v", this};
75  oops::OptionalParameter<int> ch36h{"clwret_ch36h", this};
76  oops::OptionalParameter<int> ch36v{"clwret_ch36v", this};
77  oops::OptionalParameter<std::vector<float>> origbias{"sys_bias", this};
78 };
79 
80 ///
81 /// \brief Retrieve cloud liquid water from 23.8 GHz and 31.4 GHz channels.
82 ///
83 /// Reference: Grody et al. (2001)
84 /// Determination of precipitable water and cloud liquid water over oceans from
85 /// the NOAA 15 advanced microwave sounding unit
86 /// Journal of Geophysical Research (Vol. 106, No. D3, Pages 2943-2953)
87 ///
88 class CLWRetMW : public ObsFunctionBase<float> {
89  public:
90  explicit CLWRetMW(const eckit::LocalConfiguration &
91  = eckit::LocalConfiguration());
92  ~CLWRetMW();
93 
94  void compute(const ObsFilterData &,
96  const ufo::Variables & requiredVariables() const;
97  const std::vector<std::string> &clwVariableGroups() const {
98  return options_.varGroup.value();
99  }
100  static void cloudLiquidWater(const std::vector<float> &,
101  const std::vector<float> &,
102  const std::vector<float> &,
103  const std::vector<float> &,
104  const std::vector<float> &,
105  std::vector<float> &);
106  static void CIret_37v37h_diff(const std::vector<float> &,
107  const std::vector<float> &,
108  const std::vector<float> &,
109  const std::vector<float> &,
110  const std::vector<float> &,
111  std::vector<float> &);
112  static void clw_retr_amsr2(const std::vector<float> &,
113  const std::vector<float> &,
114  const std::vector<float> &,
115  const std::vector<float> &,
116  std::vector<float> &);
117  inline static float getBadValue() {return bad_clwret_value_;}
118 
119  private:
122  static constexpr float bad_clwret_value_ = 1000.f;
123 };
124 
125 // -----------------------------------------------------------------------------
126 
127 } // namespace ufo
128 
129 #endif // UFO_FILTERS_OBSFUNCTIONS_CLWRETMW_H_
Retrieve cloud liquid water from 23.8 GHz and 31.4 GHz channels.
Definition: CLWRetMW.h:88
const std::vector< std::string > & clwVariableGroups() const
Definition: CLWRetMW.h:97
CLWRetMWParameters options_
Definition: CLWRetMW.h:121
static void cloudLiquidWater(const std::vector< float > &, const std::vector< float > &, const std::vector< float > &, const std::vector< float > &, const std::vector< float > &, std::vector< float > &)
Definition: CLWRetMW.cc:266
void compute(const ObsFilterData &, ioda::ObsDataVector< float > &) const
compute the result of the function
Definition: CLWRetMW.cc:100
static float getBadValue()
Definition: CLWRetMW.h:117
static void CIret_37v37h_diff(const std::vector< float > &, const std::vector< float > &, const std::vector< float > &, const std::vector< float > &, const std::vector< float > &, std::vector< float > &)
Definition: CLWRetMW.cc:302
static constexpr float bad_clwret_value_
Definition: CLWRetMW.h:122
const ufo::Variables & requiredVariables() const
geovals required to compute the function
Definition: CLWRetMW.cc:364
CLWRetMW(const eckit::LocalConfiguration &=eckit::LocalConfiguration())
Definition: CLWRetMW.cc:27
static void clw_retr_amsr2(const std::vector< float > &, const std::vector< float > &, const std::vector< float > &, const std::vector< float > &, std::vector< float > &)
Retrieve AMSR2_GCOM-W1 cloud liquid water. This retrieval function is taken from the subroutine "retr...
Definition: CLWRetMW.cc:332
ufo::Variables invars_
Definition: CLWRetMW.h:120
Options applying to the retrieval of cloud liquid water from 23.8 GHz and.
Definition: CLWRetMW.h:29
oops::OptionalParameter< int > ch37h
Definition: CLWRetMW.h:69
oops::OptionalParameter< std::vector< float > > origbias
Definition: CLWRetMW.h:77
oops::OptionalParameter< int > ch238
Definition: CLWRetMW.h:37
oops::OptionalParameter< int > ch18v
Definition: CLWRetMW.h:74
oops::OptionalParameter< int > ch37v
Definition: CLWRetMW.h:70
oops::Parameter< std::string > testBias
Definition: CLWRetMW.h:63
oops::Parameter< std::string > addBias
Definition: CLWRetMW.h:58
oops::RequiredParameter< std::vector< std::string > > varGroup
Definition: CLWRetMW.h:51
oops::OptionalParameter< int > ch18h
For retrieving AMSR2 cloud liquid water.
Definition: CLWRetMW.h:73
oops::OptionalParameter< int > ch314
Definition: CLWRetMW.h:43
oops::OptionalParameter< int > ch36v
Definition: CLWRetMW.h:76
oops::OptionalParameter< int > ch36h
Definition: CLWRetMW.h:75
ObsFilterData provides access to all data related to an ObsFilter.
Definition: RunCRTM.h:27