1. Set the environment variable M3HOME to alias the directory in which you want to install CMAQ, e.g.:
    setenv M3HOME /afs/isis/user/CMAQ44
  2. Set environment variables for the M3DATA, M3LIB, and M3MODEL directory paths needed by CMAQ:

    setenv M3DATA $M3HOME/data
    setenv M3LIB $M3HOME/lib
    setenv M3MODEL $M3HOME/models

  3. Create the M3LIB directory
    mkdir $M3LIB
  4. Download the CMAQ tar files and unpack them in the M3HOME directory using the following commands:

    tar xvzf SCRIPTS.tar.gz
    tar xvzf MODELS.tar.gz
    tar xvzf M3DATA.tar.gz
    tar xvzf M3DATA_REF.tar.gz

  5. The CMAQ scripts assume that the netCDF and IOAPI are already installed on your system. You can either copy the precompiled libraries or create symbolic links to the library *.a files into the appropriate locations in the M3LIB directory. For example to copy a precompiled version of the netCDF library use a variation of the following commands:

    mkdir -p $M3LIB/netCDF/Linux
    cp /home/user/netcdf-3.6.1/lib/libnetcdf.a $M3LIB/netCDF/Linux

    or to create a symbolic link:

    mkdir -p $M3LIB/netCDF/Linux
    cd $M3LIB/netCDF/Linux
    ln -s /home/user/netcdf-3.6.1/lib/libnetcdf.a libnetcdf.a

    Similarly for the IOAPI, either copy a precompiled version of the library to the $M3LIB/ioapi/Linux2_x86pg directory or create a symbolic link to the library *.a file.

    Compiler flag consistency between the netCDF and IOAPI are critical for building library files compatible with CMAQ. For Linux systems with the Portland Group Fortran compilers use the PGI Fortran and Gnu C compilers for building both the IOAPI and netCDF.

    Before compiling the netCDF set the following environment variables:

    CC = gcc
    CPPFLAGS = '-DNDEBUG -DpgiFortran`
    CFLAGS = -O
    FC = pgf90
    FFLAGS = `-O -w`
    CXX = g++

    To compile the IO API, set the BIN environment variable to Linux2_x86pg_gcc_mp before running the Unix “make” command:

    BIN = Linux2_x86pg_gcc_mp

After unpacking all of the CMAQ tar files in the M3HOME directory, setting the appropriate environment variables, and installing the IOAPI and netCDF libraries in the CMAQ $M3LIB directory your system is ready to build the CMAQ executables. Before proceeding check that CVS is available on your system by typing the following command:

which cvs

If the message “cvs: Command not found.” is returned you must install CVS on your system before you can continue with the CMAQ installation.