Building the WRF v.3 and the WPS v.3 with Intel® Compilers for distributed mode execution on Linux*

Submit New Article

November 25, 2009 8:00 PM PST



Introduction :
This document explains how to build the Weather Research & Forecasting(WRF) v3.1.1 and the WRF Preprocessing System(WPS) v3.1.1 using the Intel C++ and Fortran Compilers for Linux(e.g. version 11.1.046) and Intel MPI (e.g. 3.2.1).
Building WRF and WPS BKMs with Intel(r) Compilers in serial mode you can find here: WRF and WPS.

Before you continue reading this article please check another article at http://software.intel.com/en-us/articles/building-the-wrf-with-intel-compilers-on-linux-and-improving-performance-on-intel-architecture/.

Version :
WRF v.3.1.1.
WPS v.3.1.1.
Intel(r) C++ and Fortran Compilers Professional Edition for Linux 11.1.046.

Obtaining Source Code :
The WRF source codes can be downloaded here.
The WPS source codes can be downloaded here.

Prerequisites :
The WRF requires netCDF library. Installation best known method with the Intel® Compilers you can find here.
The WPS requires:
1)The WRF.
2)The Jasper library. Installation best know method with the Intel® Compilers you can find here.
3)The JPEG library. Installation best know method with the Intel® Compilers you can find here.
4)The Zlib  library. Installation best know method with the Intel® Compilers you can find here.
5)The NCAR Graphics* library. How to build with Intel(R) Compilers you can find here.


Environment Set Up :
You should set up environment variables for Intel(r) C++ and Fortran Compiler and netCDF. If you want to build distributed version of WPS then you should set up environment variables for Inte MPI.
E.g.
$export INTEL_COMPILER_TOPDIR="/opt/spdtools/compiler/cpro/Compiler/11.1/046"
$. $INTEL_COMPILER_TOPDIR/bin/intel64/ifortvars_intel64.sh
$. $INTEL_COMPILER_TOPDIR/bin/intel64/iccvars_intel64.sh
$export NETCDF=/opt/netcdf
$. /opt/intel/impi/3.2.1.009/bin64/mpivars.sh

Source Code Changes : none

Building the Application :
Note: While building mpicc and mpif90 should be symbolic links to mpiicc and mpiifort, respectively.

WRF:
1)Copy/move tar file WRFV3.1.1.TAR.gz to the directory /opt.
2)Decompress source files

$ tar -zxvf WRFV3.1.1.TAR.gz
3)
$cd ./WRFV3

4)Create script build_WRF.sh:

"#!/bin/sh
export NETCDF=/opt/netcdf
export JASPERLIB=/opt/usr/lib
export JASPERINC=/opt/usr/include
export LD_LIBRARY_PATH="/opt/lib/:${LD_LIBRARY_PATH}"
export INCLUDE="/opt/include/:${INCLUDE}"

# To enable large file
# support in NetCDF, set the environment variable
#WRFIO_NCD_LARGE_FILE_SUPPORT to 1
export WRFIO_NCD_LARGE_FILE_SUPPORT=1

#If you have Intel MPI installed and wish to use instead, make the
#following changes to settings below:
#DM_FC = mpiifort
#DM_CC = mpiicc
#and source bin64/mpivars.sh file from your Intel MPI installation
#before the build.
export DM_FC=mpiifort
export DM_CC=mpiicc

./configure --prefix=/opt/WRFV3-mpi

mkdir ./buildlog
./compile em_b_wave &> ./buildlog/em_b_wave
./compile em_grav2d_x &> ./buildlog/em_grav2d_x
./compile em_heldsuarez &> ./buildlog/em_heldsuarez
./compile em_hill2d_x &> ./buildlog/em_hill2d_x
./compile em_les &> ./buildlog/em_les
./compile em_quarter_ss &> ./buildlog/em_quarter_ss
./compile em_real &> ./buildlog/em_real
./compile em_seabreeze2d_x &> ./buildlog/em_seabreeze2d_x
./compile em_squall2d_x &> ./buildlog/em_squall2d_x
./compile em_squall2d_y &> ./buildlog/em_squall2d_y

"
5)Make script executable:
$chmod +x build_WRF.sh

6)Execute this script with command line:
$((./build_WRF.sh) 3>&2 2>&1 1>&3 | tee build_WRF.err ) 2>&1 | tee build_WRF.log
Or just execute script:
$./build_WRF.sh
NOTE:
For building parallel WRF version chose
7. Linux x86_64 i486 i586 i686, ifort compiler with icc (dmpar)
or
8. Linux x86_64 i486 i586 i686, ifort compiler with icc (dm+sm)
while configuring.


WPS:

1)Copy/move tar file WPSV3.1.1.TAR.gz to the directory /opt.
2)Decompress source files
$tar -zxvf WPSV3.1.1.TAR.gz
.
3)Set up environment variables which are mentioned in section "Configuration Set Up".
4)Configure WPS
$./configure
NOTE:
For building WPS parallel version chose
3. PC Linux x86_64, Intel compiler DM parallel, NO GRIB2
or
4. PC Linux x86_64, Intel compiler DM parallel
while configuring.
5)Compile WPS
$./compile


Running the Application :
1)To run under Intel(r) MPI first of all MPD ring should be brought up
a) on the single machine:
$mpdboot &
b)on hosts (some hosts) in the file mpd.hosts:
$mpdboot -n <number to start > -f mpd.hosts
.
2)To run the main WRF simulation in parallel mode:
$mpiexec - n <number of procs> ./wrf.exe
3)To run WPS components in parallel mode:
$mpiexec - n <number of procs> ./component_name.exe

Verifying Correctness :
To verify results you can use utility diffwrf. You can find it in directory./external/io_netcdf/diffwrf.

E.g. To run diffwrf from directory ./test/em_real/
$../../external/io_netcdf/diffwrf /wrfout_d01_etalon ./wrfout_d01_2000-01-24_12\:00\:00


Known Issues or Limitations :
1)If WPS should be built with WRF parallel version then in WPS post-configure file variable WRF_DIR should be changed to
WRF_DIR = ../WRFV3-mpi
.


Do you need more help?


This article applies to: ISN General,   Intel® C++ Compiler for Linux* Knowledge Base,   Intel® Fortran Compiler for Linux* Knowledge Base