Home Agenda Lectures Virtual Mtg. Etiquette



  Quick Links

Compile WRF-ARW

Obtain the Source Code

  1. Create a new directory in your home space, called compiling and go into that directory.


  2. Issue the following commands to obtain the WRF and WPS source code from GitHub:
  3. WRF : git clone --recurse-submodule https://github.com/wrf-model/WRF.git
    WPS : git clone https://github.com/wrf-model/WPS.git

    Recommended options to compile the code are:

    WRF (dmpar): INTEL (ftn/icc): Cray XC (dmpar); option 50
    WRF (serial): INTEL (ftn/icc): Cray XC (serial); option 48 – must use for 2d idealized cases

    WPS: Linux x86_64, Intel compiler (serial); option 17




Note

If you are compiling an idealized case, you only need to compile WRF (to obtain the executables ideal.exe and wrf.exe). You do not need to compile WPS.




Configure WRF


Note

Even though you will run WPS first, compilation of WPS depends on the successful compilation of the WRF code.


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

    cd WRF

    ./configure


  2. Choose the machine and its configuration from the list. See Recommended options above.

  3. Choose a nesting option.
    Compile for nesting?
    (0=no nesting, 1=basic, 2=preset moves, 3=vortex following) [default 0]:
    The most common option is "basic" (1)



Compile WRF


Note

This is for a real case compilation. To view instructions for compiling for an idealized case, please see the idealized cases exercise.




IMPORTANT NOTE!!

When compiling on Derecho specifically, to avoid saturating the Derecho login nodes with compilation processes and negatively impacting other users, we will run our compilation command on a batch node with the special qcmd command, which launches the specified command on a batch node and returns when the command has finished. So, although you would normally not use "qcmd" when compiling WRF on other systems, for this tutorial we will prefix the usual compilation command with qcmd -A UMMM0005 -- (where UMMM0005 is the computing project we're working under).

  1. Issue the following command to compile:
    qcmd -A UMMM0005 -- ./compile em_real -j 6 >& compile.log
    This can take 30-60 minutes to complete.


  2. Once it is finished, check to see if the executables are present in the main directory by issuing:
    ls -l main/*.exe
    You should see:
    wrf.exe
    real.exe
    ndown.exe

    If you don't, check the compile.log to look for compile errors (search for the string 'Error').



Configure WPS


Note

You must make sure that WRF has been successfully compiled prior to building WPS, as WPS relies on the I/O from WRF.


  1. Go into the WPS directory and define the WRF_DIR environment variable. This tells the WPS program where WRF is compiled so that it can use its I/O for compiling the geogrid and metgrid executables.
    export WRF_DIR=../WPS
  2. Configure WPS
    ./configure
  3. Pick the machine and its configuration from the list. See Recommended options above.


Compile WPS

  • Issue the compile command:
    qcmd -A UMMM0005 -- ./compile >& compile.log

    This shouldn't take very long to compile.


  • Once it's finished, check to see if these executables are present in the WPS directory:
    geogrid.exe
    ungrib.exe
    metgrid.exe

    If they are not there, check compile log to look for compile errors (search for the string 'Error').  



  • WRF Tutorial Exercises



    Continue to More Exercises

    If you plan to attempt more exercises right now, you can access the cases studies menu by clicking here.