calc_catchment_system | R Documentation |
Calculates time series of variables for reservoirs organized in a system of catchments.
calc_catchment_system(system, yields, initial_storages, output_vars,
get_routing_output)
## S3 method for class 'catchment_system'
calc_catchment_system(system, yields = NULL,
initial_storages = NULL, output_vars = c("storage", "yield"),
get_routing_output = FALSE)
system |
A |
yields |
A vector of required fixed yield values in m3.s-1, its names have to correspond with the names of the reservoirs in the system.
If not provided, their values are taken from the |
initial_storages |
A vector of initial reservoir storages in m3 whose names correspond to the reservoirs names. If NULL, all reservoirs are considered to be full initially. |
output_vars |
A vector of variables whose time series are returned. Variable names are those returned by |
get_routing_output |
If TRUE, routing output will be obtained for each outlet as the |
No transfers between reservoirs are considered (system_plain
option of calc_system
is used).
A list of data frames with time series for individual catchments, columns of the data frames are combinations of reservoirs and variables.
If get_routing_output
is given, the returned list has the routing
attribute containing output for routing in each catchment outlet (as provided by calc_series.wateres
).
calc_system
for inner function calculating the reservoir system, calc_series
for returned time series
data_catch = data.frame(DTM = seq(as.Date("1982-11-01"), length.out = 7, by = "day"), PET = rep(0.5, 7), R = rep(24 * 3.6, 7), P = rep(1, 7))
res_data_c1 = data.frame(
storage = c(1e7, 1e7, 1e7), area = c(1e4, 1e4, 1e4), part = c(0.25, 0.25, 0.5), branch_id = c("main", "lateral", "lateral"), id = c("M1", "L1", "L2"))
branches = list(main = list(down_id = NA), lateral = list(down_id = "main", connect_to_part = 0.8))
res_data_c2 = res_data_c1
res_data_c2$storage = res_data_c2$storage * 2
catch1 = as.catchment(id = "C1", down_id = "C2", data = data_catch, area = 100, res_data = res_data_c1, branches = branches, main_branch = "main")
catch2 = as.catchment(id = "C2", down_id = NA, data = data_catch, area = 200, res_data = res_data_c2, branches = branches, main_branch = "main")
catch_system = as.catchment_system(catch1, catch2)
yields = c(C1_M1 = 25, C1_L1 = 25, C1_L2 = 25, C2_M1 = 25, C2_L1 = 25, C2_L2 = 200)
resul = calc_catchment_system(catch_system, yields, output_vars = c("storage", "yield", "precipitation"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.