Detailed instructions on how to build and run SoilFreezeThaw (SFT) in three modes (standalone, pseudo, and nextgen frameworks) are provided below. Standalone mode refers to running the model by itself, not linked to any other model. Pseudo or pseudo framework mode uses code within the SoilFreezeThaw repo to link external models with SFT. The nextgen framework mode creates a build that must be run within the nextgen framework, a framework used to ingest data, pass data, link models, and provide model output.
Building SFT requires GCC and CMAKE on your machine.
git clone https://github.com/NOAA-OWP/SoilFreezeThaw
cd SoilFreezeThaw
*Note: Before running the following examples, it is recommended to run the unittests tests.
The standalone example uses prescribed soil moisture conditions that do not change with time (static) and ground surface temperature for Laramie, WY. It is intended for testing purposes only. The simulated results are compared against the benchmark results.
mkdir build && cd build
cmake ../ -DSTANDALONE=ON
make && cd ..
Run: ./run_sft.sh STANDALONE (from SoilFreezeThaw directory)
The pseudo framework example runs SFT coupled with Conceptual Funational Equivalent CFE, Soil Moisture Profiles SMP, and potential evapotranspiration model PET for about 3 years using Laramie, WY forcing data.
The simulated ice_fraction is compared with the existing golden test
ice_fraction using Schaake runoff scheme. If the test is successful, the user should be able to see Test passed? Yes
.
Notation:* PFRAMEWORK denotes pseudo-framework
All these steps should happen inside the SoilFreezeThaw directory.
git clone https://github.com/NOAA-OWP/cfe extern/cfe
git clone https://github.com/NOAA-OWP/SoilMoistureProfiles extern/SoilMoistureProfiles
git clone https://github.com/NOAA-OWP/aorc_bmi extern/aorc_bmi
git clone https://github.com/NOAA-OWP/evapotranspiration extern/evapotranspiration
mkdir build && cd build
cmake ../ -DPFRAMEWORK=ON
make && cd ..
Run: ./run_sft.sh PFRAMEWORK (from SoilFreezeThaw directory)
We provide three examples here to run and test SFT (coupled/uncoupled modes) in the nextgen framework.
- Example 1: SFT standalone example (uses prescribed ground surface temperature; same as Synthetic test). This method should only be used for testing purposes.
- Example 2: Integrated models (SLoTH+PET+SMP+SFT+CFE) example without NOAH-OWP-Mod (uses prescribed ground surface temperature).
- Example 3: Integrated models (SLoTH+SMP+SFT+CFE/LASAM) example with NOAH-OWP-Mod where NOAH-OWP-Mod provides the ground surface temperature to SFT.
See general instructions for building models in the ngen framework. Note that ngen cmake flag can be set (i.e., NGEN_WITH_EXTERN_ALL=ON
) to build SLoTH, CFE, PET, Noah-owp-modular (more details are provided below).
Specific instructions for building an integrated system:
git clone https://github.com/noaa-owp/ngen && cd ngen
git submodule update --init --recursive
To use the noah-owp-modular fortran library, we need to build the iso_c_fortran_bmi middleware.
cmake -B extern/iso_c_fortran_bmi/cmake_build -S extern/iso_c_fortran_bmi
make -C extern/iso_c_fortran_bmi/cmake_build
git submodule update --remote extern/cfe/cfe
cmake -B extern/cfe/cfe/cmake_build -S extern/cfe/cfe/ -DNGEN=ON
make -C extern/cfe/cfe/cmake_build
git clone https://github.com/NOAA-OWP/LGAR-C extern/LASAM
cmake -B extern/LASAM/LASAM/cmake_build -S extern/LASAM/ -DNGEN=ON
make -C extern/LASAM/LASAM/cmake_build
cmake -B extern/noah-owp-modular/noah-owp-modular/cmake_build -S extern/noah-owp-modular -DNGEN_IS_MAIN_PROJECT=ON
make -C extern/noah-owp-modular/noah-owp-modular/cmake_build
cmake -B extern/evapotranspiration/evapotranspiration/cmake_build -S extern/evapotranspiration/evapotranspiration/
make -C extern/evapotranspiration/evapotranspiration/cmake_build/
git submodule update --remote extern/SoilFreezeThaw/SoilFreezeThaw
cmake -B extern/SoilFreezeThaw/SoilFreezeThaw/cmake_build -S extern/SoilFreezeThaw/SoilFreezeThaw/ -DNGEN=ON
make -C extern/SoilFreezeThaw/SoilFreezeThaw/cmake_build
git submodule update --remote extern/SoilMoistureProfiles/SoilMoistureProfiles
cmake -B extern/SoilMoistureProfiles/SoilMoistureProfiles/cmake_build -S extern/SoilMoistureProfiles/SoilMoistureProfiles/ -DNGEN=ON
make -C extern/SoilMoistureProfiles/SoilMoistureProfiles/cmake_build
SLoTH is also needed to run SFT in the ngen framework. SLoTH is a BMI that is used to set a bmi variable(s) that is not provided by other BMIs but required by the model. So build SLoTH using the following instructions.
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
cmake -B cmake_build -S . -DNGEN_WITH_BMI_C=ON -DNGEN_WITH_BMI_FORTRAN=ON -DNGEN_WITH_SQLITE=ON
make -j4 -C cmake_build
As mentioned earlier, CFE, SLoTH, PET, and Noah-owp-modular can be built as ngen external models at the ngen build time using
cmake -B cmake_build -S . -DNGEN_WITH_BMI_FORTRAN=ON -DNGEN_WITH_SQLITE=ON -DNGEN_WITH_EXTERN_ALL=ON
make -j4 -C cmake_build
The following pre-process step needs to be completed before running the below examples.
mkdir sft && cd sft
ln -s ../extern
ln -s ../data
ln -s ./extern/SoilFreezeThaw/SoilFreezeThaw/configs
ln -s ./extern/SoilFreezeThaw/SoilFreezeThaw/forcings
ln -s ./extern/SoilFreezeThaw/SoilFreezeThaw/realizations
../cmake_build/ngen data/catchment_data.geojson cat-27 data/nexus_data.geojson nex-26 realizations/realization_standalone.json
Run: python ./extern/SoilFreezeThaw/SoilFreezeThaw/tests/test_standalone_ngen.py
(from the sft directory) to compare Example 1 results against the benchmark.
../cmake_build/ngen data/catchment_data.geojson cat-27 data/nexus_data.geojson nex-26 realizations/realization_coupled.json
Detailed instructions for running this example along with realization and model config files are provided in the examples directory.
- For standalone simulations: run
python extern/SoilFreezeThaw/SoilFreezeThaw/tests/test_standalone_ngen.py
(test_standalone_ngen.py script compares results with a gold test output) - For integrated simulation: Output data is stored in cat-27.csv, use your favorite tool to visualize data