Description: This linear reservoir model includes an implementation of the Basic Model Interface (BMI). It's meant for demonstration purposes, but feel free to use it however you like. I'd recommend it mostly for hydrologic modeling, but you do you.
BMI is developed by the CSDMS group at CU Boulder. Much of the BMI code here is from their heat example.
This is a simple bit of Python code developed with Python 3.9. The linearresBMI
module requires:
- The BMI Python bindings from CSDMS
numpy
yaml
The example also requires:
- Jupyter Notebook
pandas
Matplotlib
First install the BMI Python bindings using the CSDMS instructions. Next, build the model by going to the main level of the linearresBMI
directory and running:
pip install -e .
This model comes with an example Jupyter Notebook so you can see how the BMI functions work to control model execution and the handling of data.
examples/run-model-from-bmi.ipynb
To note, the example comes with its own synthetic forcing data, but you can create your own using the R code in tools
.
This is but a simple model that makes several assumptions. They are:
- All incoming precipitation (or land surface water flux) is liquid
- Discharge is the only way to leave the reservoir (i.e., there is no evapotranspiration)
- The model is configured for a daily timestep and there is no explicit handling of POSIX-formatted datetimes
If you see any bugs, errors, etc., please use this repo's Issue Tracker. You can also make any requests for help there.
- BMI from CSDMS
- The BMI Python heat example
- Wikipedia's entry on runoff models (yes, that Wikipedia)
- The linear reservoir equation cites this document: J.W. de Zeeuw, 1973. Hydrograph analysis for areas with mainly groundwater runoff. In: Drainage Principle and Applications, Vol. II, Chapter 16, Theories of field drainage and watershed runoff. p 321-358. Publication 16, International Institute for Land Reclamation and Improvement (ILRI), Wageningen, The Netherlands. (good luck finding it!)
- The Next Generation Water Prediction Capability project at the NOAA-NWS Office of Water Prediction
- GitHub repo for the NextGen Framework
- BMI implementation of the LSTM machine learning model