This issue will explain different methods for calculating Smin metrics and track decision-making in regards to implementation into Water Availability calculations #818
Approximate method: Take the minimum Storage simulated during the year of the minimum low-flow simulated for the critical period of interest (e.g. 7, 30, 90 days)
This is the most time-efficient method, since it allows us to make this calculation from available data (since we already have L90_year and L30_year stored) and store a value for Smin_L90, Smin_L30, Smin_L7, etc,
This is the preferred method to start, since we can do it quickly AND it is the most conservative method, since Smin/CPL will be lower than the mean available if Smin is reached prior to the last day of the CPL and Storage increases after it reaches Smin
We can simple use sqldf, select min(Storage) from data where year = L90_year
Near-Exact method : Iterate through flow/storage time series, and identify the days that comprise the min flow period, then take the minimum simulated Storage value during those N low-flow days.
Produces an exact value for Smin if Smin occurs on the final day of the low-flow period.
Exact method: FInd the minimum Storage during the simulated low-flow period, and the number of days into that low-flow period that the minimum storage was reached, divide Smin/days_into_Lperiod.
This will only occur when inflows are above demand + minimum release from the impoundment, and/or MIF at the impoundment refill intake. Which will be a somewhat rare occurence in an actual drought.
Considerations
The Exact method above does not consider the remainder of the low flow period after the minimum storage occurs, and therefore needs to be further understood before use
The Smin values resulting from the approximate method will either be the same or less than the near-exact values, making the approximate method slightly more conservative in certain cases
Approx. and near-exact Smin values will only be different if the minimum storage (in the low-flow year) occurs outside the low-flow period
Next Steps
[ ] More in-depth comparison of approx. and near exact methods, quantify differences in Smin and time of the year it occurs see #1156
[x] Improve Smin_methods.R
[x] Save runfile data for all impoundments to save time
[x] Enable working w/ non-impoundments (Smin = 0)
[x] Investigate Vahydro Smin metrics (approx.) not matching those calculated in Smin_methods.R
The small differences between some Smin metrics from VAhydro and those calculated in Smin_methods.R were caused by the saving and re-reading of run file timeseries data
The process used for saving the run files (instead of using fn_get_runfile) and then reading them locally to save time is not robust, which used write.zoo and fread
Methods
Original method explanations from https://github.com/HARPgroup/HARParchive/issues/818#issue-1710059974:
Considerations
Next Steps