Installing and configuring modelE AR5 Release


The directions below have been tested using Ubuntu 10.04 (Suzy Scapegoat) and MacOS 10.6.6 using
Homebrew as a package manager. If you haven’t already, you will need to install Mac Developer Tools to install common build tools (such as make) on your Mac.



1. You'll need gfortran, and the netcdf libraries.  

Ubuntu:  

$ apt-get install gfortran libnetcdf-dev

Mac: 

$ brew install gfortran

$ brew install netcdf --fortran


2. Create a folder for storing the model code and run data, e.g.


BOTH:                 

$ mkdir ~/modelE


3. I'll refer to this as $MODELE.  Unless otherwise stated, the rest of the document will assume your current directory is $MODELE.


4. Download the model code and unpack the source code:
        
BOTH:                 

$ curl  http://www.cs.toronto.edu/~nernst/modelE_AR5_branch.2011.03.10_11.12.21.tgz | tar xvz

The sources will be in the folder
modelE1_AR5_branch. Find documentation in modelE1_AR5_branch/README.txt and modelE1_AR5_branch/doc/


5. Create folders for data:

BOTH:                 

$ mkdir decks runs input saves


6. Download the data (~581Mb).  In the 'input' folder, run:

BOTH:                 

$ curl ftp://ftp.giss.nasa.gov/pub/modelE/fixed.tar.gz | tar xvz

$ wget -nc -i http://www.cs.utoronto.ca/~jp/modelE_AR5_branch_data.txt



7. In $MODELE/modelE1_AR5_branch/decks run:


BOTH:        

$ make config

This creates the configuration file
~/.modelErc, which you should edit to
point to the folders you just created (put the full path names, not $MODELE). Note the slight difference between Ubuntu and Mac in the netcdf path.

DECKS_REPOSITORY=$MODELE/decks
CMRUNDIR=$MODELE/runs
GCMSEARCHPATH=$MODELE/input
EXECDIR=$MODELE/modelE1_AR5_branch/exec
(
UB)  NETCDFHOME=/usr

(MAC) NETCDFHOME=/usr/local
SAVEDISK=$MODELE/saves
COMPILER=gfortran


8. Edit modelE1_AR5_branch/config/rules.mk and change the following line:

LIBS += -L$(NETCDFHOME)/lib -lnetcdf

to

BOTH:

LIBS += -L$(NETCDFHOME)/lib -lnetcdf -lnetcdff


This adds the netCDF fortran library (which depends on the netCDF library) to the linker options.


9. (MAC) Add proper C preprocessor flags to the compiler. Edit modelE1_AR5_branch/config/compiler.gfortran.mk to look like the following:

FFLAGS = -xf77-cpp-input -fconvert=big-endian -O2 -fno-range-check

F90FLAGS = -xf95-cpp-input -fconvert=big-endian -O2 -fno-range-check  -ffree-line-length-none



10. Now create a "rundeck". A rundeck is a set of files for a specific configuration of the model.
We'll base ours off of the E001 configuration (you can find the details in
modelE1_AR5_branch/model/E001.R
). 

In modelE1_AR5_branch/decks, run:

BOTH:                

$ make rundeck RUN=E001xyz


11. Compile the model.  In modelE1_AR5_branch/decks, run:

BOTH:                

$ make gcm RUN=E001xyz

Compiling should only take a few minutes.


12. Run the model for an hour (of simulation time) as a test.

BOTH:         

$ make setup RUN=E001xyz

Check modelE1_AR5_branch/decks/E001xyz/E001xyz.PRT for run status.


13. Run the model.

BOTH:        

$ export PATH=$PATH:$MODELE/modelE1_AR5_branch/exec

$ runE E001xyz

Check E001xyz.PRT for status.


Some stats

SLOC        Directory        SLOC-by-Language (Sorted)

281183  model           fortran=234264,f90=46452,ansic=350,pascal=117

16376   aux             fortran=13776,sh=1687,f90=679,perl=234

3675    exec            perl=2803,sh=573,python=299

3279    init_cond       fortran=3086,sh=127,f90=66

2051    tests           f90=2051

494     cmor            f90=314,sh=180

161     decks           fortran=161

0       config          (none)

0       doc             (none)

0       templates       (none)

0       top_dir         (none)

Totals grouped by language (dominant language first):

fortran:     251287 (81.79%)

f90:          49562 (16.13%)

perl:          3037 (0.99%)

sh:            2567 (0.84%)

ansic:          350 (0.11%)

python:         299 (0.10%)

pascal:         117 (0.04%)

Total Physical Source Lines of Code (SLOC)                = 307,219

SLOCCount, Copyright (C) 2001-2004 David A. Wheeler

SLOCCount is Open Source Software/Free Software, licensed under the GNU GPL.