Compile WRF & WPS for Real-data Simulations¶
Obtain the Source Code¶
Move to your “scratch” space and create a new directory called compiling, then move to that directory.
cd /glade/derecho/scratch/$USER mkdir compiling cd compiling
Issue the following commands to obtain the WRF and WPS source code from WRF’s GitHub code repository:
git clone --recurse-submodule https://github.com/wrf-model/WRF.git git clone https://github.com/wrf-model/WPS.git
You should now have a WRF and a WPS directory in your /glade/derecho/scratch/$USER/compile directory. Each of these directories contains the source code for its programs.
Configure WRF¶
Important
Although WPS programs are run first in the modeling process, compilation of WPS depends on the successful compilation of the WRF code; therefore WRF must be compiled prior to compiling WPS.
Go into the WRF directory and issue the command to configure the compile:
cd WRF ./configure
Choose the machine and its configuration from the list. The recommended option to compile WRF on Derecho is:
WRF (dmpar): INTEL (ftn/icc): Cray XC (dmpar); option 50
Choose a nesting option. The most commonly-used option is 1=basic.
Compile for nesting? (0=no nesting, 1=basic, 2=preset moves, 3=vortex following) [default 0]:
Compile WRF¶
Note
When compiling on Derecho specifically, to avoid saturating the login nodes with compilation processes and negatively impacting other users, the compilation command must run in an interactive session, which launches the specified command on a batch node and returns when the command has finished.
Issue the following command to enter an interactive session (where UMMM0013 is the project code for this tutorial class). This may take a minute or two to complete.
qinteractive -A UMMM0013
To set the interactive environment correctly source the .bashrc script that resides in your home directory:
source /glade/u/home/$user/.bashrc
Issue the following command to compile WRF. This can take 30-60 minutes to complete.
./compile em_real -j 6 >& compile.log
Once it is finished, check to see if the executables are present in the WRF/main directory by issuing:
ls -l main/*.exe
The following executables should be present:
wrf.exe
real.exe
ndown.exeIf not, check the compile.log to look for compile errors (search for the string “Error”, with a capital “E”).
Important
Stay in the interactive mode through the process of compiling WPS. After that, you may return back to your regular session on Derecho.
Configure WPS¶
Note
WRF must be successfully compiled prior to building WPS, as WPS relies on the I/O from WRF.
Move into the WPS directory and define the WRF_DIR environment variable, which instructs the WPS program where to find the WRF I/O necessary for compiling the geogrid and metgrid executables.
export WRF_DIR=../WRF
Configure WPS.
./configure
Choose the machine and its configuration from the list. The recommended option to compile WPS on Derecho is
WPS: Linux x86_64, Intel compiler (serial); option 17
Compile WPS¶
Issue the compile command:
qcmd -A UMMM0013 -- ./compile >& compile.log
This process should not take very long to compile - just a few minutes.
Once it’s finished, check to see if these executables are present in the WPS directory:
geogrid.exe
ungrib.exe
metgrid.exeIf not, check compile.log to look for compile errors (search for the string “Error” with a capital “E”).
Return to the Practice Exercise home to page to run another exercise.