15 #include "ioda/ObsDataVector.h"
40 const size_t nlevs = in.
nlevs(
Variable(
"air_pressure_levels@GeoVaLs"));
44 std::vector<float> q_mixrati(
nlocs);
45 std::vector<float> tcwv(
nlocs, 0.0);
46 std::vector<float> pre_lev0(
nlocs), pre_levl(
nlocs);
48 in.
get(
Variable(
"air_pressure_levels@GeoVaLs"), 0, pre_lev0);
49 for (
size_t ilev = 1; ilev < nlevs; ++ilev) {
50 in.
get(
Variable(
"air_pressure_levels@GeoVaLs"), ilev, pre_levl);
51 in.
get(
Variable(
"humidity_mixing_ratio@GeoVaLs"), ilev - 1, q_mixrati);
52 for (
size_t iloc = 0; iloc <
nlocs; ++iloc) {
54 q_mixrati[iloc] *= 0.001;
55 tcwv[iloc] = tcwv[iloc] + q_mixrati[iloc]/(q_mixrati[iloc]+1)
56 * fabs(pre_levl[iloc] - pre_lev0[iloc]);
60 for (
size_t iloc = 0; iloc <
nlocs; ++iloc) {
ObsFilterData provides access to all data related to an ObsFilter.
size_t nlocs() const
Returns the number of locations in the associated ObsSpace.
size_t nlevs(const Variable &) const
Returns the number of levels in the specified variable.
void get(const Variable &varname, std::vector< float > &values) const
Fills a std::vector with values of the specified variable.
void compute(const ObsFilterData &, ioda::ObsDataVector< float > &) const
compute the result of the function
TotalColumnVaporGuess(const eckit::LocalConfiguration &=eckit::LocalConfiguration())
const ufo::Variables & requiredVariables() const
geovals required to compute the function
integer function nlocs(this)
Return the number of observational locations in this Locations object.
static ObsFunctionMaker< TotalColumnVaporGuess > makerTotalColumnVaporGuess_("TotalColumnVaporGuess")
static constexpr double grav