Compile GEOS-Chem

Compilation

• GEOS-Chem uses a GNU Make system

• It has a nested configuration that all rely on options

– Makefile_include.mk has library options

– Headers/define.h has model options

• Review Headers/define.h

– lines starting with `!` are comments

– lines starting with `#` are special commands

Exercise 1: Git a version of the GEOS-Chem Code

1. Login to HPC using putty

2. Change directories to your scratch directory (`cd /scratch/lfs/user/geos-chem`)

3. Make a code directory by executing `mkdir code'

4. change directories to your code directory (cd code)

5. execute `git clone git://git.as.harvard.edu/bmy/GEOS-Chem Code.v9-01-03`

6. execute `git checkout tags/Fix_for_IFORT12`

7. Now, compare the line you excuted with the git help on clone (`git help clone`)

8. Using the words from the SYNOPSIS help section, what are the two arguments following the `clone` command? __________ and ________________

Exercise 2: Compile GEOS-Chem

1. Login to HPC using putty

2. Change directories to your scratch directory (`cd /scratch/lfs/user/geos-chem`)

3. execute `make help`

4. Review and formulate a make command (do not look ahead):

(a) write your command: _______________________________

(b) What errors do you get?: _____________________________

5. GEOS-Chem is under rapid development and the `make` options are only so-so documents

6. execute: `cd bin; ln -s $(which nc-config); ln -s $(which nf-config); cd ..`

(a) describe what these commands did: _______________________

7. execute: `cd lib; ln -s /apps/hdf5/1.8.9-intel/lib/libhdf5* ./; ln -s /apps/netcdf/4.2-intel/lib/libnetcdf* ./; cd ..`

(a) describe what these commands did: _______________________

8. execute: `MET=geos5 GRID=4x5 GC_LIB=$PWD/lib GC_INCLUDE=/apps/netcdf/4.2/include/ GC_BIN=$PWD/bin/ COMPILER=ifort OMP=yes make`