Running GCHP: Configuration

From Geos-chem
Revision as of 17:50, 17 November 2020 by Lizzie Lundgren (Talk | contribs) (Split a Simulation Into Multiple Jobs)

Jump to: navigation, search

Previous | Next | Getting Started with GCHP | GCHP Main Page

  1. Hardware and Software Requirements
  2. Setting Up the GCHP Environment
  3. Downloading Source Code and Data Directories
  4. Compiling
  5. Obtaining a Run Directory
  6. Running GCHP: Basics
  7. Running GCHP: Configuration
  8. Output Data
  9. Developing GCHP
  10. Run Configuration Files


All GCHP run directories have default simulation-specific run-time settings that are set when you create a run directory. You will likely want to change these settings. This page goes over how to do this.

Configuration files

GCHP is controlled using a set of configuration files that are included in the GCHP run directory. Files include:

  1. CAP.rc
  2. ExtData.rc
  3. GCHP.rc
  4. input.geos
  5. HEMCO_Config.rc
  6. HEMCO_Diagn.rc
  7. input.nml
  8. HISTORY.rc

Several run-time settings must be set consistently across multiple files. Inconsistencies may result in your program crashing or yielding unexpected results. To avoid mistakes and make run configuration easier, bash shell script is included in all run directories to set the most commonly changed config file settings from one location. Sourcing this script will update multiple config files to use values specified in file.

Sourcing is done automatically prior to running GCHP if using any of the example run scripts, or you can do it at the command line. Information about what settings are changed and in what files are standard output of the script. To source the script, type the following:


You may also use it in silent mode if you wish to update files but not display settings on the screen:

source --silent

While using to configure common settings makes run configure much simpler, it comes with a major caveat. If you manually edit a config file setting that is also set in then your manual update will be overrided via string replacement. Please get very familiar with the options in and be conscientious about not updating the same setting elsewhere.

You generally will not need to know more about the GCHP configuration files beyond what is listed on this page. However, for a comprehensive description of all configuration files used by GCHP see the last section of this user manual.

Commonly Changed Run Options

Compute Configuration

Set Number of Nodes and Cores

To change the number of nodes and cores for your run you must update settings in two places: (1), and (2) your run script. The file contains detailed instructions on how to set resource parameter options and what they mean. Look for the Compute Resources section in the script. Update your resource request in your run script to match the resources set in

It is important to be smart about your resource allocation. To do this it is useful to understand how GCHP works with respect to distribution of nodes and cores across the grid. At least one unique core is assigned to each face on the cubed sphere, resulting in a constraint of at least six cores to run GCHP. The same number of cores must be assigned to each face, resulting in another constraint of total number of cores being a multiple of six. Communication between the cores occurs only during transport processes.

While any number of cores is valid as long as it is a multiple of six (although there is an upper limit per resolution), you will typically start to see negative effects due to excessive communication if a core is handling less than around one hundred grid cells or a cluster of grid cells that are not approximately square. You can determine how many grid cells are handled per core by analyzing your grid resolution and resource allocation. For example, if running at C24 with six cores each face is handled by one core (6 faces / 6 cores) and contains 576 cells (24x24). Each core therefore processes 576 cells. Since each core handles one face, each core communicates with four other cores (four surrounding faces). Maximizing squareness of grid cells per core is done automatically within if variable NXNY_AUTO is set to ON.

Split a Simulation Into Multiple Jobs

There is an option to split up a single simulation into separate serial jobs. To use this option, do the following:

  1. Update with your full simulation (all runs) start and end dates, and the duration per segment (single run). Also update the number of runs options to reflect to total number of jobs that will be submitted (NUM_RUNS). Carefully read the comments in to ensure you understand how it works.
  2. Optionally turn on monthly diagnostic (Monthly_Diag). Only turn on monthly diagnostics if your run duration is monthly.
  3. Use as your run script, or adapt it if your cluster does not use SLURM. It is located in the runScriptSamples subdirectory of your run directory. As with the regular, you will need to update the file with compute resources consistent with Note that you should not submit the run script directly. It will be done automatically by the file described in the next step.
  4. Use to submit your job, or adapt it if your cluster does not use SLURM. It is located in the runScriptSamples subdirectory of your run directory. For example, to submit your series of jobs, type: ./

There is much documentation in the headers of both and that is worth reading and getting familiar with, although not entirely necessary to get the multi-run option working. If you have not done so already, it is worth trying out a simple multi-segmented run of short duration to demonstrate that the multi-segmented run configuration and scripts work on your system. For example, you could do a 3-hour simulation with 1-hour duration and number of runs equal to 3.

The multi-run script assumes use of SLURM, and a separate SLURM log file is created for each run. There is also log file called multirun.log with high-level information such as the start, end, duration, and job ids for all jobs submitted. If a run fails then all scheduled jobs are cancelled and a message about this is sent to that log file. Inspect this and your other log files, as well as output in the OutputDir/ directory prior to using for longer duration runs.

Change Domains Stack Size

For runs at very high resolution or small number of processors you may run into a domains stack size error. This is caused by exceeding the domains stack size memory limit set at run-time and the error will be apparent from the message in your log file. If this occurs you can increase the domains stack size in file input.nml. The default is set to 20000000.

Basic Run Settings

Set Cubed Sphere Grid Resolution

GCHP uses a cubed sphere grid rather than the traditional lat-lon grid used in GEOS-Chem Classic. While regular lat-lon grids are typically designated as ΔLat ⨉ ΔLon (e.g. 4⨉5), cubed sphere grids are designated by the side-length of the cube. In GCHP we specify this as CX (e.g. C24 or C180). The simple rule of thumb for determining the roughly equivalent lat/lon for a given cubed sphere resolution is to divide the side length by 90. Using this rule you can quickly match C24 with 4x5, C90 with 1 degree, C360 with quarter degree, and so on.

To change your grid resolution in the run directory edit the "CS_RES" integer parameter in to the cube side-length you wish to use.

#   Internal Cubed Sphere Resolution
CS_RES=24 # 24 ~ 4x5, 48 ~ 2x2.5, 90 ~ 1x1.25, 180 ~ 1/2 deg, 360 ~ 1/4 deg

Turn On/Off Model Components

You can toggle all primary GEOS-Chem components, including type of mixing, from within The settings in that file will update input.geos automatically.

#    Turn Components On/Off
# Automatically turns on/off GEOS-Chem components in input.geos.
# WARNING: these settings will override manual updates you make to input.geos!

Change Model Timesteps

Model timesteps, both chemistry and dynamic, are configured within They are set to match GEOS-Chem Classic default values for comparison purposes but can be updated, with caution. Read the documentation in for setting them to be fully aware of recommended settings. Changing to higher resolutions will automatically change the timestep based on the rules set in

#    Timesteps
# Optimal timesteps are dependent on grid resolution and are automatically
# set based on the GCHP Working Group's recommendation below. To override
# these settings, comment out the code and manually define the following
# variables:
#    ChemEmiss_Timestep_sec     : chemistry timestep interval [s]
#    TransConv_Timestep_sec     : dynamic timestep interval [s]
#    TransConv_Timestep_HHMMSS  : dynamic timestep interval as HHMMSS string
# WARNING: Settings in this file will override settings in input.geos!
# NOTE: Default timesteps for c24 and c48, the cubed-sphere rough equivalents
# of 4x5 and 2x2.5, are the same as defaults timesteps in GEOS-Chem Classic
if  $CS_RES -lt 180 ; then

Set Simulation Start and End Dates

Set simulation start and end in

#    Simulation Start/End/Duration
# For single-segment runs, duration should be less than or equal to the
# difference between start and end time. If end time is past start time
# plus duration, the simulation will end at start time plus duration rather
# than end time.
# Setting duration such that two or more durations can occur between start
# and end will enable multi-segmented runs. At the end of each run the 
# end time is stored as the new start time in output file cap_restart.
# Rerunning without removing or editing cap_restart will start at the
# start time in cap_restart rather than the start time listed below. 
# Use this feature with the multi-segmented runs / monthly diagnostics
# section below. See more information about this on the GCHP wiki.
Start_Time="20160101 000000"
End_Time="20160101 030000"
Duration="00000000 030000"

There is also a "Duration" field in the file which must be set to reflect how long your run will last. If your end date is earlier than your start date plus duration then your GCHP run will fail. If your end date is later than your start date plus duration then your job will not make it to your configured end date; it will end at start date plus duration. If your end date is multiple durations past your start date then subsequent job submissions will start where your last run ended, so long as you do not delete file cap_restart. That file contains a new start string that will always be used if the file is present. You can take advantage of this file for splitting up a long simulation into multiple jobs. See further down on this page for automation of this task built into the run directory.

Typically a "CAP" error indicates a problem with start, end, and duration settings. If you encounter an error with the words "CAP" near it then double-check that these settings make sense.


Change Input Meteorology Grid Resolution

The meteorology grid resolutions are set to 0.25x0.3125 for GEOS-FP and 0.5x0.625 for MERRA2 by default when creating a GCHP run directory. If you wish to change meteorology resolution you must update all meteorology paths and filenames in ExtData.rc and make sure run directory symbolic link MetDir points to the data at the resolution you will run at.

Sebastian Eastham (MIT) developed the following python code to automatically update ExtData.rc for alternative grid resolutions.

if [[ $# -ne 1 ]]; then
echo "Must provide path to either GEOS_2x2.5/MERRA2 or GEOS_2x2.5/GEOSFP"
exit 70
if [[ -L MetDir ]]; then unlink MetDir; fi
sed -i "s/025x03125\.nc/" ExtData.rc
# For MERRA-2
#sed -i "s/05x0625\.nc/" ExtData.rc
ln -s $1 MetDir
exit 0

Copy and paste the above code into a file in your run directory, for example Assuming you are using the standard directory structure, the following command should then automatically switch your ExtData.rc and MetDir to the 2x2.5 GEOS-FP input:

./ $(readlink -f $( readlink -f MainDataDir )/../GEOS_2x2.5/GEOS_FP)

When changing meteorology source and/or grid resolution, be sure that you have the data available for the time period you plan on simulating. In addition, note that meteorology listed in ExtData.rc includes both data for the time period you plan on running at as well as constants files (2011 to GEOS-FP and 2015 for MERRA2). See the downloading GEOS-Chem data page for more information on meteorology sources available and how to download them.

Change Your Initial Restart File

All GCHP run directories come with symbolic links to initial restart files for commonly used cubed sphere resolutions. The appropriate restart file is automatically chosen based on the cubed sphere resolution you set in All of the restart files are simply GEOS-Chem Classic restart files regridded to the cubed sphere.

#    Initial Restart File
# By default the linked restart files in the run directories will be 
# used. Please note that HEMCO restart variables are stored in the same
# restart file as species concentrations. Initial restart files available 
# on gcgrid do not contain HEMCO variables which will have the same effect
# as turning the HEMCO restart file option off in GC classic. However, all 
# output restart files will contain HEMCO restart variables for your next run.

# You can specify a custom initial restart file here to overwrite:
# INITIAL_RESTART=your_restart_filename_here

You may over-write the default restart file with your own by specifying the restart filename in Beware that it is your responsibility to make sure it is the proper grid resolution.

Unlike GEOS-Chem Classic, HEMCO restart files are not used in GCHP. HEMCO restart variables may be included in the initial species restart file, or they may be excluded and HEMCO will start with default values. GCHP initial restart files that come with the run directories do not include HEMCO restart variables, but all output restart files do.

Regrid an Initial Restart File

GCHP expects the restart file to be at the same grid resolution as the model run. If you have a lat-lon restart file that you want to regrid for input to GCHP, or a restart file already on cubed-sphere but at the wrong resolution, you can regrid to cubed sphere at any resolution using FORTRAN tool CSRegridTool developed by Sebastian Eastham (MIT). To use, clone the repository, source your GCHP environment file, and run make from within csregridtool. This will build the program. Then copy your source restart file to the directory and edit the input.regrid text file for the target resolution, source filename, target filename, and if you want vertical flipping. GCHP uses level 0 as top of atmosphere so regridding GEOS-Chem classic files for GCHP requires vertical flipping. Next, type ./regrid to run and generate an output file. Finally, because csregridtool creates files in NetCDF-3 format you will need to reprocess to NetCDF-4 prior to use in GCHP. To do this, type 'nccopy -k 4 restart_in restart_out' where restart_in is the name of your generated NetCDF-3 file and restart_out is the name of the new NetCDF-4 file.

Please note that csregridtool requires offline tile files with mapping weights for the regridding. There are publicly available tile files available for commonly used source and target grids at ExtData/GCHP/TilesFiles (GEOS-Chem shared data directory). Examples of regridding weights available are {4x5, 2x2.5} to {c24, c48, c90, c180, c360}. If you need tile files for a different conversion please contact the GEOS-Chem Support Team.

Turn On/Off Emissions Inventories

Because file I/O impacts GCHP performance it is a good idea to turn of file read of emissions that you do not need. You can turn emissions inventories on or off the same way you would in GEOS-Chem Classic, by setting the inventories to true or false at the top of configuration file HEMCO_Config.rc. All emissions that are turned off in this way will be ignored when GCHP uses ExtData.rc to read files, thereby speeding up the model.

For emissions that do not have an on/off toggle at the top of the file, you can prevent GCHP from reading them by commenting them out in HEMCO_Config.rc. No updates to ExtData.rc would be necessary. If you alternatively comment out the emissions in ExtData.rc but not HEMCO_Config.rc then GCHP will fail with an error when looking for the file information.

Another option to skip file read for certain files is to replace the file path in ExtData.rc with /dev/null. However, if you want to turn these inputs back on at a later time you should preserve the original path in a comment.

Add New Input Files

New in GCHP 12.5.0: Online ESMF regridding removes the need for tile files when running GCHP. However, online regridding does not apply to restart files. You can still use the tools listed below to create tile files to regrid restart files, or you can regrid using python.

There are three main requirements for adding new emissions inventories to GCHP:

  1. Add the inventory information to HEMCO_Config.rc. If you wish to add new inputs to the model that are not handled by HEMCO then you can skip this step.
  2. Add the inventory information to ExtData.rc.
  3. Have a tile file available that maps the inventory's lat/lon grid to the cubed sphere grid for the resolution you will use.

To add information to HEMCO_Config.rc, follow the same rules as you would for adding a new emission inventory to GEOS-Chem Classic. Note that not all information in HEMCO_Config.rc is used by GCHP. This is because HEMCO is only used by GCHP to handle emissions after they are read, e.g. scaling and applying hierarchy. All functions related to HEMCO file read are skipped. This means that you could put garbage for the file path and units in HEMCO_Config.rc without running into problems with GCHP. However, we recommend that you fill in HEMCO_Config.rc in the same way you would for GEOS-Chem Classic for consistency and also to avoid potential format check errors.

Staying consistent with the information that you put into HEMCO_Config.rc, add the inventory information to ExtData.rc following the guidelines listed at the top of the file and using existing inventories as examples. You can ignore all entries in HEMCO_Config.rc that are copies of another entry since putting these in ExtData.rc would result in reading the same variable in the same file twice. Doing so would be costly in GCHP because each file is opened and closed for each variable in the file. HEMCO interprets the copied variables, denoted by having dashes in the HEMCO_Config.rc entry, separate from file read.

At this point it is best to run a very short simulation with GCHP with MAPL debug prints on (see section on debugging below). If your file(s) need a new tile file then the model will crash. Tile files have already been created for many lat/lon grids and these are stored in ExtData/GCHP/TileFiles. The GCHP log file error will include the tile file name that GCHP expects to be available for regridding your new inventory. In that filename DC = dateline centered, PC = pole centered, DE = dateline edge, and PE = pole edge. UU is reserved for files on regional grids. Once you have this information you should be able to generate your own tile file by downloading the tempestremap and CSGrid repositories from GitHub and following these steps:

  • tempestremap: This tool will generate a netcdf tile file for mapping lat/lon coordinates to cubed sphere. This is a fortran tool that should work in your existing GCHP environment. Simply do make clean and then make to build the tempestremap code. Then use or to generate global or regional bound tile files. When using, you will need to specify whether your data is dateline-centered and/or pole-centered, as determined from the log file error message. We recommend generating a tile file for all supported cubed-sphere resolutions (nC = 24, 48, 90, 180, and 360). NOTE: There seems to be a 2 GB limit when creating tile files with tempestremap.
  • CSGrid: This tool will convert the netCDF file created by tempestremap to binary for compatibility with GCHP. CSGrid requires a Matlab license. If you have Matlab you can use exampleScripts/create_Tempest_TileFile_LL2CS.m to convert your netCDF output in tempestremap/TileFiles from netcdf to binary. Send the resulting file to the GCST and they can add it to ExtData/GCHP/TileFiles.

Once read in by GCHP, your data will be stored as MAPL Import variables with the same names that appear in the first column of ExtData.rc. If your input files are handled by HEMCO then you do not need to do anything else to handle the MAPL Imports. However, if your new inputs are not handled by HEMCO then you will need to take the additional steps of adding source code to transfer your MAPL Imports to something that GEOS-Chem can understand. If you wish to assign a MAPL Import directly to a State_Met or other state field in GEOS-Chem, you can do this in GCHP file "Includes_Before_Run.H". The lines in that file are executed prior to every dynamic timestep in GCHP and currently contain the setting of all State_Met fields derived from MAPL Imports. For more advanced use cases, read through GCHP file Chem_GridCompMod.F90 for examples, specifically searching for calls to subroutine MAPL_GetPointer. Contact the GEOS-Chem Support Team for more information on how to use MAPL Imports within GEOS-Chem.

A few common errors encountered when adding new input files to GCHP are:

  1. Your input file contains integer values. Beware that the MAPL I/O component in GCHP does not read or write integers. If your data contains integers then you should reprocess the file to contain floating point values instead. If you try to input integers you will get an error such as this:
    >>Reading TESTDATA from ./MainDataDir/
    CFIO: Reading ./MainDataDir/ at 19850101 000000
    CFIO_GetVar: error getting scale
    CFIO_CFIO_GetVar failed
    problem in ESMF_CFIOSdfVarRead
  2. Your data latitude and longitude dimensions are in the wrong order. Lat must always come before lon in your inputs arrays, a requirement true for both GCHP and GEOS-Chem Classic. For more information about this, see the [Preparing_data_files_for_use_with_HEMCO#Ordering_of_the_data|Preparing Data Files for Use with HEMCO wiki page]]. The symptom of this error in GCHP is:
    CFIO: Reading {filename} at {YYYYMMDD} {HHmmSS}
    Error reading
    variable using NF90_GET_VAR -57
    NetCDF: Start+count exceeds dimension bound
  3. You do not have a tile file that regrids between your input file data resolution and the internal resolution of GCHP. This will result in an ExtData error in MAPL_HorzTransform.
  4. Your 3D input data are mapped to the wrong levels in GEOS-Chem (silent error). If you read in 3D data and assign the resulting import to a GEOS-Chem state variable such as State_Chm or State_Met, then you must flip the vertical axis during the assignment. See files Includes_Before_Run.H and setting State_Chm%Species in Chem_GridCompMod.F90 for examples.
  5. You have a typo in either HEMCO_Config.rc or ExtData.rc. Error in HEMCO_Config.rc typically result in the model crashing right away. Errors in ExtData.rc typically result in a problem later on during ExtData read. Always try running with DEBUG=20 in (maximizes output to gchp.log) and Warnings and Verbose set to 3 in HEMCO_Config.rc (maximizes output to HEMCO.log) when encountering errors such as this. Another useful strategy is to find rc-file entries for similar input files and compare them against the entry for your new file. Directly comparing the file metadata may also lead to insights into the problem.


Output Diagnostics Data on a Lat-Lon Grid

This feature is new in GCHP 12.5.0. See the HISTORY.rc file in GCHP 12.5.0 run directories for instructions. Details will be included here on the wiki in the future.

Output Restart Files at Regular Frequency

The MAPL component in GCHP has the option to output restart files (also called checkpoint files) at regular intervals. Unlike the final restart file output at the end of a simulation, these regularly output restart files contain the date and time in their filename. Enabling this feature is a good idea if you plan on doing a long simulation and you are not splitting your run into multiple jobs. If the run crashes unexpectedly then you can restart mid-run rather than start over from the beginning. To set the checkpoint frequency, simply update the HHmmSS string for "Checkpoint_Freq" in runConfig.rc. Minutes and seconds must each be two digits but hours can be more than two. Each output checkpoint file will include the timestamp in the filename.

#    Output Restart Files
# You can output restart files at regular intervals throughout your
# simulation. These restarts are in addition to the end-of-run restart
# which is always produced. To configure output restart file frequency,
# set the variable below to a string of format HHmmSS. More than 2
# digits for the hours string is permitted (e.g. 1680000 for 7 days).
# Setting the frequency to 000000 will turn off this feature by setting
# it to a very large number.

Turn On/Off Diagnostics

All GCHP run directories have four collections on by default: time-averaged species concentrations, instantaneous species concentrations, time-averaged meteorology, and instantaneous meteorology. All species are enabled while only a subset of meteorology variables are enabled. There are several other collections already implemented but they are off by default for the standard and benchmark simulations, and on by default for the RnPbBe simulation.

To turn collections on or off, comment ("#") collection names in the "COLLECTIONS" list at the top of file HISTORY.rc.

# Declare collection names and toggle on/off
COLLECTIONS: #'AerosolMass'

Once a collection is turned on, you can comment diagnostics within it further down in the file by searching for the collection name with ".fields" suffix. Be aware that you cannot comment out the diagnostic that appears on the same line as the fields keyword. If you wish to suppress that specific diagnostic then move it to the next line and replace it with a diagnostic that you want to output.

# State_Met array diagnostics - time-averaged
 StateMet_avg.template:      '%y4%m2%d2_%h2%n2z.nc4',
 StateMet_avg.format:        'CFIO',
 StateMet_avg.frequency:     010000
 StateMet_avg.duration:      010000
 StateMet_avg.mode:          'time-averaged'
 StateMet_avg.fields:        'Met_AD               ', 'GIGCchem',
                             #'Met_AIRDEN          ', 'GIGCchem',
                             #'Met_AIRVOL          ', 'GIGCchem',
                             #'Met_ALBD            ', 'GIGCchem',
                             'Met_AREAM2           ', 'GIGCchem',
                             #'Met_AVGW            ', 'GIGCchem',
                             'Met_BXHEIGHT         ', 'GIGCchem',

Set Diagnostic Frequency, Duration, and Mode

WARNING: There is currently a bug in GCHP the prevents writing out more than one time per file. Duration in HISTORY.rc is ignored.

All diagnostic collections that come with the run directory have frequency, duration, and mode defined within With the exception of SpeciesConc_inst and StateMet_inst, all collections are time-averaged (mode) with frequency and duration set to the simulation length you specified in CopyRunDirs.input when creating the run directory. Any of these defaults can be over-written by editing Be aware that manual updates of HISTORY.rc will be over-written by settings.

#    Diagnostics
# Frequency, duration, and mode used for all default HISTORY.rc diagnostic
# collections are set from within this file. These are defined as:
#   Frequency = frequency of diagnostic calculation (HHmmSS)
#   Duration  = frequency of diagnostic file  write (HHmmSS)
#   Mode      = computation of diagnostics (time-averaged or instantaneous)
# Edit the frequency, duration, and mode below to change global settings.
# See the list further below of what HISTORY.rc collections will be updated.
#  1. Freq and duration hours may exceed 2 digits, e.g. 7440000 for 31 days
#  2. Freq and duration are ignored if Monthly_Diag is set to 1
#  3. If you do not want settings for certain collections set automatically
#     from this file, comment them out below.
#  4. If you add a collection to HISTORY.rc and want its settings
#     automatically updated from this file, add to the list below.
#  5. To turn off collections completely, comment them out in HISTORY.rc.
common_freq="010000"          # Ignore if using multi-run monthly diag option
common_dur="010000"           # Ignore if using multi-run monthly diag option
common_mode="'time-averaged'" # "'time-averaged'" and "'instantaneous'"


Add a New Diagnostics Collection

Adding a new diagnostics collection in GCHP is the same as for GEOS-Chem Classic netcdf diagnostics. You must add your collection to the collection list in HISTORY.rc and then define it further down in the file. Any 2D or 3D arrays that are stored within State_Met, State_Chm, or State_Diag, and that are successfully incorporated into the GEOS-Chem Registry may be included as fields in a collection. State_Met variables must be preceded by "met_", State_Chm variables must be preceded by "chm_", and State_Diag variables should not have a prefix. See GeosCore/state_diag_mod.F90 for examples of how existing State_Diag arrays are implemented.

Once implemented, you can either incorporate the new collection settings into for auto-update, or you can manually configure all settings in HISTORY.rc.

Generate Monthly Mean Diagnostics

There is an option to automatically generate monthly diagnostics by submitting month-long simulations as separate jobs. Splitting up the simulation into separate jobs is a requirement for monthly diagnostics because MAPL History requires a fixed number of hours set for diagnostic frequency and file duration. The monthly mean diagnostic option automatically updates HISTORY.rc diagnostic settings each month to reflect the number of days in that month taking into account leap years.

To use the monthly diagnostics option, first read and follow instructions for splitting a simulation into multiple jobs (see separate section on this page). Prior to submitting your run, enable monthly diagnostics in by searching for variable "Monthly_Diag" and changing its value from 0 to 1. Be sure to always start your monthly diagnostic runs on the first day of the month.

Additional Diagnostic Collection Options

See file GCHP/Shared/MAPL_Base/TeX/HistoryIntro.tex for original MAPL documentation on MAPL History. Please note that we have not tested all of these functionalities and some of them to seem to not work in MAPL. Proceed with caution and let the GEOS-Chem Support Team know what you find. Here is a brief overview of options that may be included for each collection that is taken from that document:

template Character string defining the time stamping template that is appended to collection to create a particular file name. The template uses GrADS convensions. The default value depends on the duration of the file.

descr Character string describing the collection. Defaults to `expdsc'.

format Character string to select file format ("CFIO", "CFIOasync", "flat"). "CFIO" uses MAPL_CFIO and produces netcdf output. "CFIOasync" uses MAPL_CFIO but delegates the actual I/O to the MAPL_CFIOServer (see MAPL_CFIOServer documenation for details). Default = "flat".

frequency Integer (HHHHMMSS) for the frequency of time groups in the collection. Default = 060000.

mode Character string equal to `instantaneous' or `time-averaged'. Default = 'instantaneous'.

acc_interval Integer (HHHHMMSS) for the acculation interval ($\le$ frequency) for time-averaged diagnostics. Default = frequency; ignored if mode is `instantaneous'.

ref_date Integer (YYYYMMDD) reference date for {\em frquency}; also the beginning date for the collection. Default is the Start date on the Clock.

ref_time Integer (HHMMSS) Same a ref_date.

end_date Integer (YYYYMMDD) ending date to stop diagnostic output. Default: no end

end_time Integer (HHMMSS) ending time to stop diagnostic output. Default: no end.

duration Integer (HHHHMMSS) for the duration of each file. Default = 00000000 (everything in one file). Duration is not currently functional in GCHP and will be ignored. Frequency is used instead for write frequency.

resolution Optional resolution (IM JM) for the ouput stream. Transforms betwee two regulate LogRect grid in index space. Default is the native resolution.

xyoffset Optional Flag for output grid offset when interpolating. Must be between 0 and 3. (Cryptic Meaning: 0:DcPc, 1:DePc, 2:DcPe, 3:DePe). Ignored when resolution results in no interpolation (native). Default: 0 (DatelineCenterPoleCenter).

levels Optional list of output levels (Default is all levels on Native Grid). If vvars is not specified, these are layer indices. Otherwise see vvars, vunits, vscale.

vvars Optional field to use as the vertical coordinate and functional form of vertical interpolation. A second argument specifies the component the field comes from. Example 1: the entry 'log(PLE)','DYNAMICS' uses PLE from the FV3 advection component as the vertical coordinate and interpolates to levels linearly in its log. Example 2: 'THETA','DYN' a way of producing isentropic output. Only log(*), pow(*), and real number and straight linear interpolation are supported.

vunit Character string to use for units attribute of the vertical coordinate in file. The default is the MAPL_CFIO default. This affects only the name in the file. It does not do the conversion. See vscale

vscale Optional Scaling to convert VVARS units to VUNIT units. Default: no conversion.

regrid_exch Name of the exchange grid that can be used for interpolation between two LogRect grids or from a tile grid to a LogRect grid. Default: no exchange grid interpolation. irregular grid.

regrid_name Name of the Log-Rect grid to interpolate to when going from a tile to Field to a gridde output. regrid_exch must be set, otherwise it is ignored.

conservative Set to a non-zero integer to turn on conservative regridding when going from a native cube-sphere grid to lat-lon output. Default: 0

deflate Set deflate level (0-9) of NETCDF output when format is CFIO or CFIOasync. Default: 0

subset Optional subset (lonMin lonMax latMin latMax) for the output when performing non-conservative cube-sphere to lat-lon regridding of the output.

chunksize Optional user specified chunking of NETCDF output when format is CFIO or CFIOasync, (Lon chunksize, Lat chunksize, Lev chunksize, Time chunksize)


Enable Maximum Print Output

Besides compiling with "make compile_debug", there are a few run settings you can configure to boost your chance of successful debugging. All of them involve sending additional print statements to the log files.

  1. Change "ND70" in input.geos from 0 to 1 to turn on extra GEOS-Chem print statements in the main log file.
  2. Set the "MAPL_DEBUG_LEVEL" variable in to a number greater than 0 to turn on extra MAPL print statements in MAPL ExtData. This is useful if you are having a problem reading input files. The higher the number the more prints will be sent to the log (and the slower your run will be). Usually 20 is sufficient, although you can go higher. Please be sure to remember to set MAPL_DEBUG back to 0 when you are done so as not to severely slow down your runs!
  3. Set the "Verbose" and "Warnings" settings in HEMCO_Config.rc to maximum values of 3 to send the maximum number of prints to HEMCO.log.
  4. Set the "MEMORY_DEBUG_LEVEL" option, new in 12.5.0, to 1 to turn on additional memory usage prints per timestep.
#    Debug Options
# Set MAPL debug flag to 0 for no extra MAPL debug log output, or 1 to
# print information to log. Using this flag is most helpful for debugging
# issues with file read (MAPL ExtData).
# Set memory debug flag to 0 to print memory only once per timestep. Set to
# 1 to enable memory prints at additional locations throughout the run.
# For GEOS-Chem debug prints, turn on ND70 in input.geos manually.       
# WARNING: Turning on debug prints significantly slows down the model!

None of these options require recompiling. Be aware that all of them will slow down your simulation. Be sure to set them back to the default values after you are finished debugging.

Turn On/Off MAPL Timers and Memory Logging

Your GCHP log file will include timing and memory information by default, and this is usually a good thing. If for some reason you want to turn these features off you can do so in file CAP.rc. Search for "MAPL_ENABLE_TIMERS" and "MAPL_ENABLE_MEMUTILS" and simply change "YES" to "NO". Remember to turn them back on again if you later need to to debug.

Previous | Next | Getting Started with GCHP | GCHP Main Page