This step of the tutorial will guide you through the process of recompiling WPS 3.3.1 with the PToolsWin development environment.

WRF 3.3.1 is required to build WPS, so do not attempt this step until you have completed Step2.


Before you continue, make sure you have these software prerequisites:

  1. An installation of HPC Linux with PToolsWin.

  2. NetCDF for Windows.

  3. WRF for Windows

Build WPS as a Windows Executable

  1. Open a command line in your HPC Linux distro and load the PToolsWin module:
    module load ptoolswin
    module list


  2. Navigate to the WRF directory you created in Step2:

    setenv WRFDIR ${HOME}/windows/WRF 
    cd $WRFDIR


  3. Download and unpack the WPS source:


    tar xzf WPSV3.3.1.TAR.gz


  4. Apply paratools-WPSV3.3.1-patch to the WPS source code to add a new build configuration for PToolsWin:

    wget -O paratools-WPSV3.3.1.patch
    cd WPS
    patch -p1 < ../paratools-WPSV3.3.1.patch


  5. Configure your environment with the same values as when you compiled WRF:
    setenv NETCDF ${HOME}/windows/netcdf-4.1.3
    setenv WRF_EM_CORE 1 
    setenv WRF_OS Windows


  6. Configure WPS. Select Windows x86_64, PToolsWin, DM PARALLEL, NO GRIB2 (Option 5) 1:



  7. Compile WPS 2:


     ./compile |& tee compile.log
    Verify that the ptoolswin module is loaded before you begin compiling. You can view loaded modules with the command module list


  8. If the compilation was successful, you should see three symlinks in the $WRFDIR/WPS folder:
    [paratools07] 142 > echo $WRFDIR
    [paratools07] 143 > pwd
    [paratools07] 144 > ls -l *.exe
    lrwxrwxrwx. 1 livetau livetau 23 Mar 25 14:09 geogrid.exe -> geogrid/src/geogrid.exe
    lrwxrwxrwx. 1 livetau livetau 23 Mar 25 14:10 metgrid.exe -> metgrid/src/metgrid.exe
    lrwxrwxrwx. 1 livetau livetau 21 Mar 25 14:10 ungrib.exe -> ungrib/src/ungrib.exe
    [paratools07] 145 >

    If any of these symlinks are missing or broken, check configure.log for errors ( do a case-insensitive search for “Error”) and try re-compiling. Otherwise, continue to Step 4.


  1. If you want to work with GRIB2 data then you will also need JasPer, libPNG, and zlib for Windows. Source code for these three packages is available here. Porting these libraries is fairly simple and is left as an exercise for the reader. Be sure to add the include file and library file paths for these libraries to your configure.wps file before you compile WPS. (1)
  2. Check the Compile module of the WRF ARW Online Tutorial for more information on compiling WPS. (2)