SoilPlantAirContinuum

Types

SoilPlantAirContinuum.SPACContainer1LType
mutable struct SPACContainer1L{FT}

Struct that contains 1-layer gas exchange information.

Fields

  • ag::AbstractFloat

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

  • an::AbstractFloat

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

  • c::AbstractFloat

    Leaf internal CO₂ partial pressure [Pa]

  • e::AbstractFloat

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

  • gh::AbstractFloat

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

  • p::AbstractFloat

    Xylem end pressure [MPa]

  • t::AbstractFloat

    Leaf temperature [K]

SoilPlantAirContinuum.SPACContainer2LType
mutable struct SPACContainer2L{FT}

Struct that contains 2-layer gas exchange information.

Fields

  • cont_sh::SoilPlantAirContinuum.SPACContainer1L

  • cont_sl::SoilPlantAirContinuum.SPACContainer1L

  • frac_sh::AbstractFloat

    Shaded layer fraction

  • frac_sl::AbstractFloat

    Sunlit layer fraction

  • la_sh::AbstractFloat

    Shaded layer leaf area [m²]

  • la_sl::AbstractFloat

    Sunlit layer leaf area [m²]

  • lai_sh::AbstractFloat

    Shaded layer LAI

  • lai_sl::AbstractFloat

    Sunlit layer LAI

  • par_sh::AbstractFloat

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

  • par_sl::AbstractFloat

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

  • rad_sh::AbstractFloat

    Shaded layer absorbed energy [W m⁻²]

  • rad_sl::AbstractFloat

    Sunlit layer absorbed energy [W m⁻²]

SoilPlantAirContinuum.SPACMonoType
mutable struct SPACMono{FT}

Struct that mono species SoilPlantAirContinuum system.

Fields

  • soil_bounds::Vector{FT} where FT<:AbstractFloat

    Soil layers bounds [m]

  • air_bounds::Vector{FT} where FT<:AbstractFloat

    Air layers bounds [m]

  • z_root::AbstractFloat

    Root depth [m]

  • z_canopy::AbstractFloat

    Canopy maximal height [m]

  • plant_hs::PlantHydraulics.AbstractPlantOrganism

    Plant hydraulic system

  • n_canopy::Int64

    Number of canopy layers

  • n_root::Int64

    Number of root layers

  • plant_ps::Array{StomataModels.CanopyLayer{FT}, 1} where FT<:AbstractFloat

    Plant photosynthesis systems

  • ba::AbstractFloat

    Basal area [m²]

  • ga::AbstractFloat

    Ground area [m²]

  • la::AbstractFloat

    Leaf area [m²]

  • envirs::Array{Photosynthesis.AirLayer{FT}, 1} where FT<:AbstractFloat

    Air layers

  • wind_z0::AbstractFloat

    Aerodynamic roughness [m]

  • wind_d::AbstractFloat

    Zero plane displacement [m]

  • wind_zs::Vector{FT} where FT<:AbstractFloat

    Mean layer height [m]

  • winds::Vector{FT} where FT<:AbstractFloat

    Wind speed per layer [m s⁻¹]

  • mswc::Vector{FT} where FT<:AbstractFloat

    Maximal soil water content

  • swc::Vector{FT} where FT<:AbstractFloat

    Current soil water content

  • p_soil::Vector{FT} where FT<:AbstractFloat

    Array of soil matric potential [MPa]

  • h_soil::AbstractFloat

    Maximal soil depth [m]

  • latitude::AbstractFloat

    Latitude [°]

  • longitude::AbstractFloat

    Longitude [°]

  • elevation::AbstractFloat

    Elevation [m]

  • photo_set::Photosynthesis.AbstractPhotoModelParaSet{FT} where FT<:AbstractFloat

    Photosynthesis parameter set

  • stomata_model::StomataModels.AbstractStomatalModel

    Stomatal behavior scheme

  • angles::CanopyLayers.SolarAngles{FT} where FT<:AbstractFloat

    Solar angle container

  • canopy_rt::CanopyLayers.Canopy4RT

    Canopy4RT container

  • wl_set::CanopyLayers.WaveLengths{FT} where FT<:AbstractFloat

    Wave length container

  • rt_dim::CanopyLayers.RTDimensions

    RT dimensions

  • can_rad::CanopyLayers.CanopyRads{FT} where FT<:AbstractFloat

    CanopyRads container

  • can_opt::CanopyLayers.CanopyOpticals{FT} where FT<:AbstractFloat

    CanopyOpticals container

  • leaves_rt::Array{CanopyLayers.LeafBios{FT}, 1} where FT<:AbstractFloat

    Array of LeafBios container

  • soil_opt::CanopyLayers.SoilOpticals{FT} where FT<:AbstractFloat

    SoilOpticals container

  • in_rad::CanopyLayers.IncomingRadiation{FT} where FT<:AbstractFloat

    Incoming radiation container

  • rt_con::CanopyLayers.RTCache{FT} where FT<:AbstractFloat

    RT container

  • f_SL::Vector{FT} where FT<:AbstractFloat

    Container for sunlit leaf area fraction in each layer

  • f_gpp::AbstractFloat

    Canopy GPP per ground area

  • f_npp::AbstractFloat

    Canopy GPP per ground area

  • f_H₂O::AbstractFloat

    Canopy water flux per ground area

SoilPlantAirContinuum.SPACSimpleType
mutable struct SPACSimple{FT}

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

Fields

  • hs::PlantHydraulics.TreeSimple{FT} where FT<:AbstractFloat

    Hydraulic systems

  • ec::AbstractFloat

    Critical flow rate

  • ps::Photosynthesis.Leaf

    Photosynthesis system

  • vtoj::AbstractFloat

    Ratio between Vcmax25 and Jmax25

  • envir::Photosynthesis.AirLayer

    Environmental conditions

  • container1L::SoilPlantAirContinuum.SPACContainer1L

    Container for gas exchange for a layer

  • container2L::SoilPlantAirContinuum.SPACContainer2L

    Container for gas exchange of sunlit and shaded layers

  • containerKS::Vector{FT} where FT<:AbstractFloat

    Container for default hydraulic conductance

  • containerOP::AbstractFloat

    Container for optimizer

  • opt_f_sl::AbstractFloat

    Container for optimal sunlit layer flow rate

  • opt_f_sh::AbstractFloat

    Container for optimal shaded layer flow rate

  • opt_laba::AbstractFloat

    Container for optimal leaf area per basal area

  • opt_vmax::AbstractFloat

    Container for optimal Vcmax25

  • lai::AbstractFloat

    Leaf area index

  • laba::AbstractFloat

    Leaf area per basal area

  • g_max::AbstractFloat

    Maximal stomatal conductance limit at 25 °C

  • gaba::AbstractFloat

    Ground area per basal area

  • width::AbstractFloat

    Leaf width

  • mswc::AbstractFloat

    Maximal soil water content

  • swc::AbstractFloat

    Current soil water content

  • p_soil::AbstractFloat

    Soil matrical water potential

  • h_soil::AbstractFloat

    Soil depth, 2X mean root depth

  • c_cons::AbstractFloat

    Leaf construction cost per leaf area

  • c_vmax::AbstractFloat

    Leaf nutrient cost per Vcmax25 per leaf area

  • latitude::AbstractFloat

    Latitude [°]

  • longitude::AbstractFloat

    Longitude [°]

  • elevation::AbstractFloat

    Elevation [m]

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

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

Update soil moisture and soil matrix potential, given

  • node SPACSimple 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

  • node SPACSimple 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

  • node SPACSimple 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

  • node SPACSimple 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 store simulation 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