Error in compile CCTM

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

See 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.

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~

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

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!

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 (107.1 KB)

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

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

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

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

copy m3utilio.mod and matxatts.mod in /home/ensiyeh/CMAQ-5.2/lib/x86_64/intel/ioapi/include_files

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

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).

Thanks, I moved m3utilio.mod to include_files. It has been addressed!

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 anticipationpinterpb.f.txt (20.4 KB) STATE3.EXT.txt (9.6 KB) bldit_cctm.csh.txt (26.3 KB) config_cmaq.csh.txt (10.8 KB)

See the attached files.

Hi Catalyst

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

@esm,

Thanks

Here is the log file.cctm.log.txt (98.6 KB)

@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 (112.7 KB)

This issue has been resolved.

Thanks

Catalyst