[x] Get all metrics used for WA calc. from VAhydro via metric grid
[x] Move Qavailabile writing to this routine?
[x] Have inputs mimic summary post-processing scripts
[x] Add arg for baseline scenario but default to runid_0
[ ] Test from command line and check output in VAhydro
Pull request: #1256
Inputs
pid : model element pid for the segment of interest
elid : model element id
runid_dem : demand scenario (numeric)
runid_base : baseline scenario (numeric)
CPL: critical period length (days)
PoF : minimum instream flow coefficient
$CPL$ = critical period length, such as 30 days, 90 days, 7 days, etc.
$WA_{CPL}$ = mean rate of available water remaining during critical period
$Q_{LCPLdem}$ = L90 simulated for a given demand scenario
$Q_{LCPLbase})$ = The L90 simulated in the zero demand scenario (with the same meterology).
$S_{minCPL}$ = minimum storage simulated during the L90 period in the demand scenario.
$PoF$ = % of flow that must remain in stream
Note: $(PoF * Q{LCPLbase})$ could be rewritted as $Q{mif}$, where $Q_{mif}$ = minimum instream flow (if mif is NOT a PoF, and is knowable in a single period mean numeric form)
Create a standalone WA calculation routine to export metrics to VAhydro
Inputs
pid
: model element pid for the segment of interestelid
: model element idrunid_dem
: demand scenario (numeric)runid_base
: baseline scenario (numeric)CPL
: critical period length (days)PoF
: minimum instream flow coefficientExample: Lake Pelham
Rscript WA_export.R 5714522 352006 11 0 30 0.9
WA Equation