INSTALLATION OF WEATHER RESEARCH AND
FORECASTING (WRF) MODEL ON LINUX
OPERATING SYSTEM
BY
SHILPI KALRA
Department of Mathematics
School of Vocational Studies and Applied Sciences
Gautam Buddha University
Co-Supervisor: Supervisor:
Dr. Ashish Routray Dr. Sushil Kumar
Scientist-E Assistant Professor
NCMRWF SoVSAS
Ministry of Earth Sciences Deptt. of Mathematics
Govt. Of India Gautam Buddha University
1. Required Operating System- Linux (Centos-6 versions is good to install)
Firstly Install centos OS
2. System Environment- First and Foremost, it is very important to have a gfortran, C
and C++ compiler.
To Install gcc (C, C++ compiler) and its related Development tool
#Yum install gcc gcc-c++ gcc-gfortran
#Yum groupinstall “Development tools”
3. Required Libraries-
[Link]
[Link]. Library Convenient Address to download
Location in
OS
a) NetCDF usr/local [Link]
[Link]
[Link]
b) zlib root [Link] [US([Link]) (GPG signature)]-zlib
website
[Link]
c) jasper root [Link] -jasper website
d) libpng root [Link] (Source
[Link]) -PNG website
4. Libraries Path-
It is very important to give path for libraries in .bashrc file of root.
open .bashrc file in root directory.
# vi .bashrc ( it will open the bashrcfile and edit accordingly and save it)
Give paths like this:
export NETCDF=/usr/local/netcdf-3.6.3
PATH=$NETCDF/bin:$NETCDF/lib:$PATH
export JASPERLIB=/usr/local/lib
export JASPERINC=/usr/local/include
export JASPERLIB="${JASPERLIB} -L/usr/local/lib -L/usr/local/lib"
export JASPERINC="${JASPERINC} -I/usr/local/include -I/usr/local/include"
5. Installing Libraries:
NETCDF is required for any WRF installation.
JASPER, LIBPNG, ZLIB only required if user wants their WRF/WPS version to
support GRIB2 files .
(a) NetCDF- (needed by WRF and WPS)
Requirements:- CC- C compiler, FC-Fortran compiler, CXX- C++ compiler
#export CC=gcc
#export CXX= g++
#export FC=gfortran
#export F77=gfortran
TO INSTALL:
# cd netcdf-3.6.3
#./configure
# make
# make install
Note- If NetCDF version-4 or later is installed then:
#./configure --prefix=$DIR/netcdf --disable-dap --disable-netcdf-4 --disable-shared
# make
# make install
OUTPUT
usr/local/netcdf/lib usr/local/netcdf/include usr/local/netcdf/bin
[Link] netcdf.h ncdump
libnetcdf_c++.a [Link] ncgen
netcdfcpp.h
[Link]
(b) jasper-
#cd jasper-1.2.50
#./configure
#make
#make install
(c) zlib- Compression library which is used by the PNG library.
#cd zlib-1.2.7
#./configure
# make
# make install
(c) libpng-
#cd libpng-1.2.50
#./configure
#make check
# make install
6. Building WRFV3-
WRF source code address- [Link]
Go to the WRV3 directory
# cd WRFV3
# export WRF_EM_CORE=1
#export WRFIO_NCD_LARGE_FILE_SUPPORT=1
# ./configure [Choose ×86_64 Linux gfortran compiler with gcc(serial)]
OUTPUT- [Link]
# ./compile [ To compile WRFV3 , it is needed to decide which type of case is compiled
{choose em_real (3d real case option) ]
If real case is compiled then compilation will be successful if these executables is made in the
WRFV3/main directory.
# cd WRFV3/main/
# ls -lrt
OUTPUT-
[Link] (model executable)
[Link] (real data initialization)
[Link] ( one-way nesting)
[Link]
7. Building WPS-
A successful compilation of WRF is required prior to WPS compilation!
Get the WPS zipped tar file [Link] from
[Link]
Go to the WPS directory.
#cd WPS
# ./configure
Choose one of the configure options listed. [Choose ×86_64 Linux gfortran(serial)]
(with Grib-2 option) [Don't use no_ grib-2 option]
OUTPUT- [Link]
Note- There is a line in [Link] file that directs the WPS build system to the location
of the I/O libraries from the WRF model:
WRF_DIR = ../WRFV3
Above is the default setting. If the existing default setting is correct then there is no need to
change it. If it is not correct then, it must to modify the configure file and then save the
changes before compiling.
To compile-
# ./compile
OUTPUT- [Link]
[Link]
[Link]
Verify that they are not zero-sized. To see file size - # ls -ls *.exe
8. Static Geography Data-
To initiate a real data case, the domain's physical location on the globe and the static
information for that location must be created. This requires a data set available from the WRF
download page-
[Link] -
Complete data-set
Download the file and place it at convenient place (usr/local), when un-tar the file it
will be named as Geog _Complete.
The directory information is given to the geogrid program in the [Link] file in
the geogrid section.
geog_data_path='usr/local/geog_complete'
Run WPS and WRFV3
Running WPS-
Start by running WPS.
# cd WPS
# vi [Link]
Make changes to the [Link] file, to reflect information for particular run. Also
set path of static geography data in [Link]
.[ geog_data_path='usr/local/geog_complete']
# ./[Link]
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Successful completion of geogrid. !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# ls –lrt
geo_em.[Link]
# ln -s ungrib/Variable_Tables/[Link] Vtable
# ./link_grib.csh /home/dir-name/FNL/fnl*
# ./[Link] >&[Link]
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Successful completion of ungrib. !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# ls -lrt
[Link]
UNGRIB OUTPUT- [Link]
# ./[Link]
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Successful completion of metgrid. !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
OUTPUT- met_em.d01.2017-04-21_00:00:[Link]
met_em.d01.2017-04-21_06:00:[Link]
# mv met_em.d0* /home/WRFV3/test/em_real
Or
# mv met_em.d0* /home/WRFV3/run
Running WRFV3-
# cd WRFV3/test/em_real
Or
# cd WRFV3/run
vi [Link]
Make changes to the [Link] file, to reflect information for particular run.
To know the num_metgrid_levels and num_metgrid_soil_levels for [Link] file
use command :
# ncdump -h met_em.d01.2017-04-21_00:00:[Link] |more
ctrl+Z (to exit from met_em.file)
After necessary editing in [Link] file, run the real executable:
# ./[Link]
# ls -lrt
wrfinput_d01
wrfbdy_d01
# ./[Link]
# ls -lrt
wrfout_d01_2017-04-21_00:00:00