if(requireNamespace('hydromad')) {
## A shallow / droughty soil near Sonora CA
# 100mm (4") AWC
AWC <- 100
PPT <- c(171, 151, 138, 71, 36, 7, 1, 2, 11, 48, 102, 145)
PET <- c(15.17, 18.26, 30.57, 42.95, 75.37, 108.05, 139.74, 128.9, 93.99, 59.84, 26.95, 14.2)
# water-year
# three years
x.wb <- monthlyWB(AWC, PPT, PET, S_init = 0, starting_month = 9, rep = 3)
x.wb[x.wb$mo == 'Sep', ]
# plot all three years
plotWB(x.wb)
# water-year / last iteration
x.wb <- monthlyWB(AWC, PPT, PET, S_init = 0,
starting_month = 9, rep = 3,
keep_last = TRUE
)
# plot
plotWB(x.wb)
## Drummer series (Fine-silty, mixed, superactive, mesic Typic Endoaquolls), southern IL
AWC <- 244
PPT <- c(36, 37, 54, 82, 98, 96, 92, 75, 69, 70, 65, 50)
PET <- c(0, 0, 12, 46, 90, 130, 145, 128, 88, 46, 14, 0)
# using calendar year
x.wb <- monthlyWB(AWC, PPT, PET, S_init = 0,
starting_month = 1, rep = 3,
keep_last = TRUE
)
plotWB(x.wb)
}
Run the code above in your browser using DataLab