CMAQ v5.4 error at bldit.cctm.csh

Hello,

I’ve been attempting to install CMAQ v5.4 by following the github instructions (I can’t link past the 2 pastebins below). I’m installing this remotely on a cluster and have loaded modules for GCC/9.3.0 and OpenMPI/4.0.3 for all the steps of the install process, including the correct netcdf and ioapi versions. I installed without support for netcdf-4 since it seemed not recommended and I was getting some issues with ioapi. Now, I get errors while running bldit.cctm.csh and I’m not sure how to fix these. Pastebin links for my log output and config_cmaq.csh are below in case I’ve configured something incorrectly. Thanks!

bldit.cctm.log

config_cmaq.csh

Is the STATE3.EXT the one from ioapi-3.2/ioapi or the one from ioapi-3.2/ioapi/fixed_src ?

It needs to be the latter: the Fortran Standard has two source -formats (the old “f77” fixed format, and the newer “f90” free format),as well as specifying a “mixed” format that is legal for INCLUDE files used both source formats. Since the I/O API is used by Standard-conforming applications that use both source formats, it uses this “mixed” format for all its INCLUDE files.

Unfortunately, CMAQ uses a non-Standard “fixed-132” format which is incompatible with both Standard formats. For this reason, the I/O API make fixed_src creates a new directory fixed_src, and places edited “fixed-132” compatible INCLUDE files into it. These are the ones youi need to use for CMAQ.

See https://cjcoats.github.io/ioapi/AVAIL.html#cmaq

I had noticed this after previous errors and reading the forum and specified it in my config_cmaq.csh, but I did not empty the $CMAQ_HOME/lib folder of previous symlinks. I just did that and it worked. It might be worth mentioning in a troubleshooting section that config_cmaq doesn’t replace existing symlinks if you make any edits, so you should delete the ones that it generated (or maybe this is common knowledge that should be expected). Thanks!

1 Like

Just to summarize what I am seeing in the files that you shared on pastebin:

This section of your config_cmaq.csh looks correct.

    #> I/O API, netCDF, and MPI Library Locations -- used in CMAQ
    setenv IOAPI_INCL_DIR   /scratch/gap6/LIBRARIES/ioapi-3.2/ioapi/fixed_src            #> I/O API include header files
    setenv IOAPI_LIB_DIR    /scratch/gap6/LIBRARIES/ioapi-3.2/Linux2_x86_64gfort_gcc_9.3.0             #> I/O API libraries
    setenv NETCDF_LIB_DIR   /scratch/gap6/LIBRARIES/netcdf/lib            #> netCDF C directory path
    setenv NETCDF_INCL_DIR  /scratch/gap6/LIBRARIES/netcdf/include            #> netCDF C directory path
    setenv NETCDFF_LIB_DIR  /scratch/gap6/LIBRARIES/netcdf/lib           #> netCDF Fortran directory path
    setenv NETCDFF_INCL_DIR /scratch/gap6/LIBRARIES/netcdf/include           #> netCDF Fortran directory path
    setenv MPI_INCL_DIR     /opt/apps/software/OpenMPI/4.0.3-GCC-9.3.0/include              #> MPI Include directory path
    setenv MPI_LIB_DIR      /opt/apps/software/OpenMPI/4.0.3-GCC-9.3.0/lib               #> MPI Lib directory path

The error message in the bldit_cctm.log includes the following:

Warning: Legacy Extension: Comma before i/o item list at (1)
desid_util.F:111:62:
 
  111 |              WRITE( LOGDEV, '(/,5x,3A,I3,/,5x,2A,4(/,5x,A))' ),
      |                                                              1
Warning: Legacy Extension: Comma before i/o item list at (1)
STATE3.EXT:174:27:
 
Error: Syntax error in COMMON statement at (1)
STATE3.EXT:191:27:
 
Error: Syntax error in COMMON statement at (1)
STATE3.EXT:174:27:

I am wondering if the STATE3.EXT is of the wrong format, especially as you mentioned that you had difficulty building I/O API.

It took me awhile to post this, so it is outdated.

Indeed, we need to add information in our documentation about needed to remove the links and re-create them if you edit the library locations in the config_cmaq.csh file.

1 Like

All of the

Warning: Legacy Extension: Comma before i/o item list

are CMAQ code-bugs, and the

Warning: Legacy Extension: Duplicate SAVE attribute specified

are gfortran behaving in its own indiosyncratic fashion.

The STATE3.EXT fixed-72 formatted but fixed-132 needed by CMAQ is an old problem with CMAQ, due to the fact that CMAQ refuses to conform to the Fortran Standard, whereas the I/O API must serve applications that use both of the Standard source formats.