Skip to content

Commit

Permalink
some ngen build instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jessica Garrett authored and madMatchstick committed Jun 2, 2023
1 parent 9d1f7f6 commit 0a36f02
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions NGEN_EXAMPLE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Running Snow17 in NextGen with Sample Data

See general [instructions](https://github.com/NOAA-OWP/ngen/wiki/NGen-Tutorial#running-cfe) for building models in the ngen framework.

### Build
```
git clone https://github.com/noaa-owp/ngen && cd ngen
git submodule update --init --recursive
```

- #### CFE
```
git submodule update --remote extern/cfe/cfe
cmake -B extern/cfe/cmake_build -S extern/cfe/cfe/ -DNGEN=ON
make -C extern/cfe/cmake_build
```
- #### fortran bmi
```
cmake -B extern/iso_c_fortran_bmi/cmake_build -S extern/iso_c_fortran_bmi
make -C extern/iso_c_fortran_bmi/cmake_build
```
- #### Snow17
```
git clone https://github.com/NOAA-OWP/snow17.git ./extern
cmake -B extern/snow17/cmake_build -S extern/snow17
cmake --build extern/snow17/cmake_build --target all
```
- #### PET
```
cmake -B extern/evapotranspiration/cmake_build -S extern/evapotranspiration/evapotranspiration/
make -C extern/evapotranspiration/cmake_build/
```
- #### Build [SLoTH](https://github.com/NOAA-OWP/SLoTH) using the following instructions. SLoTH bmi provides dummy values for bmi input variables that are not used in the realization.
```
cd extern/sloth/ && git checkout latest
git submodule update --init --recursive
cd ../..
cmake -B extern/sloth/cmake_build -S extern/sloth/
make -C extern/sloth/cmake_build
```
- #### NGEN
```
cmake -B cmake_build -S . -DBMI_C_LIB_ACTIVE=ON -DBMI_FORTRAN_ACTIVE=ON
make -j4 -C cmake_build
```
### Run
Pre-process step for configuration and data pathing
```
tar -xzvf extern/snow17/test_cases/ex1.tgz extern/snow17/test_cases/
cp extern/snow17/configs/example_bmi_multi_realization_config_w_snow17.json data
cp extern/snow17/configs/snow17-init-cat-27.namelist.input data/bmi/fortran/snow17-init-cat-27.namelist.input
```
Integrated models (SLoTH+PET+Snow17+CFE) example
```
./cmake_build/ngen data/catchment_data.geojson cat-27 data/nexus_data.geojson nex-26 data/example_bmi_multi_realization_config_w_snow17.json
```

0 comments on commit 0a36f02

Please sign in to comment.