A program to execute ngen cold start and forecast runs provided a configuration file from validation with nwm-cal-mgr and realization files for the cold start and forecast periods
git clone -b development --recurse-submodules https://github.com/NOAA-OWP/nwm-fcst-mgr.git
To run the program, one would need an environment for successfully running ngen and its modules (including t-route).
If you already have an environment for running ngen, you can use the same venv and pip install matplotlib if it is not already installed.
Otherwise, follow the following steps to build a new environment (in AWS Ubuntu 22.04 LTS Workspace):
- cd [VENV_ROOT]
- /usr/bin/python3.11 -m venv venv.ngen
- source venv.ngen/bin/activate
- pip install --upgrade pip
- pip3 install numpy==1.26.4 pandas bmipy netcdf4==1.6.3 joblib toolz Cython geopandas pyarrow matplotlib deprecated
- cd [NGEN_ROOT]/ngen/extern/t-route/
- pip install -r requirements.txt
- ./compiler.sh
where [VENV_ROOT] and [NGEN_ROOT] refer to the directory to install the python virtual environment and the root directory where ngen is installed, respectively.
Follow the following steps to test the program:
- source [VENV_ROOT]/env.ngen/bin/activate
- cd [NWM-FCST-MGR_ROOT]/nwm-fcst-mgr
- pip install .
where [NWM-FCST-MGR_ROOT] is where nwm-fcst-mgr is installed.
The program takes three arguments:
- Path to the config yaml file for a validation run (from nwm-cal-mgr)
- Path to a realization file for the forecast run (generated by nwm-msw-mgr)
- Optional Path to a realization file for the cold start run in provided by user (generated by nwm-msw-mgr)
Nwm-fcst-mgr can be run from the CLI or from Python code directly.
- from nwm_fcst_mgr.forecast import run_fcst
- valid_yaml = '~/ngwpc/run_ngen/kge_dds/noah_cfes/01123000/Output/Validation_Run/01123000_config_valid_best.yaml'
- real_path = '~/ngwpc/run_ngen/kge_dds/noah_cfes/01123000/Output/Forecast_Run/fcst_run1/01123000_realization_config_bmi_fcst.json'
- run_fcst(valid_yaml=valid_yaml, real_path=real_path)
If the user wishes to run a cold_start_period, then real_path would be replaced by the path to the cold start realization file.
python -m nwm_fcst_mgr.forecast valid_yaml real_path
where the arguments are replaced by the paths above.
To build and run nwm-fcst-mgr, you will need the following software installed and running on your system:
- Docker Engine
To build the nwm-fcst-mgr container, execute the following command:
docker build --tag=nwm-fcst-mgr .
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
Show your appreciation to those who have contributed to the project.
For open source projects, say how it is licensed.
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.