GEOS-Chem Makefile Structure

From Geos-chem
Jump to: navigation, search

On this page we list information about the makefiles used to build the GEOS-Chem executable.

Overview

Starting with GEOS-Chem v8-02-03, we have modified the directory structure of GEOS-Chem. Rather than keeping all source code files in a single directory, we now have partitioned source code files into several subdirectories with most subdirectories having their own Makefile. This was done for the following reasons:

1. To facilitate the installation of 3rd-party software packages such as:
into GEOS-Chem. Our guiding principle is that all 3rd-party software packages should be cleanly separable from the main-line GEOS-Chem code. This will allow the 3rd-party software packages to be updated without having an impact on the rest of the GEOS-Chem source code files.
2. To simplify the maintenance of the GEOS–Chem code files. Without subdirectories, there would have been hundreds of source code files in a single directory, and it would have been very difficult to keep track of them all.

Directory Structure

Here we list the directory structure for recent model versions.

GEOS-Chem 12

The table below lists the directory structure in GEOS-Chem 12 along with descriptions of each subdirectory and its Makefile (if one is present).

Directory Description Is there a Makefile here?
Code Main-level directory for GEOS-Chem Yes, there are two:
  • Makefile is the main-level router makefile and it calls down to the makefile in GeosCore.
  • Makefile_header.mk defines compilation and linking commands for the Fortran-90 compilers. These commands are common to the makefiles in all subdirectories.
Code/GTMM Directory containing source code files for the Global Terrestrial Mercury Model (GTMM) simulation Yes, it compiles the code in GTMM and creates library file lib/libHg.a
Code/GeosCore Directory containing most GEOS-Chem modules and routines Yes, this is the main makefile for GEOS-Chem. It calls down to the makefiles in the other subdirectories. It then compiles the code in the GeosCore directory and creates the geos executable.
Code/GeosRad Directory containing source code files for the RRTMG radiative transfer model Yes, it compiles the code in GeosRad and creates library file lib/librad.a.
Code/GeosUtil Directory containing GEOS-Chem utility modules Yes, it compiles the code in GeosUtil and creates library file lib/libGeosUtil.a.
Code/HEMCO Main-level directory for HEMCO Yes, it calls down to the makefiles in the other HEMCO subdirectories.
Code/HEMCO/Core Directory containing HEMCO modules and routines for reading, storing, and updating data used for calculating emissions Yes, it compiles the code in HEMCO/Core and creates library file lib/libHCO.a.
Code/HEMCO/Extensions Directory containing HEMCO modules and routines for calculating emissions that depend on meteorological input variables and/or non-linear parameterizations Yes, it compiles the code in HEMCO/Extensions and creates library file lib/libHCOX.a.
Code/HEMCO/Interfaces Directory containing HEMCO modules and routines that provide the link between HEMCO and the model environment Yes, it compiles the code in HEMCO/Interfaces and creates library file lib/libHCOI.a.
Code/Headers Directory containing module files with fixed parameters and derived-type definitions
  • NOTE: In previous versions, these files were header files that were inlined via the #include statement. These have since been converted to F90 modules in order to facilitate GEOS-Chem HP development.
Yes, it compiles the code in Headers and creates library file lib/libHeaders.a
Code/History Directory containing module files to archive diagnostics from GEOS-Chem "Classic" simulations to netCDF file format Yes, it compiles the code in History and creates library file lib/libHistory.a
Code/ISOROPIA Directory containing the unmodified ISORROPIA II source code files from Thanos Nenes and Havala Pye:
  • isoropiaII_main_mod.F
Yes, it compiles the code in ISOROPIA and creates library file lib/libIsoropia.a.
Code/KPP Main-level directory for the KPP chemical solver Yes, it calls down to the makefiles in the other KPP subdirectories.
Code/KPP/Custom Directory containing KPP source code files for the Standard chemistry mechanism Yes, if you compile with CHEM=customit compiles the code in KPP/Custom and creates library file lib/libKpp.a.
Code/KPP/int Directory containing the integrators (rosenbrock, runge-kutta, lsodes, etc.) for KPP No
Code/KPP/Standard Directory containing KPP source code files for the Standard chemistry mechanism Yes, it compiles the code in KPP/Standard and creates library file lib/libKpp.a.
Code/KPP/Tropchem Directory containing KPP source code files for the Troposphere-only mechanism Yes, it compiles the code in KPP/Tropchem and creates library file lib/libKpp.a.
Code/KPP/SOA_SVPOA Directory containing KPP source code files for the SOA or SOA_SVPOA chemistry mechanisms. Yes, it compiles the code in KPP/SOA_SVPOA and creates library file lib/libKpp.a.
Code/NcdfUtil Directory containing source code files for netCDF I/O. This code is from Bob Yantosca's NcdfUtilities package Yes, it compiles the code in NcdfUtil and creates library file lib/libNcUtils.a.


Code/NcdfUtil/perl Directory containing perl scripts from the NcdfUtilities package that can be used to generate Fortran code for defining, writing, and reading a netCDF file No
Code/bin Directory where executable (geos, geostomas, geosapm) files will be sent No
Code/doc Directory where automatic documentation is built Yes, it calls the ProTeX script to create reference manuals (in PS and PDF formats) from the comments in GEOS-Chem module and routine headers.
Code/help Directory containing GEOS-Chem help screen Yes, it prints the GEOS-Chem help screen to stdout
Code/lib Directory where library (*.a) files will be created No
Code/mod Directory where module (*.mod) files will be sent No

--Bob Yantosca (talk) 17:19, 16 May 2018 (UTC)

GEOS-Chem v11-02

Please see the section for GEOS-Chem 12.

GEOS-Chem v11-01

The table below lists the directory structure in GEOS-Chem v11-01 along with descriptions of each subdirectory and its Makefile (if one is present).

Directory Description Is there a Makefile here?
Code Main-level directory for GEOS-Chem Yes, there are two:
  • Makefile is the main-level router makefile and it calls down to the makefile in GeosCore.
  • Makefile_header.mk defines compilation and linking commands for the Fortran-90 compilers. These commands are common to the makefiles in all subdirectories.
Code/GTMM Directory containing source code files for the Global Terrestrial Mercury Model (GTMM) simulation Yes, it compiles the code in GTMM and creates library file lib/libHg.a
Code/GeosCore Directory containing most GEOS-Chem modules and routines Yes, this is the main makefile for GEOS-Chem. It calls down to the makefiles in the other subdirectories. It then compiles the code in the GeosCore directory and creates the geos executable.
Code/GeosRad Directory containing source code files for the RRTMG radiative transfer model Yes, it compiles the code in GeosRad and creates library file lib/librad.a.
Code/GeosUtil Directory containing GEOS-Chem utility modules Yes, it compiles the code in GeosUtil and creates library file lib/libGeosUtil.a.
Code/HEMCO Main-level directory for HEMCO Yes, it calls down to the makefiles in the other HEMCO subdirectories.
Code/HEMCO/Core Directory containing HEMCO modules and routines for reading, storing, and updating data used for calculating emissions Yes, it compiles the code in HEMCO/Core and creates library file lib/libHCO.a.
Code/HEMCO/Extensions Directory containing HEMCO modules and routines for calculating emissions that depend on meteorological input variables and/or non-linear parameterizations Yes, it compiles the code in HEMCO/Extensions and creates library file lib/libHCOX.a.
Code/HEMCO/Interfaces Directory containing HEMCO modules and routines that provide the link between HEMCO and the model environment Yes, it compiles the code in HEMCO/Interfaces and creates library file lib/libHCOI.a.
Code/Headers Directory containing module files with fixed parameters and derived-type definitions
  • NOTE: In previous versions, these files were header files that were inlined via the #include statement. These have since been converted to F90 modules in order to facilitate GEOS-Chem HP development.
Yes, it compiles the code in Headers and creates library file lib/libHeaders.a
Code/ISOROPIA Directory containing the unmodified ISORROPIA II source code files from Thanos Nenes and Havala Pye:
  • isoropiaIIcode.F
  • isrpia.inc
Yes, it compiles the code in ISOROPIA and creates library file lib/libIsoropia.a.
Code/KPP Main-level directory for the KPP chemical solver Yes, it calls down to the makefiles in the other KPP subdirectories.
Code/KPP/Standard Directory containing KPP source code files for the Standard chemistry mechanism Yes, it compiles the code in KPP/Standard and creates library file lib/libKpp.a.
Code/KPP/Tropchem Directory containing KPP source code files for the troposphere-only mechanism Yes, it compiles the code in KPP/Tropchem and creates library file lib/libKpp.a.
Code/KPP/SOA Directory containing KPP source code files for the SOA chemistry mechanism Yes, it compiles the code in KPP/SOA and creates library file lib/libKpp.a.
Code/KPP/SOA_SVPOA Directory containing KPP source code files for the SOA chemistry mechanism with secondary POA. Yes, it compiles the code in KPP/SOA_SVPOA and creates library file lib/libKpp.a.
Code/KPP/UCX Directory containing KPP source code files for the UCX chemistry mechanism Yes, it compiles the code in KPP/UCX and creates library file lib/libKpp.a.
Code/KPP/int Directory containing the integrators (rosenbrock, runge-kutta, lsodes, etc.) for KPP No
Code/NcdfUtil Directory containing source code files for netCDF I/O. This code is from Bob Yantosca's NcdfUtilities package Yes, it compiles the code in NcdfUtil and creates library file lib/libNcUtils.a.


Code/NcdfUtil/perl Directory containing perl scripts from the NcdfUtilities package that can be used to generate Fortran code for defining, writing, and reading a netCDF file No
Code/bin Directory where executable (geos, geostomas, geosapm) files will be sent No
Code/doc Directory where automatic documentation is built Yes, it calls the ProTeX script to create reference manuals (in PS and PDF formats) from the comments in GEOS-Chem module and routine headers.
Code/help Directory containing GEOS-Chem help screen Yes, it prints the GEOS-Chem help screen to stdout
Code/lib Directory where library (*.a) files will be created No
Code/mod Directory where module (*.mod) files will be sent No

--Bob Yantosca (talk) 14:23, 13 June 2017 (UTC)

Compilation sequence

GEOS-Chem's makefiles compile source code files in the following order:

  1. Files in NcdfUtil/
  2. Files in KPP (first pass)
  3. Files in Headers/
  4. Files in GeosUtil/
  5. Files in KPP/ (second pass)
  6. Files in History/
  7. Files in HEMCO/Core/
  8. Files in HEMCO/Extensions/
  9. Files in HEMCO/Interfaces/
  10. Files in ISOROPIA/
  11. Files in GeosRad/ (if RRTMG is enabled)
  12. Files in GeosCore/

Each of theses directories has its own makefile that contains a list of all of the source code files within the directory, plus dependent routines (a.k.a. the "dependencies" list). Source code files that do not refer to any modules have a dependencies list such as:

dao_mod.o                   : dao_mod.F                              

Whereas a source code file that refers to several modules (in this case, GeosCore/chemistry_mod.F) has a dependencies list like this:

chemistry_mod.o             : chemistry_mod.F90                              \
                              aerosol_mod.o           isoropiaII_mod.o       \
                              c2h6_mod.o              carbon_mod.o           \
                              dust_mod.o              drydep_mod.o           \
                              global_ch4_mod.o        mercury_mod.o          \
                              pops_mod.o                                     \
                              rpmares_mod.o           RnPbBe_mod.o           \
                              seasalt_mod.o           strat_chem_mod.o       \
                              sulfate_mod.o           tagged_co_mod.o        \
                              tagged_o3_mod.o         tomas_mod.o            \
                              flexchem_mod.o

Examination of GeosCore/chemistry_mod.F90 reveals that this module refers to many other modules not listed above. However, many of those modules are found in different directories (such as Headers/ and GeosUtil/), which are compiled prior to GeosCore/. Therefore you do not need to list those modules when creating the dependencies listing. In the example above, we have only specified the 6 modules that are located in the same directory as aerosol_mod.F.

The order of modules in the dependencies list does not matter. The GNU Make utility will define the order of compilation from the list of files (and their dependencies) that you have specified in each Makefile. You will not have to worry about this unless you add new source code files. If you have questions about how to add dependency lists to makefiles, please let us know.

--Melissa Sulprizio 12:54, 14 April 2015 (EDT)
--Bob Yantosca (talk) 18:10, 16 May 2018 (UTC)

Compiling GEOS-Chem

In this section we provide information about how to compile the GEOS-Chem source code into an executable file that you can run.

Setting the proper environment variables

Before you compile GEOS-Chem, please take a moment to make sure that you have defined the proper Unix environment variables that tell GEOS-Chem which compiler you are using, and where the netCDF library has been installed. For complete information, please see our our Setting Unix environment variables for GEOS-Chem wiki page.

--Bob Yantosca (talk) 16:14, 10 March 2017 (UTC)

Ways to compile GEOS-Chem

There are two basic ways to compile GEOS-Chem:

  1. Execute make commands in the top-level code directory
  2. Execute make commands in the run directory (RECOMMENDED)

Compiling in the top-level code directory

*** Please see Compiling in a run directory for the recommended compiling approach ***

Makefile Options

This section will describe make options when compiling from within the GEOS-Chem code directory. Note that starting in v11-01, we recommend that users compile from within the run directory by using the Makefile that comes with all run directories copied from the GEOS-Chem Unit Tester. Information about using a router Makefile, such as the one included in run directories copied from the Unit Tester, is detailed in the Advanced Compilation Techniques section of this page.

The GEOS-Chem Makefiles allow you to choose from several different options. The best way to learn about these options is to type:

make help

at the Unix prompt. You will then get a screen similar to this:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%      GEOS-Chem Help Screen      %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 

Usage: make -jN TARGET REQUIRED-FLAGS [ OPTIONAL-FLAGS ]

-jN             Compiles N files at a time (to reduce compilation time)

--------------------------------------------------------
TARGET may be one of the following:
--------------------------------------------------------
all             Default target (synonym for "lib exe")
lib             Builds GEOS-Chem source code
libcore         Builds GEOS-Chem objs & libs only in GeosCore/
libheaders      Builds GEOS-Chem objs & libs only in Headers/
libhistory      Builds GEOS-Chem objs & libs only in History/
libiso          Builds GEOS-Chem objs & libs only in ISOROPIA/
libkpp          Builds GEOS-Chem objs & libs only in KPP/
libnc           Builds GEOS-Chem objs & libs only in NcdfUtil/
librad          Builds GEOS-Chem objs & libs only in GeosRad/
libutil         Builds GEOS-Chem objs & libs only in GeosUtil/
ncdfcheck       Determines if the netCDF library installation works
exe             Creates GEOS-Chem executable
clean           Removes *.o, *.mod files in source code subdirs only
realclean       Removes all *.o, *mod, *.lib *.a, *.tex, *ps, *pdf files everywhere
distclean       Synonym for "make realclean"
doc             Builds GEOS-Chem documentation (*.ps, *.pdf) in doc/
docclean        Removes *.tex, *.pdf, *,ps from doc/
tauclean        Removes *.pdb, *.inst, *.pp, and *.continue.* files produced by TAU
help            Displays this help screen


--------------------------------------------------------
REQUIRED-FLAGS include:
--------------------------------------------------------
MET=____        Specifies the met field type
                --> Options: geosfp merra2

GRID=___        Specifies the horizontal grid
                --> Options: 4x5 2x25 05x0625 025x03125


--------------------------------------------------------
OPTIONAL-FLAGS may be one or more of the following:
--------------------------------------------------------

NEST=___        Specifies the nested-grid domain
                 --> Options: AS CH NA EU and CU (custom)

NO_REDUCED=y    Compiles GEOS-Chem with the full vertical grid
                --> Default: NO_REDUCED=y for CHEM=Standard
                             NO_REDUCED=n for CHEM=Tropchem or SOA_SVPOA
 

Parallelization and optimization flags:
---------------------------------------
OMP=no          Turns off OpenMP parallelization
                --> Default: OMP=y

NONUMA=yes      Turns on -mp=nonuma option (pgi only)
                --> Default: OMP=n

IPO=yes         Turns on optmization options -ipo -static (ifort only)
                --> Default: IPO=n

OPT=___         Specifies the optimization level
                --> Defaults OPT=-O2 (ifort and pgi)
                             OPT=-O3 (gfortran)

M_ARCH=___      Specifies the CPU architecture (gfortran only)


Chemistry options:
------------------
CHEM=___        Specifies which chemistry mechanism is used
                --> Options: Standard Tropchem UCX SOA SOA_SVPOA
                --> Default: Standard

KPPSOLVER=___   Specifies the integrator used with KPP
                --> Options: lsodes radau5 rosenbrock runge_kutta
                --> Default: rosenbrock

RRTMG=y         Turns on online radiative transfer using the RRTMG model
                --> Default: RRTMG=n


Diagnostics options:
--------------------
BPCH_DIAG=n     Disable binary-punch output for diagnostics
                --> Default: BPCH_DIAG=y

BPCH_TPBC=n     Disable binary-punch I/O for nested-grid boundary
                condition files for TPCORE.
                --> Default: BPCH_TPBC=y (if NEST is specified)

BPCH_TIMESER=n  Disable binary-punch output for timeseries diagnostics
                (i.e. to maintain backwards compatibility until these
                diagnostics are available in netCDF format)
                --> Default: BPCH_TIMESER=y

NC_DIAG=y       Enable netCDF output for diagnostics
                --> Default: NC_DIAG=n

NC_NODEFLATE=y  Disable netCDF file compression when writing
                diagnostic or restart files to disk.  This may
                be necessary for debugging, in order to ensure
                that file compression does not cause problems
                when comparing netCDF files for identicality.
                --> Default: NC_NODEFLATE=n


Debugging flags:
----------------
BOUNDS=y        Turns on subscript-array checking
                --> Default: BOUNDS=n

DEBUG=y         Turns on options -g -O0 for running GEOS-Chem in a debugger
                --> Default: DEBUG=n

FPEX=y          Turns on checking for floating-point exceptions
                --> Default: FPEX=nn

FPE=y           Synonym for FPEX=y
                --> Default: FPE=n

TIMERS=___      Turn on GEOS-Chem timers (Use 1 for GEOS-Chem "Classic")
                --> Default: TIMERS=0

TRACEBACK=y     Print out a list of called routines if the run dies with an error
                --> Default: TRACEBACK=y
                --> To disable: TRACEBACK=n

GPROF=y         Compiles GEOS-Chem for use with the GNU profiler (aka gprof)
                --> Default: GPROF=n

TAU_PROF=y      Compiles GEOS-Chem for use with the TAU performance profiler
                --> Default: TAU_PROF=n

TAU_SF=___      Specifies the TAU selectfile for removing throttled files


Aerosol microphysics flags:
---------------------------------------
TOMAS=y         Turns on 30-bin TOMAS aerosol microphysics
                --> Default: TOMAS=n

TOMAS12=y       Turns on 12-bin TOMAS aerosol microphysics
                --> Default: TOMAS12=n

TOMAS15=y       Turns on 15-bin TOMAS aerosol microphysics
                --> Default: TOMAS15=n

TOMAS40=y       Turns on 40-bin TOMAS aerosol microphysics
                --> Default: TOMAS40=n


GCHP (GEOS-Chem "High Peformance") flags:
---------------------------------------
HPC=y           Compile GEOS-Chem for HPC environments (with ESMF & MAPL)
               --> Default: HPC=n

--Bob Yantosca (talk) 18:56, 16 May 2018 (UTC)

Specifying compiler flags

GEOS–Chem relies on several different C–preprocessor switches to inform the Fortran–90 compiler which options to include in the executable file. The C–preprocesor (or CPP for short) is a feature of the C and C++ programming languages that allows you to compile blocks of code only if certain conditions are met. All modern Fortran compilers have inherited the C–preprocessor feature. Therefore, even though GEOS–Chem is written in Fortran–90, we can still incorporate C–preprocesor commands into the source code.

The C-preprocessor switches used by GEOS-Chem include:

  • Meteorological fields
  • Horizontal and vertical grid information
  • Compiler type
  • Chemistry mechanism
  • Options for special simulations (e.g. mercury)
  • Debugging options

Switches are set with Makefile options from the command line by specifying compiler flags (e.g. UCX=y). Options that are not relevant to your system will be ignored. Type make help at the command line while in the top-level GEOS-Chem source code directory for a complete list of compiler flag options (excerpted above).

Please keep the following items in mind when specifying compiler flags.

  • When starting with a new version of GEOS-Chem or a new simulation type you should always issue the following command:
     make realclean
This is especially important if you are changing the met field type or horizontal grid settings. The command will remove all previously-created compiler output files (e.g. *.a, *.o, *.mod) and executables. After doing make realclean, you can recompile GEOS–Chem again with your new options.
  • You can speed up compilation by specifying make -j4 to compile four files at a time. If you have more CPUs available you can change this number.
  • You must specify a value for MET. Please see out Overview of GMAO met data products wiki page for more information on the meteorology fields. Note that the Makefile in run directories copied from the Unit Tester automatically extract MET from input.geos and do not need to be passed in the make command.
    • Allowable values are: merra2, merrageosfp, geos5, geos4, and gcap
  • You must specify a value for GRID. Please see Appendix 2 of the GEOS-Chem User's Guide for more information on the horizontal grids. Note that the Makefile in run directories copied from the Unit Tester automatically extract GRID from input.geos and do not need to be passed in the make command.
    • Allowable values are: 4x5, 2x25, 05x0666, 025x03125
  • If you select GRID=05x0666 or GRID=025x03125, then you must select a nested-grid option. Note that the Makefile in run directories copied from the Unit Tester automatically extract NEST from input.geos and do not need to be passed in the make command. Options for NEST include:
    • NEST=as for the Asia nested grid (MERRA-2 only)
    • NEST=ch for the China nested grid
    • NEST=na for the North America nested grid
    • NEST=eu for the Europe nested grid
  • Makefile target names are case-sensitive. For example, you should type make all, not make ALL.
  • Makefile flags will accept case-insensitive output. You may omit dashes from met field names. Each of the following is acceptable:
    • MET=geosfp, MET=GEOSFP, MET=GeosFp, MET=geos-fp, etc.
  • Makefile flags that require a simple yes/no answer will accept case-insensitive input. For example:
    • DEBUG=yes, DEBUG=Yes, DEBUG=y, DEBUG=No, DEBUG=NO, etc.
  • Some debug compiler flags may slow down your simulation, so we recommend using them for short test simulations only. For more information, see this wiki post.

--Lizzie Lundgren 14:31, 15 April 2015 (EDT)
--Bob Yantosca (talk) 18:59, 16 May 2018 (UTC)

Setting default flags

The REQUIRED-FLAGS and OPTIONAL-FLAGS can be specified in one of two ways:

1. As a command-line argument to the GNU Make utility
For example, if you wanted to build the GEOS-Chem executable using the KPP solver with Rosenbrock integrator and the SOA mechanism you could type:
       make -j4 MET=geosfp GRID=4x5 KPPSOLVER=rosenbrock CHEM=SOA
2. As an environment variable
If you don't wish to keep typing KPPSOLVER=rosenbrock CHEM=SOA every time, you could instead use:
       setenv KPPSOLVER rosenbrock
       setenv CHEM      SOA
       make -j4 MET=geosfp GRID=4x5
Specifying options as environment variables allows you to predefine settings so that you don't have to physically type them on the command line every time you build GEOS-Chem. The environment variables can also be placed in your ~/.cshrc or .bashrc so that they are initialized when you log in.

--Melissa Sulprizio 18:04, 7 April 2015 (EDT)

Compiling examples

All examples below are for compiling from the top-level GEOS-Chem source code directory. Note that starting in v11-01, we recommend that users compile from within the run directory by using the Makefile that comes with all run directories copied from the GEOS-Chem Unit Tester. The run directory router Makefile invokes the top-level code directory Makefile to execute any of the commands in the examples below but creates and stores log files locally in the run directory. See Compile with a run-directory Makefile section below for instructions.

Example of compiling with Make:

(1) To build GEOS-Chem executable for the 4x5 grid with GEOS-FP meteorology, one can simply type:

   make -j4 MET=geosfp GRID=4x5

(2) To select a different compiler (e.g. PGI), type:

   make -j4 MET=geosfp GRID=4x5 COMPILER=pgi
  • Depending on your PGI compiler setup, you may also have to add the option NONUMA=yes.

(3) The default is to compile for multi-processor. To turn off the parallelization and build the executable for a single-processor, type:

   make -j4 MET=geosfp GRID=4x5 OMP=no

(4) To compile GEOS-Chem (multi-processor) for use with a debugger (e.g. Totalview), type:

   make -j4 MET=geosfp GRID=4x5 DEBUG=yes FPE=yes OMP=yes

(5) To compile GEOS-Chem (single-processor) with the same debugging options, type:

   make -j4 MET=geosfp GRID=4x5 DEBUG=yes FPE=yes OMP=no

(6) To test for array-out-of-bounds errors, type:

   make -j4 MET=geosfp GRID=4x5 BOUNDS=yes

(7) If you wish to compile the code but not make the executable, you may type:

   make -j4 MET=geosfp GRID=4x5 BOUNDS=yes lib

(8) To print the GEOS-Chem help screen, type::

   make help

(9) To generate GEOS-Chem Reference Guide documentation in PostScript and PDF formats, type:

   make doc

(10) To remove all *.o, *.mod, and executable files from the source code directories (but not from the mod, lib, or bin directories), type:

   make clean

(11) And to remove everything and start over from scratch, type:

   make realclean

--Lizzie Lundgren (talk) 18:41, 4 January 2017 (UTC)

Compiling in a run directory

*** RECOMMENDED COMPILING APPROACH ***

All run directories downloaded from the GEOS-Chem Unit Tester come with a router Makefile that enables you to easily compile and run GEOS-Chem from the run directory. Using this feature enables you to eliminate certain compile options from the make command that are always the same for a given run directory (e.g. MET and GRID) and thereby avoid common mistakes. It also creates and stores compile logs locally for easy reference.

Please see the Creating GEOS-Chem run directories wiki page for instructions on how to create a GEOS-Chem run directory from the GEOS-Chem Unit Tester.

Setting up the run directory Makefile

Once you have a run directory, open the Makefile in a text editor and edit the following three configurable variables with your preferences:

# Source code location
ifndef CODE_DIR
 CODE_DIR :=/home/$(USER)/GC/Code.v11-01
endif

# Output log file destination (default is run directory) 
ifndef LOG_DIR 
 LOG_DIR :=.
endif

# GEOS-Chem run log filename prefix
ifndef VERSION
 VERSION :=v11-01
endif

Each of these three variables are automatically passed to the make command using the default values you define in this file. Alternatively, you may define them at the terminal within the make call. For example, if you want to override your default CODE_DIR, you can include CODE_DIR=/GC/Code.Ref to compile Code.Ref rather than Code.Dev.

Makefile options

The compiler flags required for compiling GEOS-Chem, specifically MET and GRID, and in some cases NEST, TOMAS, RRTMG, or UCX, are automatically passed when you compile using the run directory Makefile. The flags are set using the getRunInfo perl script located in the run directory which reads the simulation information from the input.geos configuration file. If you wish to change any of these options you must create a new run directory.

There are two processing modes available for compiling GEOS-Chem:

  1. Single processor ("sp")
  2. Multi-processor ("mp"), which uses OpenMP parallelization

Output files, including the GEOS-Chem executable geos, have a .sp or .mp suffix depending on what processing mode is used.

The GEOS-Chem Makefiles allow you to choose from several different options. The best way to learn about these options is to type:

make help

at the Unix prompt. You will then get a screen similar to this:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%    GEOS-Chem Run Directory Makefile Help Screen    %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Usage: make -jN TARGET [OPTIONAL-FLAGS]

-jN               Compiles N files at a time (reduces compile time)

----------------------------------------------------------
TARGET may be one of the following:
----------------------------------------------------------
all               Default target (synonym for "unittest")

%%% COMPILE AND RUN %%%
unittest          Runs a GEOS-Chem unit test:
                  (1) Builds & runs GEOS-Chem with parallelization OFF;
                  (2) Builds & runs GEOS-Chem with parallelzation ON;
                  (3) Checks to see if the output is identical.
sp                Builds and runs GEOS-Chem with parallelization OFF.
mp                Builds and runs GEOS-Chem with parallelization ON.

%%% BUILD ONLY %%%
spbuild           Just builds GEOS-Chem with parallelization OFF.
mpbuild           Just builds GEOS-Chem with parallelization ON.

%%% RUN ONLY %%%
sprun             Just runs GEOS-Chem with parallelization OFF.
mprun             Just runs GEOS_Chem with parallelization ON.

%%% REMOVE DATA FILES %%%
dataclean         Removes ALL GEOS-Chem diagnostic and restart files
spdataclean       Removes diagnostic and restart files from GEOS-Chem
                    simulations with parallelization turned OFF.
mpdataclean       Removes diagnostic and restart files from GEOS-Chem
                    simulations with parallelization turned ON.

%%% REMOVE LOG FILES %%%
logclean          Removes all GEOS-Chem and HEMCO output log files.
splogclean        Removes GEOS-Chem and HEMCO log files from GEOS-Chem
                    simulations with parallelization turned OFF.
mplogclean        Removes GEOS-Chem and HEMCO log files from GEOS-Chems
                    simulations with parallelization turned ON.

%%% REMOVE EXECUTABLE FILES %%%
execlean          Removes all GEOS-Chem executable files
spexeclean        Removes GEOS-Chem executable files for which the
                    parallelization has been turned OFF.
mpexeclean        Removes GEOS-Chem executable files for which the
                    parallelization has been turned ON.

%%% REMOVE ALL FILES %%%
fileclean         Synonym for: dataclean   logclean   execlean
spclean           Synonym for: spdataclean splogclean spexeclean
mpclean           Synonym for: mpdataclean mplogclean mpexeclean

%%% REMOVE CONFIG FILES %%%
extrafileclean  Removes input.geos and HEMCO_Config.rc files

%%% CLEAN SOURCE CODE %%%
clean             Makes "clean" in source code directory ODE_DIR
realclean         Makes "realclean" in the source code directory ODE_DIR
tauclean          Removes all TAU files in the source code directory ODE_DIR

%%% CLEAN AND REMOVE ALL %%%
superclean        Synonym for: fileclean realclean

...

To compile only, type the following at the command line, including any optional compiler flags as needed:

make -j4 mpbuild

Prior to compiling, geos.mp, lastbuild.mp, and all .mp log files will be removed from the directory by calling other make targets mpexeclean and mplogclean. All standard output generated while building the new executable will be displayed in your terminal window. The executable created will reside in the /bin directory within CODE_DIR and a copy will be placed in the run directory with name geos.mp. Finally, your compile settings will be stored in log lastbuild.mp and will also be printed to the terminal window. The unix commands for each of these steps is stored under various targets in the Makefile. Note that you make call any of the make targets from the command line (e.g. make mplogclean to remove all .mp logs).

To compile and run GEOS-Chem interactively, type the following at the command line:

make -j4 mp

Prior to compiling, all .mp files (executable, log, and data) will be removed from the directory. All standard output generated while creating and then running the new executable will be sent to the run log file. As when building only, the executable created will reside in the /bin directory within CODE_DIR and a copy will be placed in the run directory with name geos.mp. Your compile settings will be stored in log lastbuild.mp as well as the run log file. Output data files are appended with the .mp suffix except for restart and HEMCO diagnostic files that do not correspond to the simulation end date. Finally, your compile and run settings will be printed to the terminal window.

The GNU Make utility is a powerful and flexible software development tool and we encourage you to explore the existing Makefile options and to customize the Makefile to optimize your own needs.

--Lizzie Lundgren 10:59, 22 April 2015 (EDT)

Information from the last time GEOS-Chem was compiled

When compiling GEOS-Chem v11-01 from one of the run directory Makefiles, a file called lastbuild.mp or lastbuild.sp will be created. This file contains the settings that were used to compile GEOS-Chem, for your reference.

LAST BUILD INFORMATION:
  CODE_DIR     : ../Code.v11-01k
  CODE_BRANCH  : Precision
  LAST_COMMIT  : Update WEST_NS_DIV in hcox_lightnox_mod.F90 to fix ozone overestimate in the US 
  COMMIT_DATE  : Fri Dec 2 15:47:35 2016 -0500 
  VERSION      : v11-01
  MET          : geosfp
  GRID         : 4x5
  SIM          : standard
  NEST         : n
  TRACEBACK    : n
  BOUNDS       : n
  DEBUG        : n
  FPE          : n
  NO_ISO       : n
  NO_REDUCED   : y
  CHEM         : Standard
  UCX          : y
  TOMAS12      : n
  TOMAS15      : n
  TOMAS30      : n
  TOMAS40      : n
  RRTMG        : n
  MASSCONS     : n
  TIMERS       : 1
  BPCH_RST_IN  : n
  BPCH_RST_OUT : n
  BPCH_DIAG    : y
  NC_DIAG      : n
  COMPILER     : gfortran 4.8.2
  Datetime     : 2016/12/02 17:53

Advanced compilation techniques

Compiling with Unix shell scripts

It is possible to write a shell script to compile the GEOS–Chem code, such as the following:

   #!/bin/tcsh -f                       # Script definition line
   cd Code.v9-02                        # your code dir
   rm -f log                            # clear log file
   make -j4 MET=geos5 GRID=4x5 > log    # build the code
   exit(0)                              # exit normally

You can then run this script interactively, or submit it to the queue system on your computational cluster.

Technical Issues

GNU Make is required

The makefiles described above are designed to be used with GNU Make. This is free, open-source software and is bundled with most of the popular Unix versions today (e.g. various Linux builds, Ubuntu, Fedora, etc.).

It is recommended to use GNU Make because not all Unix make utilities are compatible with each other. GNU Make is probably the most flexible make utility available.

If GNU Make is not already installed on your system, then you (or your IT guru) will have to install it. You can check to see if GNU Make is already installed by typing:

make --version

at the Unix prompt. GNU Make will display a version screen similar to this:

GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for x86_64-redhat-linux-gnu

Please also read the GNU Make Reference Document for more detailed information.

Install LaTeX utilities for auto documentation

Many of the updated GEOS-Chem source code files now use the ProTeX documentation headers. The protex script (included in the Code/doc subdirectory) strips the information from the documentation headers located in GEOS-Chem

  • Modules
  • Subroutines
  • Functions
  • Include files

and creates a LaTeX format (*.tex) file. The latex utility can then be used to produce output in PDF (*.pdf) and PostScript (*.ps) formats from the LaTeX file. This all happens automatically when you type:

make doc

at the Unix prompt. However, you must make sure to have the LaTeX utilities installed on your machine in order to be able to generate this automatic documentation. The LaTeX utilities include:

Utility Description
latex Converts LaTeX format files to Device-Independent format (*.dvi)
dvips Converts Device-Independent format to PostScript format
dvipdf Converts Device-Independent format to PDF format

The LaTeX utilities may be packaged with your version of Unix. Ask your IT guru for more information.

You may also want to install the following packages:

Utility Description
ghostview Reader for PostScript files
acroread Adobe Acrobat Reader for PDF files

--Bob Yantosca (talk) 18:29, 5 December 2016 (UTC)

Compile-time options that can slow down GEOS-Chem

The following compile-time options can cause a GEOS-Chem job to run more slowly than usual:

Command Description
DEBUG=y This is required for running GEOS-Chem in a debugger such as idb or Totalview. This will invoke the -g -O0 compiler options, which turn off all optimization.
BOUNDS=yes This option turns on runtime array-out-of-bounds checking, which looks for instances of invalid array indices (i.e. If the A array only has 10 elements but you try to reference A(11).)
FPEX=y or
FPE=y
This option turns on error checking for floating-point exceptions (i.e. div-by-zero, NaN, floating-invalid, and similar errors).
OMP=no This option turns off the OpenMP parallelization (which is turned on by default).

If you have selected any of the above options, then try compiling GEOS-Chem from scratch, i.e.,

make realclean
make -j4 MET=____ GRID=____

and then re-run your GEOS-Chem job.

--Bob Y. 15:47, 2 October 2013 (EDT)

Previous issues that have now been resolved

Add a more robust test for netCDF-Fortran in Makefile_header.mk

This update was included in GEOS-Chem 12.0.1, which was released on 24 Aug 2018.

We have rewritten the test that determines if the netCDF-Fortran library file (libnetcdff.a) is in the same folder or a different folder than the netCDF-C library file (libnetcdf.a). The new test should be more robust and forgiving of user error.

Some users had reported an issue with the GEOS-Chem environment variable GC_F_INCLUDE was being added to the build sequence even if there is no netCDF-Fortran library. The new test will only add GC_F_INCLUDE to the build sequence if the netCDF-Fortran library is found on disk.

--Bob Yantosca (talk) 16:44, 24 August 2018 (UTC)

Removed the COMPILER variable from Makefile_header.mk for a cleaner build sequence

This update was included in v11-02a and approved on 12 May 2017.

Farid Amid wrote:

I was trying to compile the model v11.01 with for the nested domain using PGI compiler and following command:
     make -j4 MET=GEOS-FP GRID=025x03125 NEST=NA
The issue was that mod dir remained empty and I had compiler had difficulty finding mod files, the problem was resolved by changing line 1317 of Makefile_header.mk from pgfortran to pgi.

Bob Yantosca replied:

We have made a fix to v11-02a (under development) to remove the COMPILER variable in the Makefile. We now test the value of the FC environment variable with a regular expression to determine if it is the Intel, PGI, or GNU compiler family. (On most Unix software builds, the environment variable FC is the standard name for the Fortran compiler.) Sometimes the PGI compiler on a system is called pgf90, or else pgfortran, or sometimes pgi. The new Makefile test should be more robust and accept all of these alternatives.

--Bob Yantosca (talk) 20:31, 8 March 2017 (UTC)

Bug fix: Specifying NO_REDUCED=no now compiles GEOS-Chem for reduced grids

This fix was included in v11-02a and approved on 12 May 2017.

Jiawei Zhang wrote:

I found a small but annoying bug in Makefile_header.mk. The problem is that if I use NO_REDUCED=n (i.e. use 47 levels) as a compile option, then the makefile will treat it as NO_REDUCED=yes (i.e. use 72 levels). The LLPAR parameter will then be set to 72 instead of 47, leading to unexpected behavior. That's because Makefile_header.mk contains something like:
      # %%%%% REDUCED VERTICAL GRID (default, unless specified otherwise) %%%%
      ifndef NO_REDUCED
        USER_DEFS        += -DGRIDREDUCED
      else
        REGEXP           :=(^[Yy]|^[Yy][Ee][Ss])
        ifeq ($(shell [[ "$(NO_REDUCED)" =~ $(REGEXP) ]] && echo true),true)
        endif
      endif
The GRIDREDUCED C-preprocessor switch will only be activated if NO_REDUCED is not provided. The following "yes" or "no" just doesn't matter because the nested ifeq statement doesn't do anything. With this problem, the only way to compile a 47L model is NOT providing the NO_REDUCED option. It also affects compiling GEOS-Chem from the geosfp_4x5_tropchem rundir, because NO_REDUCED=n is one of the default options.

We have now fixed this issue by setting the NO_REDUCED Makefile variable to "no" by default, and then evaluating its value in a separate IF statement. This code has now been added to the Makefile_header.mk.

  # %%%%% REDUCED VERTICAL GRID (default, unless specified otherwise) %%%%
  ifndef NO_REDUCED
    NO_REDUCED       :=no
  endif
  REGEXP              :=(^[Nn]|^[Nn][Oo])
  ifeq ($(shell [[ "$(NO_REDUCED)" =~ $(REGEXP) ]] && echo true),true)
    USER_DEFS        += -DGRIDREDUCED
  endif

This fix now will compile GEOS-Chem for 47 levels when NO_REDUCED=no is specified, or if NO_REDUCED is omitted.

--Bob Yantosca (talk) 16:09, 1 March 2017 (UTC)

TRACEBACK=y is now the default setting

This update was included in GEOS-Chem v11-01 public release

Seb Eastham (Harvard) suggested that all GEOS-Chem simulations should use the traceback option by default. An example of traceback output generated by the Intel Fortran Compiler is shown below:

Image              PC                Routine            Line        Source             
libifcoremt.so.5   00002B9EFA2188D3  Unknown               Unknown  Unknown
geos.mp            00000000011FCE35  regrid_a2a_mod_mp        1914  regrid_a2a_mod.F90
libiomp5.so        00002B9EFB70A8A3  Unknown               Unknown  Unknown

The above example shows that the GEOS-Chem simulation exited abnormally at line 1914 of module regrid_a2a_mod.F90. We believe that having this information available will help GEOS-Chem users to better diagnose and report issues.

We have modified the Makefile_header.mk file in the GEOS-Chem v11-01 public release to set the Makefile option TRACEBACK=y if it is not already passed as an argument. To disable the traceback output, you will now have to compile with TRACEBACK=n.

It should be noted that the traceback option will increase the size of the GEOS-Chem executable, but will not have any impact on execution speeds.

--Bob Yantosca (talk) 22:27, 3 January 2017 (UTC)

Compiler cannot find certain files

This issue can occur in GEOS-Chem v9-01-01 and older versions. We have added this fix into GEOS-Chem v9-01-02 and higher versions.

Matthew Johnson wrote:

When looking into the core files I get error output such as this:
   Symbol file not found for main
   Core was generated by `./geos'.
   Program terminated with signal 11, Segmentation fault.
   #0  0x0000000000733bde in pjc_pfix_mod_mp_init_press_fix_ ()
Have you seen this portion of the code causing a seg fault before?

Bob Yantosca replied:

Try reordering the lines in GeosCore/Makefile from:
   lib: libkpp libutil libiso libcore

to:
   lib:                                               # Build all G-C libraries                  
        @$(MAKE) libkpp                        
        @$(MAKE) libutil                  
        @$(MAKE) libiso                   
        @$(MAKE) libcore                  

NOTE: All indented lines begin with a TAB!
This ordering will force GNU Make to compile all of the files in KPP/ first, then all of the files in GeosUtil/, etc. This ought to prevent the build sequence from referencing files that haven't yet been compiled.

--Bob Y. 14:02, 3 January 2013 (EST)

References

  1. GNU Make Manual
  2. Mecklenburg, Robert, Managing Projects with GNU Make, Third Edition,, O'Reilly and Associates, 2004.

--Bob Y. 12:07, 19 July 2011 (EDT)

Obsolete information

These sections pertain to makefile options for obsolete versions of GEOS-Chem. We shall keep this information here for reference.

GEOS-Chem v10-01

Obsolete.jpg

The table below lists the directory structure in GEOS-Chem v10-01 along with descriptions of each subdirectory and its Makefile (if one is present).

Directory Description Is there a Makefile here?
Code Main-level directory for GEOS-Chem Yes, there are two:
  • Makefile is the main-level router makefile and it calls down to the makefile in GeosCore.
  • Makefile_header.mk defines compilation and linking commands for the Fortran-90 compilers. These commands are common to the makefiles in all subdirectories.


Code/GTMM Directory containing source code files for the Global Terrestrial Mercury Model (GTMM) simulation Yes, it compiles the code in GTMM and creates library file lib/libHg.a
Code/GeosApm Directory containing parallel copied of GEOS-Chem source code files that were modified for the APM aerosol microphysics package Yes, this is the main makefile for GEOS-Chem with APM. It calls down to the makefiles in the other subdirectories. It then compiles the code in GeosApm and GeosCore and creates the geosapm executable.

NOTE: Due to the many wide-sweeping updates (e.g. HEMCO, UCX, SOA) made in recent versions of GEOS-Chem, the APM package is now no longer compatible with GEOS-Chem v10-01. The APM team is currently working on bringing APM up to date.

Code/GeosCore Directory containing most GEOS-Chem modules and routines Yes, this is the main makefile for GEOS-Chem. It calls down to the makefiles in the other subdirectories. It then compiles the code in the GeosCore directory and creates the geos executable.
Code/GeosRad Directory containing source code files for the RRTMG radiative transfer model Yes, it compiles the code in GeosRad and creates library file lib/librad.a.
Code/GeosUtil Directory containing GEOS-Chem utility modules Yes, it compiles the code in GeosUtil and creates library file lib/libGeosUtil.a.
Code/HEMCO Main-level directory for HEMCO Yes, it calls down to the makefiles in the other HEMCO subdirectories.
Code/HEMCO/Core Directory containing HEMCO modules and routines for reading, storing, and updating data used for calculating emissions Yes, it compiles the code in HEMCO/Core and creates library file lib/libHCO.a.
Code/HEMCO/Extensions Directory containing HEMCO modules and routines for calculating emissions that depend on meteorological input variables and/or non-linear parameterizations Yes, it compiles the code in HEMCO/Extensions and creates library file lib/libHCOX.a.
Code/HEMCO/Interfaces Directory containing HEMCO modules and routines that provide the link between HEMCO and the model environment Yes, it compiles the code in HEMCO/Interfaces and creates library file lib/libHCOI.a.
Code/Headers Directory containing module files with fixed parameters and derived-type definitions
  • NOTE: In previous versions, these files were header files that were inlined via the #include statement. These have since been converted to F90 modules in order to facilitate Grid-Independent GEOS-Chem development.
Yes, it compiles the code in Headers and creates library file lib/libHeaders.a
Code/ISOROPIA Directory containing the unmodified ISORROPIA II source code files from Thanos Nenes and Havala Pye:
  • isoropiaIIcode.F
  • isrpia.inc
Yes, it compiles the code in ISOROPIA and creates library file lib/libIsoropia.a.
Code/KPP Main-level directory for the KPP chemical solver Yes, it calls down to the makefiles in the other KPP subdirectories.
Code/KPP/standard Directory containing KPP source code files for the standard chemistry mechanism Yes, it compiles the code in KPP/standard and creates library file lib/libKpp.a.
Code/KPP/SOA Directory containing KPP source code files for the SOA chemistry mechanism Yes, it compiles the code in KPP/standard and creates library file lib/libKpp.a.
Code/KPP/UCX Directory containing KPP source code files for the UCX chemistry mechanism Yes, it compiles the code in KPP/standard and creates library file lib/libKpp.a.
Code/KPP/int Directory containing the integrators (rosenbrock, runge-kutta, lsodes, etc.) for KPP No
Code/NcdfUtil Directory containing source code files for netCDF I/O. This code is from Bob Yantosca's NcdfUtilities package Yes, it compiles the code in NcdfUtil and creates library file lib/libNcUtils.a.


Code/NcdfUtil/perl Directory containing perl scripts from the NcdfUtilities package that can be used to generate Fortran code for defining, writing, and reading a netCDF file No
Code/bin Directory where executable (geos, geostomas, geosapm) files will be sent No
Code/doc Directory where automatic documentation is built Yes, it calls the ProTeX script to create reference manuals (in PS and PDF formats) from the comments in GEOS-Chem module and routine headers.
Code/help Directory containing GEOS-Chem help screen Yes, it prints the GEOS-Chem help screen to stdout
Code/lib Directory where library (*.a) files will be created No
Code/mod Directory where module (*.mod) files will be sent No
Code/obsolete Directory where obsolete source code files are placed for reference if needed No

--Lizzie Lundgren 13:46, 15 April 2015 (EDT)

GEOS-Chem v9-02

Obsolete.jpg

The table below lists the directory structure in GEOS-Chem v9-02 along with a description of each subdirectory and its Makefile (if one is present).

Directory Description Is there a Makefile here?
Code Main level GEOS-Chem directory Yes, there are two:
  • Makefile is the main-level router makefile and it calls down to the makefile in GeosCore.
  • Makefile_header.mk defines compilation and linking commands for the Fortran-90 compilers. These commands are common to the makefiles in all subdirectories.
Code/Headers Directory containing module files with fixed parameters and derived-type definitions
  • NOTE: In previous versions, these files were header files that were inlined via the #include statement. These have since been converted to F90 modules in order to facilitate Grid-Independent GEOS-Chem development.
Yes, it compiles the code in Headers and creates library file lib/libHeaders.a
Code/GeosUtil Directory containing GEOS-Chem utility modules Yes, it compiles the code in GeosUtil and creates library file lib/libGeosUtil.a
Code/GeosCore Directory containing most GEOS-Chem modules and routines Yes, this is the main Makefile for GEOS-Chem. It calls down to the makefiles in the other subdirectories.
Code/ISOROPIA Directory containing the unmodified ISORROPIA II source code files from Thanos Nenes and Havala Pye:
  • isorropiaIIcode.F
  • isrpia.inc
Yes, it compiles the code in ISOROPIA and creates library file lib/libIsoropia.a
Code/KPP Main-level directory for KPP solver Yes, it calls down to the makefiles in the other KPP subdirectories.
Code/KPP/standard Directory containing KPP source code files for the standard chemistry mechanism Yes, it compiles the code in KPP/standard and creates library file lib/libKpp.a
Code/KPP/SOA Directory containing KPP source code files for SOA chemistry mechanism Yes, it compiles the code in KPP/standard and creates library file lib/libKpp.a
Code/KPP/int Contains the integrators (rosenbrock, runge-kutta, lsodes, etc.) for KPP. No
Code/doc Directory where automatic documentation is built Yes, it calls the ProTeX script to create reference manuals (in PS and PDF formats) from the comments in GEOS-Chem module and routine headers.
Code/lib Directory where library (*.a) files will be created No
Code/mod Directory where module (*.mod) files will be sent No
Code/bin Directory where executable (geos) files will be sent No
Code/help Directory containing GEOS-Chem help screen Yes, it prints the GEOS-Chem help screen to stdout
Code/obsolete Directory where obsolete source code files are placed for future reference if need be No


NOTE: Starting with GEOS-Chem v9-02, the GeosTomas subdirectory has been removed and code for the TOMAS aerosol microphysics package has been inlined into the GeosCore directory using C-preprocessor statements. See the TOMAS Aerosol Microphysics wiki page for more information.

--Lizzie Lundgren 13:47, 15 April 2015 (EDT)

Backup files not excluded from compilation

Obsolete.jpg

Maria Zatko wrote:

During compilation using version v8-02-04, the compilation cannot be completed because the .f~ file type is not recognized. The model runs successfully once I manually remove the .f~ files from the code.
Is there a way to run v8-02-04 while keeping the backup files in the code as done in v8-03-01 and v8-02-01?

Bob Yantosca wrote:

Yes...I think in some v8-02-xx versions of the code we may have had a wildcard that grepped for *.f* in the Makefile. This would have tried to compile the *.f~ files that are generated when you use Emacs to edit the code.
In the GeosCore/Makefile you can replace any lines that look like:
   # Source and object files
   SRC   = $(wildcard *.F*)
with
   # Source and object files
   SRC   = $(wildcard *.F) $(wildcard *.F90)
and this should exclude all *.f~ and *.f90~ files from the compilation. This fix has since been standardized in GEOS-Chem v8-03-01.

--Bob Y. 13:58, 27 August 2010 (EDT)