Building and testing WRF on Triolith

From SNIC Documentation
Revision as of 12:03, 31 August 2017 by Hamish Struthers (NSC) (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page describes the compiling and testing of the WRF v371 model on NSC's triolith system (Triolith). Source code can be downloaded from the WRF page ([1]) after filling in a registration form.

The notes below refer to compiling and testing version 3.7.1 of the model.

1. Ensure the correct intel compiler, HDF5 and netcdf modules are loaded using:

module load buildenv-intel/2015-1
module load hdf5/1.8.14-i1403-impi-5.0.2.044
module load netcdf/4.3.2-i1403-impi-5.0.2.044-hdf5-1.8.14

2. Set appropriate HDF5 and netcdf environment variables:

export PHDF5=/software/apps/hdf5/1.8.14/i1403-impi-5.0.2.044
export NETCDF=/software/apps/netcdf/4.3.2/i1403-impi-5.0.2.044-hdf5-1.8.14

3. Configure the model. In the WRF base folder (WRF3):

./configure

If you are using/testing the 3D version of the model, choose option 16

If you are using/testing the 2D version of the model, choose option 13 (serial). For the 2D case, at this point the configure.wrf file also needs to be edited - lines 241-244 should appear as:

LIB_EXTERNAL    = \
                     -L$(WRF_SRC_ROOT_DIR)/external/io_netcdf -lwrfio_nf -L/software/apps/netcdf/4.3.2/i1403-impi-5.0.2.044-hdf5-1.8.14/lib -lnetcdff -lnetcdf   \
                     -L/software/apps/intel/composer_xe_2015.1.133/compiler/lib/intel64 -liomp5

4. Compile the model:

./compile -j 4 wrf

5. Compile test case (see README_test_cases), e.g. 3D quarter-circle sheer supercell

./compile em_quarter_ss

6. After a successful build, go to the specific test directory, e.g.:

cd test/em_quarter_ss

and run the initialization (ideal.exe) followed by the simulation (wrf.exe).

  • 3D case

The model should be launched using NSC's mpprun MPI launch application. The model can be tested using an interactive session e.g.

interactive -N 1 -A <your-SNIC-project-code> -t 01:00:00
mpprun ideal.exe
mpprun wrf.exe

or by submitting a run script to the batch queue system on Triolith e.g. run script:

#!/bin/csh
#SBATCH -t 01:00:00
#SBATCH -A <your-SNIC-project-code>
#SBATCH -N 1
mpprun ideal.exe
mpprun wrf.exe

More information regarding running applications on Triolith.

  • 2D case

For the 2D case, the serial code can be launched directly e.g. ./ideal.exe however note that you should still run jobs within an interactive session:

interactive -n 1 -A <your-SNIC-project-code> -t 01:00:00
./ideal.exe
./wrf.exe

or through Triolith's batch system.


Building WPS

1. Ensure the correct intel compiler, HDF5 and netcdf modules are loaded:

module load buildenv-intel/2015-1
module load hdf5/1.8.14-i1403-impi-5.0.2.044
module load netcdf/4.3.2-i1403-impi-5.0.2.044-hdf5-1.8.14

When compiling WPS, assumes you have already compiled WRF and the location/name of the WRF folder is ../WRFV3 relative to the main WPS folder.

2. Set appropriate HDF5 and netcdf environment variables:

export PHDF5=/software/apps/hdf5/1.8.14/i1403-impi-5.0.2.044
export NETCDF=/software/apps/netcdf/4.3.2/i1403-impi-5.0.2.044-hdf5-1.8.14

3. Configure WPS:

./configure

Either option 17 or 20 should work.

At this point the configure.wps file needs to be edited - line 48 should appear as:

WRF_LIB         =      -L$(WRF_DIR)/external/io_grib1 -lio_grib1 \
                       -L$(WRF_DIR)/external/io_grib_share -lio_grib_share \
                       -L$(WRF_DIR)/external/io_int -lwrfio_int \
                       -L$(WRF_DIR)/external/io_netcdf -lwrfio_nf \
                       -L$(NETCDF)/lib -lnetcdff -lnetcdf \
                       -L/software/apps/intel/composer_xe_2015.1.133/compiler/lib/intel64 -liomp5

4. Finally, compile WPS:

./compile