Open rburghol opened 4 years ago
I've created a function to run on the server which reads in all of the climate _1000-2000 files in the model, calculates the mean over the entire timespan, and outputs them in a table containing the segment name, evap mean, and precip mean -- script is found here: https://github.com/HARPgroup/openmi-om/blob/master/R/utils/batch.climate.summarize.R
I've also created a script which calculates the mean precip and temp change from the climate data that Gopal shared with me and compares it with the percent change in Qout (climate change - base / base). Since mean precip and temp change are calculated at land segment scale and Qout is calculated at river segment scale, the script "weights" precip and temp changes to river segment scale by finding all the land-river segments within a river segment, multiplying the precip/temp change of the land-river segment (assumed to be the same as that of the entire land segment) by the fraction of the river segment which the land-river segment comprises, and summing together all of these "weighted" precip/temp changes. Does this sound like the proper method to use when converting metrics between the land-segment and river-segment scale? Script is located here: https://github.com/HARPgroup/cbp6/blob/master/analysis/precip_and_temp_vs_Qout_tables.R
I'm hoping to expand this latter script in the coming days to include the precip/evap climate data in the table -- so the final output will be a table containing:
While I finish up the updates which will produce this gigantic, river-segment scale table of data, two quick questions: does the area-weighting approach I used sound like a logical method of converting data from land-segment to river-segment scale? And, @rburghol, do you know the units of precip and evap used in the inputs to VA Hydro, or what documentation I might read to find these units?
Daniel -- thanks, this looks like an ambitious, but informative plan. I think your proposed metrics are good, though I think that Runit is a better metric than Qout, since:
I would also say, store them attached to vahydro model/runid_xx properties for ease of retrieval, sharing and compatibility with existing tools in our toolkit.
As for the units, we went through that a while back and I believe the best source of info was in the lib_hydrology.php and lib_wooomm.cbp.php files in the OM repo. The conversions for cbp runoff elements is in the code there -- I don't recall exact units at the moment, but I know we figured it out last time this came up. Heck, we may even have documented it in a github issue queue issue?
Thanks for the feedback, Rob -- and I agree that Runit is an ideal unit of comparison when looking at how evapotranspiration and precipitation affect flow, especially as a starting point of analysis without any of the confounding effects you mentioned.
I am a little confused by your terminology, though -- when I think of "Runit" flows, I usually think of the "Runit" values stored within the runlog of the "1. Local Runoff Inflows" object of the river segment (i.e., in this file attached to this object. Since you're suggesting that Runit flows are already at the land segment scale (and the only model data I can find at the land segment scale are the land use tables and the edge-of-stream unit flow files -- the VA Hydro land-river segment model components even seem to exist solely to direct the model to these files), I think that you're suggesting that I compare the sum of these (unit flow per land use)*(land use area) flow values -- summed across the SURO, IFWO, and AGWO distinction as well? Are these land segment scale flow values stored somewhere on VA Hydro?
I remember some confusion about the units for SURO, IFWO, and AGWO awhile back -- and from Vol. 2 of the "Hydrological Simulation Program - FORTRAN (HSPF) : User's Manual" (page 678) we found that they were measured in inches per interval of the data. And, we confirmed this in your lib_wooomm.cbp.php script, where you used
"// converts from watershed in/ivld to watershed ft/ivld (/12.0) // to acre-feet/ivld ( luarea) // to cubic-feet ( 43560 ft-per-acre) // to cfs (/timestep)"
to convert lu_flowvar (the raw value from the eos file (???)) from in/ivld to cfs.
It appears the evaporation and precipitation inputs are both in inches/day -- I found the following in the lib_hydrology.php script:
"$this->prop_desc['et_in'] = 'Evapotrasnpiration Input (inches / day)'; $this->prop_desc['precip_in'] = 'Precipitation (inches / day)';"
-- so thanks for the suggestion to look there!
Sorry to delay. Thanks for the super deep dive on figuring out the units!
There are 3 ways that I can think of to access what I am referring to as Runit, and to clear it up, Runit is only a term we use in VAHydro/OM.
Food for thought...
Some updates:
While doing a bit of analysis on the temp/prcp/evap/flow changes, I ran into some odd trends -- Dr. Scott suggested that I check a few segments manually to ensure that there are no issues in my script. These QA checks for two river segments follow -- and I'm happy to report that I found no issues in the calculation process. Rseg_Calculation_Check.pdf
While there were no issues in the calculations, I did run into some issues with the timespans of the metrics -- namely, using the VA Hydro Qout variable was improper, since this Qout represents the mean of the entire scenario timespan (1984-2015 for base, 1991-2000 for CC). I think it would be interesting to keep this Qout value for comparison as well as the Runit -- however I'll have to calculate it by downloading VA Hydro data, trimming it to 1991-2000 and calculating the mean, so keeping Qout will add quite a bit of computation time to the scripts. Similarly, the prcp/evap means that I had calculated were over the full timescale, so I'll update that script so everything is compared over the same timescale as well (which is why I haven't posted any of the results in this post)
Pertaining to Runit -- I've been trying to find the land segment features you're talking about on VA Hydro but haven't yet had any luck -- for example, when I search for 'N51101', the only features I can find are the land-river segment containing the links to the edge-of-stream unit flow files. Could you show me an example of one of these land segment features so I can better understand how to find them?
Also Runit related -- I agree that delving into the flows from a few specific land uses will be fascinating as this analysis progresses. I'll probably start this Runit comparison by doing the full (land use area)*(land use unit flow) summed calculation -- either way I'll have to load those giant edge-of-stream flow files into R for each river segment, which was something that I was hoping to avoid having to do -- adds a lot of computation time.
Once I make some of these changes (especially fixing the timescales), I'll post some of the results -- hopefully tomorrow or Tues.
While I haven't yet updated the Qout timespans or added Runit functionality, I'll share a few plots that are causing me a bit of concern.
The following three plots show river segment percent change in precipitation (from Gopal, in the "lseg_delta_pr_RCP45_Ensemble_CRT_2041_2070_P10", "lseg_delta_pr_RCP45_Ensemble_CRT_2041_2070_P50", and "lseg_delta_pr_RCP45_Ensemble_CRT_2041_2070_P90" files) plotted against the river segment scale percent change in precipitation that is actually expressed in the scenario (this was obtained by mining the precipitation data stored here -- the mean of the prcp and evap values over the timespan were taken for each of the scenarios and the percent change was calculated based on this).
Ideally, of course, we'd like to see a roughly one-to-one increase across the plots, with percents approximately equal to each other... instead, we see the following:
P10 Precip (Gopal Data) vs. P10 Precip (Input Climate Data):
P50 Precip (Gopal Data) vs. P50 Precip (Input Climate Data):
P90 Precip (Gopal Data) vs. P90 Precip (Input Climate Data):
I'll keep working on adding functionality for Runit and for Qout with the proper timescale -- however, these plots have me a bit worried that the climate scenarios are not representing the climate data nearly as well as we would like.
Daniel -- are you using the precip data in vahydro models at the moment, or are you using what you harvested from the WDMs? I am pretty sure that you ARE (I mean, you said you mined it from the WDMs), I just wanted to double check and not assume -- note: using the VAhydro model as it currently is, many of those segments don't have the precip inputted, we load precip & evap for large impoundments as they are the only ones that make an appreciable impact.
So -- let's assume that you are comparing Gopals summaries to the WDM data you are harvesting. If so:
--
Rob, I'm using the WDM harvested precipitation -- I'm not pulling any precipitation data from VA Hydro. Other responses:
I'm using the WDM harvested precipitation Most excellent.
How do evap and precip interact to change flow?