| July 8, 2009 9:00 PM PDT | |
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
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
"
$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
.
For more complete information about compiler optimizations, see our Optimization Notice.
Comments (10) 
| September 22, 2009 3:32 AM PDT
Kirill Mavrodiev (Intel)
|
Hi, Can you tell me compiler version and OS which you use? Thanks, Kirill. |
| September 25, 2009 4:43 AM PDT
Kirill Mavrodiev (Intel)
| Building and Running WRFV3 with Intel(R) Fortran Compiler for Linux v.11.1.056 passed successfully on Intel64 arch. |
| September 29, 2009 8:25 AM PDT
Ashutosh Sharma | Which Operating System (free version of Linux) is considered the best in terms of ease of use and functionality for WRF ? |
| October 11, 2009 2:31 AM PDT
Kirill Mavrodiev (Intel)
|
Hi Ashutosh Sharma, I believe that it depends on which system you get used to work. If you have any problems then don’t hesitate to send me email directly. Thanks, Kirill. |
| October 12, 2009 4:09 AM PDT
sunchao
|
Hi, I had build the wrf/chem (you can visit wrf/chem's web site at :http://ruc.noaa.gov/wrf/WG11/) with Intel C++ and Fortran COMPILER v. 11.1.Before execution I have already made unlimited stack size.But After I run the wrf.exe,I met such error message : " forrtl: severe (174): SIGSEGV, segmentation fault occurred Image PC Routine Line Source . 40000422 Unknown Unknown Unknown libiomp5.so 400885FA Unknown Unknown Unknown libpthread.so.0 00760935 Unknown Unknown Unknown libc.so.6 0069594E Unknown Unknown Unknown " Thank you for your time! |
| November 11, 2009 3:17 AM PST
Ashutosh Sharma |
Hi, I am trying to build netcdf with Intel Fortran compiler and gcc/g++ however I get error after sudo make check install command. Making check in f90 make[1]: Entering directory `~/netcdf-4.0.1/f90' ifort -I../libsrc4 -I. -g -c -o typeSizes.o typeSizes.f90 /bin/bash: ifort: command not found make[1]: *** [typeSizes.o] Error 127 make[1]: Leaving directory `~/netcdf-4.0.1/f90' make:*** [check-recursive] Error 1 Surprisingly the ifort command works from the command line >ifort no input files... Also I have set the relevant environment variables FC=ifort F90=ifort F77=ifort CC=gcc CXX=g++ |
| November 16, 2009 4:59 AM PST
Kirill Mavrodiev (Intel)
|
It can be that building scripts doesn’t see right environment variables. E.g. if you use Midnight Commander and you set up environment there then script will have default variables. So add lines at the beginning to your building script: “ #INTEL_COMPILER_TOPDIR directory where Intel Compiler has been installed export INTEL_COMPILER_TOPDIR="/opt/spdtools/compiler/cpro/Compiler/11.1/ 059" #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 “ It should resolve your issue. |
| October 21, 2010 1:53 AM PDT
kindahero
|
I am trying to build wrf model on SGI Altix 3700 Bx2. with intel compilers using sgi mpt mpi. i am getting the following error while compiling.. ,---- | | make[3]: Leaving directory `/home/yagnesh/WRF/WRFV3/external/io_netcdf' | ( cd /home/yagnesh/WRF/WRFV3/external/RSL_LITE ; make CC="icc -lmpi -DFSEEKO64_OK -w -O3 -ip -DDM_PARALLEL -DMAX_HISTORY=25" | FC="ifort -lmpi -O3 -w -ftz -align all -fno-alias -fp-model precise -FR -convert big_endian -i4 -convert big_endian" | CPP="/lib/cpp -C -P -I. -DEM_CORE=1 -DNMM_CORE=0 -DNMM_MAX_DIM=2600 -DCOAMPS_CORE=0 -DDA_CORE=0 -DDFI_RADAR=0 -DEXP_CORE=0 -DIWORDSIZE=4 |-DDWORDSIZE=8 -DRWORDSIZE=4 -DLWORDSIZE=4 -DNONSTANDARD_SYSTEM_FUNC -DDM_PARALLEL -DNETCDF -DUSE_ALLOCATABLES -DGRIB1 -DINTIO -DLIMIT_ARGS |-DCONFIG_BUF_LEN=32768 -DMAX_DOMAINS_F=21 -DMAX_HISTORY=25 -DNMM_NEST=0 -traditional" AR="ar" ARFLAGS="ru" ; | ranlib /home/yagnesh/WRF/WRFV3/external/RSL_LITE/librsl_lite.a ) | make[3]: Entering directory `/home/yagnesh/WRF/WRFV3/external/RSL_LITE' | icc -lmpi -DFSEEKO64_OK -w -O3 -ip -DDM_PARALLEL -DMAX_HISTORY=25 -c c_code.c | icc -lmpi -DFSEEKO64_OK -w -O3 -ip -DDM_PARALLEL -DMAX_HISTORY=25 -c buf_for_proc.c | /opt/sgi/mpt/mpt-2.01/include/mpi.h(834): error: "MPI_Fint" has already been declared in the current scope | MPI_Fint MPI_Comm_c2f(MPI_Comm); | ^ | | /opt/sgi/mpt/mpt-2.01/include/mpi.h(835): error: function "MPI_Fint" is not a type name | MPI_Fint PMPI_Comm_c2f(MPI_Comm); | ^ | | /opt/sgi/mpt/mpt-2.01/include/mpi.h(837): error: "MPI_Comm" has already been declared in the current scope | MPI_Comm MPI_Comm_f2c(MPI_Fint); | ^ | | /opt/sgi/mpt/mpt-2.01/include/mpi.h(838): error: function "MPI_Comm" is not a type name | MPI_Comm PMPI_Comm_f2c(MPI_Fint); | ^ `---- any hints.? Thanks yyr |
| November 26, 2010 8:55 PM PST
Syed Ahsan Ali |
Hello All, I am compiling WRF using 12. Linux x86_64 i486 i586 i686, ifort compiler with icc (dm+sm) Also compilation process is successful but no wrf.exe or ideal.exe is made in the main. It removes executables at the end of compilation. There is also some error found in compile log , I am pasting the end of log file: COMPILING ideal.F WITHOUT OMP ranlib libwrflib.a mpif90 -f90=ifort -o ideal.exe -openmp -fpp -auto -O3 -w -ftz -align all -fno-alias -fp-model precise -FR -convert big_endian -ip ideal.o ../dyn_em/module_initialize_b_wave.o libwrflib.a /opt/WRFV3/external/fftpack/fftpack5/libfftpack.a /opt/WRFV3/external/io_grib1/libio_grib1.a /opt/WRFV3/external/io_grib_share/libio_grib_share.a /opt/WRFV3/external/io_int/libwrfio_int.a /opt/WRFV3/external/esmf_time_f90/libesmf_time.a /opt/WRFV3/external/RSL_LITE/librsl_lite.a /opt/WRFV3/frame/module_internal_header_util.o /opt/WRFV3/frame/pack_utils.o /opt/WRFV3/external/io_netcdf/libwrfio_nf.a -L/usr/local/lib -lnetcdf -L/opt/WRFV3/external/io_grib2 -lio_grib2 -L/opt/usr/lib -ljasper ifort: error #10236: File not found: '/opt/WRFV3/external/RSL_LITE/librsl_lite.a' ifort: error #10236: File not found: '/opt/WRFV3/frame/pack_utils.o' make[1]: [em_ideal] Error 1 (ignored) make[1]: Leaving directory `/opt/WRFV3/main' ( cd test/em_b_wave ; /bin/rm -f wrf.exe ; ln -s ../../main/wrf.exe . ) ( cd test/em_b_wave ; /bin/rm -f ideal.exe ; ln -s ../../main/ideal.exe . ) ( cd test/em_b_wave ; /bin/rm -f README.namelist ; ln -s ../../run/README.namelist . ) ( cd test/em_b_wave ; /bin/rm -f gribmap.txt ; ln -s ../../run/gribmap.txt . ) ( cd test/em_b_wave ; /bin/rm -f grib2map.tbl ; ln -s ../../run/grib2map.tbl . ) ( cd run ; /bin/rm -f ideal.exe ; ln -s ../main/ideal.exe . ) ( cd run ; if test -f namelist.input ; then /bin/cp -f namelist.input namelist.input.backup ; fi ; /bin/rm -f namelist.input ; ln -s ../test/em_b_wave/namelist.input . ) ( cd run ; /bin/rm -f input_jet ; ln -s ../test/em_b_wave/input_jet . ) build started: Sat Nov 27 10:22:06 PKT 2010 build completed: Sat Nov 27 10:29:49 PKT 2010 |
Trackbacks (0)
Leave a comment 
Ronald W. Green (Intel)
|


naumankhurshid
5