-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dd47d07
commit 56f51b8
Showing
10 changed files
with
93 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,55 @@ | ||
This README provides a brief description of how to build WRF-Hydro as a standalone | ||
modeling system. | ||
|
||
More details regarding the model as well as documentation and user guides can be found on | ||
the project website: | ||
# Standalone WRF-Hydro Build Instructions | ||
Details regarding the model as well as documentation and user guides can be | ||
found on the project website: | ||
https://ral.ucar.edu/projects/wrf_hydro | ||
|
||
Requirements: | ||
* A supported Fortran compiler: | ||
- PGI (pgfortran) | ||
- Intel (ifort) | ||
- GNU (gfortran) | ||
* MPI libraries (MPICH or Open MPI) | ||
* netCDF C & Fortran libraries version 4 or greater | ||
## Requirements | ||
* A supported Fortran compiler: | ||
- GNU (gfortran) | ||
- Cray (ftn) | ||
- Intel (ifort) | ||
- NVidia (nvfortran) | ||
* MPI libraries (MPICH or Open MPI) | ||
* NetCDF C & Fortran libraries v4.0+ | ||
|
||
Please note that these libraries need to be compiled with the same set of compilers | ||
that will be used to compile WRF-Hydro | ||
Please note that these libraries need to be compiled with the same set of | ||
compilers that will be used to compile WRF-Hydro | ||
|
||
Steps for building WRF-Hydro: | ||
## Building WRF-Hydro | ||
|
||
1. Obtain the source code | ||
|
||
The source code for the latest WRF-Hydro release can be obtained here: | ||
https://github.com/NCAR/wrf_hydro_nwm_public/releases/latest | ||
|
||
Download and unpack the source code and navigate to the directory where you will | ||
compile the code: | ||
|
||
cd wrf_hydro*/src | ||
|
||
2. Set the required environment variables | ||
|
||
Note: If the required netCDF libraries are not already available on your system | ||
(these are commonly available as a module on high performance computing environments), | ||
you will need to install them now. | ||
|
||
First ensure the environment variables describing where your netCDF libraries live | ||
are set appropriately so that the compiler can find them. For a bash shell the | ||
following should work with <PATH> replaced by the installation prefix for your | ||
netCDF libraries. | ||
|
||
export NETCDF_INC"<PATH>/include" | ||
export NETCDF_LIB="<PATH>/lib" | ||
|
||
Then copy over the setEnvar.sh script from the 'template' directory and edit | ||
the WRF-Hydro environment variables / compile time options in the file as needed. | ||
This file can then be passed as an argument (see step #4) to the compile scripts | ||
below which will source the environment variables for you. Alternatively these | ||
environment variables can be set by the user. | ||
The source code for the latest WRF-Hydro release can be obtained here: | ||
https://github.com/NCAR/wrf_hydro_nwm_public/releases/latest | ||
|
||
3. Configure | ||
Download and unpack the source code and navigate to the directory where you | ||
will compile the code: | ||
|
||
To configure the model run the following and select the appropriate option for | ||
your system / compiler: | ||
``` | ||
$ wget https://github.com/NCAR/wrf_hydro_nwm_public/archive/refs/tags/v5.4.0.tar.gz | ||
$ tar zxf v5.4.0.tar.gz | ||
$ cd wrf_hydro_nwm_public-5.3.0/src | ||
``` | ||
|
||
./configure | ||
2. Compile using CMake | ||
|
||
4. Compile | ||
Create build directory, configure with CMake, and then compile. | ||
See the [CMake Build link](https://github.com/NCAR/wrf_hydro_nwm_public/blob/main/docs/BUILD.md#cmake-build) | ||
for a table of WRF-Hydro specific configuration options. | ||
The user can enable debug mode, nudging, etc. | ||
|
||
To compile the model run the compile script with the name corresponding to the | ||
land surface model (i.e. Noah or NoahMP) you would like to be utilized within | ||
WRF-Hydro and pass the file containing the WRF-Hydro environment variables / | ||
compile time options as an argument: | ||
``` | ||
$ mkdir build | ||
$ cd build | ||
$ cmake .. | ||
$ make -j 4 | ||
``` | ||
|
||
./compile_offline_Noah.sh setEnvar.sh | ||
OR | ||
./compile_offline_NoahMP.sh setEnvar.sh | ||
This should result in the creation of a 'Run' directory populated with the | ||
appropriate template parameter tables and namelists for the land surface model | ||
selected as well as a model executable that is then symlinked to wrf_hydro.exe. | ||
|
||
This should result in the creation of a 'Run' directory populated with the | ||
appropriate template parameter tables and namelists for the land surface model | ||
selected as well as a model executable that is then symlinked to wrf_hydro.exe. | ||
Note that, as mentioned above, passing the environment variable file as an | ||
argument to the compile script is optional. However, if this is not passed the | ||
desired environment variables must be set prior to running the compile script. | ||
|
||
Note that, as mentioned above, passing the environment variable file as an argument | ||
to the compile script is optional. However, if this is not passed the desired | ||
environment variables must be set prior to running the compile script. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
tests/local | ||
=========== | ||
|
||
# Purpose | ||
Where local testing happens. | ||
Where local testing happens. | ||
|
||
# run_tests.py | ||
This is the commandline interface to pytest and running the tests. | ||
This is the commandline interface to pytest and running the tests. | ||
`python run_tests.py --help` | ||
for more information | ||
See ../README.md for more context. | ||
|
||
# requirements.txt | ||
These are essentially the requirements of wrf\_hydro\_py repeated here for minimal confusion. | ||
These are essentially the requirements of wrf\_hydro\_py repeated here for minimal confusion. | ||
|
||
# cheyenne | ||
Scripting for cheyenne, including scheduling. Examples in the help. | ||
# Derecho | ||
Scripting for Derecho, including scheduling. Examples in the help. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
# These paths point to a preconfigured conda environment. Likewise, you can install your own | ||
# using the utils/nwm_testing.yml conda environment file. | ||
export PATH="/glade/work/jmills/nwm_testing/miniconda3/envs/nwm_testing/bin:$PATH" | ||
export PYTHONPATH="/glade/work/jmills/nwm_testing/miniconda3/envs/nwm_testing/lib/python3.7/site-packages" | ||
# Load conda environment | ||
|
||
# Run the tests using a scheduler with default nnodes of6 and ncores of 216 | ||
# Run the tests using a scheduler | ||
python /glade/scratch/$USER/wrf_hydro_nwm_public/tests/local/run_tests.py \ | ||
--config nwm_ana nwm_long_range gridded reach \ | ||
--compiler ifort \ | ||
--output_dir /glade/scratch/$USER/test_out \ | ||
--candidate_dir /glade/scratch/$USER/wrf_hydro_nwm_public/ \ | ||
--reference_dir /glade/scratch/$USER/wrf_hydro_nwm_public/ \ | ||
--domain_dir /glade/work/jamesmcc/domains/private/CONUS \ | ||
--output_dir /glade/derecho/scratch/$USER/test_out \ | ||
--candidate_dir /glade/derecho/scratch/$USER/wrf_hydro_nwm_public/ \ | ||
--reference_dir /glade/derecho/scratch/$USER/wrf_hydro_nwm_public/ \ | ||
--domain_dir path/to/CONUS_domain \ | ||
--scheduler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.