This guide is intended to help build WRF Version 3.2.1 on Windows with PGI 2011 compilers.

Version Information

This guide was created for WRF version 3.2.1 release and the PGI 2011 release. This information is for both x64 processors running 64-bit Windows or x86 processors running 32-bit Windows.

Application Notes

Information about The Weather Research and Forecasting (WRF) Model can be found at the WRF home page.

Obtaining the Source Code

You may obtain the source for WRF Version 3.2.1 from the WRF Users Page after filling in the registration information at the bottom of the page. While the source is freely available, you will be asked to register if you are a new user.

Dependencies

A netCDF package built using the same major version of the PGI compilers is required. Please refer to the PGI Guide to netCDF for more information on building netCDF on Windows bases systems.

Configuration and Set-up Information

  1. Unzip and untar your WRF package and cd to the created WRFV3 directory.
  2. Please review chapter 2 of the WRF user's guide and the README file included with your WRF source.
  3. Set the environmental variable NETCDF to the location of your netCDF installation. NetCDF must be installed before you can continue. See PGI Guide to netCDF for informantion on how to build netCDF for Windows.
  4. Set the environmental variable: export PGI_OBJSUFFIX=o
  5. Set the environmental variable: export WRF_OS=CYGWIN_NT
  6. Set the environmental variable: export WRF_SRC_ROOT_DIR=/c/path/to/current/directory
  7. Run:

    ./configure

    and select the configuration type, Serial, OpenMP, or MPI.

Building WRF

To build WRFV3,

  1. Edit the just generated configure.wrf file and change LIB_EXTERNAL variable by changing the path specifier on the libnetcdf.lib path from /c/ to the DOS style C:/ . This seems to be needed on some systems.
  2. Continue editing the generated configure.wrf file and change LIB_EXTERNAL variable by adding the path to the Fortran netcdf library - libnetcdff.lib - at the end of the line, similarly to how the C netcdf library is listed.
  3. Next, find the build rule for "wrfio_nf" further down in the configure.wrf file and add LIBS="$(LIB)" just before the closing parenthesis so that this links in the Fortran libraries.
  4. Run:

./compile <case_name>

where <case_name> is one of the following: em_b_wave, em_hill2d_x, em_grav2d_x, em_quarter_ss, em_squall2d_x, em_squall2d_y, or em_real. All but em_real are idealized test cases. We suggest you separately build and run each test case to ensure your installation is correct. If all the test cases are correct, then build the em_real case.

Running WRF

Please refer to the WRF user's guide for more information about running a real case. For the idealized cases, please refer to the README_test_cases file located in the root of your WRFV3 directory.

To run each idealized case,

  1. cd to the test case directory, WRFV3/test/<case_name>
  2. Run the file run_me_first.csh, if it exsists.
  3. Run ideal.exe
  4. Run wrf.exe

Verifying Correctness

Each test case should print "SUCCESS" upon completion.

Known Issues and Limitations

None.

Click me