CMAQ_v5.2_DDM-3D biuld

Hi Carlie and Liz et al.,

I am trying to install CMAQv5.2_DDM-3D,

I built netcdf and ioapi with v5.2 and v5.3, installations was successful without ERROR.

I then git the repo for v5.2DDM 3D

and encountering undefined reference to nc_XXX problem

since v5.2 does not separate netcdf-c and netcdf-fortran

I ln -s all files in netcdf-fortran/lib and netcdf-fortran/include to netcdf-c lib and include

this worked fine for v5.2, but not for DDM-3D

  1. here are the vars I had in the configuration file

    #>  Intel fortran compiler......................................................

    case intel:

    #> I/O API, netCDF, and MPI library locations
    setenv IOAPI_MOD_DIR   /storage/highspeed/apps/ioapi-3.2_20190925/Linux2_x86_64ifort_intel17  #> I/O API precompiled modules
    setenv IOAPI_INCL_DIR  /storage/highspeed/apps/ioapi-3.2_20190925/ioapi/fixed_src  #> I/O API include header files
    setenv IOAPI_LIB_DIR   /storage/highspeed/apps/ioapi-3.2_20190925/Linux2_x86_64ifort_intel17  #> I/O API libraries
    setenv NETCDF_LIB_DIR  /storage/highspeed/apps/netcdf-c-4.7.0-intel17/lib #> netCDF directory path
    setenv NETCDF_INCL_DIR /storage/highspeed/apps/netcdf-c-4.7.0-intel17/include #> netCDF directory path
    setenv MPI_LIB_DIR     /storage/highspeed/apps/mvapich2-2.2_ifc17/    #> MPI directory path
    #> Compiler Aliases and Flags
    setenv myFC mpif90
    setenv myCC icc
    setenv myFSTD "-O3 -fno-alias -mp1 -fp-model source"
    setenv myDBG  "-O0 -g -check bounds -check uninit -fpe0 -fno-alias -ftrapuv -traceback"
    setenv myLINK_FLAG "-qopenmp"
    setenv myFFLAGS "-fixed -132"
    setenv myFRFLAGS "-free"
    setenv myCFLAGS "-O2"
    setenv extra_lib "-lcurl"
    #setenv extra_lib ""
    setenv mpi_lib "-lmpich"    #> No Library specification needed for mpiifort

Do I miss anything?

Thank you!


The order of libraries in make-variable NETCDF needs to be -lnetcdff -lnetcdf

The linker will look for things it needs in the first of these in the second: when the order is reversed, it tries to look for netcdf-C symbols in the netcdf-Fortran library (which is backwards) but not vice versa…

1 Like


Thanks, it is working. Can EPA change the variable in configure file as it should be? otherwise, it is very confused.



Hi Joey,

I have fixed this in the CMAQv5.2_DDM-3D branch.

Thanks, Liz

1 Like