set_precipitation.wateres: Precipitation setting

View source: R/variables.R

set_precipitationR Documentation

Precipitation setting

Description

Sets time series of precipitation on the reservoir area.

Usage

set_precipitation(reser, values)

## S3 method for class 'wateres'
set_precipitation(reser, values)

Arguments

reser

A wateres object.

values

A vector of precipitation values in mm, either monthly or daily of length of reservoir time series, or 12 monthly values starting by January (for monthly or daily data only).

Details

Precipitation is applied when calculating reservoir water balance. When calculating precipitation volume, the flooded area related to the potential storage is always used.

Value

A modified wateres object with precipitation time series added (denoted as P).

Examples

reser = data.frame(
    Q = c(0.078, 0.065, 0.168, 0.711, 0.154, 0.107, 0.068, 0.057, 0.07, 0.485, 0.252, 0.236,
          0.498, 0.248, 0.547, 0.197, 0.283, 0.191, 0.104, 0.067, 0.046, 0.161, 0.16, 0.094),
    DTM = seq(as.Date("2000-01-01"), by = "months", length.out = 24))
reser = as.wateres(reser, storage = 14.4e6, area = 754e3)
sry(reser, storage = 21e3, yield = 0.17)
reser = set_precipitation(reser, c(55, 40, 44, 43, 81, 72, 85, 84, 52, 54, 48, 58))
resul = calc_series(reser, storage = 21e3, yield = 0.17)

tgmwri/wateres documentation built on Feb. 13, 2024, 10:25 p.m.