1.2 Getting and Installing GLIMMER

GLIMMER is a relatively complex system of libraries and programs which build on other libraries. This section documents how to get GLIMMER and its prerequisites, compile and install it. Please report problems and bugs to the GLIMMER mailing list.

1.2.1 Prerequisites

GLIMMER is distributed as source code, a sane built environment is therefore required to compile the system. On UNIX systems GNU make is suggested since the Makefiles may rely on some GNU make specific features. There are two ways of getting the source code:

  1. download a released version from the GLIMMER website, or
  2. download the latest developers’ version of GLIMMER and friends from NeSCForge using CVS.

If you want to build GLIMMER from CVS then you need GNU autoconf and automake to generate the built system and python which is used for analysing dependencies and f95 code generation. Furthermore, the Python scripts rely on language features which were only introduced with python version 2.3.

GLIMMER is mostly written in FORTRAN95, a good f95 compiler is, therefore, required. GLIMMER is known to work with the NAGware f95, Intel ifort compilers. GLIMMER does not compile with the SUN WS 7.0 f95 compiler due to a compiler bug. The current SUN f95 compiler might work but has not been tested yet.

In addition to f90 and python you will also need LATEX if you want to build the documentation.

Glimmer uses the netCDF library for data I/O. You will most likely need to compile and install the netCDF library yourslef since the binary packages usually do not contain the f90 bindings which are used by GLIMMER.

1.2.2 The GLIMMER Directory Structure

The following commands describe the setup if you use the bash shell. The setup works similarly for other shells. We suggest that you install glimmer and friends in its own prefix, e.g. /home/user/glimmer. Assign the shell variable $GLIMMER_PREFIX to this directory, i.e. export GLIMMER_PREFIX=/home/user/glimmer. This directory will contain the following sub–directories:

$GLIMMER_PREFIX/bin

executables are installed in this directory. Set your path to include this directory, i.e. export PATH=$PATH:$GLIMMER_PREFIX/bin.

$GLIMMER_PREFIX/include

include and f95 module files will be installed in this directory. If you want to compile your own climate drivers set the compiler search path to include this directory.

$GLIMMER_PREFIX/lib

the libraries get installed here. Set your linker to look in this directory for the GLIMMER libraries if you want to compile your own climate drivers.

$GLIMMER_PREFIX/share

data files get installed here.

$GLIMMER_PREFIX/src

this is the only directory you need to create yourself. Unpack the GLIMMER sources here.

1.2.3 Installing a Released Version of GLIMMER

Download the GLIMMER tar–ball from the GLIMMER site and unpack it in the $GLIMMER_PREFIX/src directory using

tar -xvzf glimmer-VERS.tar.gz

where VERS is the package version.

The package is then compiled using the usual GNU sequence of commands:

./configure --prefix=$GLIMMER_PREFIX [other_options]  
make  
make install

The options and relevant environment variables are described in Table 1.1.




Variable

Description



FC

f95 compiler to be used

FCFLAGS

flags passed to the f95 compiler

LDFLAGS

linker flags



Option

Description



--help

print help

--prefix

the installation prefix, e.g. GLIMMER

--with-netcdf

prefix where the netCDF library is installed

--with-blas

extra libraries used to provide BLAS functionality. A built–in, non–optimised version of BLAS is used if this option is not used.

--enable-doc

build documentation.

--enable-profile

enable profiling of GLIMMER (see Sec. 1.2.5)




Table 1.1: Environment variables and configure options used by GLIMMER.

1.2.4 Installing from CVS

Revisions of GLIMMER are managed using CVS. You can download the latest development version of GLIMMER using the following sequence of cvs commands:

cvs -d:pserver:anonymous@forge.nesc.ac.uk:/cvsroot/glimmer login  
cvs -z3 -d:pserver:anonymous@forge.nesc.ac.uk:/cvsroot/glimmer co glimmer

The cvs version does not include some automatically generated files. In order to be able to compile the cvs version you need the GNU autotools and python. The built scripts are generated by running

./bootstrap

in the $GLIMMER_PREFIX/src directory. The package is then configured and built as described in Section 1.2.3.

1.2.5 Profiling

If you run the configure script with the option --enable-profile you enable profiling of the model. By default times are integrated over 100 time steps. You can cheange this behaviour by setting the variable PROFILE_PERIOD. The timing data is written to the file glide.profile which contains 5 columns of data (see Table 1.2).




Column 1total CPU time elapsed when data is written to file
Column 2accumulated time spent on this block of calculations
Column 3integer ID used to identify this block of calculations
Column 4model year
Column 5description of this block of calculations



Table 1.2: File format of profile data file.

A python script using the PyGMT library to visualise the profile is provided.