CMAQv5.0 Namelist redesign of CGRID model species implementation

Jump to: navigation, search

Jeff Young


CMAQ has undergone a redesign of the method by which the model utilizes the species specifications for the central CGRID array, which is the main model data accessed and updated by the sequential, time-splitting operations of the individual science processors that make up CMAQ. These specifications comprise the gas-phase, aerosols, non-reactive and optional, inert tracer species. The model species specification implementation, which has been used since the original CMAQ design up to version 4.7.1, is provided through compiling the model with 4 sets of Fortran Include files. These Include files are stored separately along with the other code in a CVS archive. With the original design and even with outdated aerosol versions rendered obsolete, there still remain ~10 mechanisms, each with 35 Include files (not including inert tracers), which results in a burdensome amount of external code to maintain and incorporate in the model building process.


The CMAQ redesign implements the species specifications by means of Fortran Namelist files, which replace the Include files but are generated in a somewhat similar fashion. Each Namelist replaces as many as a dozen Include files. The model reads the Fortran Namelist files at run time.

This approach enables more flexibility and eliminates the need to maintain a large collection of Include files with the rest of the CMAQ code.

However, the model is still not dynamically mechanism free. The two gas-phase reactions Include files, RXCM and RXDT are still required to be compiled into the CMAQ executable. Also, the compiled-in, standard EBI solver is mechanism dependent, thus the executable must still be recompiled for different mechanisms.

The functionality encapsulated in the original model species Include files can now be easily modified by the user at run time without the necessity of making code changes and recompiling the model. Of course, it is necessary to be very careful how one does this: removing a species from the deposition velocity category, e.g. will change model results, whereas removing a species from the xx_CONC category will not.

Another change is the advection and diffusion classes (xx_ADV, xx_DIFF) have been combined into a new transport class (xx_TRNS) for the GC, AE and NR groups. The idea is that, clouds notwithstanding, advection and diffusion are considered to be transport and should not be subdivided.

New CGRID_SPCS module

In order to read and store the Namelist model species data, a new Fortran90 Module was created. The module contains all the model species data in Fortran90 derived types and contains a “data constructor” initializing function, CGRID_SPCS_INIT, which is called by the CMAQ driver program during model startup. CGRID_SPCS_INIT reads the four species groups Namelist files that have been linked by the run script and does the necessary parsing of the species groups to store the corresponding information in the module’s public data portion. Subsequently, any subroutine that needs model species data has access by including the module through a USE statement at the top of the subroutine.

Required code changes

  1. Remove all the model species Include statements, except for RXCM and RXDT
  2. Use the new CGRID_SPCS Fortran Module in all routines that contain any of the original model species Fortran Include statements
  3. Insert a call to CGRID_SPCS_INIT in driver to read the Namelist files and set up the model species data in the CGRID_SPCS module
  4. Remove the PARAMETER statements that define a combined species parameter based on the previous model species Include files and replace them with appropriate statement definitions in the code
  5. Remove the call to the previous CGRID_SPCS


Comparison with CMAQv4.7.1 shows very small differences for O3 (on the order of 0.003 ppb) and somewhat larger differences for some of the aerosol species. However, total aerosol sulfate differences still remain on the order of 0.015 μg/m3. These differences are attributable to numerical noise, which arises from different memory access and computational order and also to “threshold” phenomena, wherein e.g. very slight differences in relative humidity result in different chemical regimes. The run times are about 2% longer with the Namelist approach for a one-day, 12-Km Eastern US run on the SGI Altix machines.


This redesign eliminates the need to maintain a wide variety of Include files with the CMAQ code and enables more flexibility, especially for code development and testing. If desired, some simple, careful changes to the model species dispositions can be made directly to the Namelist files without recompiling the model.