Skip to contents

Calculates the cumulative volume deficit below a specified threshold for the longest continuous deficit period.

Usage

compute_VolDef(Q, upLim, select_longest = TRUE)

Arguments

Q

Numeric vector of streamflow values m³/s

upLim

Numeric upper threshold for deficit calculation

select_longest

Logical indicating whether to use only the longest deficit period (TRUE) or all periods (FALSE). Currently only TRUE is implemented.

Value

Numeric value of volume deficit in cubic hectometers (hm³)

Details

Computes: $$VolDef = \frac{\sum (Q_{deficit}) \times 86400}{10^6}$$ Where:

  • $Q_deficit$ are flows below threshold from longest event

  • 86400 converts seconds to days

  • 10^6 converts m³ to hm³

See also

apply_threshold for the underlying event identification

Examples

Q <- c(45, 42, 39, 38, 40, 50, 48, 37, 36, 35, 40)
# Calculate volume deficit below 40 m³/s
vol_def <- compute_VolDef(Q, upLim=40)
print(paste("Volume deficit:", round(vol_def, 2), "hm³"))
#> [1] "Volume deficit: 12.79 hm³"