16 static TransformMaker<Cal_PressureFromHeightForProfile>
27 oops::Log::trace() <<
" --> Retrieve Pressure From Height (Profile)"
29 oops::Log::trace() <<
" --> method: " <<
method() << std::endl;
30 oops::Log::trace() <<
" --> formulation: " <<
formulation() << std::endl;
31 oops::Log::trace() <<
" --> obsName: " <<
obsName() << std::endl;
48 std::vector<float> airTemperature;
49 std::vector<float> airTemperatureSurface;
50 std::vector<float> geopotentialHeight;
51 std::vector<float> dewPointTemperature;
52 std::vector<float> dewPointTemperatureSurface;
53 std::vector<float> relativeHumidity;
54 std::vector<float> relativeHumiditySurface;
55 std::vector<float> pressureStation;
56 std::vector<float> stationElevation;
57 std::vector<float> airPressure;
66 bool hasBeenUpdated =
false;
68 const size_t nlocs_ =
obsdb_.nlocs();
69 ioda::ObsSpace::RecIdxIter irec;
84 if (airPressure.empty()) {
85 airPressure = std::vector<float>(nlocs_);
93 stationElevation,
true);
96 pressureStation,
true);
98 airTemperatureSurface,
true);
102 geopotentialHeight,
true);
104 airTemperature,
true);
109 dewPointTemperature);
110 if (dewPointTemperature.empty()) {
113 relativeHumidity,
true);
115 relativeHumiditySurface,
true);
118 dewPointTemperatureSurface,
true);
123 if (dewPointTemperature.empty()) {
124 if (!oops::allVectorsSameNonZeroSize(geopotentialHeight, airTemperature, relativeHumidity)) {
125 oops::Log::warning() <<
"Vector sizes: "
126 << oops::listOfVectorSizes(geopotentialHeight, airTemperature,
129 throw eckit::BadValue(
"At least one vector is the wrong size or empty out of "
130 "Z, T and Rh", Here());
133 if (!oops::allVectorsSameNonZeroSize(geopotentialHeight, airTemperature, dewPointTemperature)) {
134 oops::Log::warning() <<
"Vector sizes: "
135 << oops::listOfVectorSizes(geopotentialHeight, airTemperature,
138 throw eckit::BadValue(
"At least one vector is the wrong size or empty out of "
139 "Z, T and Td", Here());
146 for (irec =
obsdb_.recidx_begin(); irec !=
obsdb_.recidx_end(); ++irec) {
147 const std::vector<std::size_t> &rSort =
obsdb_.recidx_vector(irec);
151 Pprev = pressureStation[rSort[ilocs]];
152 Zprev = stationElevation[rSort[ilocs]];
153 Tprev = airTemperatureSurface[rSort[ilocs]];
162 if (dewPointTemperature.empty()) {
168 relativeHumiditySurface[rSort[ilocs]], Pvap, Pprev, Tprev,
formulation());
177 dewPointTemperatureSurface[rSort[ilocs]],
185 for (ilocs = 0; ilocs < rSort.size(); ++ilocs) {
187 if (!apply[rSort[ilocs]])
continue;
190 Zcurrent = geopotentialHeight[rSort[ilocs]];
191 Tcurrent = airTemperature[rSort[ilocs]];
200 if (dewPointTemperature.empty()) {
206 relativeHumidity[rSort[ilocs]], Pvap, Pprev, Tcurrent,
formulation());
214 dewPointTemperature[rSort[ilocs]],
221 airPressure[rSort[ilocs]] =
226 Pprev = airPressure[rSort[ilocs]];
229 hasBeenUpdated =
true;
233 if (hasBeenUpdated) {
254 oops::Log::trace() <<
" Retrieve Pressure From Height (ICAO)" << std::endl;
255 oops::Log::trace() <<
" --> method: " <<
method() << std::endl;
256 oops::Log::trace() <<
" --> formulation: " <<
formulation() << std::endl;
257 oops::Log::trace() <<
" --> obsName: " <<
obsName() << std::endl;
273 std::vector<float> geopotentialHeight;
274 std::vector<float> airPressure;
275 std::vector<float> airPressure_ref;
276 bool hasBeenUpdated =
false;
278 const size_t nlocs_ =
obsdb_.nlocs();
280 ioda::ObsSpace::RecIdxIter irec;
286 if (airPressure.empty()) {
287 airPressure = std::vector<float>(nlocs_);
298 if (oops::anyVectorEmpty(geopotentialHeight)) {
299 oops::Log::warning() <<
"GeopotentialHeight vector is empty. "
300 <<
"Check will not be performed." << std::endl;
301 throw eckit::BadValue(
"GeopotentialHeight vector is the wrong size or empty ", Here());
306 for (irec =
obsdb_.recidx_begin(); irec !=
obsdb_.recidx_end(); ++irec) {
307 const std::vector<std::size_t> &rSort =
obsdb_.recidx_vector(irec);
311 for (ilocs = 0; ilocs < rSort.size(); ++ilocs) {
313 if (!apply[rSort[ilocs]])
continue;
321 hasBeenUpdated =
true;
325 if (hasBeenUpdated) {
void methodUKMO(const std::vector< bool > &apply)
void runTransform(const std::vector< bool > &apply) override
Run variable conversion.
Cal_PressureFromHeightForICAO(const VariableTransformsParameters &options, const ObsFilterData &data, const std::shared_ptr< ioda::ObsDataVector< int >> &flags)
void runTransform(const std::vector< bool > &apply) override
Run variable conversion.
Cal_PressureFromHeightForProfile(const VariableTransformsParameters &options, const ObsFilterData &data, const std::shared_ptr< ioda::ObsDataVector< int >> &flags)
void methodUKMO(const std::vector< bool > &apply)
ObsFilterData provides access to all data related to an ObsFilter.
static TransformMaker< Cal_PressureFromHeightForICAO > makerCal_PressureFromHeightForICAO_("PressureFromHeightForICAO")
static TransformMaker< Cal_PressureFromHeightForProfile > makerCal_PressureFromHeightForProfile_("PressureFromHeightForProfile")
static constexpr double grav
static constexpr double rd