The BioCro C++ Library
c3_canopy.cpp
Go to the documentation of this file.
1#include <cmath> // For floor
2#include "c3CanAC.h" // For c3CanAC
3#include "c3_temperature_response.h" // for c3_temperature_response_parameters
4#include "c3_canopy.h"
5
7
8string_vector c3_canopy::get_inputs()
9{
10 return {
11 "absorbed_longwave", // J / m^2 / s
12 "atmospheric_pressure", // Pa
13 "atmospheric_scattering", // dimensionless
14 "atmospheric_transmittance", // dimensionless
15 "b0", // mol / m^2 / s
16 "b1", // dimensionless
17 "beta_PSII", // dimensionless (fraction of absorbed light that reaches photosystem II)
18 "Catm", // ppm
19 "chil", // dimensionless
20 "cosine_zenith_angle", // dimensionless
21 "electrons_per_carboxylation", // electron / carboxylation
22 "electrons_per_oxygenation", // electron / oxygenation
23 "gbw_canopy", // m / s
24 "growth_respiration_fraction", // dimensionless
25 "Gs_min", // mol / m^2 / s
26 "Gstar_c", // dimensionless
27 "Gstar_Ea", // J / mol
28 "heightf", // m^(-1)
29 "Jmax_at_25", // micromol / m^2 / s
30 "Jmax_c", // dimensionless
31 "Jmax_Ea", // J / mol
32 "k_diffuse", // dimensionless
33 "Kc_c", // dimensionless
34 "Kc_Ea", // J / mol
35 "Ko_c", // dimensionless
36 "Ko_Ea", // J / mol
37 "kpLN",
38 "lai", // dimensionless
39 "leaf_reflectance_nir", // dimensionless
40 "leaf_reflectance_par", // dimensionless
41 "leaf_transmittance_nir", // dimensionless
42 "leaf_transmittance_par", // dimensionless
43 "LeafN",
44 "leafwidth", // m
45 "lnb0",
46 "lnb1",
47 "lnfun",
48 "nlayers", // dimensionless
49 "O2", // mmol / mol
50 "par_energy_content", // J / micromol
51 "par_energy_fraction", // dimensionless
52 "phi_PSII_0", // dimensionless
53 "phi_PSII_1", // (degrees C)^(-1)
54 "phi_PSII_2", // (degrees C)^(-2)
55 "rh", // dimensionless
56 "RL_at_25", // micromol / m^2 / s
57 "RL_c", // dimensionless
58 "RL_Ea", // J / mol
59 "solar", // micromol / m^2 / s
60 "StomataWS", // dimensionless
61 "temp", // degrees C
62 "theta_0", // dimensionless
63 "theta_1", // (degrees C)^(-1)
64 "theta_2", // (degrees C)^(-2)
65 "Tp_at_25", // micromol / m^2 / s
66 "Tp_c", // dimensionless
67 "Tp_Ha", // J / mol
68 "Tp_Hd", // J / mol
69 "Tp_S", // J / K / mol
70 "Vcmax_at_25", // micromol / m^2 / s
71 "Vcmax_c", // dimensionless
72 "Vcmax_Ea", // J / mol
73 "windspeed", // m / s
74 "windspeed_height" // m
75 };
76}
77
79{
80 return {
81 "canopy_assimilation_molar_flux", // micromol / m^2 / s
82 "canopy_conductance", // mol / m^2 / s
83 "canopy_gross_assimilation_molar_flux", // micromol / m^2 / s
84 "canopy_non_photorespiratory_CO2_release_molar_flux", // micromol / m^2 / s
85 "canopy_photorespiration_molar_flux", // micromol / m^2 / s
86 "canopy_transpiration_rate", // Mg / ha / hr
87 "whole_plant_growth_respiration_molar_flux" // micromol / m^2 / s
88 };
89}
90
91void c3_canopy::do_operation() const
92{
93 // Combine temperature response parameters
95 Gstar_c,
96 Gstar_Ea,
97 Jmax_c,
98 Jmax_Ea,
99 Kc_c,
100 Kc_Ea,
101 Ko_c,
102 Ko_Ea,
103 phi_PSII_0,
104 phi_PSII_1,
105 phi_PSII_2,
106 RL_c,
107 RL_Ea,
108 theta_0,
109 theta_1,
110 theta_2,
111 Tp_c,
112 Tp_Ha,
113 Tp_Hd,
114 Tp_S,
115 Vcmax_c,
116 Vcmax_Ea};
117
118 const canopy_photosynthesis_outputs can_result = c3CanAC(
119 tr_param,
120 absorbed_longwave,
121 temp,
122 atmospheric_pressure,
123 atmospheric_scattering,
124 atmospheric_transmittance,
125 b0,
126 b1,
127 beta_PSII,
128 Catm,
129 chil,
130 cosine_zenith_angle,
131 electrons_per_carboxylation,
132 electrons_per_oxygenation,
133 gbw_canopy,
134 growth_respiration_fraction,
135 Gs_min,
136 heightf,
137 Jmax_at_25,
138 k_diffuse,
139 kpLN,
140 lai,
141 leaf_reflectance_nir,
142 leaf_reflectance_par,
143 leaf_transmittance_nir,
144 leaf_transmittance_par,
145 leafwidth,
146 LeafN,
147 lnb0,
148 lnb1,
149 O2,
150 par_energy_content,
151 par_energy_fraction,
152 rh,
153 RL_at_25,
154 solar,
155 StomataWS,
156 Tp_at_25,
157 Vcmax_at_25,
158 windspeed,
159 windspeed_height,
160 lnfun,
161 nlayers);
162
163 // Update the output quantity list
164 update(canopy_assimilation_molar_flux_op, can_result.Assim); // micromol / m^2 / s
165 update(canopy_conductance_op, can_result.canopy_conductance); // mol / m^2 / s
166 update(canopy_gross_assimilation_molar_flux_op, can_result.GrossAssim); // micromol / m^2 / s
167 update(canopy_non_photorespiratory_CO2_release_rate_op, can_result.RL); // micromol / m^2 / s
168 update(canopy_photorespiration_molar_flux_op, can_result.Rp); // micromol / m^2 / s
169 update(canopy_transpiration_rate_op, can_result.Trans); // Mg / ha / hr
170 update(whole_plant_growth_respiration_molar_flux_op, can_result.whole_plant_gr); // micromol / m^2 / s
171}
canopy_photosynthesis_outputs c3CanAC(c3_temperature_response_parameters const tr_param, double absorbed_longwave, double ambient_temperature, double atmospheric_pressure, double atmospheric_scattering, double atmospheric_transmittance, double b0, double b1, double beta_PSII, double Catm, double chil, double cosine_zenith_angle, double electrons_per_carboxylation, double electrons_per_oxygenation, double gbw_canopy, double growth_respiration_fraction, double Gs_min, double heightf, double Jmax_at_25, double k_diffuse, double kpLN, double LAI, double leaf_reflectance_nir, double leaf_reflectance_par, double leaf_transmittance_nir, double leaf_transmittance_par, double leaf_width, double leafN, double lnb0, double lnb1, double o2, double par_energy_content, double par_energy_fraction, double RH, double RL_at_25, double solarR, double StomataWS, double Tp_at_25, double Vcmax_at_25, double WindSpeed, double WindSpeedHeight, int lnfun, int nlayers)
Definition: c3CanAC.cpp:11
static string_vector get_outputs()
Definition: c3_canopy.cpp:78
A simple structure for holding the output of canopy photosynthesis calculations.
double RL
Rate of non-photorespiratory CO2 release in the light (micromol / m^2 / s)
double canopy_conductance
Stomatal conductance to water vapor (mol / m^2 / s)
double Rp
Rate of photorespiration (micromol / m^2 / s)
double whole_plant_gr
Whole-plant growth respiration rate (micromol / m^2 / s)
double Assim
Net CO2 assimilation rate (micromol / m^2 / s)
double GrossAssim
Gross CO2 assimilation rate (micromol / m^2 / s)
double Trans
Transpiration rate (Mg / ha / hr)