GEOS-Chem v10-01 Online User's Guide

Previous | Next | Printable View (no frames)

3. Compilation

Prior to running GEOS-Chem, you must compile the source code using a Fortran-90 compiler in order to create a GEOS-Chem executable. Compiling GEOS-Chem invokes the GNU Make utility which manages the entire compilation process. A series of scripts called makefiles directs GNU Make to compile the GEOS-Chem source code files in the proper order and with the proper options. The resultant binary executable has filename geos and is stored in the/bin subdirectory in the top-level source code directory.

The GEOS–Chem source code directory is partitioned into several subdirectories and each GEOS-Chem source code subdirectory contains its own makefile. You will usually not have to modify any of the GEOS–Chem source code makefiles unless you are introducing new modules or module-dependencies into GEOS-Chem. In those cases, you will need to add the new modules to the appropriate makefile and update appropriate dependency lists accordingly.

In general there are two types of makefiles:

The top-level GEOS-Chem source code directory contains a router makefile, which calls down to the regular makefiles in the various subdirectories. In each subdirectory, the regular makefile tells GNU Make how to compile the source code files. When the source code in all subdirectories has been compiled, the top-level Makefile tells GNU Make to create the GEOS-Chem executable file. For this reason, you must always compile GEOS-Chem from the top-level source code directory. You may do this either at the command line within the top-level source code directory or using another router makefile such as the one that comes with run directories copied from the GEOS-Chem Unit Tester (see Chapter 2).

Please consult the GEOS-Chem Makefile Structure wiki page for detailed information about GEOS-Chem makefiles and instructions for compiling GEOS-Chem. Quick links to subsections of this wiki page are included below:

You can find more information about GNU Make at the GNU Operating System website: https://www.gnu.org/software/make/.

Note that executables generally cannot be easily swapped between computers unless the computers have identical systems. We therefore recommend that you recompile GEOS-Chem if you decide to move GEOS-Chem to a different computer.

Previous | Next | Printable View (no frames)