Run the LWF-Brook90 hydrologic model
Sets up the input objects for the LWF-Brook90 hydrologic model, starts the model, and returns the selected results.
run_LWFB90( options_b90, param_b90, climate, precip = NULL, soil = NULL, output = NULL, output_fun = NULL, rtrn_input = TRUE, rtrn_output = TRUE, chk_input = TRUE, run = TRUE, timelimit = Inf, verbose = FALSE, ... )
options_b90 |
Named list of model control options. Use
|
param_b90 |
Named list of model input parameters. Use
|
climate |
Data.frame with daily climatic data, or a function that returns a suitable data.frame. See details for the required variables. |
precip |
Data.frame with columns 'dates' and 'prec' to supply
precipitation data separately from climate data. Can be used to provide
sub-day resolution precipitation data to LWFBrook90. For each day in dates,
1 (daily resolution) to 240 values of precipitation can be provided, with
the number of values per day defined in |
soil |
Data.frame containing the hydraulic properties of the soil layers. See section 'Soil parameters' |
output |
A [7,5]-matrix flagging the desired model output datasets at
different time intervals. Use |
output_fun |
A function or a list of functions of the form
|
rtrn_input |
Logical: append |
rtrn_output |
Logical: return the simulation results select via
|
chk_input |
Logical wether to check |
run |
Logical: run LWF-Brook90 or only return model input objects? Useful to inspect the effects of options and parameters on model input. Default is TRUE. |
timelimit |
Integer to set elapsed time limits for running LWF-Brook90. |
verbose |
Logical: print messages to the console? Default is FALSE. |
... |
Additional arguments passed to |
A list containing the selected model output (if rtrn_output ==
TRUE
), the model input (if rtrn_input == TRUE
, except for
climate
), and the return values of output_fun
if specified.
The climate
data.frame (or function) must
contain (return) the following variables in columns named 'dates' (Date),
'tmax' (deg C), 'tmin' (deg C), 'tmean' (deg C), 'windspeed' (m/s), 'prec'
(mm) , 'vappres' (kPa), and either 'globrad' ( MJ/(m²d) ) or 'sunhours' (h).
When using sunhours
, please set options_b90$fornetrad =
'sunhours'
.
Each row of soil
represents one layer,
containing the layers' boundaries and soil hydraulic parameters. The column
names for the upper and lower layer boundaries are 'upper' and 'lower' (m,
negative downwards). When using options_b90$imodel = 'MvG'
, the
hydraulic parameters are 'ths', 'thr', 'alpha' (1/m), 'npar', 'ksat' (mm/d)
and 'tort'. With options_b90$imodel = 'CH'
, the parameters are
'thsat', 'thetaf', 'psif' (kPa), 'bexp', 'kf' (mm/d), and 'wetinf'. For both
parameterizations, the volume fraction of stones has to be named 'gravel'.
If the soil
argument is not provided, list items soil_nodes
and soil_materials
of param_b90
are used for the simulation.
These have to be set up in advance, see soil_to_param
.
Name | Description | Unit |
yr | year | - |
mo | month | - |
da | day of month | - |
doy | day of year | - |
adef | available water deficit in root zone | mm |
awat | total available soil water in layers with roots between -6.18 kPa and param_b90$psicr |
mm |
balerr | error in water balance | mm |
byfl | total bypass flow | mm |
dsfl | downslope flow | mm |
evap | evapotranspiration | mm |
flow | total streamflow | mm |
gwat | groundwater storage below soil layers at the end of the time interval | mm |
gwfl | groundwater flow | mm |
intr | intercepted rain at the end of the time interval | mm |
ints | intercepted snow at the end of the time interval | mm |
irvp | evaporation of intercepted rain | mm |
isvp | evaporation of intercepted snow | mm |
nits | total number of iterations in time interval | - |
pint | potential interception for a canopy always wet | mm |
pslvp | potential soil evaporation | mm |
ptran | potential transpiration | mm |
relawat | relative available soil water in layers with roots | - |
rfal | rainfall | mm |
rint | rain interception | mm |
rnet | rainfall to soil surface | mm |
rsno | rain on snow | mm |
rthr | rain throughfall rate | mm |
safrac | source area fraction | - |
seep | seepage loss | mm |
sfal | snowfall | mm |
sint | snow interception | mm |
slfl | input to soil surface | mm |
slvp | evaporation rate from soil | mm |
smlt | snowmelt | mm |
snow | snowpack water equivalent | mm |
snvp | evaporation from snowpack | mm |
srfl | source area flow | mm |
stres | TRAN / PTRAN for time period | - |
swat | total soil water in all layers at the end of the time interval | mm |
tran | transpiration | mm |
vrfln | vertical matrix drainage from lowest layer | mm |
Name | Description | Unit |
yr | year | - |
mo | month | - |
da | day of month | - |
doy | day of year | - |
nl | index of soil layer | |
swati | soil water volume in layer | mm |
theta | water content of soil layer, mm water / mm soil matrix | - |
wetnes | wetness of soil layer, fraction of saturation | - |
psimi | matric soil water potential for soil layer | kPa |
psiti | total soil water potential for a soil layer | kPa |
infl | infiltration to soil water in soil layer | mm |
byfl | bypass flow from soil layer | mm |
tran | transpiration from soil layer | mm |
slvp | soil evaporation from a soil layer | mm |
vrfl | vertical matrix drainage from soil layer | mm |
dsfl | downslope drainage from layer | mm |
ntfl | net flow into soil layer | mm |
# Set up lists containing model control options and model parameters: param_b90 <- set_paramLWFB90() options_b90 <- set_optionsLWFB90() # Set start and end Dates for the simulation options_b90$startdate <- as.Date("2003-06-01") options_b90$enddate <- as.Date("2003-06-30") # Derive soil hydraulic properties from soil physical properties # using pedotransfer functions soil <- cbind(slb1_soil, hydpar_wessolek_tab(slb1_soil$texture)) # Run LWF-Brook90 b90.result <- run_LWFB90(options_b90 = options_b90, param_b90 = param_b90, climate = slb1_meteo, soil = soil) # use a function to be performed on the output: # aggregate soil water storage down to a specific layer agg_swat <- function(x, layer) { out <- aggregate(swati~yr+doy, x$SWATDAY.ASC, FUN = sum, subset = nl <= layer) out[order(out$yr, out$doy),]} # run model without returning the selected output. b90.aggswat <- run_LWFB90(options_b90 = options_b90, param_b90 = param_b90, climate = slb1_meteo, soil = soil, output_fun = list(swat = agg_swat), rtrn_output = FALSE, layer = 10) # passed to output_fun str(b90.aggswat$output_fun$swat)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.