These notes presume you know how to make MM5 on another platform.
Compiler versions used: gcc 3.3, Absoft 8.0, IBM xlf 8.1 (beta). OS versions: Jaguar and Panther.
Use a UFS-formatted disk, partition or disk image to preserve case sensitivity. These can be created in Disk Utility. The model needs to differentiate between files ending in .F and .f.
TERRAIN requires NCAR Graphics compiled using the same compiler. Pre-compiled Absoft binaries, along with the source code, for version 4.3.1 are available
here.
If you have the xlf compiler and plan on using no more than 1 or 2 CPUs on a single node, the MM5/SMP version below is by far the path of least trouble. The stock version of MM5 runs with very minor alterations to a few configure and makefiles. IBM's xlf has SMP support 'out of the box'. As far as I know, SMP is not available to Absoft Fortran without pricey third-party software.
For the MPP version, the CPP preprocessor is used to convert a *.F file containing directives and such into a *.f file. As of gcc 3.3, the Mac's CPP inserts atop every CPP processed a line starting with "#pragma". This doesn't fool Absoft but the xlf beta chokes on it. In some cases, I rewrote Makefiles to strip off the offending line immediately after preprocessing, using a sed command. That's before I realized that adding -xassembler-with-cpp to the CPPFLAGS in the Makefile will do the trick. Some programs below use this CPP flag, some use modified Makefiles.
No warranty or promises! Please send bug reports and suggestions to Robert Fovell
in REGRID directory, rename either Makefile.IBM_OSX or Makefile.ABSOFT_OSX to Makefile
issue make command
proceed as usual
Notes:
Altered files: top level Makefile (replaced Linux with Darwin), regridder/src/proc_namelist.F, added ranlib in pregrid/util/Makefile, pregrid/grib.misc/rd_grib.F
pregrid/util/parse_table.F was altered for IBM xlf (thanks to Philip Barbour)
in INTERPF directory, rename either Makefile.IBM_OSX or Makefile.ABSOFT_OSX to Makefile
issue make command
proceed as usual
Notes:
None at this time
MM5/SMP -- version for a single node
This is the version to use if you have the xlf compiler and a single Mac with 1 or 2 CPUs.
Procedure:
Get the MM5 tarfile from ucar.edu and unpack.
Replace configure.user in the MM5 directory with this version. Edit this file to select FC and FCFLAGS lines for SMP or non-SMP version.
Replace the Makefile in the MM5 directory with this version. This file was modified to force a call to ranlib.
Replace makedeck.csh in MM5/Util directory with this version. This file was modified to include an option for a darwin system.
Make the model, as usual.
Here is an mm5.deck file that I use. This script creates the file mmlif in the Run directory. Edit it by hand, replacing &END with / in several places.
Before running the model, I make sure these setenv (for tcsh) commands are issued:
Copy either configure.user.Absoft_OSX.MPP or configure.user.IBM_OSX.MPP to configure.user. The edit variables LINUX_MPIHOME and LOCAL_LIBRARIES to reflect location of mpich-1.2.5
In the MPP/RSL directory, copy either Makefile.RSL.Absoft_OSX or Makefile.RSL.IBM_OSX to Makefile.RSL
In the MPP/RSL/RSL directory, copy either makefile.darwin.Absoft or makefile.darwin.IBM to makefile.darwin. Then edit IDIR, CC and FC in makefile.darwin to reflect location of mpich-1.2.5. Then edit FFLAGS in makefile.darwin to reflect flags used in configure.user and used in building mpich
Make sure the LINUX_MPIHOME and LOCAL_LIBRARIES variables in configure.user point to locations consistent with mpich location set in makefile.darwin
Then issue "make mpp"
Make sure to make mpclean for minor model changes, and make uninstall for major changes, prior to recompiling.
Notes:
Numerous model code changes had to be made for the MPP version. Read the included file MM5_MPP_NOTES.txt
Single CPU executables can be built from this code; rename either configure.user.IBM_OSX.1cpu or configure.user.Absoft_OSX.1cpu to configure.user and issue make command. Note this will utilize programs modified owing to the MPP/FLIC/CPP problem discussed in MM5_MPP_NOTES.txt.
I added setenv P4_SOCKBUFSIZE 65536 to my .cshrc file; helps me get 100% CPU utilization with 2 CPUs.
Notes:
For whatever reason, make clean in mpich does NOT clean everything out. Stuff is left behind
in bin/ and not updated on a new make. So I unpack mpich.tar all over again when I want to start over.
Last modified: on or after 2 January 2004 by Robert Fovell