#Manual display of vulnerability curve
kstemmax = 4 # in mmol·m-2·s-1·MPa-1
stemc = 3
stemd = -4 # in MPa
psiVec = seq(-0.1, -7.0, by =-0.01)
kstem = unlist(lapply(psiVec, hydraulics_xylemConductance, kstemmax, stemc, stemd))
plot(-psiVec, kstem, type="l",ylab="Xylem conductance (mmol·m-2·s-1·MPa-1)",
xlab="Canopy pressure (-MPa)", lwd=1.5,ylim=c(0,kstemmax))
#Load example dataset
data(exampleforest)
#Default species parameterization
data(SpParamsMED)
#Initialize soil with default soil params (4 layers)
examplesoil <- defaultSoilParams(4)
#Initialize control parameters
control <- defaultControl("Granier")
#Switch to 'Sperry' transpiration mode
control <- defaultControl("Sperry")
#Initialize input
x <- spwbInput(exampleforest,examplesoil, SpParamsMED, control)
#Leaf vulnerability curves
hydraulics_vulnerabilityCurvePlot(x, type="leaf")
#Stem vulnerability curves
hydraulics_vulnerabilityCurvePlot(x, type="stem")
Run the code above in your browser using DataLab