1 #include <boost/algorithm/string.hpp> 13 typedef Array<double, 1> (
Meteorology::*f_val)()
const;
14 typedef Array<double, 1> (
Meteorology::*f_interp)(
const Array<double, 1>&)
const;
16 typedef Array<double, 1> (
Meteorology::*f_vmr)(
const std::string&)
const;
17 typedef Array<double, 1> (
Meteorology::*f_vmr_interp)(
const std::string&,
const Array<double, 1>&)
const;
22 .def(
"specific_humidity", ((f_interp) &Meteorology::specific_humidity))
24 .def(
"vmr", ((f_vmr_interp) &Meteorology::vmr))
26 .def(
"temperature", ((f_interp) &Meteorology::temperature))
36 return interpolate_to_grid(specific_humidity(), Pressure_level);
39 Array<double, 1>
Meteorology::vmr(
const std::string& Species,
const Array<double, 1>& Pressure_level)
const 41 return interpolate_to_grid(vmr(Species), Pressure_level);
46 return interpolate_to_grid(temperature(), Pressure_level);
51 return sqrt(
sqr(windspeed_u()) +
sqr(windspeed_v()) );
56 std::string species_upper = Species;
57 boost::to_upper(species_upper);
58 if (species_upper ==
"H2O") {
62 err <<
"Can not return VMR species " << Species <<
" handling has not been defined.";
69 Array<double, 1>
s = specific_humidity();
70 Array<double, 1> vmr(s.shape());
78 Array<double, 1> prof_res(Dest_pressure_levels.shape());
79 for(
int i = 0; i < Dest_pressure_levels.rows(); ++i) {
80 prof_res(i) = prof_interp(Dest_pressure_levels(i));
virtual double surface_pressure() const =0
Surface pressure in Pascals.
const Unit s("s", 1.0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0)
Defines the interface for supplying meteorological data.
virtual double windspeed_u() const =0
The U component windspeed in m/s.
virtual double windspeed() const
Windspeed magnitude in m/s for the surface.
This is the base of the exception hierarchy for Full Physics code.
virtual blitz::Array< double, 1 > specific_humidity() const =0
Specific humidty on the meteorological pressure levels.
#define REGISTER_LUA_CLASS(X)
Apply value function to a blitz array.
virtual blitz::Array< double, 1 > vmr(const std::string &Species) const
Volume mixing ratio for a particular species on the meteorological pressure levels.
virtual double windspeed_v() const =0
The V component windspeed in m/s.
const double molar_weight_dry_air
Molar weight of dry air, in g mol^-1.
const double molar_weight_water
Molar weight of water, in g mol^-1.
virtual blitz::Array< double, 1 > pressure_levels() const =0
Pressure levels in Pascals used for provided meteorological data.
virtual blitz::Array< double, 1 > temperature() const =0
Temperature profile in Kelvins on the meteorological pressure levels.
blitz::Array< double, 1 > interpolate_to_grid(const blitz::Array< double, 1 > &Profile, const blitz::Array< double, 1 > &Dest_pressure_levels) const
Interpolates a profile of data from the internal pressure grid to the supplied one.
Wrapper around LinearInterpolate that uses log(x) and log(y) rather than x and y when interpolating...
Contains classes to abstract away details in various Spurr Radiative Transfer software.
#define REGISTER_LUA_END()
virtual blitz::Array< double, 1 > h2o_vmr() const
Return the H20 VMR.