12 #include "ioda/ObsDataVector.h"
13 #include "oops/util/missingValues.h"
20 static ObsFunctionMaker<ModelHeightAdjustedRelativeHumidity>
26 const eckit::LocalConfiguration & conf): invars_() {
45 std::vector<float> rh(
nlocs);
46 std::vector<float> T(
nlocs);
47 std::vector<float> ModelHeight(
nlocs);
48 std::vector<float> StationHeight(
nlocs);
50 in.
get(
Variable(
"relative_humidity_at_2m@ObsValue"), rh);
52 in.
get(
Variable(
"surface_altitude@GeoVaLs"), ModelHeight);
58 const std::vector<float> rhmax{100.00, 100.98, 101.97, 102.96, 103.97, 104.99,
59 106.01, 107.05, 108.10, 109.16, 110.23, 111.31,
60 112.40, 113.51, 114.62, 115.75, 116.88, 118.03,
61 119.19, 120.36, 121.54, 122.74, 123.94, 125.15,
62 126.38, 127.62, 128.87, 130.12, 131.39, 132.67,
63 133.96, 135.26, 136.58, 137.90, 139.23, 140.57,
64 141.92, 143.27, 144.64, 146.02, 147.40};
67 for (
size_t jj = 0; jj <
nlocs; ++jj) {
72 Tbin = std::max(0, std::min(40, Tbin));
73 float CorrectedRH = std::max(rh[jj] - 0.01*(StationHeight[jj] - ModelHeight[jj]), 0.0);
74 CorrectedRH = std::min(CorrectedRH, rhmax[Tbin]);
75 out[0][jj] = CorrectedRH;
ModelHeightAdjustedRelativeHumidityParameters parameters_
const ufo::Variables & requiredVariables() const
geovals required to compute the function
ModelHeightAdjustedRelativeHumidity(const eckit::LocalConfiguration &=eckit::LocalConfiguration())
void compute(const ObsFilterData &, ioda::ObsDataVector< float > &) const
compute the result of the function
oops::RequiredParameter< Variable > temperature
Temperature to be used.
oops::RequiredParameter< Variable > elevation
Input observation station height to be used.
ObsFilterData provides access to all data related to an ObsFilter.
size_t nlocs() const
Returns the number of locations in the associated ObsSpace.
void get(const Variable &varname, std::vector< float > &values) const
Fills a std::vector with values of the specified variable.
integer function nlocs(this)
Return the number of observational locations in this Locations object.
static ObsFunctionMaker< ModelHeightAdjustedRelativeHumidity > makerModelHeightAdjustedRelativeHumidity_("ModelHeightAdjustedRelativeHumidity")
static constexpr double t0c