31 const blitz::Array<double, 1>& plevel = press_level->pressure_level();
33 blitz::Array<double, 1>::const_iterator lb_iter = std::lower_bound(plevel.begin(), plevel.end(), surf_p);
35 if (lb_iter != plevel.end())
36 nelem = lb_iter.position()(0) + 1;
38 if(nelem < 2 || nelem > plevel.rows())
39 throw Exception(
"Surface pressure is outside the range of the pressure levels");
45 double psurf_diff = surf_p.
value() - plevel(nelem-2);
46 double level_frac = (plevel(nelem-1) - plevel(nelem-2)) *
47 new_level_fractional_size;
48 if (psurf_diff < level_frac) nelem--;
52 Range r(0, nelem - 2);
53 pgrid.value(r) = plevel(r);
54 pgrid.value(nelem - 1) = surf_p;
68 coefficient()(0).
value()));
75 Os <<
"PressureFixedLevel:\n" 76 <<
" Surface pressure: " << surface_pressure().value.value() <<
"\n" 77 <<
" Retrieval Flag: " << (used_flag_value()(0) ?
"True\n":
79 <<
" Number active level: " << number_active_level() <<
"\n";
This is a filtering stream that adds a pad to the front of every line written out.
static const double new_level_fractional_size
Size a new level must be in porportion to the layer above it when resizing pressure grid due to moved...
virtual boost::shared_ptr< Pressure > clone() const
Clone a PressureFixedLevel object.
const Unit Pa("Pa", N/(m *m))
This is the base of the exception hierarchy for Full Physics code.
#define REGISTER_LUA_DERIVED_CLASS(X, Y)
Apply value function to a blitz array.
virtual void print(std::ostream &Os) const
Print to stream.
int number_variable() const
Number of variables in gradient.
virtual void calc_pressure_grid() const
Calculate the new pressure grid.
This class maintains the pressure portion of the state.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
const T & value() const
Convert to type T.
#define REGISTER_LUA_END()
This class maintains the pressure portion of the state.
double value(const FullPhysics::AutoDerivative< double > &Ad)