The BioCro C++ Library
leaf_evapotranspiration.h
Go to the documentation of this file.
1#ifndef LEAF_EVAPOTRANSPIRATION_H
2#define LEAF_EVAPOTRANSPIRATION_H
3
4#include "../framework/module.h"
5#include "../framework/state_map.h"
7
8namespace standardBML
9{
16class leaf_evapotranspiration : public direct_module
17{
18 public:
19 leaf_evapotranspiration(state_map const& input_quantities, state_map* output_quantities)
20 : direct_module{},
21
22 // Get pointers to input quantities
23 absorbed_shortwave{get_input(input_quantities, "absorbed_shortwave")},
24 atmospheric_pressure{get_input(input_quantities, "atmospheric_pressure")},
25 canopy_height{get_input(input_quantities, "canopy_height")},
26 Gs{get_input(input_quantities, "Gs")},
27 leafwidth{get_input(input_quantities, "leafwidth")},
28 min_gbw_canopy{get_input(input_quantities, "min_gbw_canopy")},
29 rh{get_input(input_quantities, "rh")},
30 temp{get_input(input_quantities, "temp")},
31 windspeed{get_input(input_quantities, "windspeed")},
32 wind_speed_height{get_input(input_quantities, "wind_speed_height")},
33
34 // Get pointers to output quantities
35 EPenman_op{get_op(output_quantities, "EPenman")},
36 EPriestly_op{get_op(output_quantities, "EPriestly")},
37 E_loss_op{get_op(output_quantities, "E_loss")},
38 gbw_canopy_op{get_op(output_quantities, "gbw_canopy")},
39 gbw_leaf_op{get_op(output_quantities, "gbw_leaf")},
40 gbw_op{get_op(output_quantities, "gbw")},
41 gsw_op{get_op(output_quantities, "gsw")},
42 H_op{get_op(output_quantities, "H")},
43 leaf_temp_check_op{get_op(output_quantities, "leaf_temp_check")},
44 leaf_temperature_op{get_op(output_quantities, "leaf_temperature")},
45 PhiN_op{get_op(output_quantities, "PhiN")},
46 storage_op{get_op(output_quantities, "storage")},
47 TransR_op{get_op(output_quantities, "TransR")},
48 iterations_op{get_op(output_quantities, "iterations")}
49 {
50 }
51 static string_vector get_inputs();
52 static string_vector get_outputs();
53 static std::string get_name() { return "leaf_evapotranspiration"; }
54
55 private:
56 // Pointers to input quantities
57 double const& absorbed_shortwave;
58 double const& atmospheric_pressure;
59 double const& canopy_height;
60 double const& Gs;
61 double const& leafwidth;
62 double const& min_gbw_canopy;
63 double const& rh;
64 double const& temp;
65 double const& windspeed;
66 double const& wind_speed_height;
67
68 // Pointers to output quantities
69 double* EPenman_op;
70 double* EPriestly_op;
71 double* E_loss_op;
72 double* gbw_canopy_op;
73 double* gbw_leaf_op;
74 double* gbw_op;
75 double* gsw_op;
76 double* H_op;
77 double* leaf_temp_check_op;
78 double* leaf_temperature_op;
79 double* PhiN_op;
80 double* storage_op;
81 double* TransR_op;
82 double* iterations_op;
83
84 // Main operation
85 void do_operation() const;
86};
87
89{
90 return {
91 "absorbed_shortwave", // J / m^2 / s
92 "atmospheric_pressure", // Pa
93 "canopy_height", // m
94 "Gs", // mol / m^2 / s
95 "leafwidth", // m
96 "min_gbw_canopy", // m / s
97 "rh", // dimensionless from Pa / Pa
98 "temp", // degrees C
99 "windspeed", // m / s
100 "wind_speed_height" // m
101 };
102}
103
105{
106 return {
107 "EPenman", // mmol / m^2 / s
108 "EPriestly", // mmol / m^2 / s
109 "E_loss", // J / m^2 / s
110 "gbw", // m / s
111 "gbw_canopy", // m / s
112 "gbw_leaf", // m / s
113 "gsw", // m / s
114 "H", // J / m^2 / s
115 "leaf_temp_check", // degrees C
116 "leaf_temperature", // degrees C
117 "PhiN", // J / m^2 / s
118 "storage", // J / m^2 / s
119 "TransR", // mmol / m^2 / s
120 "iterations" // not a physical quantity
121 };
122}
123
124void leaf_evapotranspiration::do_operation() const
125{
126 // Get absorbed longwave radiation
127 double const absorbed_longwave =
128 1.0 * physical_constants::stefan_boltzmann *
129 pow(conversion_constants::celsius_to_kelvin + temp, 4); // J / m^2 / s
130
131 // Get canopy boundary layer conductance to water vapor
132 double const gbw_canopy = canopy_boundary_layer_conductance_thornley(
133 canopy_height,
134 windspeed,
135 min_gbw_canopy,
136 wind_speed_height); // m / s
137
139 absorbed_longwave,
140 absorbed_shortwave,
141 atmospheric_pressure,
142 temp,
143 gbw_canopy,
144 leafwidth,
145 rh,
146 Gs,
147 windspeed);
148
149 update(EPenman_op, result.EPenman);
150 update(EPriestly_op, result.EPriestly);
151 update(E_loss_op, result.E_loss);
152 update(gbw_canopy_op, result.gbw_canopy);
153 update(gbw_leaf_op, result.gbw_leaf);
154 update(gbw_op, result.gbw);
155 update(gsw_op, result.gsw);
156 update(H_op, result.H);
157 update(leaf_temp_check_op, result.leaf_temp_check);
158 update(iterations_op, result.iterations);
159 update(leaf_temperature_op, temp + result.Deltat);
160 update(PhiN_op, result.PhiN);
161 update(storage_op, result.storage);
162 update(TransR_op, result.TransR);
163}
164
165} // namespace standardBML
166#endif
double canopy_boundary_layer_conductance_thornley(double CanopyHeight, double WindSpeed, double minimum_gbw, double WindSpeedHeight)
Calculates the conductance for water vapor flow from the canopy across its boundary layer using a mod...
Uses leaf_energy_balance() to determine transpiration rate and leaf temperature.
leaf_evapotranspiration(state_map const &input_quantities, state_map *output_quantities)
energy_balance_outputs leaf_energy_balance(double absorbed_longwave_energy, double absorbed_shortwave_energy, double air_pressure, double air_temperature, double gbw_canopy, double leaf_width, double relative_humidity, double stomatal_conductance, double wind_speed)
Calculates leaf-level temperature and transpiration rate for a leaf within a canopy using a Penman-Mo...
This is the standard BioCro module library; it includes the essential modules used in typical BioCro ...
Definition: aba_decay.h:8
double gbw
Total boundary layer conductance to water vapor, for mass fluxes (m / s)
double storage
Rate of energy storage by the leaf; should be zero (J / m^2 / s)
double EPriestly
Priestly transpiration rate (mmol / m^2 / s)
double TransR
Transpiration rate (mmol / m^2 / s)
double leaf_temp_check
Equals zero if loop has converged (degrees C)
double EPenman
Potential transpiration rate (mmol / m^2 / s)
double gsw
Stomatal conductance to water vapor, for mass fluxes (m / s)
double E_loss
Rate of energy loss due to transpiration (J / m^2 / s)
size_t iterations
Number of iterations used by convergence loop.
double gbw_leaf
Leaf boundary layer conductance to water vapor, for mass fluxes (m / s)
double H
Rate of sensible heat loss (J / m^2 / s)
double gbw_canopy
Canopy boundary layer conductance to water vapor, for mass fluxes (m / s)
double Deltat
Temperature difference (leaf - air) (degrees C)
double PhiN
Net energy available for transpiration and heat loss (J / m^2 / s)