Software requirement
- Fortran 90 or 95 and c compiler
- perl 5.04 or better
- If MPI and OpenMP compilation is desired, it requires MPI or
OpenMP libraries
- WRF I/O API supports netCDF and PHD5 formats, hence one of these
libraries needs to be available on the computer you are compiling
and running WRF
On Linux:
- It requires PGI-compiler installed netCDF
library, if PGI compiler is used to compile WRF code.
- If you are using the Intel compiler, it requires netCDF being
built using the Intel compiler.
On Mac:
If you are compiling on Mac using IBM xlf compiler
for pre-V2.1 code, click here.
For nesting compile:
- Not all compile options support nesting. Check
the options carefully and select those which support nesting.
Before you start
Before you compile WRF code on your computer,
check to see if you have netCDF installed. WRF I/O uses netCDF
data format. If your netCDF is installed in some odd places (e.g.
not in your /usr/local/), then you need to know the paths to netCDF
library, and to its include/ directory. You may use the environment
variable NETCDF to define where the path to netCDF library is.
To do so, type
setenv NETCDF /path-to-netcdf-library
If you don't have netCDF on your computer,
you need to install it first. You may download netCDF source code
or pre-built binary. Installation instruction can be found on
the Unidata
Web page.
A note for Linux users:
If you use PGI or Intel compiler, make sure
your netCDF is installed using the same compiler. If your path
does not point to PGI-compiled netCDF, use NETCDF environment
variable: e.g.,
setenv NETCDF /usr/local/netcdf-pgi
How to compile?
Go to WRFV2 (top) directory.
Type 'configure',
and you will be given a list of choices for your computer. These
choices range from compiling for a single processor job, to using
OpenMP shared-memory or distributed-memory parallelization options
for multiple processors. Some options support nesting, others
do not. So read it carefully. For example, the choices for NCAR's
IBM looks like this:
checking for perl5... no
checking for perl... found /usr/bin/perl (perl)
Compiling on an NCAR system with weird paths to NetCDF
Setting up a local NetCDF directory with symlinks
A directory ./netcdf_links already exists. Continuing.
Will use NETCDF in dir: /home/bluesky/wrfhelp/test/WRFV2/netcdf_links
PHDF5 not set in environment. Will configure WRF for use without.
------------------------------------------------------------------------
Please select from among the following supported platforms.
1. AIX (single-threaded,
no nesting)
2. AIX SM (OpenMP, no nesting)
3. AIX DM-Parallel (RSL_LITE, IBM-MPI, Allows nesting)
4. AIX DM-Parallel (RSL, IBM-MPI, allows nesting)
5. AIX DM-Parallel (RSL, IBM-MPI, allows nesting )(PARALLEL HDF5)
6. AIX DM-Parallel (RSL_LITE, IBM-MPI, Allows nesting )(PARALLEL
HDF5)
7. AIX DM-Parallel/SM-Parallel (not recommended) (RSL, IBM-MPI,
OpenMP, allows nesting)
8. AIX DM-Parallel (RSL, IBM-MPI, MCEL) May 2003, EXPERIMENTAL
9. AIX DM-Parallel ESMF (RSL, IBM-MPI, ESMF coupling, no nesting)
EXPERIMENTAL
10. AIX (single-threaded, nesting using RSL without MPI)
11. AIX (OpenMP, nesting using RSL without MPI)
Enter selection [1-11]
:
Enter a number.
You will see a configure.wrf file. Edit
compile options/paths, if necessary.
Note: if you are interested
in making nested runs, make sure you select an option that supports
nesting. In general, the options that are used for MPI/RSL (but
not RSL_LITE) are also those which support nesting.
Type 'compile', and it will
show the choices:
Usage:
compile wrf compile wrf in run dir
test cases (see README_test_cases):
compile em_b_wave
compile em_grav2d_x
compile em_hill2d_x
compile em_quarter_ss
compile em_real
compile em_squall2d_x
compile em_squall2d_y
compile -h help message
where em stands for the Advanced Research
WRF dynamic core (which currently is the 'Eulerian mass-coordinate'
core). When you switch from one test case to another, you must
type one of the above to recompile. The recompile is necessary
for the initialization programs (i.e. real.exe,
and ideal.exe - there is a different ideal.exe
for each of the idealized cases), while wrf.exe
is the same for all test cases.
If you want to clean directories of all object
files and executables, type 'clean'.
Type 'clean -a' to
remove all built files, including configure.wrf. This is recommended
if you make any mistake during the process, or if you have edited
the Registry.EM file.
Note: On some computers (e.g.
some Intel machines), it may be necessary to set the following
environment variable before one compiles:
setenv
WRF_EM_CORE 1
a. Idealized case
Type 'compile case_name'
to compile. Suppose you would like to run the 2-dimensional squall
case, type
compile em_squall2d_x
After successful compilation, you should have
two executables created in the main/ directory:
ideal.exe and wrf.exe. These
two executables will be linked to the corresponding test/
or run/ directories. cd to those directory to
run the model.
b. Real-data case
Compile WRF model after 'configure',
type
compile em_real