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

Submit New Article

July 8, 2009 9:00 PM PDT



Introduction :
This document explains how to build the Weather Research & Forecasting(WRF) v3.1.1 using the Intel C++ and Fortran Compilers for Linux, for example, version 11.1.046.

"WRF was developed at the National Center for Atmospheric Research (NCAR) which is operated by the University Corporation for Atmospheric Research (UCAR). NCAR and UCAR make no proprietary claims, either statutory or otherwise, to this version and release of WRF and consider WRF to be in the public domain for use by any person or entity for any purpose without any fee or charge. UCAR requests that any WRF user include this notice on any partial or full copies of WRF. WRF is provided on an "AS IS" basis and any warranties, either express or implied, including but not limited to implied warranties of non-infringement, originality, merchantability and fitness for a particular purpose, are disclaimed. In no event shall UCAR be liable for any damages, whatsoever, whether direct, indirect, consequential or special, that arise out of or in connection with the access, use or performance of WRF, including infringement actions."

This description was taken from http://www.mmm.ucar.edu/wrf/users/public.html.

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

Obtaining Source Code :
WRF source codes you can download here
http://www.mmm.ucar.edu/wrf/users/download/get_source2.html
or
http://www.mmm.ucar.edu/wrf/users/download/get_sources.html

Prerequisites :
WRF requires netCDF library and Jasper. Installation BKMs with the Intel® Compilers you can find here(netCDF) and here(Jasper).

Configuration Set Up : N/A

Source Code Changes : none

Building Notes:
All required software was installed to the /opt directory.
Typical build time on an Intel® Xeon 5500 system is about 20 minutes.

Building the Application : 
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
#INTEL_COMPILER_TOPDIR directory where Intel Compiler has been installed
export INTEL_COMPILER_TOPDIR="/opt/spdtools/compiler/cpro/Compiler/11.1/046"
#Setting environment variables for the Intel(R) C++ Compiler Professional Edition for Linux
. $INTEL_COMPILER_TOPDIR/bin/intel64/iccvars_intel64.sh
#Setting environment variables for the Intel(R) Fortran Compiler Professional Edition for Linux
. $INTEL_COMPILER_TOPDIR/bin/intel64/ifortvars_intel64.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

./configure --prefix=/opt/WRFV3

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

Running the Application :
Ideal Cases:

1) Choose ideal cases which should be executed (e.g. em_quarter_ss).
2) Change dir to directory with test:
$cd ./ cd ./test/em_quarter_ss/
3) Run ideal preprocessor:
$ ./ideal.exe
After execution file wrfinput_d01 should be generated and output should be:

wrf: SUCCESS COMPLETE IDEAL INIT
“.
4) Run the simulation:
$./wrf.exe
After execution file wrfout_d01_0001-01-01_00:00:00 should be generated and output should be:

wrf: SUCCESS COMPLETE WRF
“.

Real Case:
1) Change dir to directory with test:
$cd ./test/em_real/
2) Link in the met_em files created with metgrid.exe:
ln -sf ../../../WPS/met_em*.
Hot to create met_em files you can find here.
3) Run real preprocessor:
$ ./real.exe
After execution file wrfinput_d01 should be generated and output should be:

wrf: SUCCESS COMPLETE REAL INIT
“.
4) Run the simulation:
$./wrf.exe
After execution file wrfout_d01_0001-01-01_00:00:00 should be generated and output should be:



Verifying Correctness :

If you want to check building errors or full building log you should check file build_WRF.err or build_WRF.log, respectively.
Then you should go to the directory ./buildlog ($cd ./buildlog) and check every log file there.

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 :
Before execution you have to

make unlimited stack size
$ ulimit -s unlimited
.



Do you need more help?