# Error in compile CCTM

**URL:** <https://forum.cmascenter.org/t/error-in-compile-cctm/873>\
**Category:** Compiling\
**Created:** [August 9, 2019, 8:37pm UTC](https://forum.cmascenter.org/t/error-in-compile-cctm/873 "2019-08-09T20:37:57Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![jliu](https://avatars.discourse-cdn.com/v4/letter/j/8baadc/32.png) [@jliu](https://forum.cmascenter.org/u/jliu)\
**Post date:** [August 9, 2019, 8:37pm UTC](https://forum.cmascenter.org/t/error-in-compile-cctm/873/1 "2019-08-09T20:37:57Z")

</div>

Hi,  
I compile the CCTM, but find the errors below:

/JLIU/Build\_WRF/CMAQ/lib/x86\_64/gcc/ioapi/modules -I /kwork/JLIU/Build\_WRF/CMAQ/lib/x86\_64/gcc/ioapi/include\_files -I /kwork/JLIU/Build\_WRF/CMAQ/lib/x86\_64/gcc/mpi -I. pinterpb.f  
STATE3.EXT:174.27:  
Included at pinterpb.f:133:

```
    COMMON / BSTATE3 / &
                       1

```

Error: Syntax error in COMMON statement at (1)  
STATE3.EXT:191.27:  
Included at pinterpb.f:133:

```
    COMMON / CSTATE3 / &
                       1

```

Error: Syntax error in COMMON statement at (1)  
make: \*\*\* [pinterpb.o] Error 1  
**ERROR** while running make command

else if ( 0 ) then  
endif  
mv Makefile Makefile.gcc  
if ( -e Makefile.gcc && -e Makefile ) rm Makefile  
ln -s Makefile.gcc Makefile  
if ( 0 != 0 ) then  
if ( -e /kwork/JLIU/Build\_WRF/CMAQ/CCTM/scripts/BLD\_CCTM\_v52\_gcc/CCTM\_v52.cfg ) then  
mv CCTM\_v52.cfg.bld /kwork/JLIU/Build\_WRF/CMAQ/CCTM/scripts/BLD\_CCTM\_v52\_gcc/CCTM\_v52.cfg  
exit

---

<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:** [August 10, 2019, 1:30pm UTC](https://forum.cmascenter.org/t/error-in-compile-cctm/873/2 "2019-08-10T13:30:41Z")

</div>

See [https://www.cmascenter.org/ioapi/documentation/all\_versions/html/AVAIL.html#cmaq](https://www.cmascenter.org/ioapi/documentation/all_versions/html/AVAIL.html#cmaq):

> According to the ISO Fortran Standard, there are two “source formats” for Fortran source code – the older ( `f77` ) “fixed” format with code in columns 7-72 and continuation markers in column 6, and the ( `f90` ) “free” format, with source in columns 1-132 and ampersand (“&”) for trailing continuation markers, as well as a specification for code which is acceptable to both forms.
> 
> Since it is used by various models that use “free” format, the I/O API carefully follows the Standard in this regard, and uses the ISO-approved “both-form” format for its Fortran `INCLUDE` files.
> 
> Some of the models—in particular, CMAQ and SMOKE however, do not—instead using a non-Standard “fixed-132” format. The I/O API Makefile has a way of dealing with this; the commands
> 
> > _cd /ioapi_  
> > _make fixed\_src_
> 
> will create a new directory _ioapi/fixed\_src_ and populate it with copies of the `INCLUDE` files that have been edited to work with the non-Standard “fixed-132” format. You will need to use these `INCLUDE` files with CMAQ and SMOKE.

---

<div class="post-metadata">

**Author:** ![jliu](https://avatars.discourse-cdn.com/v4/letter/j/8baadc/32.png) [@jliu](https://forum.cmascenter.org/u/jliu)\
**Post date:** [August 10, 2019, 6:27pm UTC](https://forum.cmascenter.org/t/error-in-compile-cctm/873/3 "2019-08-10T18:27:35Z")

</div>

Thanks, but I do not quite understand. I do this, but the error is still there. Could you explain it detailed to how to fix it. thanks~

---

<div class="post-metadata">

**Author:** ![esm](https://avatars.discourse-cdn.com/v4/letter/e/f08c70/32.png) [@esm](https://forum.cmascenter.org/u/esm)\
**Post date:** [August 10, 2019, 8:10pm UTC](https://forum.cmascenter.org/t/error-in-compile-cctm/873/4 "2019-08-10T20:10:19Z")

</div>

Hi  
I think it will be better if you attach your log file, because this part isn’t enough!

---

<div class="post-metadata">

**Author:** ![esm](https://avatars.discourse-cdn.com/v4/letter/e/f08c70/32.png) [@esm](https://forum.cmascenter.org/u/esm)\
**Post date:** [August 10, 2019, 8:16pm UTC](https://forum.cmascenter.org/t/error-in-compile-cctm/873/5 "2019-08-10T20:16:19Z")

</div>

Did you modify your config\_cmaq like this?

#\> I/O API, netCDF, and MPI library locations  
setenv IOAPI\_MOD\_DIR /home/ensiyeh/LIBRARIES/ioapi-3.1/Linux2\_x86\_64gfort #\> I/O API precompiled modules  
setenv IOAPI\_INCL\_DIR /home/ensiyeh/LIBRARIES/ioapi-3.1/ioapi/fixed\_src #\> I/O API include header files  
setenv IOAPI\_LIB\_DIR /home/ensiyeh/LIBRARIES/ioapi-3.1/Linux2\_x86\_64gfort #\> I/O API libraries

I think your include directory is not right!

---

<div class="post-metadata">

**Author:** ![jliu](https://avatars.discourse-cdn.com/v4/letter/j/8baadc/32.png) [@jliu](https://forum.cmascenter.org/u/jliu)\
**Post date:** [August 10, 2019, 8:31pm UTC](https://forum.cmascenter.org/t/error-in-compile-cctm/873/6 "2019-08-10T20:31:02Z")

</div>

Yes, I modified it. please see the attached log file.

Also, this is my config\_cmaq:  
#\> I/O API, netCDF, and MPI library locations  
setenv IOAPI\_MOD\_DIR /kwork/JLIU/Build\_WRF/LIBRARIES/ioapi-3.2/Linux2\_x86\_64gfort #\> I/O API precompiled modules  
setenv IOAPI\_INCL\_DIR /kwork/JLIU/Build\_WRF/LIBRARIES/ioapi-3.2/ioapi/fixed\_src #\> I/O API include header files  
setenv IOAPI\_LIB\_DIR /kwork/JLIU/Build\_WRF/LIBRARIES/ioapi-3.2/Linux2\_x86\_64gfort #\> I/O API libraries  
setenv NETCDF\_LIB\_DIR /kwork/JLIU/Build\_WRF/LIBRARIES/netcdf/lib/ #\> netCDF directory path  
setenv NETCDF\_INCL\_DIR /kwork/JLIU/Build\_WRF/LIBRARIES/netcdf/include #\> netCDF directory path  
setenv MPI\_LIB\_DIR /kwork/JLIU/Build\_WRF/LIBRARIES/mpich/lib/ #\> MPI directory path  
setenv MPI\_INC /kwork/JLIU/Build\_WRF/LIBRARIES/mpich/include

```
    #> Compiler Aliases and Flags
    setenv myFC mpif90
    #setenv myFC mpifort
    setenv myCC gcc
    setenv myFSTD "-O3 -funroll-loops -finit-character=32 -Wtabs -Wsurprising"
    setenv myDBG "-Wall -O0 -g -fcheck=all -ffpe-trap=invalid,zero,overflow -fbacktrace"
    #setenv myDBG "$myDBG -fimplicit-none"
    setenv myFFLAGS "-ffixed-form -ffixed-line-length-132 -funroll-loops -finit-character=32"
    setenv myFRFLAGS "-ffree-form -ffree-line-length-none -funroll-loops -finit-character=32"
    setenv myCFLAGS "-O2"
    setenv myLINK_FLAG "-fopenmp"
    #setenv extra_lib "$extra_lib -lgomp"
    setenv extra_lib ""
    #setenv mpi_lib "-lmpi_mpifh" #> -lmpich for mvapich or -lmpi for openmpi
    setenv mpi_lib "-lmpich" #> -lmpich for mvapich or -lmpi for openmpi

```

[build\_cctm.txt](https://forum.cmascenter.org/uploads/short-url/vPHVtDCMAyv63p9SVtP9tDivv4T.txt) (107.1 KB)

---

<div class="post-metadata">

**Author:** ![esm](https://avatars.discourse-cdn.com/v4/letter/e/f08c70/32.png) [@esm](https://forum.cmascenter.org/u/esm)\
**Post date:** [August 10, 2019, 8:42pm UTC](https://forum.cmascenter.org/t/error-in-compile-cctm/873/7 "2019-08-10T20:42:25Z")

</div>

Did you compile BCON, ICON, and MCIP without any error?

---

<div class="post-metadata">

**Author:** ![esm](https://avatars.discourse-cdn.com/v4/letter/e/f08c70/32.png) [@esm](https://forum.cmascenter.org/u/esm)\
**Post date:** [August 10, 2019, 8:44pm UTC](https://forum.cmascenter.org/t/error-in-compile-cctm/873/8 "2019-08-10T20:44:42Z")

</div>

> [@jliu](#):
>
> #setenv mpi\_lib “-lmpi\_mpifh” #\> -lmpich for mvapich or -lmpi for openmpi setenv mpi\_lib “-lmpich” #\> -lmpich for mvapich or -lmpi for openmpi

I use gcc and mpich, but I modified my scritps as:

#\> Compiler Aliases and Flags  
setenv myFC gfortran  
#setenv myFC mpifort  
setenv myCC gcc  
setenv myFSTD “-O3 -funroll-loops -finit-character=32 -Wtabs -Wsurprising”  
setenv myDBG “-Wall -O0 -g -fcheck=all -ffpe-trap=invalid,zero,overflow -fbacktrace”  
#setenv myDBG “$myDBG -fimplicit-none”  
setenv myFFLAGS “-ffixed-form -ffixed-line-length-132 -funroll-loops -finit-character=32”  
setenv myFRFLAGS “-ffree-form -ffree-line-length-none -funroll-loops -finit-character=32”  
setenv myCFLAGS “-O2”  
setenv myLINK\_FLAG “-fopenmp”  
setenv extra\_lib “”  
#setenv mpi\_lib “-lmpi\_mpifh” #\> -lmpich for mvapich or -lmpi for openmpi  
setenv mpi\_lib “-lmpich -lmpl” #\> -lmpich for mvapich or -lmpi for openmpi

---

<div class="post-metadata">

**Author:** ![esm](https://avatars.discourse-cdn.com/v4/letter/e/f08c70/32.png) [@esm](https://forum.cmascenter.org/u/esm)\
**Post date:** [August 10, 2019, 8:48pm UTC](https://forum.cmascenter.org/t/error-in-compile-cctm/873/9 "2019-08-10T20:48:19Z")

</div>

When I wanted to compile CCTM, I copied mpich/include and mpich/lib into cmaq/lib/…gcc/mpich.

---

<div class="post-metadata">

**Author:** ![jliu](https://avatars.discourse-cdn.com/v4/letter/j/8baadc/32.png) [@jliu](https://forum.cmascenter.org/u/jliu)\
**Post date:** [September 23, 2019, 5:24pm UTC](https://forum.cmascenter.org/t/error-in-compile-cctm/873/10 "2019-09-23T17:24:45Z")

</div>

> [@cjcoats](#):
>
> ixed-132

there are no errors for BCON and ICON, but errors for MCIP:  
Here is error for MCIP, do you know the reason? Thanks~

mcipparm\_mod.f90:126.6:

USE m3utilio, ONLY: mxdesc3  
1  
Fatal Error: Can’t open module file ‘m3utilio.mod’ for reading at (1): No such file or directory  
make[1]: \*\*\* [mcipparm\_mod.o] Error 1  
make: \*\*\* [all] Error 2

---

<div class="post-metadata">

**Author:** ![esm](https://avatars.discourse-cdn.com/v4/letter/e/f08c70/32.png) [@esm](https://forum.cmascenter.org/u/esm)\
**Post date:** [September 23, 2019, 5:39pm UTC](https://forum.cmascenter.org/t/error-in-compile-cctm/873/11 "2019-09-23T17:39:44Z")

</div>

copy m3utilio.mod and matxatts.mod in /home/ensiyeh/CMAQ-5.2/lib/x86\_64/intel/ioapi/include\_files

---

<div class="post-metadata">

**Author:** ![jliu](https://avatars.discourse-cdn.com/v4/letter/j/8baadc/32.png) [@jliu](https://forum.cmascenter.org/u/jliu)\
**Post date:** [September 23, 2019, 5:59pm UTC](https://forum.cmascenter.org/t/error-in-compile-cctm/873/12 "2019-09-23T17:59:58Z")

</div>

I find the m3utilio.mod, but there is no matxatts.mod in any fold of IOAPI

---

<div class="post-metadata">

**Author:** ![esm](https://avatars.discourse-cdn.com/v4/letter/e/f08c70/32.png) [@esm](https://forum.cmascenter.org/u/esm)\
**Post date:** [September 23, 2019, 7:23pm UTC](https://forum.cmascenter.org/t/error-in-compile-cctm/873/13 "2019-09-23T19:23:48Z")

</div>

I installed IOAPI 3.1 and told you according to that. You can find them in the install directory (for me: Linux2\_x86\_64ifort directory).

---

<div class="post-metadata">

**Author:** ![jliu](https://avatars.discourse-cdn.com/v4/letter/j/8baadc/32.png) [@jliu](https://forum.cmascenter.org/u/jliu)\
**Post date:** [September 23, 2019, 8:28pm UTC](https://forum.cmascenter.org/t/error-in-compile-cctm/873/14 "2019-09-23T20:28:46Z")

</div>

> [@jliu](#):
>
> m3utilio.mod

Thanks, I moved m3utilio.mod to include\_files. It has been addressed！

---

<div class="post-metadata">

**Author:** ![Catalyst2682](https://avatars.discourse-cdn.com/v4/letter/c/a6a055/32.png) [@Catalyst2682](https://forum.cmascenter.org/u/Catalyst2682)\
**Post date:** [April 18, 2020, 8:02pm UTC](https://forum.cmascenter.org/t/error-in-compile-cctm/873/15 "2020-04-18T20:02:52Z")

</div>

Dear @jliu, @esm , @lizadams, @lizadams_3, @wong.david-c

I am having similar problem as shown below:

mpifort -c -ffixed-form -ffixed-line-length-132 -funroll-loops -finit-character=32 -O3 -funroll-loops -finit-character=32 -Wtabs -Wsurprising -I /home/catalyst/Desktop/Build\_WRF/CMAQ-5.2/lib/x86\_64/gcc7.3.0/ioapi/modules -I /home/catalyst/Desktop/Build\_WRF/CMAQ-5.2/lib/x86\_64/gcc7.3.0/ioapi/include\_files -I /home/catalyst/Desktop/Build\_WRF/CMAQ-5.2/lib/x86\_64/gcc7.3.0/mpi -I. pinterpb.f  
STATE3.EXT:174:27:

Error: Syntax error in COMMON statement at (1)  
STATE3.EXT:191:27:

Error: Syntax error in COMMON statement at (1)  
Makefile:408: recipe for target ‘pinterpb.o’ failed  
make: \*\*\* [pinterpb.o] Error 1  
**ERROR** while running make command

else if ( 0 ) then  
endif  
mv Makefile Makefile.gcc7.3.0  
if ( -e Makefile.gcc7.3.0 && -e Makefile ) rm Makefile  
ln -s Makefile.gcc7.3.0 Makefile  
if ( 0 != 0 ) then  
if ( -e /home/catalyst/Desktop/Build\_WRF/CMAQ-5.2/CCTM/scripts/BLD\_CCTM\_v52\_saprc07tic\_ae6i\_aq\_gcc7.3.0/CCTM\_v52.cfg ) then  
mv CCTM\_v52.cfg.bld /home/catalyst/Desktop/Build\_WRF/CMAQ-5.2/CCTM/scripts/BLD\_CCTM\_v52\_saprc07tic\_ae6i\_aq\_gcc7.3.0/CCTM\_v52.cfg

Please, how did you solve this issue?

Thanks in anticipation[pinterpb.f.txt](https://forum.cmascenter.org/uploads/short-url/szQCJ7shSajKhIvw2HbUmoOw9kZ.txt) (20.4 KB) [STATE3.EXT.txt](https://forum.cmascenter.org/uploads/short-url/n8JF1NuC8Tw6950VzCYZzr7rHp9.txt) (9.6 KB) [bldit\_cctm.csh.txt](https://forum.cmascenter.org/uploads/short-url/p13TJg3puL0xKgs8zRjwKDBrU70.txt) (26.3 KB) [config\_cmaq.csh.txt](https://forum.cmascenter.org/uploads/short-url/8D8EvpJQ877OHrWCuBQEDZJ2Xxo.txt) (10.8 KB)

See the attached files.

---

<div class="post-metadata">

**Author:** ![esm](https://avatars.discourse-cdn.com/v4/letter/e/f08c70/32.png) [@esm](https://forum.cmascenter.org/u/esm)\
**Post date:** [April 18, 2020, 8:25pm UTC](https://forum.cmascenter.org/t/error-in-compile-cctm/873/16 "2020-04-18T20:25:34Z")

</div>

> [@Catalyst2682](#):
>
> pinterpb.o

Hi Catalyst

Could you send the log file of compiling CCTM, please?

---

<div class="post-metadata">

**Author:** ![Catalyst2682](https://avatars.discourse-cdn.com/v4/letter/c/a6a055/32.png) [@Catalyst2682](https://forum.cmascenter.org/u/Catalyst2682)\
**Post date:** [April 18, 2020, 8:41pm UTC](https://forum.cmascenter.org/t/error-in-compile-cctm/873/17 "2020-04-18T20:41:31Z")

</div>

@esm,

Thanks

Here is the log file.[cctm.log.txt](https://forum.cmascenter.org/uploads/short-url/m1dT2o4JckSk7QlBZjQQREpCsFO.txt) (98.6 KB)

---

<div class="post-metadata">

**Author:** ![Catalyst2682](https://avatars.discourse-cdn.com/v4/letter/c/a6a055/32.png) [@Catalyst2682](https://forum.cmascenter.org/u/Catalyst2682)\
**Post date:** [April 18, 2020, 11:09pm UTC](https://forum.cmascenter.org/t/error-in-compile-cctm/873/20 "2020-04-18T23:09:18Z")

</div>

@jliu,

Please, how did you solve this issue? Kindly help. @lizadams, @cjcoats, @wong.david-c

Thanks in anticipation. Attached is the log file of the cctm.

[cctm.log.txt](https://forum.cmascenter.org/uploads/short-url/zMVeNcT5z0ReRlFQtLf3V4YVzQg.txt) (112.7 KB)

---

<div class="post-metadata">

**Author:** ![Catalyst2682](https://avatars.discourse-cdn.com/v4/letter/c/a6a055/32.png) [@Catalyst2682](https://forum.cmascenter.org/u/Catalyst2682)\
**Post date:** [April 19, 2020, 9:30am UTC](https://forum.cmascenter.org/t/error-in-compile-cctm/873/21 "2020-04-19T09:30:52Z")

</div>

This issue has been resolved.

Thanks

Catalyst
