4#include "../framework/constants.h"
5#include "../framework/quadratic_root.h"
9using calculation_constants::eps_zero;
10using physical_constants::dr_boundary;
105 double leaf_temperature,
106 double ambient_air_temperature
111 if (assimilation < 0) {
116 const double Cs = ambient_c -
117 (dr_boundary / gbw) * assimilation;
120 if (Cs < -eps_zero) {
121 throw std::range_error(
"Thrown in ball_berry_gs: Cs is negative.");
122 }
else if (Cs <= eps_zero) {
126 double const inf = std::numeric_limits<double>::infinity();
135 const double acs = assimilation / Cs;
137 const double swvp_ratio =
142 const double a = bb_slope * acs;
143 const double b = bb_offset + gbw - a;
144 const double c = -ambient_rh * gbw * swvp_ratio - bb_offset;
148 const double hs = std::min(1.0, quadratic_root_plus(a, b, c));
151 throw std::range_error(
"Thrown in ball_berry_gs: hs is less than 0.");
155 double const gswmol = a * hs + bb_offset;
stomata_outputs ball_berry_gs(double assimilation, double ambient_c, double ambient_rh, double bb_offset, double bb_slope, double gbw, double leaf_temperature, double ambient_air_temperature)
Calculates steady-state stomatal conductance to water vapor using the Ball-Berry model.
A simple structure for holding the output of stomatal conductance calculations.
double saturation_vapor_pressure(double air_temperature)
Determine saturation water vapor pressure (Pa) from air temperature (degrees C) using the Arden Buck ...