Commit 506b3f1
Adding level-pool reservoir simulation capability to v01 (#90)
* add folder to start reservoir work
* set debuglevel/verbosity to maximum for test
* Add reservoir demo script
* attribute module
* Add initial dummy reservoir calculation
* reorganize functional inputs
* created globals and reran df from utilities
* minor changes to flow/resevoir code
* moved waterbodies key values to supernetwork_data
* Sequential Network Execution
Works for Parallel, no waterbodies; serial no waterbodies; serial with waterbodies.
NOT YET WORKING for parallel with waterbodies (which may indicate deeper issue...)
* fix referencing in flowveldepth -- full execution now works
* remove never-used file Reservoir.f90
* move reservoir parameters to nested dict
* black nhd_reach_utilities
* split qlateral
Also moved flowveldepth into a purely functional call
* revert nhd_network_utilities_v02 (it should not have changed...)
* Update nhd_network_utilities_v02.py
* minor updates
* blackened
* blackened
* force single precision in reservoir calculation
* added route and replace function for testing of Mainstems_CONUS input DF
* Merge Jdhondia branch + many fixes to parallelization, etc.
More info:
Added qlateral-time-step subdivision capability
+ "--qlateral-time-step",
+ "--qts_subdivisions",
Detect and handle WSL compile (WSL solution appears to lose fidelity if compiled with optimizations)
fixing logic for network head segments downstream of other networks
add cumulative qlat and cumulative total volume in flowveldepth and modify write functions to handle
gather Qlat from all segments of the waterbody
Outstanding issues:
Head segments is never hit for quc
Tuple (False,) is unexplained
* remove tuple-wrapped False
* Use ts for flow backreference
using flowarr[-1] works within the loop but obtains the
wrong value for the arrays references upstream tributaries
-- the upstreams have completed calculation and will
have a complete time series to choose from.
* Add more usage examples
* Use empty dict for flowveldepth_connect
* Reduce volume of functional return to avoid memory error on process pickle
https://bugs.python.org/issue17560
Reviewing that link suggests that we may be following an anti-pattern in pusing
*pushing so much data into a multi-process. Hence, we are looking at the
v02 method using threads...
* Add TODO about network sorting
* Add RnR test
* fix rnr name
* fix return value to have key
* close pool only if parallel
also blackened file
* make networks global
* use static tuple inside temporary ordering list
* added sort to ordered_networks
* updated code for writing nc file for waterbodies
* added custom input arg, added init_waterbody_states and q_initial, changed json test file columns
* addes q_initial_states
* minor changes and added functions to utilities file
* separated functions to remove cascading effect
* sort waterbodies_df and correct search method
This change cut execution time in half or better
* renamed folder to file
* working custom json input and functions
* renamed inputs and removed for loop
* added waterbody_init and renamed a few things
* formatted with black
* added Waterbody_ID_crosswalks to def get_reservoir_restart_from_wrf_hydro(
* simplify references for short-time-step assumption
also fixed qlaterals.
* make placeholders to read warm/initial states
* update download link to latest version of route-link file
* symlink varPrecision
* blackend
* reorganize arguments
* add default output text and nc folders
* make channel initial states work for RnR
* set default initial state dataframe (with all zeros)
* cleanup and blacken
* cleanup and blacken
* Add Waterbody Initial State Parsing
* Blackend; add variable for xs in waterbody crosswalk
* use initial states in actual calculation
* Set custom file to read Pocono LakeParm
* add custom json example usage
* Add Pocono1 Test case
* finalize water body capability
* blackend
* Move All Inputs to Json
* add empty dict for empty custom input frames
* fix levelpool height assignment
Anyuse prior to this fix is completely wrong; the input variable was being dropped
without any assignment
* Cleanup reservoir test script and add docstring
* blackened
* remove old method
* write qlateral to flowveldepth to allow time-step adjustment
* Add sort networks argument
Also clean up and add more useful comments
* read waterbody parameters from separate utility function
* BUGFIX accumulate qup in initial states from all upstreams
The calculation previously was only re-assigning with "=" instead of "+="
* add timing statements for full program and main loop
* multiply by dt for correct qlat accumulation
* lowercase for uname.release
Co-authored-by: Jacob Hreha <jacob.hreha@noaa.gov>
Co-authored-by: jdhondia <juzer.dhondia@noaa.gov>
Former-commit-id: ee21efdbc669631a267a356f08769a8e8ce1c8701 parent 5b95e96 commit 506b3f1
File tree
39 files changed
+1821
-273
lines changed- src
- fortran_routing/mc_pylink_v00/Reservoir_singleTS
- python_framework_v01
- python_routing_v01
- test
- input
- geo/NWM_2.1_Sample_Datasets
- Pocono_TEST1
- example_CHRTOUT
- example_RESTART
- primary_domain/DOMAIN
- json
- output
- nc
39 files changed
+1821
-273
lines changedLines changed: 237 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
Lines changed: 110 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments