SoilPlantAirContinuum

Types

SoilPlantAirContinuum.SPACContainer1LType
mutable struct SPACContainer1L{FT}

Struct that contains 1-layer gas exchange information.

Fields

  • ag

    Mean gross photosynthetic rate [μmol m⁻² s⁻¹]

  • an

    Mean net photosynthetic rate [μmol m⁻² s⁻¹]

  • c

    Leaf internal CO₂ partial pressure [Pa]

  • e

    Flow rate per basal area [mol s⁻¹ m⁻²]

  • gh

    Leaf diffusive conductance to H₂O [mol m⁻² s⁻¹]

  • p

    Xylem end pressure [MPa]

  • t

    Leaf temperature [K]

source
SoilPlantAirContinuum.SPACContainer2LType
mutable struct SPACContainer2L{FT}

Struct that contains 2-layer gas exchange information.

Fields

  • cont_sh

  • cont_sl

  • frac_sh

    Shaded layer fraction

  • frac_sl

    Sunlit layer fraction

  • la_sh

    Shaded layer leaf area [m²]

  • la_sl

    Sunlit layer leaf area [m²]

  • lai_sh

    Shaded layer LAI

  • lai_sl

    Sunlit layer LAI

  • par_sh

    Shaded layer PAR [μmol m⁻² s⁻¹]

  • par_sl

    Sunlit layer PAR [μmol m⁻² s⁻¹]

  • rad_sh

    Shaded layer absorbed energy [W m⁻²]

  • rad_sl

    Sunlit layer absorbed energy [W m⁻²]

source
SoilPlantAirContinuum.SPACMonoType
mutable struct SPACMono{FT}

Struct that mono species SoilPlantAirContinuum system.

Fields

  • soil_bounds

    Soil layers bounds [m]

  • air_bounds

    Air layers bounds [m]

  • z_root

    Root depth [m]

  • z_canopy

    Canopy maximal height [m]

  • plant_hs

    Plant hydraulic system

  • n_canopy

    Number of canopy layers

  • n_root

    Number of root layers

  • plant_ps

    Plant photosynthesis systems

  • ba

    Basal area [m²]

  • ga

    Ground area [m²]

  • la

    Leaf area [m²]

  • envirs

    Air layers

  • mswc

    Maximal soil water content

  • swc

    Current soil water content

  • p_soil

    Array of soil matric potential [MPa]

  • h_soil

    Maximal soil depth [m]

  • latitude

    Latitude [°]

  • longitude

    Longitude [°]

  • elevation

    Elevation [m]

  • photo_set

    Photosynthesis parameter set

  • stomata_model

    Stomatal behavior scheme

  • angles

    Solar angle container

  • canopy_rt

    Canopy4RT container

  • wl_set

    Wave length container

  • rt_dim

    RT dimensions

  • can_rad

    CanopyRads container

  • can_opt

    CanopyOpticals container

  • leaves_rt

    Array of LeafBios container

  • soil_opt

    SoilOpticals container

  • in_rad

    Incoming radiation container

  • rt_con

    RT container

source
SoilPlantAirContinuum.SPACSimpleType
mutable struct SPACSimple{FT}

Struct that simplest mono species SoilPlantAirContinuum system, with 1 root, stem, and leaf.

Fields

  • hs

    Hydraulic systems

  • ec

    Critical flow rate

  • ps

    Photosynthesis system

  • vtoj

    Ratio between Vcmax25 and Jmax25

  • envir

    Environmental conditions

  • container1L

    Container for gas exchange for a layer

  • container2L

    Container for gas exchange of sunlit and shaded layers

  • containerKS

    Container for default hydraulic conductance

  • containerOP

    Container for optimizer

  • opt_f_sl

    Container for optimal sunlit layer flow rate

  • opt_f_sh

    Container for optimal shaded layer flow rate

  • opt_laba

    Container for optimal leaf area per basal area

  • opt_vmax

    Container for optimal Vcmax25

  • lai

    Leaf area index

  • laba

    Leaf area per basal area

  • g_max

    Maximal stomatal conductance limit at 25 °C

  • gaba

    Ground area per basal area

  • width

    Leaf width

  • mswc

    Maximal soil water content

  • swc

    Current soil water content

  • p_soil

    Soil matrical water potential

  • h_soil

    Soil depth, 2X mean root depth

  • c_cons

    Leaf construction cost per leaf area

  • c_vmax

    Leaf nutrient cost per Vcmax25 per leaf area

  • latitude

    Latitude [°]

  • longitude

    Longitude [°]

  • elevation

    Elevation [m]

source

Soil

SoilPlantAirContinuum.soil_moisture_p25!Function
soil_moisture_p25!(node::SPACSimple{FT}, p_25::FT) where {FT<:AbstractFloat}

Update soil moisture and soil matrix potential, given

  • nodeSPACSimple type struct
  • p_25 Given soil maxtrix potential at 25 Celcius
SoilPlantAirContinuum.soil_moisture!Function
soil_moisture!(node::SPACSimple{FT}, flow, dt=1.0) where {FT<:AbstractFloat}

Update soil moisture and soil matrix potential, given

  • nodeSPACSimple type struct
  • flow Mean outlet flow rate in [Kg h⁻¹]
  • Δt Time period in [h]

Planet

SoilPlantAirContinuum.zenith_angleFunction
zenith_angle(latd::FT, decd::FT, lhad::FT) where {FT<:AbstractFloat}
zenith_angle(latd::FT, day::FT, hour::FT, minute::FT) where {FT<:AbstractFloat}

Calculate the zenith angle, given

  • latd Latitude in degree
  • decd Declination of the Sun in degree
  • lhad Local hour angle in degree
  • day Day of year
  • hour Hour of day
  • minute Minute of hour

Big-leaf model

SoilPlantAirContinuum.gain_risk_mapFunction
gain_risk_map(node::SPACSimple{FT}, photo_set::AbstractPhotoModelParaSet{FT}) where {FT<:AbstractFloat}

Return the matrix of optimizers at different sunlit and shaded layer flow rates, given

  • node [SPACSimple] type struct
  • photo_set [AbstractPhotoModelParaSet] type photosynthesis parameter set
SoilPlantAirContinuum.leaf_gas_exchange_nonopt!Function
leaf_gas_exchange_nonopt!(node::SPACSimple{FT}, photo_set::AbstractPhotoModelParaSet{FT}, flow::FT, par::FT, rad::FT, la::FT, container::SPACContainer1L{FT}) where {FT<:AbstractFloat}
leaf_gas_exchange_nonopt!(node::SPACSimple{FT}, photo_set::AbstractPhotoModelParaSet{FT}, flow::FT) where {FT<:AbstractFloat}
leaf_gas_exchange_nonopt!(node::SPACSimple{FT}, photo_set::AbstractPhotoModelParaSet{FT}, f_sl::FT, f_sh::FT) where {FT<:AbstractFloat}

Simulate leaf level gas exchange and fill it into the container for 1-layer or 2-layer canopy, given

  • node [SPACSimple] type struct
  • photo_set [AbstractPhotoModelParaSet] type struct
  • flow Flow rate per basal area into the leaves (e.g., for sunlit leaves)
  • f_sl Flow rate per basal area into the sunlit leaves
  • f_sh Flow rate per basal area into the shaded leaves
  • par Leaf-level photosynthetic active radiation
  • rad Leaf-level absorbed radiative energy
  • la Leaf area of the leaves (total or each layer)
  • container [SPACContainer1L] type container
SoilPlantAirContinuum.leaf_gas_exchange!Function
leaf_gas_exchange!(node::SPACSimple{FT}, photo_set::AbstractPhotoModelParaSet{FT}, flow::FT, par::FT, rad::FT, la::FT, container::SPACContainer1L{FT}) where {FT<:AbstractFloat}
leaf_gas_exchange!(node::SPACSimple{FT}, photo_set::AbstractPhotoModelParaSet{FT}, flow::FT) where {FT<:AbstractFloat}
leaf_gas_exchange!(node::SPACSimple{FT}, photo_set::AbstractPhotoModelParaSet{FT}, f_sl::FT, f_sh::FT) where {FT<:AbstractFloat}

Simulate leaf level gas exchange and fill it into the container for 1-layer or 2-layer canopy, given

  • node [SPACSimple] type struct
  • photo_set [AbstractPhotoModelParaSet] type struct
  • flow Flow rate per basal area into the leaves (e.g., for sunlit leaves)
  • f_sl Flow rate per basal area into the sunlit leaves
  • f_sh Flow rate per basal area into the shaded leaves
  • par Leaf-level photosynthetic active radiation
  • rad Leaf-level absorbed radiative energy
  • la Leaf area of the leaves (total or each layer)
  • container [SPACContainer1L] type container
SoilPlantAirContinuum.optimize_flows!Function
optimize_flows!(node::SPACSimple{FT}, photo_set::AbstractPhotoModelParaSet{FT}) where {FT<:AbstractFloat}

Optimize the flow rates in sunlit and shaded layers, given

  • node [SPACSimple] type struct
  • photo_set [AbstractPhotoModelParaSet] type struct
SoilPlantAirContinuum.big_leaf_partition!Function
big_leaf_partition!(node::SPACSimple{FT}, zenith::FT, r_all::FT) where {FT <:AbstractFloat}

Partition the big-leaf canopy into sunlit and shaded layers, given

  • partition Container for partition
  • zenith Zenith angle in degree
  • r_all Total radiation in [W m⁻²]
SoilPlantAirContinuum.leaf_temperatureFunction
leaf_temperature(node::SPACSimple{FT}, rad::FT, e_rad::FT, epla::FT) where {FT<:AbstractFloat}
leaf_temperature(node::SPACSimple{FT}, rad::FT, flow::FT) where {FT<:AbstractFloat}

Return leaf temperature, given

  • nodeSPACSimple type struct
  • rad Absorbed solar radiation per leaf area
  • e_rad Emitted absorbed radiation per leaf area
  • epla Flow rate per leaf area
  • flow Total flow rate per basal area
SoilPlantAirContinuum.leaf_temperature_sunlitFunction
leaf_temperature_sunlit(node::SPACSimple{FT}, rad::FT, f_sl::FT) where {FT<:AbstractFloat}

Return leaf temperature, given

  • nodeSPACSimple type struct
  • rad Absorbed solar radiation per leaf area
  • f_sl Total flow rate per basal area into sunlit leaves
SoilPlantAirContinuum.leaf_temperature_shadedFunction
leaf_temperature_shaded(node::SPACSimple{FT}, rad::FT, f_sh::FT) where {FT<:AbstractFloat}

Return leaf temperature, given

  • nodeSPACSimple type struct
  • rad Absorbed solar radiation per leaf area
  • f_sh Total flow rate per basal area into shaded leaves
SoilPlantAirContinuum.annual_profitFunction
annual_profit(node::SPACSimple{FT}, photo_set::AbstractPhotoModelParaSet{FT}, weather::Array{FT,2}) where {FT<:AbstractFloat}

Calculate the profit in the growing season so as to optimize leaf investment, given

  • node [SPACSimple] type struct
  • photo_set [AbstractPhotoModelParaSet] type struct
  • weather Weather profile in a growing season
SoilPlantAirContinuum.annual_simulation!Function
annual_simulation!(node::SPACSimple{FT}, photo_set::AbstractPhotoModelParaSet{FT}, weather::DataFrame, output::DataFrame) where {FT<:AbstractFloat}

Run annual simulation for a growing season, given

  • node [SPACSimple] type struct
  • photo_set [AbstractPhotoModelParaSet] type struct
  • weather Weather profile in a growing season
  • output The predefined output result
SoilPlantAirContinuum.create_dataframeFunction
function create_dataframe(FT, weather::DataFrame)

Create a data frame to storesimulation output, given

  • FT Floating number type
  • weather Weather profile in a growing season

Optimal investment

SoilPlantAirContinuum.leaf_allocation!Function
leaf_allocation!(node::SPACSimple{FT}, laba::FT) where {FT<:AbstractFloat}
leaf_allocation!(node::SPACSimple{FT}, photo_set::AbstractPhotoModelParaSet{FT}, vmax::FT) where {FT<:AbstractFloat}
leaf_allocation!(node::SPACSimple{FT}, photo_set::AbstractPhotoModelParaSet{FT}, laba::FT, vmax::FT) where {FT<:AbstractFloat}

Update leaf area and maximal carboxylation rate, given

  • node [SPACSimple] type struct
  • photo_set [AbstractPhotoModelParaSet] type struct
  • laba Given leaf area per basal area
  • vmax Given Vcmax25
SoilPlantAirContinuum.optimize_leaf!Function
optimize_leaf!(node::SPACSimple{FT}, photo_set::AbstractPhotoModelParaSet{FT}, weather::Array{FT,2}, printing::Bool) where {FT<:AbstractFloat}

Optimize leaf area (LAI within 0-20) and photosynthetic capacity (within 5-200), given

  • node [SPACSimple] type struct
  • photo_set [AbstractPhotoModelParaSet] type struct
  • weather Weather profile in a growing season
  • printing Optional. If true, printing progress
SoilPlantAirContinuum.optimize_hs!Function
optimize_hs!(node::SPACSimple{FT}, photo_set::AbstractPhotoModelParaSet{FT}, weather::Array{FT,2}) where {FT<:AbstractFloat}

Optimize hydraulic conductance and leaf investment, given

  • node [SPACSimple] type struct
  • photo_set [AbstractPhotoModelParaSet] type struct
  • weather Weather profile in a growing season