GEOSCHEM v60205
User's Guide
Contact: Bob Yantosca (bmy@io.harvard.edu)
2. Installation and Compilation
2.1 Obtaining the GEOSCHEM Source Code
The first step is to obtain the current version of the GEOSCHEM model. The most recent GEOSCHEM release is available for download from the GEOSCHEM Source Code and Data Files page. You may also download data and input files for the GEOSCHEM model from this site. For security reasons, the site is password protected. Contact Bob Yantosca (bmy@io.harvard.edu) to get the current password.
The current GEOSCHEM source code and benchmark simulation output are contained in a GNU-zipped TAR file (i.e. the extension is *.tar.gz), which is also known as "tarball" format. To unzip the file, type:
gunzip GEOSCHEM.v60205.stdrun.tar.gz
and to extract the files, type:
tar xvf GEOSCHEM.v60205.stdrun.tar
This will
create a directory named geos.v60205,
which is further divided into subdirectories:
Code.v60205 Directory containing the GEOSCHEM source code IDL Directory containing IDL code to process benchmark output runs/geos.v60205 Contains run.fullchem and run.Rn-Pb-Be directories. runs/geos.v60205/run.fullchem Contains output from v50708 full-chemistry benchmark simulation. runs/geos.v60205/run.Rn-Pb-Be Contains output from v50708 radionuclide (Radon-Lead-Beryllium) benchmark simulation.
Each GEOSCHEM version is benchmarked with a standard full-chemistry simulation so that the results of a given version may be compared to the results of the prior version. In this way, errors in coding, emissions, or chemistry mechanisms may be readily discerned. Also, for GEOSCHEM versions which may alter the convection or transport routines, a radionuclide (Radon-Lead-Beryllium) benchmark will also be performed. The output files from the benchmark runs as well as PostScript plots are provided in the run.fullchem and run.Rn-Pb-Be subdirectories of the geos.v60205 directory.
For non-Harvard
GEOSCHEM users: you should attempt to perform both full-chemistry and radionuclide
benchmark simulations on your own platform. This will help you to determine
if GEOSCHEM is working correctly at your location.
2.2 Obtaining the GEOSCHEM run directories
TAR files containing sample GEOSCHEM run directories are stored on the GEOSCHEM download page. To install the 4 x 5 run directories, type the following at the Unix prompt:
gunzip GEOSCHEM.v60205.rundir4x5.tar.gz
tar xvf GEOSCHEM.v60205.rundir4x5.tar
This will create 4 x 5 run directories named:
/run.v60205.geos1 /run.v60205.geoss
/run.v60205.geos3 /run.v6-02-05.geos4
which will store input files and a restart file for the 4 x 5 GEOS1, GEOSSTRAT, GEOS3 and GEOS4 grids. The input files assume that you want to perform a full-chemistry simulation. You can modify the input files to specify other types of GEOSCHEM simulations; see Section 5 for more details.
To install the 2 x 2.5 run directories, you can follow the same procedure listed above. (If you have just extracted the 4 x 5 run directories, make sure to rename them or move them to a new directory so that the extraction of the 2 x 2.5 directories won't overwrite them). Type the following at the Unix prompt:
gunzip GEOSCHEM.v60205.rundir2x25.tar.gz
tar xvf GEOSCHEM.v60205.rundir2x25.tar
This will extract directories named
/run.v60205.geos1 /run.v60205.geoss
/run.v60205.geos3 /run.v6-01-05.geos4
these directories will contain input files and restart files for the 2 x 2.5 GEOS1, GEOSSTRAT, GEOS3 and GEOS4 grids. As with the 4 x 5 directories, the input files are preset to select a full-chemistry simulation.
GEOSCHEM restart files are provided in order to provide you with a set of initial conditions that you can start your model runs with. However, it is highly recommended that you not use these restart files for any of your production runs. Rather, you will probably want to generate your own restart file by spinning up the model for at least a year.
2.3 Obtaining the GEOSCHEM data directories
You may now download all of the files in the GEOSCHEM data directories from the data server geos.as.harvard.edu. If you do not have an account on this machine, please contact our systems administrator Jack Yatteau.
To download the 4 x 5 data directories, you may use ftp or sftp:
ftp geos.as.harvard.edu
cd /geos/data/GEOS_4x5
and then you can download each of the individual subdirectories which contain the various GEOSCHEM 4 x 5 input files.
Likewise, to extract the 2 x 2.5 data directories, type the following at the Unix prompt:
ftp geos.as.harvard.edu
cd /geos/data/GEOS_2x2.5
and then you can download each of the individual subdirectories which contain the various GEOSCHEM 2 x 2.5 input files.
2.4 Setting the C-preprocessor switches
Before compiling
the GEOSCHEM model, you must set the proper C-preprocessor switches to tell
the compiler which options you would like compiled into the GEOSCHEM executable.
These switches are located in header file define.h, and are as follows:
GEOS_1 Use GEOS1 met fields (20 layer, 1985-1995 ) GEOS_STRAT Use GEOSSTRAT met fields (26 layer, 1996-1997 ) GEOS_3 Use GEOS3 met fields (48 layer, 1998-2001 ) GEOS_4 Use GEOS4 met fields (55 layer, hybrid, 1999-) A_LLK_03 Use GEOS4 obsolete "a_llk_03" data set for 2003 GRID1x1 Use 1 x 1 grid (for nested grids) GRID2x25 Use 2 x 2.5 grid GRID4x5 Use 4 x 5 grid GRID30LEV Use 30-level GEOS-3 or GEOS-4 vertical grid FULLCHEM Use full SMVGEAR chemistry mechanism LGEOSCO Use Bryan Duncan's CO chem w/ parameterized OH LFASTJ Use FAST-J photolysis code from UC Irvine LSLOWJ Use traditional SLOW-J photolysis code COMPAQ Compile for HP/Compaq Alpha IBM_AIX Compile for IBM/AIX LINUX_PGI Compile for Linux with PGI compiler LINUX_IFC Compile for Linux with 32-bit Intel IFC compiler LINUX_EFC Compile for Linux with 64-bit Intel EFC compiler SGI_MIPS Compile for SGI Origin with MIPSpro compiler SPARC Compile for Sun/Sparc
The C-Preprocessor Switches in define.h take the form of:
!#define GEOS_1 'GEOS_1'
The quotes are necessary to facilitate compilation on the Linux platforms.
In order to activate a particular switch, simply remove the comment character (exclamation mark) from the first column of the line. To de-activate a switch, simply place a comment character (exclamation mark) in the first column of the line.
Note that you may only select one particular met field type (GEOS_1, GEOS_STRAT, GEOS_3, GEOS_4), one particular grid type (GRID1x1, GRID2x25, GRID4x5), and one particular chemical mechanism (FULLCHEM, LGEOSCO).
Also, there are two different versions of GEOS4 met field data. Data produced before January 1, 2004 are known as the "Version 3" or a_llk_03 data. Data produced on or after January 1, 2004 are known as the "Version 4" or a_flk_04 (first-look) and a_llk_04 (late-look) data. There are some minor scientific differences between the two data sets. However, a more significant difference is that the timestamps of the 6-hour averaged 3-D fields in the two data sets differ by 3 hours. If you are using the GEOS4 "Version 3" data set, then you must uncomment the a_llk_03 flag in the define.h file.
If you will be running a simulation which requires photolysis, you must pick one of either LFASTJ or LSLOWJ. If your simulation does not require photolysis, you may leave both LFASTJ and LSLOWJ deactivated.
2.5 Compiling the GEOSCHEM source code
Once you are satisfied that the C-preprocessor switches in the define.h header file are set properly for the type of simulation that you want to perform, you can proceed to compile the code.
At present, GEOSCHEM ships with 7 makefiles, which are used to build the executable via the Unix make utility. The makefiles are named as follows:
Makefile.compaq for HP/Compaq Alpha Makefile.ibm for IBM/AIX Makefile.pgi for Linux with PGI compiler (e.g. Linux Boxes) Makefile.ifc for Linux platform with IFC compiler (e.g. Linux boxes) Makefile.efc for Linux platform with EFC compiler (e.g Itanium) Makefile.sgi for SGI Origin Makefile.sparc for Sun/SPARC
NOTES:
For your convenience, GEOSCHEM now ships with a Perl script named build, which compiles the model using the proper Makefile for your operating system. To compile the GEOSCHEM model, simply type:
To select a particular compilation option type:
build [option-name] for any platform
where allowable Makefile option-names are:
geos Compile GEOSCHEM w/ FAST-J photolysis (Default) geos_sj Compile GEOSCHEM w/ SLOW-J photolysis (mostly obsolete) geosco Compile GEOSCHEM w/ parameterized CO-OH chemistry clean Removes all pre-compiled executables and object files
Note that geos_sj (GEOSCHEM with SLOWJ photolysis) is now more or less obsolete; however, there may be a special instance when you want to compile with this option. Likewise, geosco should only be used if you are running GEOSCHEM with parametericed CO and OH chemistry (cf. Bryan Duncan).
By default, the Makefile will create a multi-processor GEOSCHEM executable (the name will be the same as option-name). This is adequate for most applications. However, for testing purposes, it may be desirable to create a single-processor GEOSCHEM executable. This is possible and only involves a bit of extra effort.
If you look near the very top of the Makefile (for now let's assume the SGI version), you will see the following lines:
# F90 compiler options
FFLAGS = f90 -cpp -64 -O3 -OPT:reorg_common=off# F90 Options -- multiprocessor
F90 = $(FFLAGS) -mp -Dmultitask
# F90 Options -- single processor
#F90 = $(FFLAGS)
If instead
you would like to build a single-processor executable, then follow these steps:
1. Type build clean. This will remove all previously compiled object files. 2. Add a comment character (#) in front of the FF in the "F90 Options -- Multiprocessor" line near the top of the Makefile.
3. Remove the comment character (#) from the FF in the "F90 Options -- Single Processor" line near the top of the Makefile. 4. Type build [option-name] with the appropriate Makefile option (see above).
You may also add extra F90 compiler options to either the single processor or multi-processor compilation lines in the Makefile. For example, to also add subscript error checking to the multi-processor compile option (for SGI), then add a -C to the Fortran compiler options line:
FFLAGS = f90 -cpp -64 -O3 -OPT:reorg_common=off -C
For more information about subscript error checking, please see Section 6.5.1, GEOSCHEM debugging tips.
2.6 Compiling the GEOSCHEM Source Code with Unix Shell Scripts
It is possible
to write a shell script to compile the GEOSCHEM code, such as the following:
#!/bin/tcsh -f # script definition line cd Code.v60205 # your code dir rm -f log # clear log file build geos > log # build code exit(0) # exit normally
which can then be submitted to either the LSF or PBS batch queue system (depending on which queue system is used on your computers).
You can even write one script to both compile and run the GEOSCHEM model:
#!/bin/tcsh -f # script definition line cd Code.v60205 # your code dir rm -f log # clear log file build geos > log # build code mv geos ../run.v60205 # move exec file cd ../run.v60205 # change dir geos >> log # append output to log file exit(0) # exit normally
Likewise, this script may also be submitted to the LSF or PBS batch queue systems.
(Non-Harvard users: ask your local computer guru about how to submit batch jobs on your own system.)
Bob Yantosca has compiled a convenient package of shell scripts named TESTRUN, which allows you to compile and run the GEOSCHEM model automatically. A nice feature of TESTRUN is that it renames the log and binary punch files, so that successive model runs do not conflict with each other. TESTRUN is compatible with both LSF and PBS batch queue systems.
For more information on running the GEOSCHEM model, see Section 6, Running GEOSCHEM.