how to run CCM3 on a DEC alpha


Subject: how to run CCM3 on a DEC alpha
From: Karen M Shell (kshell@insci14.ucsd.edu)
Date: Thu Jul 29 1999 - 10:32:37 MDT


After many weeks of frustration, I finally succeeded in running
CCM3.6.6 on my alpha machine. To hopefully save further frustration,
here's what worked for me in the end.

1) Download latest version from CCM home page

2) gunzip and tar -xvf CCM3 and datasets according to instructions

3) Modify bld/build.noncray.csh
        - change CPU to DEC
        - put in appropriate paths for netCDF
        - change MAXCPUS to 1

4) Modify bld/Makefile
        - Add the following lines to the architecture-specific
        section:

#------------------------------------------------------------------------
# DEC Alpha
#------------------------------------------------------------------------

ifeq ($(UNAMES),OSF1)
CPP := cpp
CFLAGS := $(cpp_path)

FFLAGS := $(cpp_path) -r8 -i4 -arch host -fast
LDFLAGS := -L$(LIB_NETCDF) -lnetcdf

endif

5) Go through all files in the src directory looking for sections
which use a CPU of either SUN or SGI. Decide whether or not to make
these sections also applicable to the DEC CPU type. For the most
part, these SUN only sections deal with a problem with the SUN
compiler, so we don't have to worry about those. The ones we changed
are:

src/ccmlsm_share/getmem.F
-------------------------
        
Change these lines:

#if ( defined SUN ) || ( defined RS6K )
      integer malloc
      external malloc
#endif

to this:

#if ( defined SUN ) || ( defined RS6K ) || ( defined DEC )
#if ( defined DEC )
      integer*8 malloc
#else
      integer malloc
#endif
      external malloc
#endif

why? Alpha's use integer*8 for pointers, rather than i4.

Also, add DEC to the following list of options:

#if ( defined SUN ) || ( defined SGI ) || ( defined HP ) || ( defined
LINUX )
#if ( ! defined SPMD )
CCCC$DIR CRITICAL_SECTION
#endif
      address = malloc(WORDSIZE*nwords)
      if (address.eq.0) then
         write(6,*)'GETMEM f
...

So it's now

#if ( defined SUN ) || ( defined SGI ) || ( defined DEC ) || ( defined
HP ) || ( defined LINUX )
...

src/ccmlsm_share/freemem.F
--------------------------

replace this line
#if ( defined SGI ) || ( defined HP ) || ( defined LINUX )

with this:
#if ( defined SGI ) || ( defined HP ) || (defined DEC) || ( defined
LINUX )

Note that you don't have to declare free, while you do have to declare
malloc. We're not sure why they are treated differently.

src/control/wrapup.F
-------------------

replace
#if ( defined SUN ) || ( defined SGI ) || ( defined LINUX )

with
#if ( defined SUN ) || ( defined SGI ) || ( defined DEC ) || ( defined
LINUX )

6) before running, type "limit datasize 200000"

Good luck
-Karen



This archive was generated by hypermail 2b27 : Thu Jun 01 2000 - 09:28:10 MDT