Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make diffusive routing capable of running on refactored hydrofabric of Lower Colorado River, TX #561

Merged
merged 14 commits into from
May 24, 2022

Conversation

kumdonoaa
Copy link
Contributor

@kumdonoaa kumdonoaa commented May 18, 2022

The computation time of the diffusive wave channel routing module of t-route mainly depends on the length of the shortest stream segment among all stream segments of a channel network. The current shortest length is as small as a few meters. The refactored hydrofabric we tested for this PR has about 500 meters as the shortest. This change significantly increased the computation speed. However, tentative results showed decrease in routing accuracy to some extent mainly because a finite-difference equation for solving the partial differential equations of the diffusive routing generally requires a small spatial interval of a space-time grid for achieving expected accuracy. Furthermore, the change tends to increase celerity (faster move of flooding waves) and decrease diffusivity because spatial interval in the denominator of celerity equation and diffusivity multiplied by the second order PDE w.r.t. distance, respectively. Further investigation is needed to reach a final conclusion.

Additions

  • diffusive.f90 : crosswalk mapping routing results (i.e., streamflow and elevation) of refactored hydrofabric to the original.
  • preprocess.py: prepares natural x-sec topobathy data for refactored hydrofabric when "run_hybrid_routing"= True, "use_natl_xsections"=True, and "run_refactored_network"=True in test_AnA.yaml
  • diffusive_utils.py: multiple functions were added mainly for adding 1) fortran-python network map, 2) lateral flow/initial flow/segment lengths. 3) x-section topobathy data, and 4) crosswalk map all for refactored hydrofabric. When "run_refactored_network"= False with other flags being still True, it run topobathy data of original hydrofabric. When use_natl_xsections" is also False, diffusive routing runs on trapezoidal channel.
  • test_AnA.yaml : used for running a couple days
  • lower_colorado_refac.yaml: used for running a month simulation

Removals

Changes

Testing

1. One month simulation of hybrid routing (MC for entire network / Diffusive only on mainstem) for original vs. refactored hydrofabric

Water balance check between original and refactored hydrofabric focused on a dry period between about 6/10 and 6/20 where the two hydrographs (refac and no refac) are almost identical each other, partially confirming that the same total water volume entered the system existed almost the same rate. Regarding compute time for one month simulation for the Lower Colorado domain, MC only took 112 seconds with a parallel compute scheme while the hybrid took 242 seconds.

Recording 2022-05-18 at 16 27 32

This hydrograph shows a tradeoff between compute speed and routing accuracy, resulting from increasing the length of shortest stream segment. The light green hydrograph from refactored hydrofabric shows more kinematic wave character (less wave attenuation) and earlier arrival of the wave (due to larger celerity) than the wave from original hydrofabric. Is it a sort of degradation of diffusive wave routing? We need further investigation with a different shortest stream segment length (for example, 250 meters instead of 500 meters) to get more sense of it.

image

Screenshots

Notes

Todos

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows project standards (link if applicable)
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Visually tested in supported browsers and devices (see checklist below 👇)
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool ➡️

Testing checklist

Target Environment support

  • Windows
  • Linux
  • Browser

Accessibility

  • Keyboard friendly
  • Screen reader friendly

Other

  • Is useable without CSS
  • Is useable without JS
  • Flexible from small to large screens
  • No linting errors or warnings
  • JavaScript tests are passing

param_df = param_df.set_index("key").sort_index()

# get and apply domain mask
if "mask_file_path" in diff_network_parameters:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I dropped this in my branch as it was causing issues when actually applied. Let's revisit after testing and we can use the code from my branch.

Copy link
Collaborator

@BrianAvant BrianAvant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing complete for Lower Colorado diffusive domain. Still need to resolve issues with full coastal domain.

@BrianAvant BrianAvant merged commit c6d8c9d into NOAA-OWP:master May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants