The Northwest River Forecast Center (NWRFC) uses the National Weather Service River Forecast System (NWSRFS) to support flood forecasting, water supply operations, drought monitoring, recreation, navigation, and environmental flow analyses.
This repository contains:
- Original NWSRFS FORTRAN source code and wrappers used for modern integrations.
- An R package (
nwsrfsr). - A Python package (
nwsrfspy).
The model suite includes SAC-SMA, SNOW-17, UNIT-HG, LAG-K, CHANLOSS, and CONS_USE.
From CRAN:
install.packages('nwsrfsr')Requires Python 3.11 or newer; CI and wheel builds cover Python 3.11–3.14.
Install from PyPI:
pip install nwsrfspy
pixi manages the Python toolchain (Python, gfortran for the Python build, meson, quarto, etc.) in a reproducible environment from pixi.toml. The environment will be automatically activated when you run any pixi command.
To compile the R package from source, R needs to be installed and available on the system PATH along with gfortran. See dev/README.md for the one time R setup.
git clone https://github.com/NOAA-NWRFC/nwsrfs-hydro-models.git cd nwsrfs-hydro-models pixi install # create environment pixi run install-py # build & install Python package (editable) pixi run install-r # build & install R package pixi run test-py # run Python tests pixi run test-r # run R tests pixi run test-all # run both pixi run check-r # R CMD check (no manual) pixi run build-r # build R source tarball pixi run check-r-cran # CRAN submission check on built tarball pixi run build-docs # build all docs (Python + R + R README) pixi run build-docs-py # build Python Sphinx docs only pixi run build-docs-r # build R pkgdown docs only pixi run build-docs-r-readme # render R README.qmd to HTML
-
nwsrfs-hydro-autocalibration — Automated calibration framework for NWSRFS models using evolving dynamically dimensioned search (EDDS). Uses the R and Python packages from this repository.
-
Sample calibration data:
— Input data for 5 example basins (FSSO3, SAKW1, SFLN2, WCHW1, WGCM8) archived on Zenodo.
Please cite:
Walters, G., C. Bracken, B. Gillies, et al. 2026. “A Comprehensive Calibration Framework for the Northwest River Forecast Center.” JAWRA Journal of the American Water Resources Association 62, no. 2: e70112. https://doi.org/10.1111/1752-1688.70112
If adapting this code, please credit this repository as the original source.
For model background, see the NWSRFS User Manual
Guidance on compiling and running NWSRFS code was informed by work from Andy Wood ([email protected]) and collaborators. See NWS_hydro_models.
This is a scientific product and does not represent official communication from NOAA or the U.S. Department of Commerce. All code is provided "as is."
See full disclaimer: NOAA GitHub Policy
National Oceanographic and Atmospheric Administration | National Weather Service | Northwest River Forecast Center