# CMAQ v5.4 error at bldit.cctm.csh

**URL:** <https://forum.cmascenter.org/t/cmaq-v5-4-error-at-bldit-cctm-csh/4807>\
**Category:** Compiling\
**Created:** [March 26, 2024, 9:09pm UTC](https://forum.cmascenter.org/t/cmaq-v5-4-error-at-bldit-cctm-csh/4807 "2024-03-26T21:09:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gpara35](https://avatars.discourse-cdn.com/v4/letter/g/76d3ee/32.png) [@gpara35](https://forum.cmascenter.org/u/gpara35)\
**Post date:** [March 26, 2024, 9:09pm UTC](https://forum.cmascenter.org/t/cmaq-v5-4-error-at-bldit-cctm-csh/4807/1 "2024-03-26T21:09:32Z")

</div>

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](https://pastebin.com/AZrpWcbJ)

[config\_cmaq.csh](https://pastebin.com/eTV0eEcp)

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [March 26, 2024, 10:04pm UTC](https://forum.cmascenter.org/t/cmaq-v5-4-error-at-bldit-cctm-csh/4807/2 "2024-03-26T22:04:23Z")

</div>

Is the `STATE3.EXT` the one from _ioapi-3.2/ioap_i 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](https://cjcoats.github.io/ioapi/AVAIL.html#cmaq)

---

<div class="post-metadata">

**Author:** ![gpara35](https://avatars.discourse-cdn.com/v4/letter/g/76d3ee/32.png) [@gpara35](https://forum.cmascenter.org/u/gpara35)\
**Post date:** [March 26, 2024, 10:16pm UTC](https://forum.cmascenter.org/t/cmaq-v5-4-error-at-bldit-cctm-csh/4807/3 "2024-03-26T22:16:07Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![lizadams](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lizadams](https://forum.cmascenter.org/u/lizadams)\
**Post date:** [March 26, 2024, 10:17pm UTC](https://forum.cmascenter.org/t/cmaq-v5-4-error-at-bldit-cctm-csh/4807/4 "2024-03-26T22:17:52Z")

</div>

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:

```auto
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.

> <https://github.com/cjcoats/ioapi-3.2/issues/3>
>
> I wasn't sure whether I should report this issue to the CMAQ or to the IOAPI Git…Hub repository. I chose to report it here and hope that it is the correct place. 
> 
> I am compiling CMAQ 5.2.1 with Intel 2015 compiler suite. By default \`-fixed -132\` is set as flags for \`\*.F\` files (when using gnu instead of intel, the corresponding flags are set). The Intel Fortran compiler assumes that the included EXT files also conform with \`-fixed -132\`. The \`STATE3.EXT\` is not fixed-132 but fixed-72 formatted. Thus, an error is thrown when the file \`pinterpb.f\` is compiled:
> 
> \`\`\`
> ftn -c -fixed -132 -O3 -fno-alias -mp1 -fp-model source -I /home/mvkdneum/CMAS/CMAQ\_v5.2.1/lib/x86\_64/intel15/ioapi/modules -I /home/mvkdneum/CMAS/CMAQ\_v5.2.1/lib/x86\_64/intel15/ioapi/include\_files -I /home/mvkdneum/CMAS/CMAQ\_v5.2.1/lib/x86\_64/intel15/mpi -I. pinterpb.f
> /home/mvkdneum/CMAS/CMAQ\_v5.2.1/lib/x86\_64/intel15/ioapi/include\_files/STATE3.EXT(174): error #5082: Syntax error, found '&' when expecting one of: \<IDENTIFIER\>
> COMMON / BSTATE3 / &
> \------------------------------------------------------------------------^
> ...
> \`\`\`
> 
> If the \`&\` is moved to column 133, the compilation works fine. I am not sure how to solve this issue in the CMAQ build script. Hence, I post it here.
> 
> I currently work on a cluster by Cray. Therefore, you see \`ftn\` (a wrapper for ifort) instead of \`ifort\`. Several relevant flags are not shown because they are included in the \`ftn\` wrapper.

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.

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [March 26, 2024, 10:42pm UTC](https://forum.cmascenter.org/t/cmaq-v5-4-error-at-bldit-cctm-csh/4807/5 "2024-03-26T22:42:47Z")

</div>

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.
