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

BMI for Standalone Reservoirs #611

Merged
merged 33 commits into from
May 12, 2023

Conversation

shorvath-noaa
Copy link
Contributor

Creates access to t-route's reservoir modules through standard BMI functions. This takes all input via BMI (rather than by reading from files) with the exception of a config file. Designed to operate in individual reservoir. All reservoirs are initialized as Level Pool, then DA is handled accordingly for Persistence or RFC reservoirs. Reservoir inflow, outflow, and water surface elevation are available as output variables.

Additions

  • bmi_reservoirs.py: BMI standard functions that access reservoir functions
  • reservoir_model.py: New 'model' class that contains key functions of reservoirs. This is what bmi_reservoirs.py interacts with
  • reservoir_RFC_da.py: Python version of RFC DA that was previously done in Fortran (adapted from file troute/src/kernel/reservoir/RFC_Forecasts/module_rfc_forecasts.F)
  • test files for persistence and RFC reservoir examples

Removals

Changes

Testing

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

shorvath-noaa and others added 30 commits March 6, 2023 21:48
Merge branch 'reservoir_bmi' of https://github.com/shorvath-noaa/t-route into reservoir_bmi
@shorvath-noaa shorvath-noaa requested a review from kumdonoaa May 11, 2023 14:16
self._timeseries_discharges, # gage observation values (cms)
self._timeseries_idx, # index of for current time series observation
self._time_step, # routing period (sec)
self._time, # model time (sec)
Copy link
Contributor

Choose a reason for hiding this comment

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

As current_time advances by routing_period each time the RFC Fortran gets called, self._time in L180 needs to be modified by self._time + self._time_step to compute the same outflow list as from Fortran.

-----
'''
if use_RFC and current_time<=rfc_forecast_persist_seconds:
if current_time >= update_time:
Copy link
Contributor

Choose a reason for hiding this comment

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

To be the same as the Fortran version, we need to add one more condition at L232: "and timeseries_idx < total_counts:", which subsequently requires to add total_counts as an additional input argument.

@shorvath-noaa shorvath-noaa merged commit b0d814a into NOAA-OWP:master May 12, 2023
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