How to install WRF 3.6.1 on Ubuntu 14.10 server.

Very very long time for updating my site, Today, I really need to share some experience about installation of WRF 3.6.1 on Ubunt 14.10 server. OK let’s start now.

Server specification:

OS : Ubuntu Server 14.10 and install ubuntu-gnome-desktop
CPU : Intel Core i3 (2 Cores)
Memory : 8 GB

Location of installation software:


|— mpich-3.1.2.tar
|— zlib-1.2.8.tar
|— hdf5-1.8.12.tar
|— netcdf-4.3.2.tar
|— ARWpost_V3.tar
|— jasper-1.701.0.tar
|— libpng-1.6.12.tar
|— bufr.tar

Libraly & Software require:

  1. mpich-3.1.2.tar.gz
  2. zlib-1.2.8.tar.gz
  3. hdf5-1.8.13.tar.gz
  4. netcdf-4.3.2.tar.gz
  5. netcdf-fortran-4.4.0.tar.gz
  6. netcdf-cxx4-4.2.tar.gz
  7. ARWpost_V3.tar.gz
  8. jasper-1.701.0.tar.gz
  9. libpng-1.6.12.tar.gz
  10. bufr.tar.gz
  11. WRF 3.6.1

Step#1: We need to install gcc gcc-c++ gcc-gfortran first by

$ sudo apt-get install gcc gcc-c++ gcc-gfortran

Step#2 : Install basic software for compiling software.
$ sudo apt-get install build-essential

Step#3 : Install MPI

$ ./configure --prefix=/home/wrfadmin/WRFV3/library/mpich-3.0.4/mpich-install
$ make
$ make install

Then add path of MPI into file ~/.basrc

PATH=/home/wrfadmin/WRFV3/library/mpich-3.0.4/mpich-install/bin:$PATH;export PATH

Step#4 : Install zlib

$ ./configure --prefix=/home/wrfadmin/WRFV3/library/zlib-1.2.8
$ make test
$ make install

Then add path of zlib into file ~/.basrc

export zlib=/home/wrfadmin/WRFV3/library/zlib-1.2.8

Step#5 : Install HDF5
$ ./configure --prefix=/home/aoddy/Develops/WRF/library/hdf5-1.8.13 --enable-fortran --enable-cxx --with-zlib=/home/aoddy/Develops/WRF/library/zlib-1.2.8
$ make
$ make test
$ make install
$ make check-install

Then add path of HDF5 into file ~/.basrc

export HDF5=/home/wrfadmin/WRFV3/library/hdf5-1.8.12

Step#6 : Install NetCDF4.3.2

Before you start to compile&install you need to add a list of export variable below in ~/.bashrc

export CPPFLAGS="-I/home/aoddy/Develops/WRF/library/hdf5-1.8.13/include -I/home/aoddy/Develops/WRF/library/zlib-1.2.8/include -I/home/aoddy/Develops/WRF/library/netcdf.4.3.2/include"
export LDFLAGS="-L/home/aoddy/Develops/WRF/library/hdf5-1.8.13/lib -L/home/aoddy/Develops/WRF/library/zlib-1.2.8/lib -L/home/aoddy/Develops/WRF/library/netcdf.4.3.2/lib"
export LD_LIBRARY_PATH="/home/aoddy/Develops/WRF/library/hdf5-1.8.13/lib /home/aoddy/Develops/WRF/library/zlib-1.2.8/lib /home/aoddy/Develops/WRF/library/netcdf.4.3.2/lib"

** Don’t forget to update .bashrs by :
$ source ~/.bashrc

Create a directory for new netcdf. (It’s not the same directory of netcdf software.)

$ mkdir netcdf.4.3.2
Go to the installation netcdf software (netcdf-4.3.2) and start to install :
** Directory of source code is netcdf-4.3.2 but the directory for installation is netcdf.4.3.2 **

$ ./configure --prefix=/home/aoddy/Develops/WRF/library/netcdf.4.3.2 FC=gfortran F77=gfortran CC=gcc --enable-shared
$ make
$ make check
$ make install

You need to update ~/.bashrc file by adding :

export NetCDF=/home/aoddy/Develops/WRF/library/netcdf.4.3.2
export NETCDF_LIB=/home/aoddy/Develops/WRF/library/netcdf.4.3.2/lib
export NETCDF_INC=/home/aoddy/Develops/WRF/library/netcdf.4.3.2/include

Step#7 : Install netcdf-fortran-4.4.0
The installation of netcdf-fortran should install in the same of netcdf directory.
./configure --prefix=/home/aoddy/Develops/WRF/library/netcdf.4.3.2 FC=gfortran F77=gfortran CC=gcc --enable-shared 2>&1 | tee configure.log
$ make
$ make check
$ make install

Step#8 : Install netcdf-cxx4-4.2
The installation of netcdf-cxx should install in the same of netcdf directory.
./configure --prefix=/home/aoddy/Develops/WRF/library/netcdf.4.3.2 FC=gfortran F77=gfortran CC=gcc --enable-shared 2>&1 | tee configure.log
$ make
$ make check
$ make install

Step#9 : Install Install Jasper

./configure --prefix=/home/aoddy/Develops/WRF/library/jasper-1.900.1
make check
make install

You need to update ~/.bashrc file by adding :

export jasper=/home/aoddy/Develops/WRF/library/jasper-1.900.1
export JASPERLIB=/home/aoddy/Develops/WRF/library/jasper-1.900.1/lib
export JASPERINC=/home/aoddy/Develops/WRF/library/jasper-1.900.1/include

Step#10 : Install lipng

./configure --prefix=/home/aoddy/Develops/WRF/library/libpng-1.6.9
make check
make install

You need to update ~/.bashrc file by adding :
export libpng=/home/aoddy/Develops/WRF/library/libpng-1.6.9

Step#11 : Install burf
tar xvfz bufr.tar.gz
cd bufr
gcc -c *.c
gfortran -c -DUNDERSCORE *.f
ar -ru libbufr.a *.o

You need to update ~/.bashrc file by adding :
export BUFR=/home/aoddy/Develops/WRF/library/bufr

Step#12 : Verified .bashrc file
PATH=/home/aoddy/Develops/WRF/library/mpich-3.1.2/mpich-install/bin:$PATH;export PATH
export HDF5=/home/aoddy/Develops/WRF/library/hdf5-1.8.13
export BUFR=/home/aoddy/Develops/WRF/library/bufr
export NetCDF=/home/aoddy/Develops/WRF/library/netcdf.4.3.2
export NETCDF=/home/aoddy/Develops/WRF/library/netcdf.4.3.2
export NETCDF_LIB=/home/aoddy/Develops/WRF/library/netcdf.4.3.2/lib
export NETCDF_INC=/home/aoddy/Develops/WRF/library/netcdf.4.3.2/include
export jasper=/home/aoddy/Develops/WRF/library/jasper-1.701.0
export JASPERLIB=/home/aoddy/Develops/WRF/library/jasper-1.701.0/lib
export JASPERINC=/home/aoddy/Develops/WRF/library/jasper-1.701.0/include
export libpng=/home/aoddy/Develops/WRF/library/libpng-1.6.12
export zlib=/home/aoddy/Develops/WRF/library/zlib-1.2.8

export CPPFLAGS=”-I/home/aoddy/Develops/WRF/library/hdf5-1.8.13/include -I/home/aoddy/Develops/WRF/library/zlib-1.2.8/include -I/home/aoddy/Develops/WRF/library/netcdf.4.3.2/include”
export LDFLAGS=”-L/home/aoddy/Develops/WRF/library/hdf5-1.8.13/lib -L/home/aoddy/Develops/WRF/library/zlib-1.2.8/lib -L/home/aoddy/Develops/WRF/library/netcdf.4.3.2/lib”
export LD_LIBRARY_PATH=”/home/aoddy/Develops/WRF/library/hdf5-1.8.13/lib /home/aoddy/Develops/WRF/library/zlib-1.2.8/lib /home/aoddy/Develops/WRF/library/netcdf.4.3.2/lib”

Step#13 : WRFV3.6.1
./compile em_real 2>&1 | tee compile.log

Some error message after you compiled, something like this :


Fatal Error: Can’t open module file ‘wrf_data.mod’ for reading at (1): No such file or directory

You need to update something in configure.wrf  like :

DM_FC           =       mpif90
DM_CC           =       mpicc -DMPI2_SUPPORT -DMPI2_THREAD_SUPPORT

And don’t forget to install ‘m4’ by :

$ sudo apt-get install m4