On this page, the results of my efforts to port the WRF model to other platforms and/or compilers are reported. This page presumes you already know how to compile and use WRF. The page is current as of released version 2.0.2 and was last revised on 10 October 2004. Comments, corrections and suggestions made to Robert Fovell are gratefully received.
You may need to right-click or option-click to download the linked files.
As of WRF 2.0.2, the provided configuration code for Intel is broken. The alterations submitted below have been provided to wrfhelp, and when they are incorporated into the official model code, this section will be removed.
Only version 8 of the Intel compiler suite has been tested. As of this version, the Fortran compiler is renamed ifort.
I have not tried (yet) to port the WRFSI to Intel. Have you?
Procedure
Replace the Intel compiler sections of arch/configure.defaults with the contents of this file. Please read the notes below carefully.
Notes
I have a problem with compiling the OpenMP version on my Intel x86 machines. These notes show a way of circumventing this that appears to work, but your mileage may vary. As of WRF 2.0.2, the OpenMP code and performance is suspect anyway. On my Intel machines, the shared (OpenMP) memory version does not outperform the distributed (MPI) version, so I see no reason to use OpenMP at this time.
First, note there is a difference between the clean and clean -a commands. Only the latter clears out built code in the external directory, which is the source of the OpenMP compilation problem.
To build the OpenMP version, this is what I do
Do clean -a to start from scratch.
Configure the model for single threaded, and compile the code.
Issue clean, not clean -a.
Configure for OpenMP and compile again.
If I (or anyone else) figures out what's amiss, I'll post it here.
WRF for Mac OS X
Preamble
Compile and run WRF on a UFS formatted disk, partition or mounted disk image!
The following presumes you have the IBM Fortran compiler xlf.
At this time, I do not have the IBM C compiler xlc, so the code provided uses gcc instead. You should use xlc if you have it.
Currently, I have ported the single threaded version and also the distributed memory (MPI) version using "RSL_LITE" and no nesting to OS X. I do not anticipate having difficulty with the nested MPI version, but haven't needed that yet. Thankfully, the MPI version of WRF was far, far easier to port than it was for MM5.
I have not been able to get the OpenMP version ported. I believe I am facing a compiler problem that has not yet been addressed by IBM. If you get the OpenMP version working, of course I'd like to know. Based on OpenMP performance on Intel, however, this is not a priority.
I have not ported the WRFSI to Darwin.
Procedure
For both single threaded and MPI:
Add the contents of this file to arch/configure.defaults.
Replace external/esmf_time_f90/Makefile with this file (external_esmftime_Makefile), renaming it Makefile. This adds a necessary call to ranlib.
Replace external/io_netcdf/makefile with this file (external_netcdf_makefile), renaming it makefile. Another ranlib call added.
Replace external/io_int/makefile with this file, renaming it makefile. This redefined ranlib within the makefile. There is probably a better way of handling that, but this works.
For MPI version without nesting, using RSL_LITE:
First, configure and compile MPICH or alternative. My MPICH notes for OSX can be found on this page. I put the MPICH bin directory in my path so the OS knows where to find mpif90 and mpicc, etc..
Replace external/RSL_LITE/makefile with this file ( external_rsllite_makefile), renaming it makefile. This file contains these alterations:
A ranlib call was added.
The -DSUN flag was added to the rsl_malloc compile line, to circumvent a compile problem. This should be handled differently, but it works.
Replace external/RSL_LITE/rsl_malloc.c with this file. On OSX, the location of malloc.h appears to be different than on other Unix and Unix-like systems. This should be handled with a compiler flag like -DOSX, but it's working for now.
Notes
Remember to ulimit or unlimit, depending on shell, before running WRF.
It seems the WRF code compiles faster with bash than tcsh... is that really true? Compilation takes a long time, in any case.
NetCDF is required; make it with the xlf compiler.
I use the -qfloat=nomaf flag because it permits optimizations without program semantics changes. In my tests, I get identical results from -O3 and -g when I use -qfloat=nomaf, which is fantastic. (I have never been able to get identical results between optimized and non-optimized versions on any other platform or with any other compiler.)
WRF supporting programs for Mac OS X
WRF2GrADS:
Edit the Makefile, altering location of NetCDF in the LIBNETCDF and INCLUDE lines, and adding -xassembler-with-cpp to the CPPFLAGS line.
RIP4 does not completely work on OS X yet, as if this writing.
WRF on Sun Solaris
For me, WRF on the Sun has been a major headache. It run poorly at best, encountering problems not seen on other platforms, and resists optimization. I finally managed to get the June 2001 test case to run successfully, but it required code hacking. The problem was in the Lin microphysics, in the Pgfr code; a floating exception was thrown late in the model run. The hacked microphysics code is here; use it to replace the original file in phys/. With this fix, the test case will run at optimization level -O2.
Still, the model bombs when the optimization level is raised above -O2, at least for me. I use the Sun-supplied compilers and libraries.
Last modified: on or after 10 October 2004 by Robert Fovell