11/05/2011

WRF Introduction and Compilation


Recently (2011/10/20) I've started a new research project about air pollution simulation. In the research we are going to use atmospheric models as input and air pollutants dispersion models as the simulation tool. As a GISer, I have no idea about these models. So these three weeks is not a long time to get familiar with these concepts and configure and run the models.

WRF (Weather Research and Forecasting Model) is "mesoscale numerical weather prediction model designed to provide a  common framework for both operational numerical weather prediction and atmospheric  research". Although WRF is designed to solve mesoscale, or regional problems, it can also be used for smaller scales like local scales by means of nesting.

WRF consists of three components:
1. WRF itself
2. WPS, pre-processing system, to get in static data like terrain and gridded data
3. ARWPost, post-processing system, for data format transforming

This is the WRF system structure:

Compilation:
My environment: Ubuntu 11.10, 32bit
Fortran compiler: gFortran

To install WRF, you have to install NetCDF library first, which is a common shared library for scientific data access and sharing. 
Note: NetCDF 3.6.3 is required (ARWPost does not agree with NetCDF 4)

1. Download and install NetCDF, set environment variable NETCDF
2. Download WRF, configure and compile, according to specific cases. 
3. Download WPS, configure and compile
4. Download ARWPost. ARWPost is used to transform WRF output (wrfout_d*_*) to files (.dat and .tcl) that GrADS can read. And it has stopped to update, instead, NCL is used to directly read WRF output and visualize data, which is also more professional and accurate than GrADS. However, as more people nearby use GrADS, I choose it as well.

Everything is done.

Trouble shoot:
During the compilation, various errors and problems may rise up, mostly because of a lack of related libraries or environment variables. It is advised to redirect the compilation log to a log file:
./compile your_case >& compile.log
Then search the log file for such key words  as "error" "ignored" "no such file" "missing" "not found" "can't find", etc. You are not to complete the compilation until you can run wrf.exe and ideal.exe or real.exe in the run/ dir.

Below is some problems and solutions I came across when compiling:

1. Unknown command m4. Install m4: sudo apt-get install m4
2. Wrong with libcgool-ppl0.  Install libcgool-ppl0: sudo apt-get install libcgool-ppl0
3. When compiling module_cu_g3.o, input seed invalid. Edit module_cu_g3.F90,revise dimension (8) to dimension (12). (It is strange, beyond my understanding)





No comments:

Post a Comment