Compiling CMAQ on Cheyenne at NCAR

Hi Guys,

I tried to compile CMAQ on Cheyenne in NCAR.
My ioapi version is 3.1, the compiler is intel, and the related environment settings in config_cmaq.csh (line 80-105) is:

case intel:

    #> I/O API, netCDF, and MPI library locations
    setenv IOAPI_INCL_DIR   /glade/scratch/chengpin/ioapi_3_1/Linux2_x86_64ifort     #ioapi_inc_intel  #> I/O API include header files
    setenv IOAPI_LIB_DIR    /glade/scratch/chengpin/ioapi_3_1/Linux2_x86_64ifort     #> I/O API libraries
    setenv NETCDF_LIB_DIR   /glade/u/apps/ch/opt/netcdf/4.7.4/intel/19.0.5/lib       #netcdf_lib_intel   #> netCDF C directory path
    setenv NETCDF_INCL_DIR  /glade/u/apps/ch/opt/netcdf/4.7.4/intel/19.0.5/include   #> netCDF C directory path
    setenv NETCDFF_LIB_DIR  /glade/u/apps/ch/opt/netcdf/4.7.4/intel/19.0.5/lib       #> netCDF Fortran directory path
    setenv NETCDFF_INCL_DIR /glade/u/apps/ch/opt/netcdf/4.7.4/intel/19.0.5/include   #> netCDF Fortran directory path
    setenv MPI_LIB_DIR      /glade/u/apps/ch/opt/mpt/2.22                            #> MPI directory path

    #> Compiler Aliases and Flags
    #> set the compiler flag -qopt-report=5 to get a model optimization report in the build directory with the optrpt extension
    setenv myFC ifort
    setenv myCC icc
    setenv myFSTD "-O3 -fno-alias -mp1 -fp-model source -ftz -simd -align all -xHost -vec-guard-write -unroll-aggressive"
    setenv myDBG  "-O0 -g -check bounds -check uninit -fpe0 -fno-alias -ftrapuv -traceback"
    setenv myLINK_FLAG #"-qopenmp-simd" openMP not supported w/ CMAQ
    setenv myFFLAGS "-fixed -132"
    setenv myFRFLAGS "-free"
    setenv myCFLAGS "-O2"
    setenv extra_lib "-lcurl"
    #chsetenv extra_lib ""
    setenv mpi_lib "-lmpich"    #> No Library specification needed for mpiifort
                         #> -lmpich for mvapich
                         #> -lmpi for openmpi

And I ./bldit_cctm.csh under /CCTM/scripts, some error messages occurred, which is:

ptrwrite3.f(65): error #5102: Cannot open include file ‘STATE3.EXT’
INCLUDE ‘STATE3.EXT’
--------------^
ptrwrite3.f(116): error #6404: This name does not have a type, and must have an explicit type. [FINIT3]
IF ( .NOT. FINIT3 ) THEN
-----------------^
ptrwrite3.f(118): error #6404: This name does not have a type, and must have an explicit type. [LOGDEV]
WRITE( LOGDEV,91010 ) ‘WRITE3(): I/O API not yet initialized.’
----------------^
ptrwrite3.f(141): error #6404: This name does not have a type, and must have an explicit type. [COUNT3]
FID = INDEX1 ( FIL16, COUNT3, FLIST3 )
------------------------------^
ptrwrite3.f(141): error #6404: This name does not have a type, and must have an explicit type. [FLIST3]
FID = INDEX1 ( FIL16, COUNT3, FLIST3 )
--------------------------------------^
ptrwrite3.f(151): error #6404: This name does not have a type, and must have an explicit type. [SDATE3]
STEP = JSTEP3 ( JDATE, JTIME, SDATE3( FID ), STIME3( FID ),
---------------------------------------^
ptrwrite3.f(151): error #6404: This name does not have a type, and must have an explicit type. [STIME3]
STEP = JSTEP3 ( JDATE, JTIME, SDATE3( FID ), STIME3( FID ),
------------------------------------------------------^
ptrwrite3.f(152): error #6404: This name does not have a type, and must have an explicit type. [TSTEP3]
& ABS( TSTEP3( FID ) ) )
------------------------------^
ptrwrite3.f(152): warning #7319: This argument’s data type is incompatible with this intrinsic procedure; procedure assumed EXTERNAL. [ABS]
& ABS( TSTEP3( FID ) ) )
------------------------------^
ptrwrite3.f(152): error #6404: This name does not have a type, and must have an explicit type. [ABS]
& ABS( TSTEP3( FID ) ) )
-------------------------^
ptrwrite3.f(288): error #6410: This name has not been declared as an array or a function. [MXREC3]
MXREC3( FID ) = MAX( MXREC3( FID ), ABS( STEP ) )
---------^
ptrwrite3.f(288): warning #7319: This argument’s data type is incompatible with this intrinsic procedure; procedure assumed EXTERNAL. [MAX]
MXREC3( FID ) = MAX( MXREC3( FID ), ABS( STEP ) )
------------------------------^
ptrwrite3.f(288): error #6404: This name does not have a type, and must have an explicit type. [MAX]
MXREC3( FID ) = MAX( MXREC3( FID ), ABS( STEP ) )
-------------------------^
compilation aborted for ptrwrite3.f (code 1)
Makefile:448: recipe for target ‘ptrwrite3.o’ failed
make: *** [ptrwrite3.o] Error 1
make: *** Waiting for unfinished jobs…
pshut3.F(53): error #5102: Cannot open include file ‘STATE3.EXT’
INCLUDE ‘STATE3.EXT’
----------------^
pshut3.F(72): error #6404: This name does not have a type, and must have an explicit type. [FINIT3]
IF (.NOT. FINIT3) THEN
------------------^
pshut3.F(82): error #6404: This name does not have a type, and must have an explicit type. [COUNT3]
DO FILE = 1, COUNT3
---------------------^
pshut3.F(84): error #6404: This name does not have a type, and must have an explicit type. [CDFID3]
FID = CDFID3(FILE)
-----------------^
pshut3.F(86): error #6404: This name does not have a type, and must have an explicit type. [FLIST3]
IF ((FID .GE. 0) .AND. (FLIST3(FILE) .NE. CMISS3)) THEN
-----------------------------------^
pshut3.F(86): warning #6043: This Hollerith or character constant is too long and cannot be used in the current numeric context. [’???’]
IF ((FID .GE. 0) .AND. (FLIST3(FILE) .NE. CMISS3)) THEN
-----------------------------------------------------^
pshut3.F(99): error #6404: This name does not have a type, and must have an explicit type. [FTYPE3]
IF( FTYPE3( FILE ) .EQ. LOC_MPIGRD3 ) THEN
------------------^
pshut3.F(118): error #6404: This name does not have a type, and must have an explicit type. [LOGDEV]
WRITE( LOGDEV,91010 )
------------------------------^
pshut3.F(120): error #6054: A CHARACTER data type is required in this context. [FLIST3]
& ‘File name: ’ // FLIST3( FILE ) ,
-----------------------------------------^
pshut3.F(128): error #6410: This name has not been declared as an array or a function. [FLIST3]
FLIST3(FILE) = CMISS3
-----------^
pshut3.F(129): error #6404: This name does not have a type, and must have an explicit type. [NVARS3]
DO V = 1, NVARS3( FILE )
---------------------^
pshut3.F(130): error #6410: This name has not been declared as an array or a function. [ILAST3]
ILAST3(V,FILE) = IMISS3
--------------^
pshut3.F(131): error #6410: This name has not been declared as an array or a function. [LDATE3]
LDATE3(V,FILE) = IMISS3
--------------^
pshut3.F(132): error #6410: This name has not been declared as an array or a function. [LTIME3]
LTIME3(V,FILE) = IMISS3
--------------^
pshut3.F(133): error #6410: This name has not been declared as an array or a function. [NDATE3]
NDATE3(V,FILE) = IMISS3
--------------^
pshut3.F(134): error #6410: This name has not been declared as an array or a function. [NTIME3]
NTIME3(V,FILE) = IMISS3
--------------^
pshut3.F(140): error #6303: The assignment operation or the binary expression operation is invalid for the data types of the two operands.
FINIT3 = .FALSE.
-----------------^
compilation aborted for pshut3.F (code 1)
Makefile:445: recipe for target ‘pshut3.o’ failed
make: *** [pshut3.o] Error 1
pwrite3.f(62): error #5102: Cannot open include file ‘STATE3.EXT’
INCLUDE ‘STATE3.EXT’
--------------^
pwrite3.f(114): error #6404: This name does not have a type, and must have an explicit type. [FINIT3]
IF ( .NOT. FINIT3 ) THEN
-----------------^
pwrite3.f(116): error #6404: This name does not have a type, and must have an explicit type. [LOGDEV]
WRITE( LOGDEV,91010 ) ‘WRITE3(): I/O API not yet initialized.’
----------------^
pwrite3.f(142): error #6404: This name does not have a type, and must have an explicit type. [COUNT3]
FID = INDEX1 ( FIL16, COUNT3, FLIST3 )
------------------------------^
pwrite3.f(142): error #6404: This name does not have a type, and must have an explicit type. [FLIST3]
FID = INDEX1 ( FIL16, COUNT3, FLIST3 )
--------------------------------------^
pwrite3.f(152): error #6404: This name does not have a type, and must have an explicit type. [SDATE3]
STEP = JSTEP3 ( JDATE, JTIME, SDATE3( FID ), STIME3( FID ),
---------------------------------------^
pwrite3.f(152): error #6404: This name does not have a type, and must have an explicit type. [STIME3]
STEP = JSTEP3 ( JDATE, JTIME, SDATE3( FID ), STIME3( FID ),
------------------------------------------------------^
pwrite3.f(153): error #6404: This name does not have a type, and must have an explicit type. [TSTEP3]
& ABS( TSTEP3( FID ) ) )
------------------------------^
pwrite3.f(153): warning #7319: This argument’s data type is incompatible with this intrinsic procedure; procedure assumed EXTERNAL. [ABS]
& ABS( TSTEP3( FID ) ) )
------------------------------^
pwrite3.f(153): error #6404: This name does not have a type, and must have an explicit type. [ABS]
& ABS( TSTEP3( FID ) ) )
-------------------------^
pwrite3.f(300): error #6410: This name has not been declared as an array or a function. [MXREC3]
MXREC3( FID ) = MAX( MXREC3( FID ), ABS( STEP ) )
---------^
pwrite3.f(300): warning #7319: This argument’s data type is incompatible with this intrinsic procedure; procedure assumed EXTERNAL. [MAX]
MXREC3( FID ) = MAX( MXREC3( FID ), ABS( STEP ) )
------------------------------^
pwrite3.f(300): error #6404: This name does not have a type, and must have an explicit type. [MAX]
MXREC3( FID ) = MAX( MXREC3( FID ), ABS( STEP ) )
-------------------------^
compilation aborted for pwrite3.f (code 1)
Makefile:448: recipe for target ‘pwrite3.o’ failed
make: *** [pwrite3.o] Error 1
CSQY_DATA.F(524): remark #8291: Recommended relationship between field width ‘W’ and the number of fractional digits ‘D’ in this edit descriptor is ‘W>=D+7’.
READ( PHOTAB_UNIT,’(A16,7X,F8.3,1X,40(1PE12.6,2X))’ )
-----------------------------------------------------^
CSQY_DATA.F(540): remark #8291: Recommended relationship between field width ‘W’ and the number of fractional digits ‘D’ in this edit descriptor is ‘W>=D+7’.
READ( PHOTAB_UNIT,’(A16,7X,F8.3,1X,40(1PE12.6,2X))’ )
-----------------------------------------------------^
CSQY_DATA.F(577): remark #8291: Recommended relationship between field width ‘W’ and the number of fractional digits ‘D’ in this edit descriptor is ‘W>=D+7’.
READ( PHOTAB_UNIT,’(A16,7X,F8.3,1X,40(1PE12.6,2X))’ )
--------------------------------------------------^
CSQY_DATA.F(1247): remark #8291: Recommended relationship between field width ‘W’ and the number of fractional digits ‘D’ in this edit descriptor is ‘W>=D+7’.
READ( OPTICS_UNIT,’(A30,1X,40(1PE12.6,2X))’ ) LAND_EXPECT,
------------------------------------------^
ERROR while running make command

I think some command was missing for ptrwrite3.o & pshut3.o, but I am not sure.
Did anyone have the same issue with Cheyenne?
Thanks.

Before we get started here: For netCDF4, you must be using I/O API 3.2. See https://cjcoats.github.io/ioapi/NEWSTUFF.html#oct302015:

Recent (post-4.4) versions of netCDF-Fortran have dropped the NC*() interfaces used; a major and tedious re-write was necessary to re-cast all 800+ NC*() calls in terms of netCDF-3-style NF_*() interfaces

For compile errors, always include the complete command line for the compile command that failed.,

In this case, you must be missing an include-path directive to the correct I/O API INCLUDE-files: Since CMAQ uses a non-Standard “fixed-132” source format, this is the ioapi/fixed_src directory in your I/O API installation. Typically, this directive in your command line might be something like

-I${HOME}/Models/ioapi-3.2/ioapi/fixed_src

.

Hi cjcoats,

Thanks for your suggestion. I have compiled ioapi 3.2 with pgi compiler, and set the environment in cmaq_config.sh as showed

case pgi:

    #> I/O API, netCDF, and MPI library locations
    setenv IOAPI_INCL_DIR   /glade/scratch/chengpin/ioapi-3.2/Linux4_x86_64pg   #> I/O API include header files
    setenv IOAPI_LIB_DIR    /glade/scratch/chengpin/ioapi-3.2/Linux4_x86_64pg   #> I/O API libraries
    setenv NETCDF_LIB_DIR   /glade/u/apps/ch/opt/netcdf/4.7.4/intel/19.0.5/lib  #> netCDF C directory path
    setenv NETCDF_INCL_DIR  /glade/u/apps/ch/opt/netcdf/4.7.4/intel/19.0.5/include  #> netCDF C directory path
    setenv NETCDFF_LIB_DIR  /glade/u/apps/ch/opt/netcdf/4.7.4/intel/19.0.5/lib #> netCDF Fortran directory path
    setenv NETCDFF_INCL_DIR /glade/u/apps/ch/opt/netcdf/4.7.4/intel/19.0.5/include #> netCDF Fortran directory path
    setenv MPI_LIB_DIR      /glade/u/apps/ch/opt/mpt/2.22    #> MPI directory path

    #> Compiler Aliases and Flags
    setenv myFC ifort
    setenv myCC pgcc
    setenv myLINK_FLAG # "-mp" openMP not supported w/ CMAQ
    setenv myFSTD "-O3"
    setenv myDBG  "-O0 -g -Mbounds -Mchkptr -traceback -Ktrap=fp"
    setenv myFFLAGS "-Mfixed -Mextend -mcmodel=medium -tp px"
    setenv myFRFLAGS "-Mfree -Mextend -mcmodel=medium -tp px"
    setenv myCFLAGS "-O2"
    #setenv extra_lib "-lextra"
    #setenv mpi_lib "-lmpi"   #> -lmpich for mvapich or -lmpi for openmpi
    setenv extra_lib "-lcurl"
    setenv mpi_lib "-lmpich"   #> -lmpich for mvapich or -lmpi for openmpi

    breaksw

I also tried to modified the directory to /glade/scratch/chengpin/ioapi-3.2/Linux4_x86_64pg/ioapi/fixed_src as your suggestion, and there are still some issues when compiling CCTM.

I show error message part in the log file here.

if ( 1 || ! -f /glade/scratch/chengpin/CMAQ_REPO/UTIL/bldmake/bldmake_pgi.exe ) then
cd /glade/scratch/chengpin/CMAQ_REPO/UTIL/bldmake/scripts
./bldit_bldmake.csh
rm: No match.
ifort: command line warning #10006: ignoring unknown option ‘-Mfixed’
ifort: command line warning #10006: ignoring unknown option ‘-Mextend’
ifort: command line remark #10148: option ‘-tp px’ not supported
cfg_module.f(47): error #5120: Unterminated character constant
& (/ '.F ', '.f ', '.c ', ‘.F90’, ‘.f90’ /)
-------------------------------------------------------------------^
cfg_module.f(47): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: , : (/ /)
& (/ '.F ', ‘.f ‘, ‘.c ‘, ‘.F90’, ‘.f90’ /)
----------------------------------------------------------------------------^
cfg_module.f(246): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: :: ) ( , : * . % + - [ . = ** / // .LT. < .LE. <= .EQ. == …
If ( (Len_Trim(record) + Len_Trim(nextrecord)) .Ge. (Len(record)) ) Then
----------------------------------------------------------------------------------^
cfg_module.f(247): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ) ,
Write(*,’(//“ERROR The maximum record length exceeded”)’)
-------------------------------------------------------------------------^
cfg_module.f(287): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: :: ) ( , : * <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> …
If ( verbose ) Write( *, ‘("make options set to ",a)’ ) Trim( make_options )
--------------------------------------------------------------------------------------^
cfg_module.f(301): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: :: ) ( , : * . % + - [ . = ** / // .LT. < .LE. <= .EQ. == …
If ( verbose ) Write( *, ‘("Repository set to ",a)’ ) Trim( repo )
----------------------------------------------------------------------------^
cfg_module.f(308): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: :: ) ( , : * . % + - [ . = ** / // .LT. < .LE. <= .EQ. == …
If ( verbose ) Write( *, ‘("Mechanism set to ",a)’ ) Trim( mechanism )
--------------------------------------------------------------------------------^
cfg_module.f(315): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: :: ) ( , : * . % + - [ . = ** / // .LT. < .LE. <= .EQ. == …
If ( verbose ) Write( *, ‘("LIB_BASE set to ",a)’ ) Trim( lib_base )
------------------------------------------------------------------------------^
cfg_module.f(354): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: :: ) ( , : * . % + - [ . = ** / // .LT. < .LE. <= .EQ. == …
If ( verbose ) Write( *, ‘("F_COMPILER set to ",a)’ ) Trim( f_compiler )
----------------------------------------------------------------------------------^
cfg_module.f(373): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: :: ) ( , : * . % + - [ . = ** / // .LT. < .LE. <= .EQ. == …
If ( verbose ) Write( *, ‘("f_flags set to ",a)’ ) Trim( f_flags )
----------------------------------------------------------------------------^
cfg_module.f(379): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: :: ) ( , : * . % + - [ . = ** / // .LT. < .LE. <= .EQ. == …
If ( verbose ) Write( *, ‘("f90_flags set to ",a)’ ) Trim( f90_flags )
--------------------------------------------------------------------------------^
cfg_module.f(386): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: :: ) ( , : * . % + - [ . = ** / // .LT. < .LE. <= .EQ. == …
If ( verbose ) Write( *, ‘("C_COMPILER set to ",a)’ ) Trim( c_compiler )
----------------------------------------------------------------------------------^
cfg_module.f(392): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: :: ) ( , : * . % + - [ . = ** / // .LT. < .LE. <= .EQ. == …
If ( verbose ) Write( *, ‘("C_FLAGS set to ",a)’ ) Trim( c_flags )
----------------------------------------------------------------------------^
cfg_module.f(405): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: :: ) ( , : * . % + - [ . = ** / // .LT. < .LE. <= .EQ. == …
If ( verbose ) Write( *, ‘("CPP_FLAGS set to ",a)’ ) Trim( cpp_flags )
--------------------------------------------------------------------------------^
cfg_module.f(412): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: :: ) ( , : * . % + - [ . = ** / // .LT. < .LE. <= .EQ. == …
If ( verbose ) Write( *, ‘("LINKER set to ",a)’ ) Trim( linker )
--------------------------------------------------------------------------^
cfg_module.f(418): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: :: ) ( , : * . % + - [ . = ** / // .LT. < .LE. <= .EQ. == …
If ( verbose ) Write( *, ‘("LINK_FLAGS set to ",a)’ ) Trim( link_flags )
----------------------------------------------------------------------------------^
cfg_module.f(430): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: :: ) ( , : * . % + - [ . = ** / // .LT. < .LE. <= .EQ. == …
If ( verbose ) Write( *, ‘("NETCDF set to ",a)’ ) Trim( netcdf )
--------------------------------------------------------------------------^
cfg_module.f(432): catastrophic error: Too many errors, exiting
compilation aborted for cfg_module.f (code 1)
ifort: command line warning #10006: ignoring unknown option ‘-Mfixed’
ifort: command line warning #10006: ignoring unknown option ‘-Mextend’
ifort: command line remark #10148: option ‘-tp px’ not supported
bldmake.f(73): error #5120: Unterminated character constant
If ( status .ne. 0 ) Call error_msg( ‘Cannot create FILE [Makefile]’ )
-------------------------------------------^
bldmake.f(73): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: :: ) , :
If ( status .ne. 0 ) Call error_msg( ‘Cannot create FILE [Makefile]’ )
----------------------------------------------------------------------------^
bldmake.f(147): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: :: ) ( , : * . % + - [ . = ** / // .LT. < .LE. <= .EQ. == …
Call help_msg(‘Invalid configuration file argument:’ // Trim( cfgFile ) )
---------------------------------------------------------------------------------^
bldmake.f(161): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: :: ) ( , : * . % + - [ . = ** / // .LT. < .LE. <= .EQ. == …
Call help_msg(‘Invalid arguments on command line:’ // Trim( argv ) )
------------------------------------------------------------------------------^
bldmake.f(208): error #5120: Unterminated character constant
Call help_msg( ‘Invalid arguments [’ // Trim(argv) // ‘] on command line’ )
--------------------------------------------------------------^
bldmake.f(208): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: :: ) , :
Call help_msg( ‘Invalid arguments [’ // Trim(argv) // ‘] on command line’ )
-----------------------------------------------------------------------------------^
bldmake.f(225): error #5082: Syntax error, found IDENTIFIER ‘DATEVALUES’ when expecting one of: :: ) ( , : * ; . (/ + - ] /) ’ ** > PRIVATE / …
& dateValues( 2 ), dateValues( 3 ), dateValues( 1 ),
---------^
bldmake.f(250): error #5120: Unterminated character constant
Write( ,’(" -git_local Does NOT copy source files to BLD directory")’ )
-----------------^
bldmake.f(250): error #5082: Syntax error, found ‘’’ when expecting one of: ( * <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> …
Write( ,’(" -git_local Does NOT copy source files to BLD directory")’ )
---------------^
bldmake.f(252): error #5120: Unterminated character constant
Write( ,’(" -debug_cctm Execute make with DEBUG option set to TRUE")’ )
-----------------^
bldmake.f(252): error #5082: Syntax error, found ‘’’ when expecting one of: ( * <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> …
Write( ,’(" -debug_cctm Execute make with DEBUG option set to TRUE")’ )
---------------^
bldmake.f(253): error #5120: Unterminated character constant
Write( ,’(" -isam_cctm Execute make with ISAM option set to TRUE")’ )
-----------------^
bldmake.f(253): error #5082: Syntax error, found ‘’’ when expecting one of: ( * <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> …
Write( ,’(" -isam_cctm Execute make with ISAM option set to TRUE")’ )
---------------^
bldmake.f(293): error #5120: Unterminated character constant
Write( lfn, ‘("# Makefile generated for serial execution using program bldmake")’ )
-----------------------^
bldmake.f(293): error #5082: Syntax error, found ‘’’ when expecting one of: ( * <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> …
Write( lfn, ‘("# Makefile generated for serial execution using program bldmake")’ )
---------------------^
bldmake.f(295): error #5120: Unterminated character constant
Write( lfn, ‘("# Makefile generated for parallel execution using program bldmake")’ )
-----------------------^
bldmake.f(295): error #5082: Syntax error, found ‘’’ when expecting one of: ( * <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> …
Write( lfn, ‘("# Makefile generated for parallel execution using program bldmake")’ )
---------------------^
bldmake.f(298): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: :: ) ( , : * . % + - [ . = ** / // .LT. < .LE. <= .EQ. == …
Write( lfn, ‘("# Generation date [",a,"]")’ ) Trim( currentDate )
------------------------------------------------------------------------------^
bldmake.f(299): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: :: ) ( , : * . % + - [ . = ** / // .LT. < .LE. <= .EQ. == …
Write( lfn, ‘("# Configuration file [",a,"]")’ ) Trim( cfgFile )
--------------------------------------------------------------------------^
bldmake.f(302): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: :: ) ( , : * . % + - [ . = ** / // .LT. < .LE. <= .EQ. == …
& Write( lfn, ‘("# With mechanism [",a,"]")’ ) Trim( mechanism )
----------------------------------------------------------------------------^
bldmake.f(307): error #5120: Unterminated character constant
Write( lfn, ‘("# Full Compiler Paths when Makefile was Built:")’ )
-----------------------^
bldmake.f(309): catastrophic error: Too many errors, exiting
compilation aborted for bldmake.f (code 1)
ifort: command line warning #10006: ignoring unknown option ‘-Mfixed’
ifort: command line warning #10006: ignoring unknown option ‘-Mextend’
ifort: command line remark #10148: option ‘-tp px’ not supported
parser.f(107): error #6404: This name does not have a type, and must have an explicit type. [NFIELD]
If ( Index( delimiter, record( i:i ) ) .Gt. 0 ) nfields = nfields+1
------------------------------------------------------------------^
parser.f(213): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ) ,
Subroutine getParsedField( record, delimiter, nth, field, includeDel )
----------------------------------------------------------------------------^
parser.f(213): error #6404: This name does not have a type, and must have an explicit type. [INCLUDED]
Subroutine getParsedField( record, delimiter, nth, field, includeDel )
----------------------------------------------------------------^
parser.f(313): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( : % [ . = =>
If ( string( 1:1 ) .Ne. ‘"’ .And. string( last:last ) .Ne. ‘"’ ) Return
-----------------------------------------------------------------------------^
parser.f(313): error #6343: The statement following the Logical IF statement is invalid.
If ( string( 1:1 ) .Ne. ‘"’ .And. string( last:last ) .Ne. ‘"’ ) Return
------^
parser.f(355): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> <INTEGER_CONSTANT> …
If ( infield .And. string( i:i ) .Eq. inchar ) string( i:i ) = outchar
-------------------------------------------------------------------------------^
parser.f(376): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> <INTEGER_CONSTANT> …
if ( ( k .Ge. 97 ) .And. ( k .Le. 122 ) ) str( i:i ) = Char( k - 32 )
-----------------------------------------------------------------------------^
compilation aborted for parser.f (code 1)
ifort: command line warning #10006: ignoring unknown option ‘-Mfixed’
ifort: command line warning #10006: ignoring unknown option ‘-Mextend’
ifort: command line remark #10148: option ‘-tp px’ not supported
utils.f(183): error #5120: Unterminated character constant
Write(
,’(“ERROR opening scratch file to capture which results”/)’)
------------------^
utils.f(183): error #5082: Syntax error, found ‘’’ when expecting one of: ( * <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> …
Write(
,’(“ERROR opening scratch file to capture which results”/)’)
----------------^
utils.f(176): error #6404: This name does not have a type, and must have an explicit type. [TRI]
Write(
,’("ERROR writing “,a,” to ",a/)’) Trim(cmdline), Trim(scrfile)
---------------------------------------------------------------------^
utils.f(232): error #5120: Unterminated character constant
Write(
,’(“ERROR openning scratch file to capture pwd results”/)’)
------------------^
utils.f(232): error #5082: Syntax error, found ‘’’ when expecting one of: ( * <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> …
Write(
,’(“ERROR openning scratch file to capture pwd results”/)’)
----------------^
utils.f(225): error #6404: This name does not have a type, and must have an explicit type. [TRI]
Write(
,’("ERROR writing “,a,” to ",a/)’) Trim(cmdline), Trim(scrfile)
---------------------------------------------------------------------^
compilation aborted for utils.f (code 1)
ifort: No match.

ERROR BLDMAKE Compile failed

The first problem you’re having is that you think you’re using PGI, but in fact you’re getting Intel (ifort), which does not understand any of the PGI-formatted compiler directives.

Hi cgnolte,

Really thanks for your response.

I think I need to ask one basic question which is how to know the compiler.
I tried the myFC as the default setting (mpifort) or the ioapi compiler (pgi), and neither one can work.
I will try to test other possible terms. Anyway, thanks for your time.

For the update, I tried to module load pgi to replace intel before compilation, and change the environment settings to:

case pgi:

    #> I/O API, netCDF, and MPI library locations
    setenv IOAPI_INCL_DIR   /glade/scratch/chengpin/ioapi-3.2/Linux4_x86_64pg   #> I/O API include header files
    setenv IOAPI_LIB_DIR    /glade/scratch/chengpin/ioapi-3.2/ioapi/fixed_src   #> I/O API libraries
    setenv NETCDF_LIB_DIR   /glade/u/apps/ch/opt/netcdf/4.7.4/pgi/20.4/lib  #> netCDF C directory path
    setenv NETCDF_INCL_DIR  /glade/u/apps/ch/opt/netcdf/4.7.4/pgi/20.4/include  #> netCDF C directory path
    setenv NETCDFF_LIB_DIR  /glade/u/apps/ch/opt/netcdf/4.7.4/pgi/20.4/lib #> netCDF Fortran directory path
    setenv NETCDFF_INCL_DIR /glade/u/apps/ch/opt/netcdf/4.7.4/pgi/20.4/include #> netCDF Fortran directory path
    setenv MPI_LIB_DIR      /glade/u/apps/ch/opt/mpt/2.22    #> MPI directory path

    #> Compiler Aliases and Flags
    setenv myFC pgi
    setenv myCC pgcc
    setenv myLINK_FLAG # "-mp" openMP not supported w/ CMAQ
    setenv myFSTD "-O3"
    setenv myDBG  "-O0 -g -Mbounds -Mchkptr -traceback -Ktrap=fp"
    setenv myFFLAGS "-Mfixed -Mextend -mcmodel=medium -tp px"
    setenv myFRFLAGS "-Mfree -Mextend -mcmodel=medium -tp px"
    setenv myCFLAGS "-O2"
    #setenv extra_lib "-lextra"
    #setenv mpi_lib "-lmpi"   #> -lmpich for mvapich or -lmpi for openmpi
    setenv extra_lib "-lcurl"
    setenv mpi_lib "-lmpich"   #> -lmpich for mvapich or -lmpi for openmpi

    breaksw

And I compiled under CCTM/scripts using:

./bldit_cctm.csh pgi |& tee bldit.cctm.log

BLD_CCTM_v532_pgi showed up in the same directory but only CCTM_v532.cfg.bld in it, I cannot compile CCTM there.

I still try to fix it with my little coding capability.

Here’s the log file:

Compiler is set to pgi
setenv CCTM_SRC /glade/u/home/chengpin/CCTM/src
set GlobInc = /glade/u/home/chengpin/CCTM/src/ICL
set Mechs = /glade/u/home/chengpin/CCTM/src/MECHS
setenv REPOROOT /glade/u/home/chengpin/CCTM/src
set CompileBLDMAKE
set CopySrc
set ParOpt
set make_options = -j
if ( 0 ) then
if ( 0 ) then
set VRSN = v532
endif
set EXEC = CCTM_v532.exe
set CFG = CCTM_v532.cfg
set ModGrid = grid/cartesian
set DepMod = m3dry
set ModAdv = wrf_cons
set ModHdiff = hdiff/multiscale
set ModVdiff = vdiff/acm2_m3dry
set ModDepv = depv/m3dry
set ModEmis = emis/emis
set ModBiog = biog/beis3
set ModPlmrs = plrise/smoke
set ModCgrds = spcs/cgrid_spcs_nml
set ModPhot = phot/inline
set Mechanism = cb6r3_ae7_aq
set ModGas = gas/ebi_cb6r3_ae7_aq
set ModAero = aero/aero7
set ModCloud = cloud/acm_ae7
set ModUtil = util/util
set ModDiag = diag
set Tracer = trac0
set ModPa = procan/pa
set ModPvO3 = pv_o3
set ModISAM = isam
set ModDDM3D = ddm3d
setenv FC pgi
set FP = pgi
set CC = pgcc
setenv BLDER /glade/scratch/chengpin/CMAQ_REPO/UTIL/bldmake/bldmake_pgi.exe
set NETCDF = /glade/scratch/chengpin/CMAQ_REPO/lib/x86_64/pgi/netcdf/lib -lnetcdf
set NETCDFF = /glade/scratch/chengpin/CMAQ_REPO/lib/x86_64/pgi/netcdff/lib -lnetcdff
set PNETCDF = /glade/scratch/chengpin/CMAQ_REPO/lib/x86_64/pgi/pnetcdf/lib -lpnetcdf
set FSTD = -O3
set DBG = -O0 -g -Mbounds -Mchkptr -traceback -Ktrap=fp
setenv F_FLAGS -Mfixed -Mextend -mcmodel=medium -tp px
set F90_FLAGS = -Mfree -Mextend -mcmodel=medium -tp px
set CPP_FLAGS =
set C_FLAGS = -O2 -DFLDMN -I
set LINK_FLAGS =
if ( ! -e /glade/u/home/chengpin || ! -e /glade/scratch/chengpin/CMAQ_REPO/lib/x86_64/pgi ) then
echo Model repository base path: /glade/u/home/chengpin
Model repository base path: /glade/u/home/chengpin
echo library path: /glade/scratch/chengpin/CMAQ_REPO/lib/x86_64/pgi
library path: /glade/scratch/chengpin/CMAQ_REPO/lib/x86_64/pgi
if ( 0 ) then
setenv CMAQ_MODEL /glade/u/home/chengpin
echo default Model repository path: /glade/u/home/chengpin
default Model repository path: /glade/u/home/chengpin
endif
set BLD_OS = uname -s
uname -s
if ( Linux != Linux ) then
if ( 0 ) then
if ( 0 ) then
set PIO =
endif
if ( m3dry == m3dry ) then
set cpp_depmod = -Dm3dry_opt
else if ( m3dry == stage ) then
if ( 1 ) then
echo Parallel; set MPI flags
Parallel; set MPI flags
set ModStenex = STENEX/se
set ModPario = PARIO
set ModPar = par/mpi
set PARIO = /glade/u/home/chengpin/PARIO
set STENEX = /glade/u/home/chengpin/STENEX
set PAR = ( -Dparallel )
set Popt = SE
set seL = se_snl
set LIB2 = -lioapi
set LIB3 = -lmpich -lcurl
set Str1 = ( // Parallel / Include message passing definitions )
set Str2 = ( include SUBST_MPI mpif.h ; )
else
if ( 0 ) then
set SENS =
endif
set ModMech = MECHS/cb6r3_ae7_aq
if ( cb6r3_ae7_aq == cb6r3m_ae7_kmtbr ) then
set ModTrac = MECHS/trac0
if ( 0 ) then
set POT =
endif
set Bld = /glade/scratch/chengpin/CMAQ_REPO/CCTM/scripts/BLD_CCTM_v532_pgi
if ( ! -e /glade/scratch/chengpin/CMAQ_REPO/CCTM/scripts/BLD_CCTM_v532_pgi ) then
if ( ! -d /glade/scratch/chengpin/CMAQ_REPO/CCTM/scripts/BLD_CCTM_v532_pgi ) then
endif
cd /glade/scratch/chengpin/CMAQ_REPO/CCTM/scripts/BLD_CCTM_v532_pgi
set ICL_PAR = /glade/u/home/chengpin/CCTM/src/ICL/fixed/mpi
set ICL_CONST = /glade/u/home/chengpin/CCTM/src/ICL/fixed/const
set ICL_FILES = /glade/u/home/chengpin/CCTM/src/ICL/fixed/filenames
set ICL_EMCTL = /glade/u/home/chengpin/CCTM/src/ICL/fixed/emctrl
if ( 1 ) then
set ICL_MPI = .
endif
if ( 1 ) then
/bin/cp: No match.
/bin/cp: No match.
/bin/cp: No match.
/bin/cp: No match.
if ( 1 ) then
/bin/cp -fp ./mpif.h /glade/scratch/chengpin/CMAQ_REPO/CCTM/scripts/BLD_CCTM_v532_pgi
/bin/cp: cannot stat ‘./mpif.h’: No such file or directory
endif
set ICL_PAR = .
set ICL_CONST = .
set ICL_FILES = .
set ICL_EMCTL = .
if ( 1 ) then
set ICL_MPI = .
endif
endif
set STX1 = ( -DSUBST_BARRIER=SE_BARRIER -DSUBST_GLOBAL_MAX=SE_GLOBAL_MAX -DSUBST_GLOBAL_MIN=SE_GLOBAL_MIN -DSUBST_GLOBAL_MIN_DATA=SE_GLOBAL_MIN_DATA -DSUBST_GLOBAL_TO_LOCAL_COORD=SE_GLOBAL_TO_LOCAL_COORD -DSUBST_GLOBAL_SUM=SE_GLOBAL_SUM -DSUBST_GLOBAL_LOGICAL=SE_GLOBAL_LOGICAL -DSUBST_LOOP_INDEX=SE_LOOP_INDEX -DSUBST_SUBGRID_INDEX=SE_SUBGRID_INDEX )
set STX2 = ( -DSUBST_HI_LO_BND_PE=SE_HI_LO_BND_PE -DSUBST_SUM_CHK=SE_SUM_CHK -DSUBST_SE_INIT=SE_INIT -DSUBST_INIT_ARRAY=SE_INIT_ARRAY -DSUBST_COMM=SE_COMM -DSUBST_MY_REGION=SE_MY_REGION -DSUBST_SLICE=SE_SLICE -DSUBST_GATHER=SE_GATHER -DSUBST_DATA_COPY=SE_DATA_COPY -DSUBST_IN_SYN=SE_IN_SYN )
if ( wrf_cons == wrf_cons ) then
set ModCpl = couple/gencoor_wrf_cons
set ModHadv = hadv/ppm
set ModVadv = vadv/wrf_cons
else if ( wrf_cons == local_cons ) then
set Cfile = /glade/scratch/chengpin/CMAQ_REPO/CCTM/scripts/BLD_CCTM_v532_pgi/CCTM_v532.cfg.bld
set quote = "
echo
if ( 1 ) then
echo make_options “-j”;
echo
endif
echo model CCTM_v532.exe;
echo
echo repo /glade/u/home/chengpin/CCTM/src;
echo
echo mechanism cb6r3_ae7_aq;
echo
echo lib_base /glade/scratch/chengpin/CMAQ_REPO/lib/x86_64/pgi;
echo
echo lib_1 ioapi/lib;
echo
echo lib_2 ioapi/include_files;
echo
if ( 1 ) then
echo lib_3 “mpi -I.”;
echo
endif
echo
echo lib_4 ioapi/lib;
echo
set text = " -Dparallel -Dm3dry_opt -DSUBST_BARRIER=SE_BARRIER -DSUBST_GLOBAL_MAX=SE_GLOBAL_MAX -DSUBST_GLOBAL_MIN=SE_GLOBAL_MIN -DSUBST_GLOBAL_MIN_DATA=SE_GLOBAL_MIN_DATA -DSUBST_GLOBAL_TO_LOCAL_COORD=SE_GLOBAL_TO_LOCAL_COORD -DSUBST_GLOBAL_SUM=SE_GLOBAL_SUM -DSUBST_GLOBAL_LOGICAL=SE_GLOBAL_LOGICAL -DSUBST_LOOP_INDEX=SE_LOOP_INDEX -DSUBST_SUBGRID_INDEX=SE_SUBGRID_INDEX -DSUBST_HI_LO_BND_PE=SE_HI_LO_BND_PE -DSUBST_SUM_CHK=SE_SUM_CHK -DSUBST_SE_INIT=SE_INIT -DSUBST_INIT_ARRAY=SE_INIT_ARRAY -DSUBST_COMM=SE_COMM -DSUBST_MY_REGION=SE_MY_REGION -DSUBST_SLICE=SE_SLICE -DSUBST_GATHER=SE_GATHER -DSUBST_DATA_COPY=SE_DATA_COPY -DSUBST_IN_SYN=SE_IN_SYN";
echo cpp_flags " -Dparallel -Dm3dry_opt -DSUBST_BARRIER=SE_BARRIER -DSUBST_GLOBAL_MAX=SE_GLOBAL_MAX -DSUBST_GLOBAL_MIN=SE_GLOBAL_MIN -DSUBST_GLOBAL_MIN_DATA=SE_GLOBAL_MIN_DATA -DSUBST_GLOBAL_TO_LOCAL_COORD=SE_GLOBAL_TO_LOCAL_COORD -DSUBST_GLOBAL_SUM=SE_GLOBAL_SUM -DSUBST_GLOBAL_LOGICAL=SE_GLOBAL_LOGICAL -DSUBST_LOOP_INDEX=SE_LOOP_INDEX -DSUBST_SUBGRID_INDEX=SE_SUBGRID_INDEX -DSUBST_HI_LO_BND_PE=SE_HI_LO_BND_PE -DSUBST_SUM_CHK=SE_SUM_CHK -DSUBST_SE_INIT=SE_INIT -DSUBST_INIT_ARRAY=SE_INIT_ARRAY -DSUBST_COMM=SE_COMM -DSUBST_MY_REGION=SE_MY_REGION -DSUBST_SLICE=SE_SLICE -DSUBST_GATHER=SE_GATHER -DSUBST_DATA_COPY=SE_DATA_COPY -DSUBST_IN_SYN=SE_IN_SYN";
echo
echo f_compiler pgi;
echo
echo fstd “-O3”;
echo
echo dbg “-O0 -g -Mbounds -Mchkptr -traceback -Ktrap=fp”;
echo
echo f_flags “-Mfixed -Mextend -mcmodel=medium -tp px”;
echo
echo f90_flags “-Mfree -Mextend -mcmodel=medium -tp px”;
echo
echo c_compiler pgcc;
echo
echo c_flags “-O2 -DFLDMN -I”;
echo
echo link_flags “”;
echo
echo ioapi “-lioapi”;
echo
echo netcdf “-lnetcdf”;
echo
echo netcdff “-lnetcdff”;
echo
if ( 1 ) then
echo mpich “-lmpich -lcurl”;
echo
endif
echo include SUBST_PE_COMM ./PE_COMM.EXT;
echo include SUBST_CONST ./CONST.EXT;
echo include SUBST_FILES_ID ./FILES_CTM.EXT;
echo include SUBST_EMISPRM ./EMISPRM.EXT;
echo
if ( 1 ) then
echo // Parallel / Include message passing definitions
echo include SUBST_MPI ./mpif.h;
endif
echo
set text = stenex or se_noop
echo // options are stenex or se_noop
echo Module STENEX/se;
if ( 1 ) then
set text = // parallel executable; stenex and pario included
echo // parallel executable; stenex and pario included
echo Module PARIO;
else
echo
set text = par, par_nodistr and par_noop
echo // options are par, par_nodistr and par_noop
if ( 1 ) then
echo Module par/mpi;
endif
echo
if ( 0 ) then
set text = driver
echo // options are driver
echo Module driver;
echo
set text = cartesian
echo // options are cartesian
echo Module grid/cartesian;
echo
set text = Init
echo // options are Init
echo Module init;
echo
set text = gencoor_wrf_cons and gencoor_local_cons
echo // options are gencoor_wrf_cons and gencoor_local_cons
echo Module couple/gencoor_wrf_cons;
echo
set text = ppm
echo // options are ppm
echo Module hadv/ppm;
echo
set text = wrf_cons and local_cons
echo // options are wrf_cons and local_cons
echo Module vadv/wrf_cons;
echo
set text = multiscale
echo // options are multiscale
echo Module hdiff/multiscale;
echo
set text = acm2_m3dry or acm2_stage
echo // options are acm2_m3dry or acm2_stage
echo Module vdiff/acm2_m3dry;
echo
set text = m3dry or stage
echo // options are m3dry or stage
echo Module depv/m3dry;
echo
set text = emis
echo // options are emis
echo Module emis/emis;
echo
set text = beis3
echo // options are beis3
echo Module biog/beis3;
echo
set text = smoke
echo // options are smoke
echo Module plrise/smoke;
echo
set text = cgrid_spcs_nml and cgrid_spcs_icl
echo // options are cgrid_spcs_nml and cgrid_spcs_icl
echo Module spcs/cgrid_spcs_nml;
echo
set text = inline and table
echo // options are inline and table
echo Module phot/inline;
echo
set text = gas chemistry solvers
echo // gas chemistry solvers
set text = smvgear, ros3, and ebi_; see ‘gas chemistry mechanisms’ for
echo // options are smvgear, ros3, and ebi_; see ‘gas chemistry mechanisms’ for
echo Module gas/ebi_cb6r3_ae7_aq;
echo
set MechList = cb6mp_ae6_aq, cb6r3_ae6_aq, cb6r3_ae7_aq, cb6r3_ae7_aqkmt2, cb6r3m_ae7_kmtbr, racm2_ae6_aq, saprc07tc_ae6_aq, saprc07tic_ae6i_aq, saprc07tic_ae6i_aqkmti, saprc07tic_ae7i_aq, saprc07tic_ae7i_aqkmt2
set text = gas chemistry mechanisms
echo // gas chemistry mechanisms
set text = cb6mp_ae6_aq, cb6r3_ae6_aq, cb6r3_ae7_aq, cb6r3_ae7_aqkmt2, cb6r3m_ae7_kmtbr, racm2_ae6_aq, saprc07tc_ae6_aq, saprc07tic_ae6i_aq, saprc07tic_ae6i_aqkmti, saprc07tic_ae7i_aq, saprc07tic_ae7i_aqkmt2
echo // options are cb6mp_ae6_aq, cb6r3_ae6_aq, cb6r3_ae7_aq, cb6r3_ae7_aqkmt2, cb6r3m_ae7_kmtbr, racm2_ae6_aq, saprc07tc_ae6_aq, saprc07tic_ae6i_aq, saprc07tic_ae6i_aqkmti, saprc07tic_ae7i_aq, saprc07tic_ae7i_aqkmt2
echo Module MECHS/cb6r3_ae7_aq;
echo
set text = tracer modules
echo // tracer modules
echo // options are trac0, trac1
echo Module MECHS/trac0;
echo

if ( 0 ) then
set text = aero6
echo // options are aero6
echo Module aero/aero7;
echo
set text = acm_ae6, acm_ae6_kmt, acm_ae7_kmt2, acm_ae6_mp, acm_ae7
echo // options are acm_ae6, acm_ae6_kmt, acm_ae7_kmt2, acm_ae6_mp, acm_ae7
echo Module cloud/acm_ae7;
echo
set text = // compile for inline process analysis
echo // compile for inline process analysis
echo Module procan/pa;
echo
set text = // compile for integrated source apportionment method
echo // compile for integrated source apportionment method
echo Module isam;
echo
if ( 0 ) then
set text = util
echo // options are util
echo Module util/util;
echo
set text = diag
echo // options are diag
echo Module diag;
echo
set text = stm
echo // options are stm
echo Module stm;
echo
set text = cio
echo // options are cio
echo Module cio;
echo
if ( 0 ) then
unalias mv rm
if ( 1 || ! -f /glade/scratch/chengpin/CMAQ_REPO/UTIL/bldmake/bldmake_pgi.exe ) then
cd /glade/u/home/chengpin/UTIL/bldmake/scripts
/glade/u/home/chengpin/UTIL/bldmake/scripts: No such file or directory.

First, what version of CMAQ are you using?

Your problem is in the model build step, before the compiler even tries to compile.

You are arriving at this portion of the build script:

#> Recompile BLDMAKE from source if requested or if it does not exist
 if ( $?CompileBLDMAKE || ! -f $BLDER ) then
   cd ${CMAQ_REPO}/UTIL/bldmake/scripts
   ./bldit_bldmake.csh
 endif

But you are getting a “no such file or directory” error when you try to cd to ${CMAQ_REPO}/UTIL/bldmake/scripts. Please check the value of CMAQ_REPO. Is that path correct?

Dear @cgnolte

Thanks for your suggestion and time.
The CMAQ version is 5.3.2, and I have modified the ${CMAQ_REPO} and made sure it exist.
Now the compilation stopped, and the error message showed:

if ( 1 || ! -f /glade/scratch/chengpin/CMAQ_REPO/UTIL/bldmake/bldmake_pgi.exe ) then
cd /glade/u/home/chengpin/CMAQ_REPO/UTIL/bldmake/scripts
./bldit_bldmake.csh
rm: No match.
pgi: Command not found.
pgi: Command not found.
pgi: Command not found.
pgi: Command not found.
pgi: No match.

ERROR BLDMAKE Compile failed

But I already set the compiler to pgi and am still trying to figure out the reason.

Update my status.
Now it can compile with the compiler pgf90, which is the same in /ioapi-3.2/ioapi/Makeinclude.Linux4_x86_64pg

But CCTM compilation stops with the following error:

“distr_env.c”, line 52: warning: variable “numprocs” was set but never used
int myid, numprocs;
^

“distr_env.c”, line 54: warning: variable “ret” was set but never used
int ret, i, error;
^

“distr_env.c”, line 54: warning: variable “error” was set but never used
int ret, i, error;

The whole log file is uploaded.
Did anyone encounter the similar issue or have any thought about the error?
bldit.cctm.log.txt (184.9 KB)

That’s just a warning, not an error. It’s just a hold-over (I think) from a previous and more primitive generation of this routine that did use that variable.

Hi, @cjcoats,

I am not sure these errors will cause compilation failure in the end or not.
Because in the end, it shows:

Makefile generated
ERROR while running make command

Now, what you’re seeing is a failure to find the MPI implementation specific libraries and header files. Go back and read the “building the CCTM” instructions.

Hi all

Update my latest status.
Now I used intel-compiled IOAPI 3.2 to compile CCTM (Linux2_x86_64ifort).
CMAQ version is 5.3.2.

Module list is

  1. ncarenv/1.3 2) intel/19.0.5 3) ncarcompilers/0.5.0 4) mpt/2.22 5) netcdf/4.7.4

Environment setting in config_cmaq.csh is

case intel:

    #> I/O API, netCDF, and MPI library locations
    setenv IOAPI_INCL_DIR   /glade/scratch/chengpin/ioapi-3.2/ioapi/fixed_src        #ioapi_inc_intel  #> I/O API include header files
    setenv IOAPI_LIB_DIR    /glade/scratch/chengpin/ioapi-3.2/Linux2_x86_64ifort     #> I/O API libraries
    setenv NETCDF_LIB_DIR   /glade/u/apps/ch/opt/netcdf/4.7.4/intel/19.0.5/lib       #netcdf_lib_intel   #> netCDF C directory path
    setenv NETCDF_INCL_DIR  /glade/u/apps/ch/opt/netcdf/4.7.4/intel/19.0.5/include   #> netCDF C directory path
    setenv NETCDFF_LIB_DIR  /glade/u/apps/ch/opt/netcdf/4.7.4/intel/19.0.5/lib       #> netCDF Fortran directory path
    setenv NETCDFF_INCL_DIR /glade/u/apps/ch/opt/netcdf/4.7.4/intel/19.0.5/include   #> netCDF Fortran directory path
    setenv MPI_LIB_DIR      /glade/u/apps/ch/opt/mpt/2.22                            #> MPI directory path

    #> Compiler Aliases and Flags
    #> set the compiler flag -qopt-report=5 to get a model optimization report in the build directory with the optrpt extension
    setenv myFC ifort
    setenv myCC icc
    setenv myFSTD "-O3 -fno-alias -mp1 -fp-model source -ftz -simd -align all -xHost -vec-guard-write -unroll-aggressive"
    setenv myDBG  "-O0 -g -check bounds -check uninit -fpe0 -fno-alias -ftrapuv -traceback"
    setenv myLINK_FLAG #"-qopenmp-simd" openMP not supported w/ CMAQ
    setenv myFFLAGS "-fixed -132"
    setenv myFRFLAGS "-free"
    setenv myCFLAGS "-O2"
    setenv extra_lib "-lcurl"
    #chsetenv extra_lib ""
    setenv mpi_lib "-lmpich"    #> No Library specification needed for mpiifort
                         #> -lmpich for mvapich
                         #> -lmpi for openmpi

    breaksw

Now I got an error message with:

pm3warn.f(54): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [M3UTILIO]
USE M3UTILIO ! i/o api
----------^
compilation aborted for pm3warn.f (code 1)
subdmap.f(72): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [M3UTILIO]
USE M3UTILIO ! i/o api
----------^
compilation aborted for subdmap.f (code 1)

I checked the netcdf and netcdff lib/include path, and they do exist.
Did anyone encounter a similar problem before?
Thanks.

Now you’ve either botched the I/O API :: CMAQ match-up or you’ve botched the INCLUDE directives. To repeat myself:

  • For compile errors, always include the complete command line for the compile command that failed., and
  • Go back and read the “building the CCTM” instructions.

Hope it’s my last question. I tried to detailed my steps but it could be redundant. Thanks for reading.

Thanks to @cjcoats 's advice.
I read the IOAPI and CCTM compiling instructions carefully, and the error still occurred at CCTM compiling.

Module reset first.

  1. ncarenv/1.3 2) intel/19.0.5 3) ncarcompilers/0.5.0 4) mpt/2.22 5) netcdf/4.7.4

In IOAPI 3.2, I set

setenv BIN Linux2_x86_64ifort
setenv BASEDIR $cwd
setenv CPLMODE nocpl

command out the following setting in the file, /ioapi/Makeinclude.Linux2_x86_64ifort:

OMPFLAGS = # -fopenmp 
OMPLIBS = # -fopenmp
...
ARCHLIB   = #-Bstatic

I asked NCAR help desk and they provided me the build script here.

#!/bin/bash
BLDID=$(date +%m%dT%H%M)
DEBUG=false
DEBUGFLAGS="-O0 -g -traceback"
IOVER=3.2-20200828

module purge
module reset

rm -fr ioapi-IOVER tar -xf ioapi-{IOVER}.tar.gz

cd ioapi-${IOVER}

export BIN=Linux2_x86_64ifort
export BASEDIR=$PWD

export CPLMODE=nocpl
ln -s Makefile.template Makefile
cp ioapi/Makefile.$CPLMODE ioapi/Makefile
cp m3tools/Makefile.$CPLMODE m3tools/Makefile

for F in $(find . -name Makefile); do
sed -i “s|(BASEDIR =).*|\1 $PWD|” $F
done

F=$(find . -name Makeinclude.$BIN)
sed -i “s|-openmp|-qopenmp|g” $F
sed -i ‘/^ARCHFLAGS/a \ -DIOAPI_NCF4=1 \’ $F
[[ $DEBUG == true ]] && sed -i “s|-O3|$DEBUGFLAGS|g” $F

The modified Makeinclude.Linux2_x86_64ifort also in the gz file, ioapi-3.2-20200828.tar.gz.
Then I ./build.sh and IOAPI 3.2 was successfully compiled.

Second, in config_cmaq.sh, I modified the fold directories and modified the netcdf, netcdff, and mpi’s lib and include directories. I used openMPI here and module load openMPI.
The module list is

  1. ncarenv/1.3 2) intel/19.0.5 3) ncarcompilers/0.5.0 4) netcdf/4.7.4 5) openmpi/4.0.5

Environment setting in config_cmaq.sh is

    #> I/O API, netCDF, and MPI library locations
    setenv IOAPI_INCL_DIR    /glade/scratch/chengpin/ioapi-3.2/ioapi/fixed_src
    setenv IOAPI_LIB_DIR     /glade/scratch/chengpin/ioapi-3.2/Linux2_x86_64gfort
    setenv NETCDF_LIB_DIR    /glade/u/apps/ch/opt/netcdf/4.7.4/intel/19.0.5/lib     
    setenv NETCDF_INCL_DIR   /glade/u/apps/ch/opt/netcdf/4.7.4/intel/19.0.5/include 
    setenv NETCDFF_LIB_DIR   /glade/u/apps/ch/opt/netcdf/4.7.4/intel/19.0.5/lib     
    setenv NETCDFF_INCL_DIR  /glade/u/apps/ch/opt/netcdf/4.7.4/intel/19.0.5/include 
    setenv MPI_LIB_DIR       /glade/u/apps/ch/opt/openmpi/4.0.5/intel/19.0.5 

    #> Compiler Aliases and Flags
    #> set the compiler flag -qopt-report=5 to get a model optimization report in the build directory with the optrpt extension
    setenv myFC ifort
    setenv myCC icc
    setenv myFSTD "-O3 -fno-alias -mp1 -fp-model source -ftz -simd -align all -xHost -vec-guard-write -unroll-aggressive"
    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 mpi_lib "-lmpi"  
    breaksw

Then I compiled icon and bcon before CCTM, and they succeeded.
When I used ./bldit_cctm.csh intel |& tee build_cctm.log to compile CCTM, the log showed the error which I considered that could be due to mpi lib file settings, because bcon and icon would not use mpi for compilation. l listed 5 lines here and the detailed log file in the attachment.
build_cctm.log.txt (408.9 KB)

/usr/lib64/gcc/x86_64-suse-linux/4.8/…/…/…/…/x86_64-suse-linux/bin/ld: se_data_send_module.o: in function se_data_send_module_mp_se_1d_data_send_': se_data_send_module.f:(.text+0x433): undefined reference to mpi_send_’
/usr/lib64/gcc/x86_64-suse-linux/4.8/…/…/…/…/x86_64-suse-linux/bin/ld: se_data_send_module.o: in function se_data_send_module_mp_se_2d_data_send_': se_data_send_module.f:(.text+0xc84): undefined reference to mpi_send_’
/usr/lib64/gcc/x86_64-suse-linux/4.8/…/…/…/…/x86_64-suse-linux/bin/ld: se_data_send_module.o: in function se_data_send_module_mp_se_2de_data_send_': se_data_send_module.f:(.text+0x1455): undefined reference to mpi_send_’
/usr/lib64/gcc/x86_64-suse-linux/4.8/…/…/…/…/x86_64-suse-linux/bin/ld: se_data_send_module.o: in function se_data_send_module_mp_se_3d_data_send_': se_data_send_module.f:(.text+0x1f11): undefined reference to mpi_send_’
/usr/lib64/gcc/x86_64-suse-linux/4.8/…/…/…/…/x86_64-suse-linux/bin/ld: se_data_send_module.o: in function se_data_send_module_mp_se_3de_data_send_': se_data_send_module.f:(.text+0x28af): undefined reference to mpi_send_’

So I module show openMPI to show the path here:

Built on Sun Nov 22 20:33:42 MST 2020
Modules used:
ncarenv/1.3
intel/19.0.5
ncarcompilers/0.5.0
]])
prepend_path(“PATH”,"/glade/u/apps/ch/opt/openmpi/4.0.5/intel/19.0.5/bin")
prepend_path(“CPATH”,"/glade/u/apps/ch/opt/openmpi/4.0.5/intel/19.0.5/include")
prepend_path(“FPATH”,"/glade/u/apps/ch/opt/openmpi/4.0.5/intel/19.0.5/include")
prepend_path(“PKG_CONFIG_PATH”,"/glade/u/apps/ch/opt/openmpi/4.0.5/intel/19.0.5/lib/pkgconfig")
prepend_path(“LIBRARY_PATH”,"/glade/u/apps/ch/opt/openmpi/4.0.5/intel/19.0.5/lib")
prepend_path(“LD_LIBRARY_PATH”,"/glade/u/apps/ch/opt/openmpi/4.0.5/intel/19.0.5/lib")
prepend_path(“MANPATH”,"/glade/u/apps/ch/opt/openmpi/4.0.5/intel/19.0.5/share/man")
setenv(“MPI_ROOT”,"/glade/u/apps/ch/opt/openmpi/4.0.5/intel/19.0.5/")
setenv(“MPI_VERSION”,“4.0.5”)
append_path(“MODULEPATH”,"/glade/u/apps/ch/modulefiles/default/openmpi/4.0.5/intel/19.0.5")
prepend_path(“PATH”,"/glade/u/apps/ch/opt/ncarcompilers/0.5.0/intel/19.0.5/mpi")
setenv(“MPICC_CC”,“icc”)
setenv(“MPICXX_CXX”,“icpc”)
setenv(“MPIF90_F90”,“ifort”)
setenv(“NCAR_ROOT_OPENMPI”,"/glade/u/apps/ch/opt/openmpi/4.0.5/intel/19.0.5/")
setenv(“NCAR_RANK_OPENMPI”,“1000”)
setenv(“NCAR_LIBS_OPENMPI”,"-lrt -ldl")
setenv(“NCAR_LDFLAGS_OPENMPI”,"/glade/u/apps/ch/opt/openmpi/4.0.5/intel/19.0.5/lib")
setenv(“LMOD_MPI”,“openmpi”)
setenv(“LMOD_MPI_VERSION”,“4.0.5”)
setenv(“UCX_NET_DEVICES”,“mlx5_0:1”)

What in /glade/u/apps/ch/opt/openmpi/4.0.5/intel/19.0.5/lib include:
libmca_common_dstore.la
libmca_common_sm.so.40
libmpi_usempif08.la
libopen-pal.so.40
mpi_f08_interfaces.mod
libmca_common_dstore.so
libmca_common_sm.so.40.20.0
libmpi_usempif08.so
libopen-pal.so.40.20.5
mpi_f08.mod
libmca_common_dstore.so.1
libmca_common_ucx.la
libmpi_usempif08.so.40
libopen-rte.la
mpi_f08_types.mod
libmca_common_dstore.so.1.0.2
libmca_common_ucx.so
libmpi_usempif08.so.40.21.1
libopen-rte.so
mpi.mod
libmca_common_monitoring.la
libmca_common_ucx.so.40
libmpi_usempi_ignore_tkr.la
libopen-rte.so.40
ompi_monitoring_prof.la
libmca_common_monitoring.so
libmca_common_ucx.so.40.20.2
libmpi_usempi_ignore_tkr.so
libopen-rte.so.40.20.5
ompi_monitoring_prof.so
libmca_common_monitoring.so.50
libmpi.la
libmpi_usempi_ignore_tkr.so.40
liboshmem.la
openmpi
libmca_common_monitoring.so.50.10.0
libmpi_mpifh.la
libmpi_usempi_ignore_tkr.so.40.20.0
liboshmem.so
pkgconfig
libmca_common_ompio.la
libmpi_mpifh.so
libompitrace.la
liboshmem.so.40
pmix
libmca_common_ompio.so
libmpi_mpifh.so.40
libompitrace.so
liboshmem.so.40.22.1
pmpi_f08_interfaces.mod
libmca_common_ompio.so.41
libmpi_mpifh.so.40.20.2
libompitrace.so.40
mpi_ext.mod
libmca_common_ompio.so.41.19.4
libmpi.so
libompitrace.so.40.20.0
mpi_f08_callbacks.mod
libmca_common_sm.la
libmpi.so.40
libopen-pal.la
mpi_f08_ext.mod
libmca_common_sm.so
libmpi.so.40.20.5
libopen-pal.so
mpi_f08_interfaces_callbacks.mod

What in /glade/u/apps/ch/opt/openmpi/4.0.5/intel/19.0.5/include include:
mpi-ext.h
mpif-constants.h
mpif.h
mpif-io-handles.h
mpi.h
openmpi
pshmemx.h
shmem.h
mpif-c-constants-decl.h
mpif-externals.h
mpif-handles.h
mpif-sentinels.h
mpi_portable_platform.h
openshmem
shmem-compat.h
shmemx.h
mpif-config.h
mpif-ext.h
mpif-io-constants.h
mpif-sizeof.h
mpp
pshmem.h
shmem.fh

I still don’t know why config_cmaq.sh cannot capture the mpi lib and include file.
Or did I missing something during the compiling?
Thanks for your time to read my words.

o repeat myself again:

  • For compile errors, always include the complete command line for the compile command that failed. ,

and don’t make me have to spend lots of time digging through the log to find problems.

ifort -qopenmp se_bndy_copy_info_ext.o ... subhfile.o -L/glade/scratch/chengpin/CMAQ_REPO/lib/x86_64/intel/ioapi/lib -lioapi -L/glade/scratch/chengpin/CMAQ_REPO/lib/x86_64/intel/netcdff/lib -lnetcdff -L/glade/scratch/chengpin/CMAQ_REPO/lib/x86_64/intel/netcdf/lib -lnetcdf  -o CCTM_v532.exe

There’s nothing here about MPI libraries. And that’s the problem.

That’s the issue I have. The lib and include specify the path which has the following files, but I don’t realize why the CCTM compilation cannot capture them.

These are what under /glade/scratch/chengpin/CMAQ_REPO/lib/x86_64/intel/netcdf/lib
libh5bzip2.la
libhdf5hl_fortran.la
libnetcdff.la
libh5bzip2.so
libhdf5_hl_fortran.so
libnetcdff.settings
libhdf5.a
libhdf5hl_fortran.so
libnetcdff.so
libhdf5_cpp.a
libhdf5hl_fortran.so.100
libnetcdff.so.7
libhdf5_cpp.la
libhdf5hl_fortran.so.100.0.6
libnetcdff.so.7.0.0
libhdf5_cpp.so
libhdf5_hl.la
libnetcdf.la
libhdf5_cpp.so.103
libhdf5_hl.so
libnetcdf.settings
libhdf5_cpp.so.103.3.0
libhdf5_hl.so.100
libnetcdf.so
libhdf5_fortran.a
libhdf5_hl.so.100.1.4
libnetcdf.so.18
libhdf5_fortran.la
libhdf5.la
libnetcdf.so.18.0.0
libhdf5_fortran.so
libhdf5.settings
libsz.a
libhdf5_fortran.so.102
libhdf5.so
libsz.la
libhdf5_fortran.so.102.1.0
libhdf5.so.103
libsz.so
libhdf5_hl.a
libhdf5.so.103.3.0
libsz.so.2
libhdf5_hl_cpp.a
libnetcdf.a
libsz.so.2.0.0
libhdf5_hl_cpp.la
libnetcdf_c++4.a
libz.a
libhdf5_hl_cpp.so
libnetcdf_c++4.la
libz.so
libhdf5_hl_cpp.so.100
libnetcdf_c++4.so
libz.so.1
libhdf5_hl_cpp.so.100.1.5
libnetcdf_c++4.so.1
libz.so.1.2.11
libhdf5_hl_fortran.a
libnetcdf_c++4.so.1.1.0
pkgconfig
libhdf5hl_fortran.a
libnetcdff.a

These are what under /glade/scratch/chengpin/CMAQ_REPO/lib/x86_64/intel/netcdff/lib
libh5bzip2.la
libhdf5hl_fortran.la
libnetcdff.la
libh5bzip2.so
libhdf5_hl_fortran.so
libnetcdff.settings
libhdf5.a
libhdf5hl_fortran.so
libnetcdff.so
libhdf5_cpp.a
libhdf5hl_fortran.so.100
libnetcdff.so.7
libhdf5_cpp.la
libhdf5hl_fortran.so.100.0.6
libnetcdff.so.7.0.0
libhdf5_cpp.so
libhdf5_hl.la
libnetcdf.la
libhdf5_cpp.so.103
libhdf5_hl.so
libnetcdf.settings
libhdf5_cpp.so.103.3.0
libhdf5_hl.so.100
libnetcdf.so
libhdf5_fortran.a
libhdf5_hl.so.100.1.4
libnetcdf.so.18
libhdf5_fortran.la
libhdf5.la
libnetcdf.so.18.0.0
libhdf5_fortran.so
libhdf5.settings
libsz.a
libhdf5_fortran.so.102
libhdf5.so
libsz.la
libhdf5_fortran.so.102.1.0
libhdf5.so.103
libsz.so
libhdf5_hl.a
libhdf5.so.103.3.0
libsz.so.2
libhdf5_hl_cpp.a
libnetcdf.a
libsz.so.2.0.0
libhdf5_hl_cpp.la
libnetcdf_c++4.a
libz.a
libhdf5_hl_cpp.so
libnetcdf_c++4.la
libz.so
libhdf5_hl_cpp.so.100
libnetcdf_c++4.so
libz.so.1
libhdf5_hl_cpp.so.100.1.5
libnetcdf_c++4.so.1
libz.so.1.2.11
libhdf5_hl_fortran.a
libnetcdf_c++4.so.1.1.0
pkgconfig
libhdf5hl_fortran.a
libnetcdff.a

Or said, did the lib lack the files with the specific name?
What are the file names we need under lib and include?

And sorry for spending your time.

Hi,
If your FC definition is set to mpifort, and your modules are loaded correctly, then the mpi libraries will be found automatically.

Please check the output of the following command:

mpifort -show

It should display something like the following if you have the following modules loaded.
Currently Loaded Modules:

  1. gcc/9.1.0 2) openmpi_4.0.1/gcc_9.1.0
gfortran -I/nas/longleaf/apps-dogwood/mpi/gcc_9.1.0/openmpi_4.0.1/include -pthread -I/nas/longleaf/apps-dogwood/mpi/gcc_9.1.0/openmpi_4.0.1/lib -Wl,-rpath -Wl,/nas/longleaf/apps-dogwood/mpi/gcc_9.1.0/openmpi_4.0.1/lib -Wl,--enable-new-dtags -L/nas/longleaf/apps-dogwood/mpi/gcc_9.1.0/openmpi_4.0.1/lib -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi

Hi @lizadams
Thanks for your replying.

Here’s what I got using mpifort -show

ifort -I/glade/u/apps/ch/opt/netcdf/4.7.4/intel/19.0.5/include -Wl,-Bstatic -lnetcdff -lnetcdf -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lsz -lz -Wl,-Bdynamic -lm -ldl -lrt -ldl -Wl,–disable-new-dtags -L/glade/u/apps/ch/opt/netcdf/4.7.4/intel/19.0.5/lib -L/glade/u/apps/ch/opt/openmpi/4.0.5/intel/19.0.5/lib -Wl,-rpath,/glade/u/apps/ch/opt/netcdf/4.7.4/intel/19.0.5/lib -Wl,-rpath,/glade/u/apps/ch/opt/openmpi/4.0.5/intel/19.0.5/lib

Here I have a question.
If I used mpt/2.22 for IOAPI compilation and openMPI/4.0.5 for CCTM compilation.
Will this different MPI contradict themself?

If you compiled the pnetcdf-enabled version, then you need to use the same MPI version throughout.
If you didn’t, the I/O API library is independent of MPI version (mainly depends on Fortran compiler and optimization-level).