Compiling WRF on ARCHER (XC30)

This page provides compilation instructions for WRF on ARCHER (Cray XC30, Ivy Bridge).

Module Setup

Load the module to access the latest build scripts, currently

module load wrf-build/3.7.1_build1

and copy the WRF, Chem, and WPS source directories, and build scripts to your build directory

cd <your build directory>
cp -pr $WRF_BUILD_DIR/master/* .
cp -p $WRF_BUILD_DIR/pre-build.bash .
cp -p $WRF_BUILD_DIR/build.bash .
cp -p $WRF_BUILD_DIR/compile.pbs .
ln -s $WRF_GEOG geog

master contains the WRFV3 and WPS directories, and has had the relevant WRF patches applied. Archer-specific patches, mainly to the configuration defaults to add Archer-specific configurations for the Cray and Gnu compilers, have also been applied. If you want to modify the code, you should work from this master copy.

Versions 3.5.1 and 3.6.1 are still available.

Build the code

Choose the programming environment, currently Cray and Gnu have the configuration defaults set up.

Set the account to be used for the compile job that is submitted to the serial queue (the compilation takes between 1 and 8 hours depending on the compiler and the load on the post-processing node, and will exceed the CPU time limit on the login nodes).

export pbs_account=<your account here>

Set up the build environment

. ./pre-build.bash

Choose to include chemistry if you want

export WRF_CHEM=0 # without chemistry
export WRF_CHEM=1 # with chemistry

To change the nesting type from the default basic nesting, the build.bash script will need to be edited.

Then build the code with


This will configure WRF and WPS and then submit a serial job to compile the code. The compilation takes from 1 hour for the GNU compiler with no load on the post-processing node, to 8 hours for the Cray compiler and the post-processing node heavily loaded. The executables will be in the usual locations in the WRFV3 and WPS directories. In addition to the configure.wrf files that are generated, logs for the configuration and compilation steps are produced for you to check.

The wrf-build module also sets the $WRF_GEOG variable to the location of the geographical data for the chosen WRF version; this can be linked into your build directory as shown above.

Back to the WRF page