A program to execute forecast and hindcast runs runs provided a configuration file from a past calibration run by the nwm-cal-mgr.
git clone -b development --recurse-submodules https://github.com/NGWPC/nwm-fcst-mgr.gitTo 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.ngensource venv.ngen/bin/activatepip install --upgrade pippip3 install numpy==1.26.4 pandas bmipy netcdf4==1.6.3 joblib toolz Cython geopandas pyarrow matplotlib deprecatedcd [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/activatecd [NWM-FCST-MGR_ROOT]/nwm-fcst-mgrpip install .
where [NWM-FCST-MGR_ROOT] is where nwm-fcst-mgr is installed.
nwm-fcst-mgr supports two workflows: forecast and hindcast runs.
Run a cold start or a forecast period. These runs must be preceded by calls to the nwm-msw-mgr.
python -m nwm_fcst_mgr run_forecast \
/path/to/valid.yaml \
/path/to/realization.json \from nwm_fcst_mgr.forecast import run_forecast
run_forecast(
valid_yaml='/path/to/valid.yaml',
real_path='/path/to/realization.json'
)valid_yaml- Path to validation yaml file from previous calibration run (from nwm-cal-mgr)input_path- Path to cold start or forecast realization file generated by nwm-msw-mgr
Run repeated hindcast cycles at regular intervals, with start up states provided by warm start runs. Cold start run must be executed separately using run_forecast.
python -m nwm_fcst_mgr run_hindcast \
/path/to/valid.yaml \
/path/to/input.config \
my_hindcast_run \
3 \
10 \
--cold_start_state '/path/to/cold_start_state/' \from nwm_fcst_mgr.forecast import run_hindcast
run_hindcast(
valid_yaml='/path/to/valid.yaml',
input_path='/path/to/input.config',
fcst_run_name='my_hindcast_run',
cycle_interval=3,
num_iterations=10,
cold_start_state='/path/to/cold_start_state/'
)valid_yaml- Path to validation yaml file from previous calibration run (from nwm-cal-mgr)input_path- Path to forecast input configuration file (from nwm-msw-mgr)my_hindcast_run- Name for the hindcast run foldercycle_interval- Cycle interval in hours (spacing between hindcast cycles)num_iterations- Number of hindcast cycles to perform--cold_start_state- (Optional) Path to cold start state to initialize hindcasting workflow
With cycle_interval=3 and num_iterations=10, hindcast runs will be executed at 0, 3, 6, 9, 12, 15, 18, 21, 24, 27 hours.
Run medium range lagged ensembles cycles with forcing inputs lagged at 6 hour intervals, with open and closed loop AnA start up states. Members 1 and no_da have no forcing time lags, while Members 2-6 have sequential 6 hour time lags. ALl lagged ensemble ngen runs are orchestrated to begin at the same time and run for either 10 days (Members 1 and no_da) or 8.5 days (Members 2-6). The lagged ensemble workflow can only be executed with a medium range configuration.
python -m nwm_fcst_mgr run_lagged_ens \
/path/to/valid.yaml \
/path/to/input.config \
my_lagged_ens_run \
--open_loop_state /path/to/open_loop_state/ \
--closed_loop_state /path/to/closed_loop_state/ \from nwm_fcst_mgr.forecast import run_lagged_ens
run_lagged_ens(
valid_yaml='/path/to/valid.yaml',
input_path='/path/to/input.config',
fcst_run_name='my_lagged_ens_run',
open_loop_state='/path/to/open_loop_state/',
closed_loop_state='/path/to/closed_loop_state/'
)valid_yaml- Path to validation yaml file from previous calibration run (from nwm-cal-mgr)input_path- Path to forecast input configuration file (from nwm-msw-mgr)my_lagged_ens_run- Name for the lagged ensemble run folder--open_start_state- Path to open loop AnA state to initialize no data assimilation member--closed_start_state- Path to closed loop AnA state to initialize members 1-6
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.