The BioCro C++ Library
sunML.cpp File Reference
#include "sunML.h"
+ Include dependency graph for sunML.cpp:

Go to the source code of this file.

Functions

double thin_layer_absorption (double R, double T, double I_0)
 Computes absorbed light from incident light for a thin layer of material. More...
 
double thick_layer_absorption (double R, double T, double I_0)
 Computes absorbed light from incident light for a thick layer of material. More...
 
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 photon flux density (PPFD; in micromol / m^2 / s). More...
 
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. More...
 
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). More...
 
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). More...
 
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). More...
 
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, solar zenith angle, and other parameters. More...
 

Function Documentation

◆ absorbed_shortwave()

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.

The total shortwave radiation absorbed by a leaf is the sum of the absorbed energy in the photosynthetically active radiation (PAR) and near-infrared (NIR) bands: total_absorbed = par_absorbed + nir_absorbed.

In each band, the absorbed radiation can be calculated from the incident radiation using the thin_layer_absorption() function with the appropriate values of leaf reflectance and transmission for each band.

The incident PAR energy can be calculated from the incident photosynthetically active photon flux density (PPFD) using the average energy per photon in the PAR band.

Parameters
[in]incident_nirEnergy flux in the NIR band incident on a leaf expressed in micromol / m^2 / s
[in]incident_ppfdPhotosynthetically active photon flux density (PPFD) incident on a leaf expressed in micromol / m^2 / s
[in]par_energy_contentThe average energy per photon in the PAR band expressed in J / micromol
[in]leaf_reflectance_parThe fractional amount of PAR band radiation reflected by the leaf
[in]leaf_transmittance_parThe fractional amount of PAR band radiation transmitted through the leaf
[in]leaf_reflectance_nirThe fractional amount of NIR band radiation reflected by the leaf
[in]leaf_transmittance_nirThe fractional amount of NIR band radiation transmitted through the leaf
Returns
The total shortwave radiation absorbed by the leaf expressed in J / m^2 / s

Definition at line 150 of file sunML.cpp.

References thin_layer_absorption().

Referenced by sunML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ downscattered_radiation()

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).

The downscattered radiation Q_sc is given by

Q_sc = Q_bt - Q_b [Equation (1)]

where Q_bt is the total beam radiation (direct and downscattered) and Q_b is the direct beam radiation. Q_bt can be calculated using the total_radiation() function, while Q_b is given by Equation 15.16:

Q_b = tau_b * Q_ob [Equation (2)]

where Q_ob is the beam radiation just above the canopy and tau_b is a transmission factor whose value decreases deeper into the canopy. tau_b is given by an un-numbered equation in the text which can be found just after Equation 15.17:

tau_b = exp(-k_direct * ell) [Equation (3)]

where k_direct is the canopy extinction coefficient for direct radiation, and ell is the cumulative leaf area index.

Combining Equations (1-3) above, we arrive at

Q_sc = Q_bt - Q_ob * exp(-sqrt(alpha) * k_direct * ell))

which is implemented in the code below.

Note that Q_ob and Q_bt are expressed on a ground area basis; in other words, they are fluxes of photons or energy passing through a horizontal surface. However, Q_sc is diffuse radiation; it is not directional, and its value represents the flux through any surface.

Parameters
[in]Q_obThe beam radiation just above the canopy expressed on a ground area basis using either quantum flux density (micromol / m^2 / s) or energy density (J / m^2 / s).
[in]k_directThe (dimensionless) canopy extinction coefficient for direct radiation.
[in]alpha_directThe (dimensionless) leaf absorptivity for direct radiation.
[in]ellThe cumulative leaf area index, which is dimensionless from m^2 leaf / m^2 ground.
Returns
The amount of downscattered radiation at depth ell in the canopy, expressed in the same units as Q_ob.

Definition at line 277 of file sunML.cpp.

References total_radiation().

Referenced by shaded_radiation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nir_from_ppfd()

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 photon flux density (PPFD; in micromol / m^2 / s).

We can calculate the energy in the photosynthetically active radiation (PAR) band from the PPFD using the average energy per photon in this band. Then, we can calculate the energy in the NIR band using the ratio of (PAR energy) / (total energy), which we call par_energy_fraction. If all shortwave energy is split between the PAR and NIR bands, then par_energy_fraction = PAR / (PAR + NIR), so NIR / PAR = (1 - par_energy_fraction) / par_energy_fraction.

Definition at line 101 of file sunML.cpp.

Referenced by sunML().

+ Here is the caller graph for this function:

◆ shaded_radiation()

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).

The radiation incident on shaded leaves (Q_sh) is given by

Q_sh = Q_d + Q_sc [Equation (1)]

where Q_d is diffuse flux from the sky and Q_sc is downscattered radiation that is produced as the direct beam is scattered by leaves. Q_sc can be calculated using the downscattered_radiation() function, while Q_d is given by Equation 15.17:

Q_d = tau_dt * Q_od [Equation (2)]

where Q_od is the diffuse radiation just above the canopy and tau_dt is a transmission factor whose value decreases deeper into the canopy. tau_dt is given by Equation 15.6, so Q_d can be calculated using the total_radiation() function.

Note that Q_ob and Q_od are expressed on a ground area basis; in other words, they are fluxes of photons or energy passing through a horizontal surface. However, Q_sh, Q_d, and Q_sc are diffuse radiation; they are not directional, and their values represent the flux through any surface.

Parameters
[in]Q_obThe direct radiation just above the canopy expressed on a ground area basis using either quantum flux density (micromol / m^2 / s) or energy density (J / m^2 / s).
[in]Q_odThe diffuse radiation just above the canopy expressed on a ground area basis using either quantum flux density (micromol / m^2 / s) or energy density (J / m^2 / s).
[in]k_directThe (dimensionless) canopy extinction coefficient for direct radiation.
[in]k_diffuseThe (dimensionless) canopy extinction coefficient for diffuse radiation.
[in]alphaThe (dimensionless) leaf absorptivity.
[in]ellThe cumulative leaf area index, which is dimensionless from m^2 leaf / m^2 ground.
Returns
The amount radiation incident on shaded leaves at depth ell in the canopy, expressed in the same units as Q_ob.

Definition at line 335 of file sunML.cpp.

References downscattered_radiation(), and total_radiation().

Referenced by sunML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sunML()

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, solar zenith angle, and other parameters.

Parameters
[in]ambient_ppfd_beamPhotosynthetically active photon flux density (PPFD) for beam light passing through a surface perpendicular to the beam direction at the top of the canopy; this represents direct sunlight for a plant in a field (micromol / (m^2 beam) / s)
[in]ambient_ppfd_diffusePhotosynthetically active photon flux density (PPFD) for diffuse light at the top of the canopy; this represents diffuse light scattered out of the solar beam by the Earth's atmosphere for a plant in a field; as a diffuse flux density, this represents the flux through any surface (micromol / m^2 / s)
[in]chilRatio of average projected areas of canopy elements on horizontal surfaces; for a spherical leaf distribution, chil = 0; for a vertical leaf distribution, chil = 1; for a horizontal leaf distribution, chil approaches infinity (dimensionless from m^2 / m^2)
[in]cosine_zenith_angleCosine of the solar zenith angle (dimensionless)
[in]heightfLeaf area density, i.e., LAI per height of canopy (m^-1 from m^2 leaf / m^2 ground / m height)
[in]k_diffuseExtinction coefficient for diffuse light (dimensionless)
[in]laiLeaf area index (LAI) of the entire canopy, which represents the leaf area per unit of ground area (dimensionless from m^2 leaf / m^2 ground)
[in]leaf_reflectance_nirThe fractional amount of NIR band radiation reflected by the leaf
[in]leaf_reflectance_parThe fractional amount of PAR band radiation reflected by the leaf
[in]leaf_transmittance_nirThe fractional amount of NIR band radiation transmitted through the leaf
[in]leaf_transmittance_parThe fractional amount of PAR band radiation transmitted through the leaf
[in]par_energy_contentThe average energy per photon in the PAR band expressed in J / micromol
[in]par_energy_fractionThe fraction of total shortwave energy in the PAR band
[in]nlayersInteger number of layers in the canopy
Returns
An n-layered light profile representing quantities within the canopy, including several photon flux densities and the relative fractions of shaded and sunlit leaves

Definition at line 408 of file sunML.cpp.

References absorbed_shortwave(), Light_profile::canopy_direct_transmission_fraction, Light_profile::height, MAXLAY, nir_from_ppfd(), Light_profile::shaded_absorbed_ppfd, Light_profile::shaded_absorbed_shortwave, Light_profile::shaded_fraction, Light_profile::shaded_incident_nir, Light_profile::shaded_incident_ppfd, shaded_radiation(), Light_profile::sunlit_absorbed_ppfd, Light_profile::sunlit_absorbed_shortwave, Light_profile::sunlit_fraction, Light_profile::sunlit_incident_nir, Light_profile::sunlit_incident_ppfd, and thin_layer_absorption().

Referenced by c3CanAC(), CanAC(), and multilayer_canopy_properties::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ thick_layer_absorption()

double thick_layer_absorption ( double  R,
double  T,
double  I_0 
)

Computes absorbed light from incident light for a thick layer of material.

Suppose light of intensity I_0 (representing a flux density of photons or energy, expressed in units of photons per area per time, or energy per area per time) is incident on an infinitely thick layer of a material that reflects, absorbs, and transmits light. If R and T represent the fractions of light reflected by and transmitted through a thin layer of the material, then we can calculate the light absorbed by an infinitely thick layer of the material (I_abs) as follows:

I_abs = I_0 * (1 - R - T) / (1 - T) [Equation (1)]

In this equation, the factor (1 - R - T) / (1 - T) represents the fraction of light absorbed by the thick layer. See the "Light Absorption by a Thick Layer" vignette for more information about this equation.

Parameters
[in]RThe fractional amount of light reflected by a thin layer of the material in the appropriate wavelength band; note that this reflectance is not necessary the same as would be measured from a thin layer in isolation.
[in]TThe fractional amount of light transmitted by a thin layer of the material in the appropriate wavelength band; note that this transmittance is not necessary the same as would be measured from a thin layer in isolation.
[in]I_0The amount of light incident on the material, perhaps restricted to a particular wavelength band; for quantum fluxes, the units will typically be micromol / m^2 / s; for energy fluxes, the units will typically be J / m^2 / s.
Returns
The amount of radiation absorbed by the material expressed in the same units as I_0.

Definition at line 79 of file sunML.cpp.

Referenced by SoilEvapo().

+ Here is the caller graph for this function:

◆ thin_layer_absorption()

double thin_layer_absorption ( double  R,
double  T,
double  I_0 
)

Computes absorbed light from incident light for a thin layer of material.

Suppose light of intensity I_0 (representing a flux density of photons or energy, expressed in units of photons per area per time, or energy per area per time) is incident on a thin layer of a material that reflects, absorbs, and transmits light. If R and T represent the fractions of light reflected by and transmitted through the layer, then we can calculate the light absorbed by the layer (I_abs) as follows:

I_abs = I_0 * (1 - R - T) [Equation (1)]

In this equation, the factor (1 - R - T) represents the fraction of light absorbed by the layer. In BioCro, this equation is often used to calculate the light absorbed by a leaf or a thin layer of leaf material.

Parameters
[in]RThe fractional amount of light reflected by a thin layer of the material in the appropriate wavelength band.
[in]TThe fractional amount of light transmitted by a thin layer of the material in the appropriate wavelength band.
[in]I_0The amount of light incident on the material, perhaps restricted to a particular wavelength band; for quantum fluxes, the units will typically be micromol / m^2 / s; for energy fluxes, the units will typically be J / m^2 / s.
Returns
The amount of radiation absorbed by the material expressed in the same units as I_0.

Definition at line 34 of file sunML.cpp.

Referenced by absorbed_shortwave(), and sunML().

+ Here is the caller graph for this function:

◆ total_radiation()

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).

The total radiation Q_t is given by

Q_t = tau * Q_o [Equation (1)]

where Q_o is the radiation just above the canopy and tau is a transmission factor whose value decreases deeper into the canopy. tau is given by Equation 15.6:

tau = exp(-sqrt(alpha) * k * ell) [Equation (2)]

where alpha is the leaf absorptivity, k is the canopy extinction coefficient, and ell is the cumulative leaf area index. Combining Equations (1) and (2), we have

Q_t = Q_o * exp(-sqrt(alpha) * k * ell) [Equation (3)]

which is implemented in the code below.

Note that Q_o and Q_t are expressed on a ground area basis; in other words, they are fluxes of photons or energy passing through a horizontal surface.

Also note that this equation can be used for direct or diffuse radiation, provided appropriate values of Q_o, alpha and k are used.

Parameters
[in]Q_oThe radiation just above the canopy expressed on a ground area basis using either quantum flux density (micromol / m^2 / s) or energy density (J / m^2 / s).
[in]kThe (dimensionless) canopy extinction coefficient.
[in]alphaThe (dimensionless) leaf absorptivity.
[in]ellThe cumulative leaf area index, which is dimensionless from m^2 leaf / m^2 ground.
Returns
The total radiation (direct and downscattered) at depth ell in the canopy, expressed in the same units as Q_o.

Definition at line 216 of file sunML.cpp.

Referenced by downscattered_radiation(), and shaded_radiation().

+ Here is the caller graph for this function: