Install WRF model in Ubuntu Linux

Dear All,

Here I am going to explain the very simple steps to install The Weather Research & Forecasting Model (WRF) model in Ubuntu or any Linux Distributions.

$ sudo apt-get install m4 csh netcdf-bin hdf4-tools hdf5-tools zlib* jasper libpng-dev build-essential ncl-ncarg gcc gfortran libnetcdf-dev mpich

$ sudo updatedb

$ locate netcdf.inc
/usr/include/netcdf.inc

Here we got path where netcdf.inc file present and then we need export the path (till before include directory) to NETCDF environment variable in home .bashrc .

In some machines, it may be /usr/local/include/netcdf.inc, in which case export NETCDF directory path upto /usr/local/ .

Add the following lines in your home .bashrc

$ vim ~/.bashrc

# WRF SETTINGS
export NETCDF=/usr
export WRFIO_NCD_LARGE_FILE_SUPPORT=1

Save it !

$ source ~/.bashrc

Download latest WRF model sources from http://www2.mmm.ucar.edu/wrf/users/download/get_sources.html

I downloaded v3.6.1 WRF-ARW and WPS and extracted.

$ cd WRFV3

$ ./configure

Select option relevant to your system linux configuration (like i386 or x64_86), fortran type (like gfortran or ifort or pgfortran) and processors (like parallel or serial).

Select GNU GCC option if you want to use GNU GCC compiler!

and

select model support option (like 1 for basic which I chosed)

$ ./compile em_real

Read the README file of WRFV3 to know more options to compile model.

$ cd ..

$ cd WPS

$ ./configure

Select option relevant to your system linux configuration (like i386 or x64_86), fortran type (like gfortran or ifort or pgfortran) and Grib type (like 1 or 2).

$ ./compile

Read the README files of WPS to compile further with plotting tools (like NCL).

Done !

PS: This compilation progress need atleast 2 GB RAM without swap, or maybe 512 MB RAM + SWAP 2 GB


Regards,
Arulalan.T
Project Associate
Centre for Atmospheric Sciences
Indian Institute of Technology Delhi

My Experiments In Gnu/Linux ! : https://tuxcoder.wordpress.com

Advertisements

About arulalant

Currently working as "Project Scientist – C" in National Centre for Medium Range Weather Forecasting (NCMRWF), MoES, Noida, India
This entry was posted in Atmosphere, Climate, Software, Ubuntu and tagged , , , , , , . Bookmark the permalink.

14 Responses to Install WRF model in Ubuntu Linux

  1. prathav says:

    hello, I a new to linux. Can you give a full description on how to install the WRF on linux 16.04 LTS

    Like

  2. Ian Sosa says:

    @Arulalant Thanks, it really helped me a lot.

    Like

  3. Rajarajan says:

    HI Arualalan, this is Rajarajan, I am writing my PhD in Germany and I would like to meet interact with you. will it possible gimme your e_mail id.

    Like

  4. Sandeep Ram says:

    Thank You soo much…

    Like

  5. sumesh says:

    very helpful post

    Like

  6. akhfa says:

    Hi arulalant,
    I think you should make some change
    1. For prerequisite with
    sudo apt-get install m4 csh netcdf-bin hdf4-tools hdf5-tools zlib* jasper libpng-dev build-essential ncl-ncarg gcc gfortran libnetcdf-dev mpich

    2. Add option if using GNU GCC compiler
    sudo apt-get install gcc gfortran

    3. Change “export NETCDF=’/usr’” to “export NETCDF=/usr”

    4. Add information that this compilation progress need RAM 2 GB without swap, or maybe 512 MB RAM + SWAP 2 GB

    5. add information that when execute ./configure, we should choose GNU GCC if we want to use GNU GCC compiler

    I have many error before I do steps above, but now it should be fine

    Like

    • arulalant says:

      Thanks Akhfa.
      I edited the post as per your suggestions.

      Like

      • akhfa says:

        Sorry I forget something important again:

        1. locate netcdf.inc doesn’t have result if you don’t exec “sudo updatedb” first, because changes of file in disk cannot be detected automatically by system in short time…

        2. After add 2 export to .bashrc, you must exec “source ~/.bashrc” to update the path. If not, “./configure” will not find NETCDF path before you relogin to your ubuntu

        Like

  7. amit says:

    Thanks for a great guide!
    now what? how can i run the gui program?
    Thanks!

    Like

  8. Prasanth says:

    Thank you brother!!!

    Like

  9. David H says:

    What version of Ubuntu are you using?

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s