# The following is a toy example. I strongly recommend to see
# the package vignettes in order to improve your skills on HBV.IANIGLA
# HBV soil routine with variable area
## Calder's model
potEvap <- PET(model = 1, hemis = 1, inputData = as.matrix(1:315), elev = c(1000, 1500),
param = c(4, 0.5))
## Debris-covered ice
ObsTemp <- sin(x = seq(0, 10*pi, 0.1))
ObsPrecip <- runif(n = 315, max = 50, min = 0)
ObsGCA <- seq(1, 0.8, -0.2/314)
## Fine debris covered layer assumed. Note that the ice-melt factor is cumpulsory but harmless.
DebrisCovGlac <- SnowGlacier_HBV(model = 3, inputData = cbind(ObsTemp, ObsPrecip, ObsGCA),
initCond = c(10, 3, 1), param = c(1, 1, 0, 3, 1, 6))
## Soil routine
ObsSoCA <- 1 - ObsGCA
inputMatrix <- cbind(DebrisCovGlac[ , 9], potEvap, ObsSoCA)
soil <- Soil_HBV(model = 2, inputData = inputMatrix, initCond = c(50), param = c(200, 0.5, 2))
Run the code above in your browser using DataLab