40 return I_0 * (1 - R - T);
85 return I_0 * (1 - R - T) / (1 - T);
103 double par_energy_content,
104 double par_energy_fraction
107 return ppfd * par_energy_content *
108 (1 - par_energy_fraction) / par_energy_fraction;
152 double incident_ppfd,
153 double par_energy_content,
154 double leaf_reflectance_par,
155 double leaf_transmittance_par,
156 double leaf_reflectance_nir,
157 double leaf_transmittance_nir
161 leaf_reflectance_par,
162 leaf_transmittance_par,
163 incident_ppfd * par_energy_content);
166 leaf_reflectance_nir,
167 leaf_transmittance_nir,
170 return absorbed_par + absorbed_nir;
223 return Q_o * exp(-k * sqrt(alpha) * ell);
285 Q_ob * exp(-k_direct * ell);
409 double ambient_ppfd_beam,
410 double ambient_ppfd_diffuse,
412 double cosine_zenith_angle,
416 double leaf_reflectance_nir,
417 double leaf_reflectance_par,
418 double leaf_transmittance_nir,
419 double leaf_transmittance_par,
420 double par_energy_content,
421 double par_energy_fraction,
425 if (nlayers < 1 || nlayers >
MAXLAY) {
426 throw std::out_of_range(
"nlayers must be at least 1 but no more than MAXLAY.");
429 if (cosine_zenith_angle > 1 || cosine_zenith_angle < -1) {
430 throw std::out_of_range(
"cosine_zenith_angle must be between -1 and 1.");
433 if (k_diffuse > 1 || k_diffuse < 0) {
434 throw std::out_of_range(
"k_diffuse must be between 0 and 1.");
438 throw std::out_of_range(
"chil must be non-negative.");
442 throw std::out_of_range(
"heightf must greater than zero.");
446 double const absorptivity_nir = 1.0 - leaf_reflectance_nir - leaf_transmittance_nir;
447 double const absorptivity_par = 1.0 - leaf_reflectance_par - leaf_transmittance_par;
449 if (absorptivity_par > 1 || absorptivity_par < 0) {
450 throw std::out_of_range(
"absorptivity_par must be between 0 and 1.");
453 if (absorptivity_nir > 1 || absorptivity_nir < 0) {
454 throw std::out_of_range(
"absorptivity_nir must be between 0 and 1.");
464 double zenith_angle = acos(cosine_zenith_angle);
465 double k0 = sqrt(pow(chil, 2) + pow(tan(zenith_angle), 2));
466 double k1 = chil + 1.744 * pow((chil + 1.182), -0.733);
467 double k_direct = k0 / k1;
469 double lai_per_layer = lai / nlayers;
477 double canopy_direct_transmission_fraction =
478 cosine_zenith_angle <= 1E-10 ? 0.0 : exp(-k_direct * lai);
481 const double ambient_ppfd_beam_ground = ambient_ppfd_beam * cosine_zenith_angle;
484 double ambient_ppfd_beam_leaf = ambient_ppfd_beam_ground * k_direct;
488 ambient_ppfd_beam, par_energy_content, par_energy_fraction);
491 ambient_ppfd_beam_ground, par_energy_content, par_energy_fraction);
494 ambient_ppfd_diffuse, par_energy_content, par_energy_fraction);
497 ambient_ppfd_beam_leaf, par_energy_content, par_energy_fraction);
504 for (
int i = 0; i < nlayers; ++i) {
507 const double cumulative_lai = lai_per_layer * (i + 0.5);
511 ambient_ppfd_beam_ground, ambient_ppfd_diffuse,
513 absorptivity_par, cumulative_lai);
517 ambient_nir_beam_ground, ambient_nir_diffuse,
519 absorptivity_nir, cumulative_lai);
523 double sunlit_fraction = exp(-k_direct * cumulative_lai);
524 double shaded_fraction = 1 - sunlit_fraction;
529 if (cosine_zenith_angle <= 1E-10) {
530 ambient_ppfd_beam_leaf = ambient_ppfd_beam / k1;
531 ambient_nir_beam_leaf = ambient_nir_beam / k1;
532 shaded_ppfd = ambient_ppfd_diffuse * exp(-k_diffuse * cumulative_lai);
533 shaded_nir = ambient_nir_diffuse * exp(-k_diffuse * cumulative_lai);
539 light_profile.
height[i] = (lai - cumulative_lai) / heightf;
550 leaf_reflectance_par,
551 leaf_transmittance_par,
552 ambient_ppfd_beam_leaf + shaded_ppfd);
556 leaf_reflectance_par,
557 leaf_transmittance_par,
563 ambient_nir_beam_leaf + shaded_nir,
564 ambient_ppfd_beam_leaf + shaded_ppfd,
566 leaf_reflectance_par,
567 leaf_transmittance_par,
568 leaf_reflectance_nir,
569 leaf_transmittance_nir);
576 leaf_reflectance_par,
577 leaf_transmittance_par,
578 leaf_reflectance_nir,
579 leaf_transmittance_nir);
581 return light_profile;
double shaded_fraction[MAXLAY]
double sunlit_incident_nir[MAXLAY]
double shaded_incident_nir[MAXLAY]
double sunlit_absorbed_ppfd[MAXLAY]
double sunlit_fraction[MAXLAY]
double shaded_incident_ppfd[MAXLAY]
double sunlit_incident_ppfd[MAXLAY]
double shaded_absorbed_shortwave[MAXLAY]
double sunlit_absorbed_shortwave[MAXLAY]
double canopy_direct_transmission_fraction
double shaded_absorbed_ppfd[MAXLAY]
double shaded_radiation(double Q_ob, double Q_od, double k_direct, double k_diffuse, double alpha, double ell)
Computes the radiation incident on shaded leaves using Equation 15.19 from Campbell & Norman (1998).
Light_profile sunML(double ambient_ppfd_beam, double ambient_ppfd_diffuse, double chil, double cosine_zenith_angle, double heightf, double k_diffuse, double lai, double leaf_reflectance_nir, double leaf_reflectance_par, double leaf_transmittance_nir, double leaf_transmittance_par, double par_energy_content, double par_energy_fraction, int nlayers)
Computes an n-layered light profile from the direct light, diffuse light, leaf area index,...
double absorbed_shortwave(double incident_nir, double incident_ppfd, double par_energy_content, double leaf_reflectance_par, double leaf_transmittance_par, double leaf_reflectance_nir, double leaf_transmittance_nir)
Computes total shortwave radiation absorbed by a leaf.
double thin_layer_absorption(double R, double T, double I_0)
Computes absorbed light from incident light for a thin layer of material.
double downscattered_radiation(double Q_ob, double k_direct, double alpha_direct, double ell)
Computes downscattered radiation using Equation 15.20 from Campbell & Norman (1998).
double total_radiation(double Q_o, double k, double alpha, double ell)
Computes total radiation (direct and downscattered) using Equation 15.15 from Campbell & Norman (1998...
double nir_from_ppfd(double ppfd, double par_energy_content, double par_energy_fraction)
Computes energy flux in the near-infrared band (in J / m^2 / s) from the photosynthetically active ph...
double thick_layer_absorption(double R, double T, double I_0)
Computes absorbed light from incident light for a thick layer of material.