OpenCDSS / ArkDSS-Colors-of-Water

Colorado's Decision Support Systems (CDSS) ArkDSS Colors of Water Model Engine code
GNU General Public License v3.0
2 stars 5 forks source link

StateTL - improvements to facilitate output to hydrobase #39

Closed kelleythompson closed 2 years ago

kelleythompson commented 2 years ago

To pass COW output data into hydrobase, one general output file was needed (for daily data) with one row per entry but with a type key that conveyed the type of data in the row (ie river, release, exchange, native). For releases, lagged returns from bank storage create a long tail of very small amounts that can return to the stream for months. An important part of the transit loss calculation is to apply set rules to define what portion of that hydrograph tail can be captured at a headgate (or reservoir) that is both physically reasonable and doesn't risk injury to other water users. To reduce output size and for the tool, it was determined that the same TL capture rules that are applied at the receiving structure should be applied to all intermediate node locations. Also, these rules vary by area and structure, so additional capability was added to apply a specific rule based on the receiving structure WDID. Finally, improvement was needed to acknowledge exchanges in the calculation of native flows.

kelleythompson commented 2 years ago

An option was added to build one file to pass COW output data to Hydrobase. This file currently only contains daily data and describes colors of water throughout the modeled river system for display in the COW tool. A separate file will probably be used to output hourly data for single water classes as part of scenario planning. The comma delimited text file is currently structured with the following columns: WDID,node_position,COW_row_type,waterclass_num,data_timestep_num,data_model_date,data_value where: node_position: US or DS COW_row_type: riv = Amount of actual water in river, note that riv = nat+sum(rel) -sum(exch) nat = water that is not part of a release; these are the potential amounts not considering exchanges rel = amount of release type water class (ie not an exchange); these are the potential amounts not considering exchanges exch = exchange amount (where waterclass_num corresponds to lower T:7 record) uncTL =-unconsumed transit loss of release at destination node data_timestep_num: 1=daily

The following line was added to the command file to trigger creation of the file: 'outputtoHB=1'. To create the output file for hydrobase, the model should run the river, wc, exchange, and capture loops. An additional command line argument was added that turns on all these loops in addition to the output option. This command argument would be issued as: StateTL –h

To reduce output size and add to consistency in COW output at internal nodes, the transit loss capture rules that are applied at the receiving structure were applied to all intermediate node locations. A column titled TLrule was added to the input file to specify the type of rule to be applied. In the input file, the rule applies to the next downstream WDID (dswdid for subreach). The TLrule keys off the beginning number and the 3 letter ending text. Although different options could be entered, options have included: ‘10avg’, ‘5avg’, ‘10max’, ‘5max’, ‘6day’, and ‘none’. The code will assume ‘none’ if the column or entry is not provided. Currently, the following rules are being applied (but this is under debate and may be changed using the input datefile):

The same code block that was previously applied just to the last receiving node is applied at the intermediate nodes which includes the following general process:

An improvement was also added in the calculation of native flows. As currently provided for HB, release amounts are the total “potential” amount without reduction due to an exchange. To also have native amounts as “potential” amounts, native water is calculated as river amount plus total exchange amount minus total release amounts.

smalers commented 2 years ago

I don't follow these issues in detail but scan in case there is something that overlaps OpenCDSS work. A general comment is that the -h command option is typically used for help and would print the program usage. An equivalent --help is also often used. Similarly -v and --version are used for version. Therefore, I caution using these options for other things.

kelleythompson commented 2 years ago

Steve, Thanks - thats good to know that and I appreciate your knowledge base. I know I need to change several of these command line args now, and hopefully will before this goes to any sort of deployment. Thanks, Kelley

Kelley L. Thompson, P.E. Senior Lead Modeler - Modeling and DSS / Water Information Team

P 303.866.3581 ext 8261 | C 719.480.3423 1313 Sherman St., Suite 818, Denver, CO 80203 @.*** | www.water.state.co.us

On Fri, May 20, 2022 at 2:49 PM Steve Malers @.***> wrote:

I don't follow these issues in detail but scan in case there is something that overlaps OpenCDSS work. A general comment is that the -h command option is typically used for help and would print the program usage. An equivalent --help is also often used. Similarly -v and --version are used for version. Therefore, I caution using these options for other things.

— Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_OpenCDSS_ArkDSS-2DColors-2Dof-2DWater_issues_39-23issuecomment-2D1133358384&d=DwMCaQ&c=sdnEM9SRGFuMt5z5w3AhsPNahmNicq64TgF1JwNR0cs&r=v8IOejxniM24GGbuf52hAajizwligqp4dTwlVwvfpSs&m=LUnO4S3Y6Ztf6TDy_3OwTL84RLHaHApRCu4I563-gJU_fAt92sfe2MZWFQoHmpWs&s=xYh27Ygf-ynnZhsdH3UjKYS7Kn6lT_T-AtQy9VffXFk&e=, or unsubscribe https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AC4LFGDMIIIRXRNJN5DY4ODVK73ENANCNFSM5WQOB3FA&d=DwMCaQ&c=sdnEM9SRGFuMt5z5w3AhsPNahmNicq64TgF1JwNR0cs&r=v8IOejxniM24GGbuf52hAajizwligqp4dTwlVwvfpSs&m=LUnO4S3Y6Ztf6TDy_3OwTL84RLHaHApRCu4I563-gJU_fAt92sfe2MZWFQoHmpWs&s=MU0q33c2S_-D8_oYZ7sUtuMYEsWrbRdKHmY3fjXxUtc&e= . You are receiving this because you modified the open/close state.Message ID: @.***>