Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 39 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,50 +41,83 @@ Follow the following steps to test the program:
where `[NWM-FCST-MGR_ROOT]` is where nwm-fcst-mgr is installed.

## Usage
nwm-fcst-mgr supports two workflows: **forecast** and **hindcast** runs.
nwm-fcst-mgr supports three workflows: **forecast**, **hindcast**, and **lagged ensemble** runs. Each workflow support two modes controlled by the `--no_valid` flag:

- **Validation-based mode** (`no_valid = False`, default) - Uses a validation yaml file from a previous nwm-cal-mgr calibration/validation run.
- **Default/Regionaliztion-based mode** (`no_valid = True`) - Runs a forecast using the msw-mgr default or regionalization run types. gpkg and ngen paths are derived from the run directory.

Note: the hindcast workflow only supports the validation-based mode (no_valid = False)

---

### Forecast Workflow

Run a cold start or a forecast period. These runs must be preceded by calls to the nwm-msw-mgr.
Run a cold start, forecast, or lagged ensemble workflow. These runs must be preceded by calls to the nwm-msw-mgr.

Medium range lagged ensembles cycles are run 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 no_da member should be initialized with a state load from an open loop cycle. Members 1-6 should be initialized with
a state load from a closed loop cycle. The lagged ensemble workflow can only be executed with a medium range configuration.

#### CLI

** Validation-based mode:**
```bash
python -m nwm_fcst_mgr run_forecast \
/path/to/valid.yaml \
/path/to/realization.json \
--valid_yaml /path/to/valid.yaml \

```

** Default/Regionalization mode:**
```bash
python -m nwm_fcst_mgr run_forecast \
/path/to/realization.json \
--no_valid
```

#### Python

** Validation-based mode:**
```python
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/valid.yaml',
)
```

** Default/Regionalization mode:**
```python
from nwm_fcst_mgr.forecast import run_forecast

run_forecast(
real_path='/path/to/realization.json',
no_valid=True
)
```

#### Arguments
- `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
- `--valid_yaml` - (Optional) Path to validation yaml file from previous calibration run (from nwm-cal-mgr)
- `--no_valid` - (Optional) Use validation-based workflow with valid_yaml (False, default) or default/regionalization-based workflow (True)

---

### Hindcast Workflow

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.

Only supported with validation-based mode (no_valid = False)

#### CLI

```bash
python -m nwm_fcst_mgr run_hindcast \
/path/to/valid.yaml \
/path/to/input.config \
my_hindcast_run \
3 \
10 \
--valid_yaml /path/to/valid.yaml
--cold_start_state '/path/to/cold_start_state/' \
```

Expand Down Expand Up @@ -116,43 +149,6 @@ run_hindcast(
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.


### Lagged Ensemble Workflow

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.

#### CLI

```bash
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/ \
```

#### Python

```python
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/'
)
```

#### Arguments
- `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


## Docker container

### Requirements
Expand Down
Loading