The purpose of this document is to provide a brief usage guide to compiling the MM90 code and the R90 library. R90 is the version of RSL tailored to supporting Fortran-90 codes. It handles interprocessor communication, decomposition, and management of distributed execution. Running the MM90 code and in particular the configuration of nesting through namelist settings is discussed.
Fortran-90 provides a syntactic nicety called array-syntax. However, this is avoided in MM90 because of demonstrable shortcomings in computational performance with respect to code that uses explicit loops and indices. One exception where array syntax is used in MM90 is in the initialization of an array or array to array copies. However, array syntax is employed only in sections of the code having to do with model or nest initialization that execute only once per model or nest instantiation.
tar xvf model-xxxx.tarThis will unpack to MM90/mpmm.tar.Z and R90/rsltar.Z.
zcat rsltar.Z | tar xvf -The files of interest are makefile, makefile.mpl, and makefile.ibm. Makefile is the the top level makefile and has a number of configurable settings:
# largest number of domains MAX_DOMAINS = 10 # largest number of processors MAX_PROC = 128These can be reset to reasonably larger values or smaller values without ill effect (some data structures in the RSL library itself will grow or shrink accordingly). If these are changed the library must be made clean (make clean) and recompiled.
The files makefile.mpl and makefile.ibm are invoked by the top level makefile in response to the commands make mpl or make ibm; they should not be invoked directly. There is usually no reason to modify these.
Making R90 produces a library file librsl.a and an include file rsl.inc (which is included by most routines of MM90). Compiling R90 with make mpl produces a version of the code for the IBM SP. Compiling R90 with make ibm produces a version of the code for networks of IBM workstations connected via MPI (MPI can also be used on the SP).
zcat mpmm.tar.Z | tar xvf -The files of interest are makefile, makefile.mpl, and makefile.ibm.
In the top level makefile, the setting of the make macro RSLLOC should indicate the location of the R90 library directory relative to the MM90 directory.
RSLLOC = ../R90The files makefile.mpl and makefile.ibm are invoked by the top level makefile in response to make mpl or make ibm. New architecture-specific makefiles will appear as the MM90 model is ported to additional platforms. Compiling MM90 with make mpl produces a version of the code for the IBM SP. Compiling MM90 with make ibm produces a version of the code for networks of IBM workstations connected via MPI (MPI can also be used on the SP).
Settable parameters in makefile.mpl and makefile.ibm deal principally with optimization and libraries:
################################################### # User settable compile time constants. ################################################### ## compiler/preprocessor optimization flags DEBUG= # -g # note -- qhsflt will change answers slightly OPTIM= -O3 -qstrict -qarch=pwrx -qhsflt # # If you don't have mass lib, comment this out # for more info on -lmass, try the following URL or # contact IBM through your rep: # # http://www.austin.ibm.com/tech/MASS # LIB = $(RSLLIB)/librsl.a -lmassThe macro OPTIM is set to optimization flags to be passed to the compiler. The settings -O3 and -qstrict are the standard optimizations. The setting -qarch=pwrx enables the use of instructions Power2 processor instructions -- use this on the SP2 but not on the SP1. The -qhsflt option instructs the processor to do all internal arithmetic at full precision with truncation to model precision only on stores to memory. This improves performance on IBM processors when running at 32-bit precision but may change answers slightly (within the bounds of floating point rounding error). These compiler options are described in detail in the IBM Fortran Language Users' Manual. To enable compilation for debugging (thus disabling all optimization) set DEBUG to -g. The pound sign (#) in a setting comments out the rest of the line.
The macro LIB must include the R90 library and may also include other libraries: for example, accelerated math intrinsic subroutine libraries such as the IBM MASS library . One usually does not need to include message passing library files in this setting. Systems supporting MPI usually provide special versions of the link editor command, for example mpif77, that automatically link in these libraries. For MPL on the IBM SP the link editor command is mpxlf. Use of these special message-passing layer specific link editing commands is already set in the makefiles.
Departing from the convention of the source MM5 model and from MPMM, MM90 reads data from named files rather than from default Fortran units. Initial data files are named ic.01, ic.02, .... The number denotes the number of the model domain in the namelist; 01 is always the mother domain.
Also input to the model are lateral boundary conditions which are read only by the mother domain. The name of this file is lbc.01.
Output from each domain of the model is written to the files out.01, out.02, and so on. The frequency of model output is expressed in simulation minutes and specified by the namelist variable TAPFRQ.
The Fortran namelist that is used to configure the model is read from standard Fortran unit 7, which on IBM and many other Unix workstations has the filename fort.7. Note for IBM workstations: MM90 namelists adhere to Fortran-77 style namelist syntax (as opposed the Fortran 90 syntax). Set the environment variable XLFRTEOPTS to namelist=old at the command line to allow the XLF Fortran runtime system to properly read the namelists. Under Unix C-shell ( csh ) the command is:
setenv XLFRTEOPTS namelist=old
http://www.mcs.anl.gov/~michalak/usage/usage.html.
The ones that differ are described here.
Refer to this sample namelist in the discussion that follows.
&BASIC NPROC_LT = 2, NPROC_LN = 2, IICE = 1, NLEV = 23, &END &CPARAM indir = '.', outdir = '/tmp', &END &OPARAM LEVIDN = 0,1,2,1,1,1,1,1,1,1, NUMNC = 0,1,2,9,9,9,9,9,9,9, TAPFRQ = 180., &END &LPARAM IFRAD = 2, RADFRQ = 30., ICUSTB = 1, IEXICE = 0, IFDRY = 0, IMVDIF = 1, IBMOIST = 0, ICOR3D = 1, IFUPR = 0, IBOUDY = 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, IBLTYP = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, IDRY = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, IMOIST = 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, ICUPA = 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, ISFFLX = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ITGFLG = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ISFPAR = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ICLOUD = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ICDCON = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, IFSNOW = 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, IMOIAV = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, IVMIXM = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, HYDPRE = 1.,1.,1.,1.,1.,1.,1.,1.,1.,1., IEVAP = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ISHALLO= 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NESTIX = 61, 61, 46, 46, 46, 46, 46, 46, 46, 46, NESTJX = 61, 61, 46, 46, 61, 61, 61, 61, 61, 61, NESTI = 1, 30, 10, 10, 1, 1, 1, 1, 1, 1, NESTJ = 1, 30, 10, 10, 1, 1, 1, 1, 1, 1, XSTNES = 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., XENNES = 2880.,2880.,2880.,720.,720.,720.,720.,720.,720., IOVERW = 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, &END &PPARAM TIMAX = 360., ZZLND = 0.1, ZZWTR = 0.0001, ALBLND = 0.15, THINLD = 0.04, XMAVA = 0.3, CONF = 1.0, TISTEP = 303., IFEED = 4, IABSOR = 0, &END &FPARAM FDASTA=0.,0.,0.,0.,0.,0.,0.,0.,0.,0., FDAEND=0.,0.,0.,0.,0.,0.,0.,0.,0.,0., &END
IEXMS = 1 ; explicit moisture IRDDIM = 1 ; dudhia radiation scheme
---------------------------------------------------------------------- BUG -- using 9 as the invalid nest indicator in NUMNC limits the maximum number of nests to 8. --- jm 12/14/95 ----------------------------------------------------------------------For example, in the sample namelist above, three domains (a mother and two nests) are specified. Mother domain is the first entry in each list, followed by the the first nest at nest level 1 with the mother as its parent, then followed by the second nest at nest level 2 with the first nest as its parent.
Multiple domains may be specified at each nest level as shown in the following example which specifies a total of four domains: a mother domain, two nests at level 1 and a nest at level 2 with the first level-1 nest as its parent:
LEVIDN = 0,1,1,2,1,1,1,1,1,1, NUMNC = 0,1,1,2,9,9,9,9,9,9,The resulting hierarchy may be expressed:
1. mother domain (has no parent so 0 entered in NUMNC).
2. first nest at level 1 with domain #1 (mother) as parent
4. nest at level 2 with domain #2 as parent
3. second nest at level 1 with domain #1 (mother) as parent
Except for the mother domain, which must always be domain number 1, nests
may be specified in any order in the list.
The other namelist variables having to do with nesting: NESTIX, NESTJX (domain size), NESTI, NESTJ (nest position), XSTNES, XENNES (start and end times of nest) and IOVERW (initialize from file) are the same as in the source MM5 code and in MPMM. Note: MM90 only allocates memory for a domain while it is active (while the simulation time is between XSTNES and XENNES for a nest).
For more information, please contact:
John Michalakes ,