Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

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-
http://www2.mmm.ucar.edu/wrf/users/download/get_sources.html

S.NO. Library Convenient Address to download


Location in
OS
a) NetCDF usr/local http://www.unidata.ucar.edu/software/netcdf/
http://www.unidata.ucar.edu/software/netcdf/release-
notes-3.6.3.html
b) zlib root http://zlib.net/ [US(zlib.net) (GPG signature)]-zlib
website
http://www.zlib.net/fossils/
c) jasper root http://www.ece.uvic.ca/~frodo/jasper/ -jasper website
d) libpng root http://www.libpng.org/pub/png/libpng.html (Source
code-.tar.gz) -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

libnetcdf.la netcdf.h ncdump


libnetcdf_c++.a netcdf.inc ncgen
netcdfcpp.h
netcdf.mod

(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- http://www2.mmm.ucar.edu/wrf/users/


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- configure.wrf

# ./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-

wrf.exe (model executable)

real.exe (real data initialization)


ndown.exe ( one-way nesting)
tc.exe

7. Building WPS-
A successful compilation of WRF is required prior to WPS compilation!
 Get the WPS zipped tar file WPSV3.TAR.gz from

http://www2.mmm.ucar.edu/wrf/users/download/get_source.html

 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- configure.wps
Note- There is a line in configure.wps 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- geogrid.exe
ungrib.exe
metgrid.exe
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-
http://www2.mmm.ucar.edu/wrf/users/download/get_sources_wps_geog.html -
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 namelist.wps 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 namelist.WPS

 Make changes to the namelist.wps file, to reflect information for particular run. Also
set path of static geography data in namelist.wps
.[ geog_data_path='usr/local/geog_complete']
# ./geogrid.exe
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Successful completion of geogrid. !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

# ls –lrt

geo_em.d01.nc

# ln -s ungrib/Variable_Tables/Vtable.GFS Vtable

# ./link_grib.csh /home/dir-name/FNL/fnl*

# ./ungrib.exe >&ungrib.output
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Successful completion of ungrib. !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

# ls -lrt

GRIBFILE.AAA

UNGRIB OUTPUT- ungrib.log

# ./metgrid.exe
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Successful completion of metgrid. !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

OUTPUT- met_em.d01.2017-04-21_00:00:00.nc

met_em.d01.2017-04-21_06:00:00.nc

# 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 namelist.input

 Make changes to the namelist.input file, to reflect information for particular run.
 To know the num_metgrid_levels and num_metgrid_soil_levels for namelist.input file
use command :

# ncdump -h met_em.d01.2017-04-21_00:00:00.nc |more

ctrl+Z (to exit from met_em.file)


After necessary editing in namelist.input file, run the real executable:

# ./real.exe

# ls -lrt

wrfinput_d01

wrfbdy_d01

# ./wrf.exe

# ls -lrt

wrfout_d01_2017-04-21_00:00:00

You might also like