# NOT RUN {
# load data
data("shpdata1")
# observations
retdata <- shpdata1$LFH1$wrc[!is.na(shpdata1$LFH1$wrc[,1]),]
condata <- shpdata1$LFH1$hcc
# 7 - resFun ------------------------------------------------------------
# soil hydraulic property model parameters, van Genuchten-Mualem
p <- c("thr" = 0.16, "ths" = 0.46, "alf1" = 0.03, "n1" = 1.42, "Ks" = 26, "tau" = .5)
# calculate weighted residuals
wres <- resFun(p, retdata = retdata, condata = condata, pretrans = NULL,
weight = list("wth" = 0.0025, "wKh" = 1), method = "res", trim = FALSE)
## residuals of the soil water retention curve [-]
theta.wres <- wres[1:dim(retdata)[1]]
## residuals of the log10 hydraulic conductivity curve [cm/d]
log10K.wres <- wres[(dim(retdata)[1]+1) : length(wres)]
# }
Run the code above in your browser using DataLab