GEOS–Chem v9–02 Online User's Guide

Previous | Next | Printable View (no frames)

7. Coding and Debugging

7.1 Coding: Practice and Style

We provide below some guidelines for writing GEOS–Chem source code routines.

7.1.1 GEOS–Chem program units

We have written GEOS–Chem in Fortran–90. Two different program units comprise the GEOS–Chem source code:

  1. Traditional subroutines and functions (*.F) contain one subroutine or function per file. Most of these traditional subroutines and functions come from third-party packages (e.g. FAST–J, SMVGEAR, etc.)

  2. Fortran–90 modules (*_mod.F, *_mod.F90) bundle global variables, subroutines, and functions into a coherent package that can be shared by other program units. Modules contain dynamically allocatable arrays, which are more memory-efficient than the older Fortran–77 COMMON blocks. We have written most GEOS–Chem source code files as modules.

    Note: The *.F90 extension denotes free-format Fortran–90 layout, as opposed to the 72-character fixed format.

NOTE: All header files (*.h) have been removed or replaced with Fortran–90 modules in GEOS–Chem v9–02.

GEOS–Chem's Makefiles determine how to compile individual program unit. Each routine (and the modules that it references) are listed in makefiles. This lets the GNU Make utility determine the order of compilation. Refer to Chapter 7.1.3 for more information.

7.1.2 Fortran Programming Style

We have attempted to create a clear and consistent programming style for GEOS–Chem subroutines and modules. Some of our style points include:

When making upgrades to the code, block off the section that you are replacing with comments, and label that with Prior to MM/DD/YY. You can remove the blocked off section once your modified code has been declared stable.

For more information, please be sure to read Appendix 7: GEOS–Chem Style Guide, as well as the floating point and math issues page on the GEOS–Chem wiki.

7.1.3 List of GEOS–Chem Modules

As described in Chapter 3, we have separated the GEOS–Chem source code files into various subdirectories. We sought to separate core GEOS–Chem routines from 3rd-party code.

Here we list the directory structure in GEOS–Chem v9–02:

Directory name Description
Help
help Contains the GEOS–Chem help screen. Type make help to view.
doc Contains reference documentation (*.pdf, *.ps) generated from ProTeX headers. Type make doc to create this documentation.
Core directories
Headers Contains modules with size parameters and global variables used by GEOS–Chem.
3rd-party codes may reference files in this directory.
GeosUtil Contains modules with utility routines: file I/O, horizontal grid, vertical grid, regridding tools, etc.
3rd-party codes may reference files in this directory.
GeosCore Contains core modules, subroutines, and functions for GEOS–Chem.
3rd-party codes may NOT reference files in this directory. You must pass data to/from these routines as arguments.
3rd party codes
GTMM Contains routines for the Global Terrestrial Mercury Model code.
GeosApm

Contains specific routines for APM aerosol microphysics and copies of all GeosCore routines modified by APM.

ISORROPIA Contains routines for ISORROPIA II.
KPP Contains chemistry solver routines created by the KPP pre-processor. You can use KPP as an alternative to SMVGEAR.
NcdfUtil Contains routines for netCDF file I/O, taken from Bob Yantosca's NcdfUtilities package.
Outputs
bin Contains the executable created by the compilation process.
lib Contains archives of the object files (stored in files with the *.a extension) from each GEOS–Chem subdirectory.
mod Contains the *.mod files generated by the compiler (one per Fortran–90 module)
obsolete Contains obsolete subroutines and module files. We keep these here for future reference.

The GEOS–Chem distribution currently contains over 150 module files. As discussed above, we employ modules to package both variables, subroutines, and functions into a single logical program unit. We list all of the modules and their dependencies below:

Module Name Purpose Other Modules Referenced
Headers directory
CMN_DIAG_mod.F Contains size parameters and global variables for the GEOS–Chem diagnostic arrays. CMN_SIZE_mod.F
gigc_errcode_mod.F90
CMN_GCTM_mod.F Contains GEOS–Chem specific physical constraints and derived quantities. none
CMN_NOX_mod.F Contains NOx from soils. CMN_SIZE_mod.F
gigc_errcode_mod.F90
CMN_O3_mod.F Contains common blocks for anthropogenic emissions via SMVGEAR. CMN_SIZE_mod.F
gigc_errcode_mod.F90
CMN_SIZE_mod.F Contains size parameters for GEOS–Chem arrays. gigc_errcode_mod.F90
CMN_mod.F Contains global variables (remnant of header file CMN). CMN_SIZE_mod.F
gigc_errcode_mod.F90
cmn_fj_mod.F Contains parameters and global variables used to interface between Harvard chemistry and UC-Irvine FAST-J photolysis programs. CMN_SIZE_mod.F
gigc_errcode_mod.F90
commsoil_mod.F Contains global variables for the soil NOx emissions routines. CMN_SIZE_mod.F
gigc_errcode_mod.F90
comode_loop_mod.F Contains common blocks and variables for SMVGEAR II. CMN_SIZE_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
EF_MGN20_mod.F Contains emission factors for 20 MEGAN species. none
gigc_errcode_mod.F90 Contains the error codes (i.e. that report success or failure) returned by routines of the Grid-Independent GEOS–Chem. none
gigc_input_opt_mod.F90 Contains the derived type for GEOS–Chem options and logical switches. CMN_SIZE_mod.F
gigc_errcode_mod.F90
gigc_state_chm_mod.F90 Contains the derived type used to define the Chemistry State object for the Grid-Independent GEOS–Chem implementation. gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_met_mod.F90 Contains the derived type used to define the Meteorology State object for the Grid-Independent GEOS–Chem implementation. CMN_SIZE_mod.F
gigc_errcode_mod.F90
gigc_state_phy_mod.F90 Contains the derived type used to define the Physics State object for the Grid-Independent GEOS–Chem implementation. gigc_errcode_mod.F90
jv_cmn_mod.F Contains global variables for the FAST-J code. CMN_SIZE_mod.F
cmn_fj_mod.F
gigc_errcode_mod.F90
sv_dimension_mod.F
jv_mie_mod.F Contains physical constants for the GEOS–Chem column chemistry code. none
smv_dimension_mod.F Contains various placeholder parameters that are required to replace references to GEOS–Chem grid parameters. none
smv_physconst_mod.F Contains physical constants for the GEOS–Chem column chemistry code. none
GeosUtil directory
bpch2_mod.F Contains the routines used to read data from and write data to binary punch file format (v. 2.0). CMN_SIZE_mod.F
error_mod.F
file_mod.F
inquireMod.F90
julday_mod.F
charpak_mod.F Contains selected routines from the CHARPAK package for string manipulation. none
directory_mod.F Contains the directory path variables used by
GEOS–Chem.
none
error_mod.F Contains error checking subroutines. ieee_arithmetic.F
(Intel Fortran Compiler only)
file_mod.F Contains file unit numbers and I/O error trapping routines. error_mod.F
global_grid_mod.F90 Contains variables and routines for computing grid box longitudes, latitudes, and surface areas on a global grid. CMN_GCTM_mod.F
CMN_SIZE_mod.F
error_mod.F
grid_mod.F
grid_mod.F90 Contains variables and routines for computing grid box longitudes, latitudes, and surface areas. CMN_GCTM_mod.F
CMN_SIZE_mod.F
error_mod.F
gigc_errcode_mod.F90
hdf_mod.F
Contains routines to write data to HDF5 files.
CMN_SIZE_mod.F
grid_mod.F
error_mod.F
inquireMod.F90
Contains functions to find free and unopened logical file units (LUN) for Fortran I/O.
none
julday_mod.F Contains routines for converting YYYYMMDD and HHMMSS to/from astronomical Julian date. (This allows GEOS–Chem to handle transitions such as end-of-month, end-of-year, and end-of-century in a consistent fashion.) none
pressure_mod.F Contains variables and routines which specify the grid box pressures for both hybrid or pure-sigma models. This is necessary for running GEOS–Chem with the fvDAS meteorology. CMN_SIZE_mod.F
error_mod.F
gigc_errcode_mod.F90
gigc_state_met_mod.F90
regrid_1x1_mod.F90 Does online regridding of data on the GEOS–Chem 1° x 1° grid to 1° x 1°, 2° x 2.5°, or 4° x 5° GEOS or GCAP grids. CMN_GCTM_mod.F
CMN_SIZE_mod.F
charpack_mod.F
error_mod.F
grid_mod.F
regrid_a2a_mod.F90 Does online regridding of data from one horiziontal resolution to another using the MAP_A2A regridding algorithm. CMN_GCTM_mod.F
CMN_SIZE_mod.F
grid_mod.F
file_mod.F
inquireMod.F90
time_mod.F Contains routines for computing date & time variables. CMN_DIAG_mod.F
CMN_SIZE_mod.F
charpak_mod.F
error_mod.F
gigc_errcode_mod.F90
grid_mod.F
julday_mod.F
transfer_mod.F Contains routines to copy data from REAL*4 to REAL*8 precision, and also to regrid GEOS–3 data from 48 vertical levels to 30 vertical levels. CMN_SIZE_mod.F
error_mod.F
unix_cmds_mod.F Contains Unix command strings which are used for unzipping of meteorological data files. none
GeosCore directory
RnPbBe_mod.F Contains variables and routines used for the 222Rn-210Pb-7Be-10Be simulation. CMN_DIAG_mod.F
CMN_SIZE_mod.F
diag_mod.F
directory_mod.F
file_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
inquireMod.F90
pressure_mod.F
time_mod.F
tropopause_mod.F vdiff_pre_mod.F
a3_read_mod.F Contains routines which unzip, open and read the GEOS–Chem A-3 fields from disk. CMN_DIAG_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
diag_mod.F
directory_mod.F
error_mod.F
file_mod.F
gigc_input_opt_mod.F90
gigc_state_met_mod.F90
inquireMod.F90
time_mod.F
transfer_mod.F
a6_read_mod.F Contains routines which unzip, open and read the GEOS–Chem A-6 fields from disk. CMN_DIAG_mod.F
CMN_GCTM_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
dao_mod.F
diag_mod.F
directory_mod.F
error_mod.F
file_mod.F
gigc_input_opt_mod.F90
gigc_state_met_mod.F90
inquireMod.F90
time_mod.F
transfer_mod.F
acetone_mod.F Contains subroutines to emit the biogenic flux of acetone into the full chemistry simulation. CMN_DIAG_mod.F
CMN_SIZE_mod.F
diag_mod.F
directory_mod.F
error_mod.F
gigc_state_met_mod.F90
grid_mod.F
megan_mod.F
time_mod.F
aeic_mod.F Contains variables and routines for aircraft flight emissions into the chemistry and transport grids. CMN_DIAG_mod.F
CMN_GCTM_mod.F
CMN_SIZE_mod.F
CMN_mod.F
diag_mod.F90 directory_mod.F
error_mod.F
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
pressure_mod.F
regrid_a2a_mod.F90
time_mod.F
tracerid_mod.F
tropopause_mod.F
aerosol_mod.F Contains routines which compute aerosol concentrations (kg/m3) and optical depths. CMN_DIAG_mod.F
CMN_SIZE_mod.F
cmn_fj_mod.F
bpch2_mod.F
comode_loop_mod.F
comode_mod.F
dao_mod.F
diag_mod.F
directory_mod.F
error_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
jv_cmn_mod.F
time_mod.F
tracerid_mod.F
transfer_mod.F
tropopause_mod.F
arctas_ship_emiss_mod.F Contains variables and routines to read the Arctas Ship emissions. CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
grid_mod.F
regrid_a2a_mod.F90
scale_anthro_mod.F
tracerid_mod.F
tracer_mod.F
benchmark_mod.F Contains routines to save out tracer masses in kg for the 1-month fullchem and Rn-Pb-Be benchmark simulations. CMN_SIZE_mod.F
bpch2_mod.F
file_mod.F
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
inquireMod.F90
time_mod.F
tracerid_mod.F
biofuel_mod.F Contains arrays and routines to compute monthly biofuel burning emissions for NOx, CO, ALK4, ACET, MEK, ALD2, PRPE, C3H8, CH2O, C2H6 CH4, and CH3I. CMN_DIAG_mod.F
CMN_O3_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
bravo_mod.F
cac_anthro_mod.F
diag_mod.F
directory_mod.F
emep_mod.F
epa_nei_mod.F
error_mod.F
future_emissions_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
logical_mod.F
streets_anthro_mod.F
time_mod.F
tracerid_mod.F
tracer_mod.F
transfer_mod.F
biomass_mod.F Contains arrays and routines to compute monthly biomass burning emissions for NOx, CO, ALK4, ACET, MEK, ALD2, PRPE, C3H8, CH2O, C2H6 CH4, and CH3I. CMN_DIAG_mod.F
CMN_SIZE_mod.F
diag_mod.F
error_mod.F
gc_biomass_mod.F
gfed2_biomass_mod.F
gfed3_biomass_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
logical_mod.F
time_mod.F
tracerid_mod.F
tracer_mod.F
bravo_mod.F Contains variables and routines to read the BRAVO mexican anthropogenic emission inventory. CMN_O3_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
future_emissions_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
grid_mod.F
regrid_a2a_mod.F90
scale_anthro_mod.F
time_mod.F
tracerid_mod.F
transfer_mod.F
bromocarb_mod.F Contains variables and routines for bromine emissions. CMN_DIAG_mod.F
CMN_SIZE_mod.F
comode_loop_mod.F
dao_mod.F
directory_mod.F
error_mod.F
gigc_state_met_mod.F90
grid_mod.F
logical_mod.F
pbl_mix_mod.F
regrid_a2a_mod.F90
time_mod.F
tracer_mod.F
c2h6_mod.F Contains the variables and routines used to perform a standalone simulation for ethane. CMN_DIAG_mod.F
CMN_O3_mod.F
CMN_SIZE_mod.F
biofuel_mod.F
biomass_mod.F
diag_mod.F
directory_mod.F
error_mod.F
geia_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
global_oh_mod.F
grid_mod.F
time_mod.F
tracerid_mod.F
transfer_mod.F
cac_anthro_mod.F Contains variables and routines to read the Criteria Air Contaminant Canadian anthropogenic emissions. CMN_O3_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
future_emissions_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
grid_mod.F
regrid_a2a_mod.F90
scale_anthro_mod.F
time_mod.F
tracerid_mod.F
tracer_mod.F
canopy_nox_mod.F Contains routines for computing the bulk surface resistance of the canopy NOx. CMN_SIZE_mod.F
commsoil_mod.F
drydep_mod.F
gigc_state_met_mod.F90
modis_lai_mod.F90
carbon_mod.F Contains variables and routines for carbon aerosol emissions and chemistry. CMN_DIAG_mod.F
CMN_GCTM_mod.F
CMN_O3_mod.F
CMN_SIZE_mod.F
CMN_mod.F
biomass_mod.F
bpch2_mod.F
comode_loop_mod.F
comode_mod.F
dao_mod.F
diag_mod.F
directory_mod.F
drydep_mod.F
error_mod.F
future_emissions_mod.F
gfed2_biomass_mod.F
gfed3_biomass_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
global_no3_mod.F
global_o3_mod.F
global_oh_mod.F
grid_mod.F
meganut_mod.F
megan_mod.F
pbl_mix_mod.F
pressure_mod.F
regrid_a2a_mod.F90
time_mod.F
tomas_mod.F
tracerid_mod.F
tracer_mod.F
transfer_mod.F
tropopause_mod.F
vdiff_pre_mod.F
ch3i_mod.F Contains the variables and routines used to perform a standalone simulation for methyl iodide. CMN_DIAG_mod.F
CMN_SIZE_mod.F
biofuel_mod.F
biomass_mod.F
bpch2_mod.F
comode_loop_mod.F
diag_mod.F
diag_pl_mod.F
directory_mod.F
error_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
time_mod.F
tracerid_mod.F
transfer_mod.F
chemistry_mod.F Contains a driver program which selects the proper chemistry routine for the various GEOS–Chem simulation types. CMN_DIAG_mod.F
CMN_SIZE_mod.F
acetone_mod.F
aerosol_mod.F
c2h6_mod.F
carbon_mod.F
ch3i_mod.F
comode_loop_mod.F
comode_mod.F
drydep_mod.F
dust_mod.F
error_mod.F
gckpp_comode_mod.F
gckpp_function.F
gckpp_global.F
gckpp_initialize.F
gckpp_integrator.F
gckpp_model.F
gckpp_monitor.F
gckpp_rates.F
gckpp_util.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
global_ch4_mod.F
h2_hd_mod.F
hcn_ch3cn_mod.F
isoropiaii_mod.F
mercury_mod.F
optdepth_mod.F
pops_mod.F
rnpbbe_mod.F
rpmares_mod.F
seasalt_mod.F
strat_chem_mod.o
sulfate_mod.F
tagged_co_mod.F
tagged_ox_mod.F
time_mod.F
tomas_mod.F
tracerid_mod.F
co2_mod.F Contains variables and routines used for the CO2 simulation. CMN_SIZE_mod.F
biomass_mod.F
bpch2_mod.F
diag04_mod.F
directory_mod.F
error_mod.F
file_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
inquireMod.F90
regrid_a2a_mod.F90
time_mod.F
tracerid_mod.F
transfer_mod.F
comode_mod.F Contains allocatable arrays for SMVGEAR that were previously contained in common blocks in header file comode.h. CMN_SIZE_mod.F
comode_loop_mod.F
error_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
convection_mod.F Contains routines which select the proper convection code for GEOS–1, GEOS–STRAT, GEOS–3 or GEOS–4 met data sets. CMN_DIAG_mod.F
CMN_SIZE_mod.F
depo_mercury_mod.F
diag_mod.F
error_mod.F
fvdas_convect_mod.F
gcap_convect_mod.F
gc_type_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
mercury_mod.F
pressure_mod.F
smv_errcode_mod.F
smv_physconst_mod.F
time_mod.F
tracerid_mod.F
tracer_mod.F
wetscav_mod.F
dao_mod.F Contains arrays that hold DAO met fields, as well as subroutines that compute, interpolate, or otherwise process DAO met field data. CMN_GCTM_mod.F
CMN_SIZE_mod.F
error_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_met_mod.F90
grid_mod.F
logical_mod.F
pressure_mod.F
time_mod.F
depo_mercury_mod.F Contains routines to handle deposition fluxes for mercury. CMN_SIZE_mod.F
bpch2_mod.F
dao_mod.F
diag_mod.F
directory_mod.F
error_mod.F
file_mod.F
gigc_state_met_mod.F90
grid_mod.F
inquireMod.F90
logical_mod.F
time_mod.F
tracerid_mod.F
tracer_mod.F
diag03_mod.F Contains arrays and routines for archiving the ND03 diagnostic -- Hg emissions, mass, and production. CMN_DIAG_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
error_mod.F
file_mod.F
grid_mod.F
logical_mod.F
time_mod.F
tracerid_mod.F
diag04_mod.F Contains arrays and routines for archiving the ND04 diagnostic -- CO2 emissions and fluxes. CMN_DIAG_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
error_mod.F
file_mod.F
grid_mod.F
time_mod.F
diag41_mod.F Contains arrays and routines for archiving the ND41diagnostic -- Afternoon PBL heights. CMN_DIAG_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
error_mod.F
file_mod.F
grid_mod.F
pbl_mix_mod.F
time_mod.F
diag42_mod.F Contains arrays and routines for archiving the ND42 diagnostic -- secondary organic aerosols (μg/m3). CMN_DIAG_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
carbon_mod.F
diag_mod.F
error_mod.F
file_mod.F
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
logical_mod.F
pressure_mod.F
time_mod.F
tracerid_mod.F
diag48_mod.F Contains variables and routines to save timeseries data at particular lat/lon locations. CMN_GCTM_mod.F
CMN_O3_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
cmn_fj_mod.F
error_mod.F
file_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
inquireMod.F90
jv_cmn_mod.F
pbl_mix_mod.F
pressure_mod.F
time_mod.F
tracerid_mod.F
tracer_mod.F
diag49_mod.F Contains variables and routines to save instantaneous timeseries data to disk for a 3-D subset of the globe. CMN_GCTM_mod.F
CMN_O3_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
cmn_fj_mod.F
commsoil_mod.F
error_mod.F
file_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
inquireMod.F90
jv_cmn_mod.F
modis_lai_mod.F90
pbl_mix_mod.F
pressure_mod.F
time_mod.F
tracerid_mod.F
tracer_mod.F
diag50_mod.F Contains variables and routines to generate 24-hour average timeseries data for a 3-D subset of the globe. CMN_GCTM_mod.F
CMN_O3_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
cmn_fj_mod.F
comode_loop_mod.F
comode_mod.F
dao_mod.F
error_mod.F
file_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
hdf5.F
hdf_mod.F
inquireMod.F90
jv_cmn_mod.F
logical_mod.F
pbl_mix_mod.F
pressure_mod.F
time_mod.F
tracerid_mod.F
tracer_mod.F
diag51_mod.F Contains variables and routines to save timeseries data over the United States where the local time is between two user-defined limits. This is useful for comparing with sun-synchronous satellites such as GOME. CMN_GCTM_mod.F
CMN_O3_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
cmn_fj_mod.F
error_mod.F
file_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
hdf5.F
hdf_mod.F
inquireMod.F90
jv_cmn_mod.F
modis_lai_mod.F90
pbl_mix_mod.F
pressure_mod.F
time_mod.F
tracerid_mod.F
tracer_mod.F
tropopause_mod.F
diag51b_mod.F Contains similar variables and routines as diag51_mod.F to allow to follow two satellite tracks at a time.
CMN_GCTM_mod.F
CMN_O3_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
cmn_fj_mod.F
error_mod.F
file_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
hdf5.F
hdf_mod.F
inquireMod.F90
jv_cmn_mod.F
modis_lai_mod.F90
pbl_mix_mod.F
pressure_mod.F
time_mod.F
tracerid_mod.F
tracer_mod.F
tropopause_mod.F
diag56_mod.F Contains arrays and routines for archiving the ND56 diagnostic -- lightning flash rates. CMN_DIAG_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
error_mod.F
file_mod.F
grid_mod.F
time_mod.F
diag63_mod.F Contains variables and routines to generate timeseries data for PARANOX ship emissions. CMN_GCTM_mod.F
CMN_O3_mod.F
CMN_SIZE_mod.F
cmn_fj_mod.F
bpch2_mod.F
diag_mod.F
error_mod.F
file_mod.F
grid_mod.F
inquireMod.F90
jv_cmn_mod.F
pbl_mix_mod.F
pressure_mod.F
time_mod.F
diag_mod.F Contains declarations for allocatable arrays for use with GEOS–Chem diagnostics and other routines. none
diag_oh_mod.F Contains routines to compute the mean OH diagnostic for a full chemistry simulation. CMN_SIZE_mod.F
comode_loop_mod.F
comode_mod.F
error_mod.F
logical_mod.F
tracerid_mod.F
tracer_mod.F
diag_pl_mod.F Contains routines to compute chemical production for tracers. CMN_DIAG_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
charpak_mod.F
comode_loop_mod.F
comode_mod.F
directory_mod.F
error_mod.F
file_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
inquireMod.F90
time_mod.F
tracerid_mod.F
tracer_mod.F
drydep_mod.F Contains variables and routines to compute dry deposition velocities and frequencies. CMN_DIAG_mod.F
CMN_GCTM_mod.F
CMN_SIZE_mod.F
commsoil_mod.F
comode_loop_mod.F
comode_mod.F
dao_mod.F
diag_mod.F
directory_mod.F
error_mod.F
get_ndep_mod.F
get_popsinfo_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
logical_mod.F
pbl_mix_mod.F
pressure_mod.F
time_mod.F
tomas_mod.F
tracerid_mod.F
dust_dead_mod.F Contains routines and variables from Charlie Zender's DEAD dust mobilization model. Most routines are from Charlie Zender, but have been modified and/or cleaned up for inclusion into GEOS–Chem. CMN_GCTM_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
dao_mod.F
directory_mod.F
error_mod.F
file_mod.F
gigc_state_met_mod.F90
grid_mod.F
time_mod.F
transfer_mod.F
dust_mod.F Contains routines for computing dust aerosol emissions, chemistry, and optical depths. CMN_DIAG_mod.F
CMN_GCTM_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
cmn_fj_mod.F
comode_loop_mod.F
comode_mod.F
diag_mod.F
directory_mod.F
drydep_mod.F
dust_dead_mod.F
error_mod.F
file_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
inquireMod.F90
jv_cmn_mod.F
pressure_mod.F
time_mod.F
tomas_mod.F
tracerid_mod.F
transfer_mod.F
edgar_mod.F Contains variables and routines to read the EDGAR global anthropogenic emission inventory. CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
future_emissions_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
grid_mod.F
regrid_a2a_mod.F90
scale_anthro_mod.F
time_mod.F
tracerid_mod.F
emep_mod.F Contains variables and routines to read the EMEP European anthropogenic emission inventory for CO, NOz, and some NMVOCs. The EMEP files come from Marion Auvray and Isabelle Bey at EPFL. CMN_O3_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
file_mod.F
future_emissions_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
inquireMod.F90
regrid_a2a_mod.F90
scale_anthro_mod.F
time_mod.F
tracerid_mod.F
emissions_mod.F Contains a driver program which selects the proper emissions subroutine for the various GEOS–Chem simulation types. CMN_O3_mod.F
CMN_SIZE_mod.F
arctas_ship_emiss_mod.F
biomass_mod.F
bravo_mod.F
c2h6_mod.F
cac_anthro_mod.F
carbon_mod.F
ch3i_mod.F
co2_mod.F
dust_mod.F
edgar_mod.F
emep_mod.F
epa_nei_mod.F
error_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
global_ch4_mod.F
h2_hd_mod.F
hcn_ch3cn_mod.F
icoads_ship_mod.F
logical_mod.F
mercury_mod.F
nei2005_anthro_mod.F
paranox_mod.F
pops_mod.F
retro_mod.F
rcp_mod.F
rnpbbe_mod.F
seasalt_mod.F
ssa_bromine_mod.F
streets_anthro_mod.F
sulfate_mod.F
tagged_co_mod.F
time_mod.F
tracerid_mod.F
vistas_anthro_mod.F
epa_nei_mod.F Contains variables and routines to read the weekday/weekend emissions from the EPA/NEI emissions inventory. CMN_O3_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
file_mod.F
future_emissions_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
grid_mod.F
inquireMod.F90
scale_anthro_mod.F
time_mod.F
tracerid_mod.F
tracer_mod.F
transfer_mod.F
fjx_acet_mod.F Contains functions for pressure dependency for Acetone photolysis from FAST–JX. CMN_FJ_mod.F
jv_cmn_mod.F
future_emissions_mod.F Contains variables and routines for returning scale factors for IPCC A1 & B1 emissions scenarios for future years such as 2030, 2050, etc. CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
file_mod.F
transfer_mod.F
fvdas_convect_mod.F Contains routines (originally from NCAR) which perform shallow and deep convection for the GEOS–4 met fields. These routines account for shallow and deep convection, updrafts, and downdrafts. CMN_DIAG_mod.F
CMN_SIZE_mod.F
depo_mercury_mod.F
diag_mod.F
gigc_state_met_mod.F90
grid_mod.F
logical_mod.F
pressure_mod.F
tracerid_mod.F
tracer_mod.F
gamap_mod.F Contains routines to create GAMAP tracerinfo.dat and diaginfo.dat files which are customized to each particular GEOS–Chem simulation. CMN_DIAG_mod.F
CMN_SIZE_mod.F
diag03_mod.F
diag04_mod.F
diag41_mod.F
diag42_mod.F
diag48_mod.F
diag49_mod.F
diag50_mod.F
diag51_mod.F
diag51b_mod.F
diag56_mod.F
diag63_mod.F
diag_pl_mod.F
drydep_mod.F
error_mod.F
file_mod.F
get_popsinfo_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
hdf_mod.F
inquireMod.F90
time_mod.F
tomas_mod.F
tracerid_mod.F
tracer_mod.F
wetscav_mod.F
gc_biomass_mod.F Contains arrays and routines to compute monthly biomass burning emissions for NOx, CO, ALK4, ACET, MEK, ALD2, PRPE, C3H8, CH2O, C2H6, CH4, and CH3I. CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
future_emissions_mod.F
grid_mod.F
inquireMod.F90
logical_mod.F
time_mod.F
tracerid_mod.F
tracer_mod.F
transfer_mod.F
gc_type_mod.F Contains derived type definitions for GEOS–Chem that will represent the "socket" within external modules. This is used in the grid-independent GEOS-Chem code. none
gcap_convect_mod.F Contains routines (originally from GISS) which perform shallow and deep convection for the GCAP met fields. CMN_DIAG_mod.F
CMN_SIZE_mod.F
diag_mod.F
grid_mod.F
pressure_mod.F
gcap_read_mod.F Contains subroutines that unzip, open, and read the GCAP PHIS and LWI_GISS fields from disk. CMN_DIAG_mod.F
CMN_GCTM_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
diag_mod.F
error_mod.F
file_mod.F
gigc_input_opt_mod.F90
gigc_state_met_mod.F90
inquireMod.F90
time_mod.F
transfer_mod.F
geia_mod.F Contains routines used to read and scale the GEIA/Piccot fossil fuel emissions for NOx, CO, and hydrocarbons. CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
file_mod.F
grid_mod.F
inquireMod.F90
time_mod.F
geosfp_read_mod.F90 Contains routines used to open and read the GEOS–FP fields from disk. CMN_DIAG_mod.F
CMN_GCTM_mod.F
CMN_SIZE_mod.F
diag_mod.F
error_mod.F
gigc_input_opt_mod.F90
gigc_state_met_mod.F90
time_mod.F
transfer_mod.F
get_ndep_mod.F Contains routines for computing the nitrogen dry and wet deposition. This quantity is needed by GEOS–Chem soil emissions. CMN_DIAG_mod.F
commsoil_mod.F
grid_mod.F
time_mod.F
tracerid_mod.F
get_popsinfo_mod.F Contains variables and routines for the GEOS–Chem persistent organic pollutants (POPs) simulation. none
gfed2_biomass_mod.F Contains variables and routines to compute the GFED2 biomass burning emissions. CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
file_mod.F
future_emissions_mod.F
grid_mod.F
inquireMod.F90
julday_mod.F
logical_mod.F
regrid_a2a_mod.F90
time_mod.F
tracerid_mod.F
tracer_mod.F
gfed3_biomass_mod.F Contains variables and routines to compute the GFED3 biomass burning emissions. CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
file_mod.F
future_emissions_mod.F
global_grid_mod.F90
grid_mod.F
inquireMod.F90
julday_mod.F
logical_mod.F
regrid_a2a_mod.F90
time_mod.F
tracerid_mod.F
tracer_mod.F
gigc_environment_mod.F90 Contains routines to establish the runtime environment for the Grid-Independent GEOS–Chem (aka "GIGC") model. It is designed to receive model parameter and geophysical environment information and allocate memory based upon it. CMN_DEP_mod.F
CMN_DIAG_mod.F
CMN_NOx_mod.F
CMN_O3_mod.F
CMN_SIZE_mod.F
CMN_mod.F
cmn_fj_mod.F
commsoil_mod.F
comode_loop_mod.F
gigc_errcode_mod.F
gigc_input_opt_mod.F
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
jv_cmn_mod.F
logical_mod.F
time_mod.F
tracer_mod.F
vdiff_pre_mod.F
global_bc_mod.F Contains variables and routines for reading the global monthly mean BC concentration from disk. CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
transfer_mod.F
global_br_mod.F Contains variables and routines for reading the global monthly Bromine concentration from disk. CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
gigc_state_met_mod.F90
ocean_mercury_mod.F
transfer_mod.F
tropopause_mod.F
global_ch4_mod.F Contains variables and routines for simulating CH4 chemistry in the troposphere. CMN_DIAG_mod.F
CMN_SIZE_mod.F
CMN_mod.F
bpch2_mod.F
biomass_mod.F
diag_mod.F
diag_oh_mod.F
directory_mod.F
error_mod.F
file_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
global_oh_mod.F
grid_mod.F
inquireMod.F90
logical_mod.F
pressure_mod.F
time_mod.F
tracer_mod.F
transfer_mod.F
vdiff_pre_mod.F
global_hno3_mod.F Contains variables and routines for reading in monthly mean HNO3 concentrations for the offline sulfate simulation. CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
gigc_state_met_mod.F90
tracer_mod.F
transfer_mod.F
global_no3_mod.F Contains variables and routines for reading in global monthly mean NO3 concentrations (used for the offline sulfate simulation). CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
transfer_mod.F
global_nox_mod.F Contains variables and routines for reading the global monthly mean NOx concentration from disk (used for the offline sulfate simulation). CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
gigc_input_opt_mod.F90
transfer_mod.F
global_o1d_mod.F Contains variables and routines for reading the global monthly mean O1D stratospheric concentration from disk. This is used in the H2/HD simulation. The O1D fields were obtained from Gabriele Curci GEOS–Chem simulation in the stratosphere (v5.03). CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
transfer_mod.F
global_o3_mod.F Contains variables and routines for reading the global monthly mean O3 concentration from disk. CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
transfer_mod.F
global_oc_mod.F Contains variables and routines for reading the global monthly mean OC concentration from disk. CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
transfer_mod.F
global_oh_mod.F Contains variables and routines for reading the global monthly mean OH concentration from disk. CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
gigc_state_met_mod.F90
transfer_mod.F
h2_hd_mod.F Contains variables and routines used for the H2-HD simulation. CMN_DIAG_mod.F
CMN_O3_mod.F
CMN_SIZE_mod.F
biofuel_mod.F
biomass_mod.F
bpch2_mod.F
diag_mod.F
directory_mod.F
drydep_mod.F
error_mod.F
geia_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
global_o1d_mod.F
global_oh_mod.F
global_nox_mod.F
grid_mod.F
megan_mod.F
meganut_mod.F
pressure_mod.F
scale_anthro_mod.F
tagged_co_mod.F
time_mod.F
tracerid_mod.F
transfer_mod.F
tropopause_mod.F
hcn_ch3cn_mod.F Contains variables and routines that are used for the geographically tagged HCN/CH3CN simulation. CMN_DIAG_mod.F
CMN_SIZE_mod.F
biomass_mod.F
bpch2_mod.F
diag_mod.F
directory_mod.F
error_mod.F
geia_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
global_oh_mod.F
grid_mod.F
pbl_mix_mod.F
time_mod.F
tracerid_mod.F
transfer_mod.F
i6_read_mod.F Contains routines which unzip, open and read the GEOS–Chem I-6 fields from disk. CMN_DIAG_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
diag_mod.F
directory_mod.F
error_mod.F
file_mod.F
gigc_input_opt_mod.F90
gigc_state_met_mod.F90
inquireMod.F90
logical_mod.F
time_mod.F
transfer_mod.F
icoads_ship_mod.F Contains variables and routines to read the International Comprehensive Ocean-Atmosphere Data Set (ICOADS) ship emissions. Base year is 2002.
CMN_O3_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
future_emissions_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
grid_mod.F
regrid_a2a_mod.F90
scale_anthro_mod.F
time_mod.F
tracerid_mod.F
tracer_mod.F
input_mod.F

Contains routines which read information from the input.geos file and pass it to the various initialization routines of GEOS–Chem modules.

NOTE: This module needs to be compiled last, as it references many other modules.

CMN_DIAG_mod.F
CMN_O3_mod.F
CMN_SIZE_mod.F
aerosol_mod.F
apm_init_mod.F
apm_wets_mod.F
benchmark_mod.F
biofuel_mod.F
biomass_mod.F
bpch2_mod.F
bromocarb_mod.F
carbon_mod.F
charpak_mod.F
depo_mercury_mod.F
diag03_mod.F
diag04_mod.F
diag41_mod.F
diag42_mod.F
diag48_mod.F
diag49_mod.F
diag50_mod.F
diag51_mod.F
diag51b_mod.F
diag56_mod.F
diag63_mod.F
diag_oh_mod.F
diag_pl_mod.F
directory_mod.F
drydep_mod.F
dust_mod.F
emissions_mod.F
error_mod.F
file_mod.F
future_emissions_mod.F
gamap_mod.F
get_popsinfo_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
global_grid_mod.F90
grid_mod.F
inquireMod.F90
julday_mod.F
land_mercury_mod.F
linoz_mod.F
logical_mod.F
mercury_mod.F
modis_lai_mod.F90
ocean_mercury_mod.F
planeflight_mod.F
pops_mod.F
rcp_mod.F
restart_mod.F
seasalt_mod.F
sulfate_mod.F
time_mod.F
tomas_mod.F
tpcore_bc_mod.F
tracerid_mod.F
tracer_mod.F
transfer_mod.F
transport_mod.F
tropopause_mod.F
unix_cmds_mod.F
wetscav_mod.F
isoropiaII_mod.F Contains the routines from the ISORROPIAII package, which performs aerosol thermodynamical equilibrium. CMN_SIZE_mod.F
apm_init_mod.F
error_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
global_hno3_mod.F
time_mod.F
tracerid_mod.F
tropopause_mod.F
land_mercury_mod.F Contains variables and routines for the land emissions for the GEOS–Chem mercury simulation. CMN_DIAG_mod.F
CMN_SIZE_mod.F
biomass_mod.F
bpch2_mod.F
dao_mod.F
depo_mercury_mod.F
directory_mod.F
error_mod.F
file_mod.F
gigc_state_met_mod.F90
grid_mod.F
inquireMod.F90
logical_mod.F
modis_lai_mod.F90
time_mod.F
tracerid_mod.F
transfer_mod.F
lightning_nox_mod.F Contains variables and routines for emitting NOx from lightning into the atmosphere. Cleaned up for inclusion into GEOS–Chem v9–01–01 by Lee Murray. CMN_GCTM_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
dao_mod.F
diag56_mod.F
diag_mod.F
directory_mod.F
error_mod.F
file_mod.F
gigc_state_met_mod.F90
grid_mod.F
inquireMod.F90
logical_mod.F
pressure_mod.F
time_mod.F
tracerid_mod.F
transfer_mod.F
tropopause_mod.F
linoz_mod.F Contains routines to perform the Linoz stratospheric ozone chemistry.
CMN_SIZE_mod.F
error_mod.F
file_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
inquireMod.F90
pressure_mod.F
time_mod.F
tracerid_mod.F
tropopause_mod.F
logical_mod.F Contains all of the logical switches used by GEOS–Chem. none
mapping_mod.F90 Contains a derived-type object to compute the mapping weight and areal mapping.. CMN_SIZE_mod.F
error_mod.F
logical_mod.F
megan_mod.F Contains variables and routines specifying the algorithms that control the MEGAN inventory of biogenic emissions. CMN_GCTM_mod.F
CMN_SIZE_mod.F
a3_read_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
file_mod.F
geosfp_read_mod.F90
gigc_input_opt_mod.F90
gigc_state_met_mod.F90
grid_mod.F
inquireMod.F90
julday_mod.F
logical_mod.F
meganut_mod.F
merra_a1_mod.F
modis_lai_mod.F90
regrid_a2a_mod.F90
time_mod.F
meganut_mod.F Contains functions used by MEGAN and other routines.
CMN_SIZE_mod.F
mercury_mod.F Contains variables and routines for the GEOS–Chem mercury simulation. CMN_DIAG_mod.F
CMN_GCTM_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
dao_mod.F
depo_mercury_mod.F
diag03_mod.F
diag_mod.F
directory_mod.F
drydep_mod.F
error_mod.F
file_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
global_br_mod.F
global_o3_mod.F
global_oh_mod.F
grid_mod.F
land_mercury_mod.F
logical_mod.F
ocean_mercury_mod.F
pbl_mix_mod.F
pressure_mod.F
regrid_a2a_mod.F90
rnpbbe_mod.F
time_mod.F
tracerid_mod.F
transfer_mod.F
tropopause_mod.F
vdiff_pre_mod.F
merra_a1_mod.F Contains subroutines for reading the 1-hour time averaged (aka "A1") fields from the MERRA data archive. CMN_DIAG_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
diag_mod.F
error_mod.F
file_mod.F
gigc_input_opt_mod.F90
gigc_state_met_mod.F90
inquireMod.F90
time_mod.F
transfer_mod.F
merra_a3_mod.F Contains subroutines for reading the 3-hour time averaged (aka "A3") fields from the MERRA data archive. CMN_DIAG_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
diag_mod.F
error_mod.F
file_mod.F
gigc_input_opt_mod.F90
gigc_state_met_mod.F90
inquireMod.F90
time_mod.F
transfer_mod.F
merra_cn_mod.F Contains subroutines for reading the constant (aka "CN") fields from the MERRA data archive. CMN_DIAG_mod.F
CMN_GCTM_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
diag_mod.F
error_mod.F
file_mod.F
gigc_input_opt_mod.F90
gigc_state_met_mod.F90
inquireMod.F90
time_mod.F
transfer_mod.F
merra_i6_mod.F Contains subroutines for reading the 6-hour instantaneous (aka "I6") fields from the MERRA data archive. CMN_DIAG_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
error_mod.F
file_mod.F
gigc_input_opt_mod.F90
gigc_state_met_mod.F90
inquireMod.F90
time_mod.F
transfer_mod.F
modis_lai_mod.F90 Reads MODIS LAI data at the native grid and rebins to the proper GEOS–Chem LAI arrays. CMN_SIZE_mod.F
directory_mod.F
error_mod.F
gigc_errcode_mod.F90
gigc_state_met_mod.F90
logical_mod.F
mapping_mod.F90
time_mod.F
nei2005_anthro_mod.F Contains variables and routines to read the NEI2005 anthropogenic emissions.
CMN_O3_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
future_emissions_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
grid_mod.F
regrid_a2a_mod.F90
scale_anthro_mod.F
time_mod.F
tracerid_mod.F
tracer_mod.F
transfer_mod.F
ocean_mercury_mod.F Contains variables and routines needed to compute the oceanic flux of mercury. Original code by Sarah Strode at UWA/Seattle. CMN_DEP_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
dao_mod.F
depo_mercury_mod.F
diag03_mod.F
directory_mod.F
error_mod.F
file_mod.F
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
inquireMod.F90
logical_mod.F
time_mod.F
tracerid_mod.F
tracer_mod.F
transfer_mod.F
olson_land_map.F90 Contains routines to read the Olson land map and compute the IREG, ILAND, and IUSE arrays. CMN_GCTM_mod.F
CMN_SIZE_mod.F
directory_mod.F
error_mod.F
gigc_state_met_mod.F90
grid_mod.F
logical_mod.F
mapping_mod.F90
optdepth_mod.F Contains routines to compute optical depths for GEOS–1, GEOS–STRAT, GEOS–2, and GEOS–3 met data sets. CMN_DIAG_mod.F
CMN_SIZE_mod.F
diag_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_met_mod.F90
paranox_mod.F Contains routines to reading and interpolating look up tables that are necessary for the PARANOX ship plume model. CMN_SIZE_mod.F
directory_mod.F
error_mod.F
file_mod.F
gigc_state_met_mod.F90
inquireMod.F90
time_mod.F
pbl_mix_mod.F Contains routines and variables used to compute the planetary boundary layer (PBL) height and to mix tracers underneath the PBL top. CMN_DIAG_mod.F
CMN_GCTM_mod.F
CMN_SIZE_mod.F
diag_mod.F
error_mod.F
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
pressure_mod.F
time_mod.F
tracer_mod.F
pjc_pfix_geos5_window_mod.F Contains routines which implements the Philip Cameron-Smith pressure fixer. Specially modified for the GEOS–5 nested grid simulation. CMN_GCTM_mod.F
CMN_SIZE_mod.F
CMN_mod.F
error_mod.F
grid_mod.F
pressure_mod.F
pjc_pfix_geosfp_window_mod.F Contains routines which implements the Philip Cameron-Smith pressure fixer. Specially modified for the GEOS–FP nested grid simulation. CMN_GCTM_mod.F
CMN_SIZE_mod.F
CMN_mod.F
error_mod.F
grid_mod.F
pressure_mod.F
pjc_pfix_mod.F Contains variables and routines which implement the Philip Cameron-Smith pressure fixer for the GEOS–4/TPCORE transport code (contained in tpcore_fvdas_mod.F90). CMN_GCTM_mod.F
CMN_SIZE_mod.F
CMN_mod.F
error_mod.F
grid_mod.F
pressure_mod.F
planeflight_mod.F Contains variables and routines which are used to "fly" a plane through the GEOS–Chem model simulation. This is useful for comparing model results with aircraft observations. CMN_DIAG_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
comode_loop_mod.F
comode_mod.F
diag_mod.F
error_mod.F
file_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
inquireMod.F90
jv_cmn_mod.F
ocean_mercury_mod.F
pressure_mod.F
time_mod.F
tracer_mod.F
pops_mod.F Contains variables and routines for the GEOS–Chem persistent organic pollutants (POPs) simulation. CMN_DIAG_mod.F
CMN_GCTM_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
diag53_mod.F
diag_mod.F
directory_mod.F
drydep_mod.F
error_mod.F
get_popsinfo_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
global_bc_mod.F
global_o3_mod.F
global_oc_mod.F
global_oh_mod.F
grid_mod.F
pbl_mix_mod.F
regrid_a2a_mod.F90
time_mod.F
tracerid_mod.F
vdiff_pre_mod.F
rcp_mod.F Contains variables and routines for access to the RCP emission inventories that were prepared for IPCC AR5. CMN_DIAG_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
diag_mod.F
directory_mod.F
error_mod.F
file_mod.F
gigc_input_opt_mod.F90
gigc_state_met_mod.F90
grid_mod.F
time_mod.F
tracerid_mod.F
tracer_mod.F
transfer_mod.F
restart_mod.F Contains variables and routines which are used to read and write GEOS–Chem restart files, which contain tracer concentrations in [v/v] mixing ratio. CMN_SIZE_mod.F
CMN_mod.F
bpch2_mod.F
charpak_mod.F
comode_loop_mod.F
comode_mod.F
error_mod.F
file_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
inquireMod.F90
logical_mod.F
time_mod.F
tracer_mod.F
retro_mod.F Contains the routines used to read emissions data from the RETRO anthropogenic VOC emissions inventory. CMN_O3_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
file_mod.F
future_emissions_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
grid_mod.F
inquireMod.F90
scale_anthro_mod.F
time_mod.F
tracer_mod.F
tracerid_mod.F
transfer_mod.F
rpmares_mod.F Contains variables and routines to compute aerosol thermodynamic equilibrium. apm_init_mod.F
CMN_SIZE_mod.F
error_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
global_hno3_mod.F
time_mod.F
tracerid_mod.F
tracer_mod.F
tropopause_mod.F
scale_anthro_mod.F Contains routines to scale anthropogenic emissions from a base year to a simulation year. CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
file_mod.F
regrid_a2a_mod.F90
seasalt_mod.F Contains arrays and routines for performing either a coupled chemistry/aerosol run or an offline seasalt aerosol simulation. The original code taken from Mian Chin's GOCART model and was modified accordingly for GEOS–Chem.
CMN_DIAG_mod.F
CMN_GCTM_mod.F
CMN_SIZE_mod.F
dao_mod.F
diag_mod.F
drydep_mod.F
error_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
logical_mod.F
pbl_mix_mod.F
pressure_mod.F
ssa_bromine_mod.F
time_mod.F
tomas_mod.F
tracerid_mod.F
tracer_mod.F
vdiff_pre_mod.F
soil_nox_mod.F Contains routines for GEOS–Chem soil NOx emissions.
CMN_SIZE_mod.F
gigc_errcode_mod.F90
soilnox_restart_mod.F Contains variables and routines used to read and write GEOS–Chem soil NOx restart files.
CMN_SIZE_mod.F
bpch2_mod.F
commsoil_mod.F
error_mod.F
file_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
grid_mod.F
inquireMod.F90
time_mod.F
ssa_bromine_mod.F Contains variables and routines for emissions of Br2. CMN_DIAG_mod.F
CMN_O3_mod.F
CMN_SIZE_mod.F
bromocarb_mod.F
comode_loop_mod.F
diag_mod.F
grid_mod.F
logical_mod.F
time_mod.F
tracerid_mod.F
strat_chem_mod.F90 Contains variables and routines for performing a simple linearized chemistry scheme in the stratosphere.
CMN_GCTM_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
dao_mod.F
directory_mod.F
error_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
logical_mod.F
linoz_mod.F
pressure_mod.F
time_mod.F
tracer_mod.F
tracerid_mod.F
transfer_mod.F
tropopause_mod.F
streets_anthro_mod.F Contains variables and routines to read the David Streets et al. Asian anthropogenic emissions. CMN_O3_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
dao_mod.F
directory_mod.F
error_mod.F
future_emissions_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
logical_mod.F
regrid_1x1_mod.F
regrid_a2a_mod.F90
scale_anthro_mod.F
time_mod.F
tracerid_mod.F
tracer_mod.F
sulfate_mod.F Contains the sulfate chemistry routines from Mian Chin's GOCART model and updated routines. CMN_DIAG_mod.F
CMN_FJ_mod.F
CMN_GCTM_mod.F
CMN_O3_mod.F
CMN_SIZE_mod.F
arctas_ship_emiss_mod.F
biomass_mod.F
bpch2_mod.F
bravo_mod.F
cac_anthro_mod.F
comode_mod.F
dao_mod.F
diag_mod.F
directory_mod.F
drydep_mod.F
edgar_mod.F
emep_mod.F
epa_nei_mod.F
error_mod.F
file_mod.F
future_emissions_mod.F
gfed2_biomass_mod.F
gfed3_biomass_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
global_hno3_mod.F
global_no3_mod.F
global_oh_mod.F
grid_mod.F
icoads_ship_mod.F
inquireMod.F90
logical_mod.F
nei2005_anthro_mod.F
pbl_mix_mod.F
pressure_mod.F
rcp_mod.F
regrid_a2a_mod.F90
scale_anthro_mod.F
seasalt_mod.F
streets_anthro_mod.F
time_mod.F
tomas_mod.F
tracerid_mod.F
tracer_mod.F
transfer_mod.F
tropopause_mod.F
uvalbedo_mod.F
vdiff_pre_mod.F
wetscav_mod.F
tagged_co_mod.F Contains variables and routines used for the geographically tagged CO simulation. CMN_DIAG_mod.F
CMN_O3_mod.F
CMN_SIZE_mod.F
biofuel_mod.F
biomass_mod.F
bpch2_mod.F
diag_mod.F
diag_pl_mod.F
directory_mod.F
error_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
global_nox_mod.F
global_oh_mod.F
grid_mod.F
meganut_mod.F
megan_mod.F
pbl_mix_mod.F
pressure_mod.F
time_mod.F
tracerid_mod.F
tracer_mod.F
transfer_mod.F
tropopause_mod.F
tagged_ox_mod.F Contains variables and routines to perform a tagged Ox simulation. P(Ox) and L(Ox) rates need to be archived from a full chemistry simulation before you can run w/ Tagged Ox. CMN_DIAG_mod.F
CMN_GCTM_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
charpak_mod.F
diag_mod.F
diag_pl_mod.F
directory_mod.F
drydep_mod.F
error_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
julday_mod.F
pbl_mix_mod.F
time_mod.F
tracerid_mod.F
transfer_mod.F
tropopause_mod.F
tomas_mod.F Contains variables and routines specific to the TOMAS aerosol microphysics simulation. CMN_DIAG_mod.F
CMN_SIZE_mod.F
comode_loop_mod.F
dao_mod.F
diag_mod.F
diag_pl_mod.F
directory_mod.F
error_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
inquireMod.F90
pressure_mod.F
time_mod.F
tracerid_mod.F
tropopause_mod.F
tomas_tpcore_mod.F Contains routines for GEOS–4 and GEOS–5 tpcore module (tpcore_fvdas_mod.F90) used for TOMAS aerosol microphysics. error_mod.F
tomas_mod.F
tracerid_mod.F
toms_mod.F Contains variables and routines for reading the EP-TOMS O3 column data from disk (for use w/ the FAST–J photolysis routines). CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
time_mod.F
transfer_mod.F
tpcore_bc_mod.F Contains variables and routines to read and write boundary conditions from a global simulation. These are needed for TPCORE transport for nested grid 1° x 1° simulations. CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
file_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
grid_mod.F
inquireMod.F90
time_mod.F
tracer_mod.F
tpcore_fvdas_mod.F90 Contains routines for the TPCORE transport scheme, as implemented in the GMI model, based on Lin Rood 1995. CMN_GCTM_mod.F
tpcore_geos5_window_mod.F90
Contains routines for the GEOS–5/fvDAS transport scheme.  Original code from S-J Lin and Kevin Yeh. none
tpcore_geosfp_window_mod.F90
Contains routines for the GEOS–FP/fvDAS transport scheme.  Original code from S-J Lin and Kevin Yeh. none
tracer_mod.F Contains the GEOS–Chem tracer array STT plus various other related quantities. TRACER_MOD also contains inquiry functions that can be used to determine the type of GEOS–Chem simulation. CMN_SIZE_mod.F
apm_init_mod.F
error_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
tracerid_mod.F Contains variables and routines used to identify tracers, emission species, biomass burning species, and biofuel burning species. CMN_SIZE_mod.F
charpak_mod.F
comode_loop_mod.F
error_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
logical_mod.F
tracer_mod.F
transport_mod.F Contains routines which select the proper transport routines for GEOS–Chem global and window simulations. CMN_DIAG_mod.F
CMN_GCTM_mod.F
CMN_SIZE_mod.F
diag_mod.F
error_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
pjc_pfix_geos5_window_mod.F
pjc_pfix_geosfp_window_mod.F
pjc_pfix_mod.F
pressure_mod.F
time_mod.F
tpcore_bc_mod.F
tpcore_fvdas_mod.F
tpcore_geos5_window_mod.F
tpcore_geosfp_window_mod.F
tracer_mod.F
tropopause_mod.F Contains routines and variables for reading and returning the value of the annual mean tropopause. CMN_SIZE_mod.F
CMN_mod.F
bpch2_mod.F
comode_loop_mod.F
comode_mod.F
diag_mod.F
directory_mod.F
error_mod.F
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
logical_mod.F
pressure_mod.F
transfer_mod.F
uvalbedo_mod.F Contains variables and routines for reading the UV Albedo data from disk (for use w/ the FAST–J photolysis routines). CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
error_mod.F
gigc_state_met_mod.F90
transfer_mod.F
vdiff_mod.F90 Contains all routines for the non-local PBL mixing scheme.
CMN_SIZE_mod.F
comode_mod.F
dao_mod.F
depo_mercury_mod.F
diag_mod.F
drydep_mod.F
error_mod.F
get_ndep_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
grid_mod.F
logical_mod.F
ocean_mercury_mod.F
pbl_mix_mod.F
pressure_mod.F
time_mod.F
tracerid_mod.F
tracer_mod.F
vdiff_pre_mod.F
vdiff_pre_mod.F Contains variables used in vdiff_mod.F. CMN_DIAG_mod.F
CMN_O3_mod.F
CMN_SIZE_mod.F
comode_loop_mod.F
gigc_errcode_mod.F90
tracer_mod.F
vistas_anthro_mod.F Contains variables and routines to read the VISTAS anthropogenic emissions. CMN_O3_mod.F
CMN_SIZE_mod.F
bpch2_mod.F
directory_mod.F
epa_nei_mod.F
error_mod.F
future_emissions_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
grid_mod.F
regrid_a2a_mod.F90
scale_anthro_mod.F
time_mod.F
tracerid_mod.F
tracer_mod.F
wetscav_mod.F Contains arrays used in the wet scavenging of tracers in cloud updrafts, rainout, and washout. CMN_DIAG_mod.F
CMN_SIZE_mod.F
commsoil_mod.F
dao_mod.F
depo_mercury_mod.F
diag_mod.F
error_mod.F
get_ndep_mod.F
get_popsinfo_mod.F
gigc_errcode_mod.F90
gigc_input_opt_mod.F90
gigc_state_chm_mod.F90
gigc_state_met_mod.F90
pressure_mod.F
time_mod.F
tomas_mod.F
tracerid_mod.F
tracer_mod.F

7.1.4 Compilation Sequence for GEOS–Chem

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

  1. Files in NcdfUtil/
  2. Files in Headers
  3. Files in KPP/
  4. Files in GeosUtil/
  5. Files in ISOROPIA/
  6. Files in GeosCore/

If you select the GEOS–Chem mercury simulation with the Global Terrestrial Mercury Model option, then the makefiles will compile files in this order::

  1. Files in GTMM/
  2. Files in NcdfUtil/
  3. Files in Headers
  4. Files in KPP/
  5. Files in GeosUtil/
  6. Files in ISOROPIA/
  7. Files in GeosCore/

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

decomp.o                     : decomp.F

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

tropopause_mod.o             : tropopause_mod.F                     \
                               comode_mod.o         diag_mod.o      \
                               logical_mod.o

Looking at the List of GEOS–Chem Modules, you will see that GeosCore/tropopause_mod.F refers to 13 other modules. But 10 of those modules are found in different directories (such as Headers/ and GeosUtil/), which are compiled prior to GeosCore/. Therefore you can ignore these when creating the dependencies listing. In the example above, we have only specified the 3 modules that are located in the same directory as tropopause_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.

7.1.5 OpenMP parallel loop directives

In the late 1990's, several compiler vendors defined a new open standard for parallel computing, aptly named OpenMP. Most modern Fortran and C compilers include support for OpenMP, which facilitates porting parallel source code to different platforms. GEOS–Chem has used OpenMP parallel computing since version 4.17.

GEOS–Chem uses OpenMP parallelization to gain computational advantage by using several CPUs. Recall that most GEOS–Chem arrays represent quantities (i.e. meteorological fields, tracer concentrations, chemical species concentrations) on a geospatial grid. Therefore, OpenMP parallelization essentially assigns each CPU its own region of the "world" to work on. While each CPU is restricted to performing computations on its own region of the "world", it can see the entire "world"—that is, all of the memory on the system. This is illustrated by the figure below.

OpenMP

It is important to remember that OpenMP parallelization is a loop-level parallelization. Only commands within selected DO loops will execute in parallel. All GEOS–Chem simulations begin executing on a single CPU (known as the "master CPU"). Upon entering a parallel DO loop, other CPUs will be invoked to share the workload within the loop. At the end of the parallel DO loop, the other CPUs return to standby status and the execution continues only on the "master" CPU.

Here is an example of the OpenMP commands that you need to add to a GEOS–Chem DO loop in order to make it execute in parallel:

Column   1         2         3         4
1234567890123456789012345678901234567890
!$OMP PARALLEL DO
!$OMP+SHARED( A )
!$OMP+PRIVATE( I, J )
!$OMP+SCHEDULE( DYNAMIC )
      DO J = 1, JJPAR
      DO I = 1, IIPAR
	     A(I,J) = A(I,J) * 2.0
      ENDDO
      ENDDO
!$OMP END PARALLEL DO

Notice that the first column of each !$OMP directive has a Fortran comment character (!). This is by design. In order to invoke OpenMP's parallel directives, you must toggle a specific switch in your makefile (usually -mp or -openmp, depending on your compiler). Otherwise, the compiler will interpret the OpenMP parallel directives as Fortran comments. This would cause all OpenMP parallel DO-loops revert to regular Fortran DO loops, executing on a single CPU.

Because the above example uses the traditional fixed-format (Fortran–77) style, the !$OMP directives must begin at column 1. Otherwise a syntax error will result at compile time. If you are using the free-format (Fortran–90) style, then you may indent the !OMP directives.

OpenMP parallelization is not equivalent to MPI (message passing interface) parallelization. With OpenMP, you can execute parallel code across CPUs of the same machine or cluster node. You CANNOT use CPUs from physically separated machines or nodes. Therefore, OpenMP is incompatible with distributed architectures (e.g. Beowulf, grid computing, cloud computing). Our grid-independent GEOS–Chem project seeks to remove this bottleneck by making make GEOS–Chem compatible with MPI parallelization.

For more information about OpenMP, consult the web site OpenMP.org.

7.2 GEOS–Chem Debugging

The GEOS–Chem model evolves constantly. Our rapidly-increasing user base frequently submits updates and new features for inclusion into the standard GEOS–Chem repository. As with any software project, mistakes are inevitable.

The bugs you will encounter when working on GEOS–Chem fall into one of two categories:

  1. True bugs: typos, omissions, reading the wrong file, or other outright mistakes.

  2. Design limitation bugs: that is, writing code in such a way that precludes future expansion.

You can easily rectify the bugs of the first category. Fixing these usually means correcting a misspelled word, updating an incorrect numerical value, reading from the proper file, etc.

You may struggle to correct the bugs of the second category. You'll find that your simulation works perfectly—until you try to add in a new species, reaction, offline chemistry simulation, diagnostic, or third-party code package. You may have to invest significant time and effort in modifying GEOS–Chem before it finally does what you want..

Remember that GEOS–Chem includes several disparate software elements: emissions, chemistry and deposition routines from Harvard, transport and convection routines from GSFC, photolysis from UC Irvine, etc. The structure of these codes have largely dictated the overall structure of GEOS–Chem. At present, we are working to rectify many of these legacy-code issues (a.k.a. "historical baggage).

7.2.1 Recent fixes

We strive to fix bugs in GEOS–Chem as soon as we find them. Please see our Bugs and Fixes page on the GEOS–Chem wiki. On this page, you will find a list of bugs by GEOSChem version. Clicking on a link will take you to a wiki post which explains the bug (and how it was fixed) in detail.

When your GEOS–Chem simulation dies with an error, first refer to our Common GEOS–Chem Error Messages wiki page. You may find a solution there.

We invite you to peruse these useful resources:

  1. Appendix 7: GEOS–Chem Style Guide
  2. GEOS–Chem wiki. Floating point math issues
  3. GEOS–Chem wiki: Machine issues & portability

7.2.2 Debugging with the GEOS–Chem Unit Tester

The GEOS–Chem Unit Tester is a package of scripts and Makefiles that will compile and run several short (~1 model hour) GEOS–Chem simulations with a set of standard debugging flags. Each simulation is designed to uncover several common bugs for different combinations of meterology, horizontal grid, and simulation type. Using the Unit Tester helps us to ensure that source code updates from developers do not introduce any unforeseen errors into future GEOS–Chem versions.

You can download the GEOS–Chem Unit Tester with Git:

git clone git://git.as.harvard.edu/bmy/GEOS-Chem-UnitTest

The GEOS–Chem Unit Tester package has several subdirectories:

doc/ jobs/ logs/ perl/ runs/

In the perl/ directory you will find the main program (gcUnitTest) and a sample input file (UnitTest.input). You may edit the input file to specify which GEOS–Chem test simulations (i.e. combinations of meteorology, grid, and simulation type) you would like the Unit Tester to run. For example, adding these lines to the input file:

#---------|-----------|------|----------------|------------|------------|
#  MET    | GRID      | NEST | SIMULATION     | START DATE | END DATE   |
#---------|-----------|------|----------------|------------|------------|
  geos5     2x25        -      fullchem        2013070100   2013070101
  geosfp    4x5         -      fullchem        2005070100   2005070101
  geos5     4x5         -      RnPbBe          2005070100   2005070101
  merra     4x5         -      soa             2005070100   2005070101

will tell the GEOS–Chem Unit Tester to schedule the following tests:

  1. GEOS–5 meteroology + 2° x 2.5° horizontal grid + Full-chemistry simulation
  2. GEOS–FP meteroology + 4° x 5° horizontal grid + Full-chemistry simulation
  3. GEOS–5 meteroology + 4° x 5° horizontal grid + Radon-Lead-Beryllium simulation
  4. MERRA meteroology + 4° x 5° horizontal grid + SOA simulation

When you type:

gcUnitTest UnitTest.input

the GEOS–Chem Unit Tester will compile and run GEOS–Chem twice for each set of tests (once with OpenMP parallelizaton turned off, and again with OpenMP parallelization turned on). Then the Unit tester will check to see if the output files from both simulations are identical. (Output from the unit test simuations will be sent to a subdirectory of logs/. The runs/ directory contains a run directory for each of unit test simulation.)

For complete information about how to use the GEOS–Chem Unit Tester, please refer to our GEOS-Chem Unit Tester page on the GEOS–Chem wiki.

7.2.3 Debugging tips

Here are some steps you can take to try to diagnose a particular GEOS–Chem error.

1.

Turn on diagnostic ND70 in the file input.geos. ND70 tells GEOS–Chem to call subroutine DEBUG_MSG from various locations in the code (after advection, chemistry, emissions, dry deposition, etc). DEBUG_MSG writes a short message to the screen and immediately flushes the output to the log file. This will help you be able to pin down where the error occurred.

NOTE: DEBUG_MSG prints and then immediately flushes the error message to disk. Keep in mind that most Unix systems feature buffered I/O—the screen does not refresh until an internal buffer (usually some multiple of 16KB) fills up with text. If you don't flush an error message to disk, then the last log file output may not reflect the location of the error.

 
2.

Add more calls to DEBUG_MSG as necessary:

CALL DEBUG_MSG( '### after routine X'  )
CALL DEBUG_MSG( '### after function Y' )
 
3.

Check for negative concentrations, NaN or Infinite values, call routine CHECK_STT:

! Put this at the top of the subroutine where you are calling CHECK_STT
USE TRACER_MOD, ONLY: CHECK_STT

. . .

! Check for NaN, infinity, negatives:		
CALL CHECK_STT( 'Where I think there is a problem' )


4.

Check the minimum and maximum values of an array with the MINVAL and MAXVAL intrinsic functions:

PRINT*, '### Min, Max: ', MINVAL( ARRAY ), MAXVAL( ARRAY )
CALL FLUSH( 6 )

Check the sum of an array with the SUM intrinsic function:

PRINT*, '### Sum of X : ', SUM( ARRAY )
CALL FLUSH( 6 )

Don't forget to add a CALL FLUSH(6)to flush the output to the screen or log file.

 
5.

Compile your code with array-out-of-bounds error checking. This makes sure that you are not accessing an array with an invalid index. Consider this example:

REAL*8 :: A(10), B(10)
...
DO I = 1, 10
   B(I) = A(I+1)
ENDDO

The code will try access the 11th element of the A array. But since A only has 10 elements, the code will access the next contiguous memory location, which belongs to a different variable altogether. This will copy a "junk" value into the 10th element of the B array.

Out-of-bounds errors may also manifest themselves as a segmentation fault:

forrtl: severe (174): SIGSEGV, segmentation fault occurred

To invoke array-out-of-bounds checking in your code, issue these commands:

make realclean
make -j4 BOUNDS=yes ...

(If you use the Intel Fortran Compiler, you can also add the TRACEBACK=yes, which will print out a list of all routines that were being called at the time of the error.)

The compiler will trap out-of-bounds errors at runtime. You may get an error message such as:

forrtl: severe (408): fort: (3):
Subscript #1 of the array PBL_THICK has value -1 
which is less than the lower bound of 1

NOTE: Once you have located and fixed the offending array statement, you should recompile without the array-out-of-bounds checking built in. The error checking causes your code to slow down noticeably. Check for array-out-of-errors in your debugging runs but not in your production runs.

   

7.2.4 Using a debugger

If you have access to a debugger (IDB, DBX, Totalview), then learn how to use at least the basic commands, such as:

This will save you a lot of time and hassle.

When you use a debugger, you must compile your code with a flag that tells the compiler to generate symbolic debug information. On most compilers, this flag is named -g. You also need to switch off any compiler optimizations (which can modify the sequence in which individual instructions occur) by specifying the -O0 flag.

Add DEBUG=yes (case sensitive) to the make command to apply these options:

make -j4 DEBUG=yes OMP=no    # Without parallelization
make -j4 DEBUG=yes           # With parallelization

Previous | Next | Printable View (no frames)