#Load example daily meteorological data
data(examplemeteo)
#Load example plot plant data
data(exampleforestMED)
#Default species parameterization
data(SpParamsMED)
#Initialize soil with default soil params (4 layers)
examplesoil = soil(defaultSoilParams(4))
#Initialize control parameters
control = defaultControl("Granier")
#Initialize input
x1 = forest2spwbInput(exampleforestMED,examplesoil, SpParamsMED, control)
# Cohort name for Pinus halepensis
PH_coh = paste0("T1_", SpParamsMED$SpIndex[SpParamsMED$Name=="Pinus halepensis"])
PH_coh
# Modify Z50 and Z95 of Pinus halepensis cohort
customParams <- c(200,2000)
names(customParams) <- paste0(PH_coh,c("/Z50", "/Z95"))
x1m <- modifyInputParams(x1, customParams)
# Inspect original and modified objects
x1$below
x1m$below
# Inspect dependencies: fine root distribution across soil layers
x1$belowLayers$V
x1m$belowLayers$V
# Modify rock fragment content and sand proportion of soil layer 1
x1s <- modifyInputParams(x1, c("rfc@1" = 5, "sand@1" = 10))
# Inspect original and modified soils
x1$soil
x1s$soil
# When modifying growth input objects dependencies increase
x1 = forest2growthInput(exampleforestMED,examplesoil, SpParamsMED, control)
customParams <- c(2000,2)
names(customParams) <- paste0(PH_coh,c("/Al2As", "/LAI_live"))
x1m <- modifyInputParams(x1, customParams)
Run the code above in your browser using DataLab