Compile WRF for Idealized 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 source code from WRF’s GitHub code repository:
git clone --recurse-submodule https://github.com/wrf-model/WRF.git
You should now have a WRF directory in your /glade/derecho/scratch/$USER/compile directory that contains the source code for its programs.
Configure WRF¶
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 options to compile WRF on Derecho are listed below. For simplicity, we recommend compiling any idealized case with the serial option during this class.
WRF (dmpar): INTEL (ftn/icc): Cray XC (dmpar); option 50 WRF (serial): INTEL (ftn/icc): Cray XC (serial); option 48
Important
2D and 1D idealized cases must be compiled with the serial option. The 2D cases include “2d” in their name, and there is one 1D case (em_scm_xy). All others are 3D cases.
Choose a nesting option. The most commonly-used option is 1=basic, but for 1D/2D cases, option 0=no nesting must be chosen).
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.
./compile em_TESTCASE -j 6 >& compile.log
where TESTCASE refers to the ideal test you’d like to compile. These are the options:
em_b_wave compile em_convrad compile em_fire compile em_grav2d_x compile em_heldsuarez compile em_hill2d_x compile em_les compile em_quarter_ss compile em_scm_xy compile em_seabreeze2d_x compile em_squall2d_x compile em_squall2d_y compile em_tropical_cyclone
This can take 30-60 minutes to complete.
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
ideal.exeIf not, check the compile.log to look for compile errors (search for the string “Error”, with a capital “E”).
Note
If you later decide to compile another idealized case during the class, you will need to recompile the code, or complete all the above steps in a directory with a name other than “compile,” so as to not overwrite this work.
Return to the Practice Exercise home to page to run another exercise.