#Load example daily meteorological data
data(examplemeteo)
#Load example plot plant data
data(exampleforest)
#Default species parameterization
data(SpParamsMED)
#Define soil with default soil params (4 layers)
examplesoil <- defaultSoilParams(4)
#Initialize control parameters
control <- defaultControl("Granier")
#Initialize input
x <- spwbInput(exampleforest,examplesoil, SpParamsMED, control)
#Call simulation function (ten days)
S1<-spwb(x, examplemeteo[1:10, ], latitude = 41.82592, elevation = 100)
#Extracts daily forest-level output as a data frame
extract(S1, level = "forest")
#Extracts daily soil layer-level output as a data frame
extract(S1, level = "soillayer")
#Extracts daily cohort-level output as a data frame
extract(S1, level = "cohort")
#Select the output tables/variables to be extracted
extract(S1, level ="cohort", output="Plants", vars = c("PlantStress", "StemPLC"))
Run the code above in your browser using DataLab