Compile WRF & WPS for Real-data Simulations



Obtain the Source Code

  1. 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
    


  2. 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.


  1. Go into the WRF directory and issue the command to configure the compile:


    cd WRF
    
    ./configure
    


  2. 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
    


  3. 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.


  1. 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
    

  2. To set the interactive environment correctly source the .bashrc script that resides in your home directory:


    source /glade/u/home/$user/.bashrc
    


  3. Issue the following command to compile WRF. This can take 30-60 minutes to complete.


    ./compile em_real -j 6 >& compile.log
    


  4. 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.exe


    If 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.


  1. 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
    


  2. 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

  1. Issue the compile command:


    qcmd -A UMMM0013 -- ./compile >& compile.log
    

    This process should not take very long to compile - just a few minutes.



  2. Once it’s finished, check to see if these executables are present in the WPS directory:

    geogrid.exe
    ungrib.exe
    metgrid.exe


    If 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.