PGF90-W-0951-Extraneous tokens ignored following # directive

Dears,

I’m trying to compile CMAQ 4.6 and i got this error:

PGF90-W-0951-Extraneous tokens ignored following # directive (AERO_EMIS.F: 196)
PGF90-S-0021-Label field of continuation line is not blank (AERO_EMIS.F: 196)

I checked CMAQ code at “AERO_EMIS.F: 196” and got:

         INCLUDE SUBST_RXCMMN    ! to get mech name
         INCLUDE SUBST_AE_SPC    ! aerosol species names and molecular weights
         INCLUDE SUBST_GC_EMIS   ! gas chem emis surrogate names and map table
         INCLUDE SUBST_IOPARMS   ! I/O parameters definitions
#include      SUBST_IODECL      # I/O definitions and declarations
         INCLUDE SUBST_FILES_ID  ! file name parameters
         INCLUDE SUBST_IOFDESC   ! file header data structure

When I was using PGI Version 2014-141 it worked with no problems. I updated it to 2016-163 and I got this error.

Follow below configurations used to compile it .


#> Set full path of Fortran 90 compiler
 set FC = /share/apps/mpich-3.2/bin/mpif90
 set FP = $FC

#> Set location of MPICH if using multiple processors
 set MPICH  = /share/apps/mpich-3.2

#> Set compiler flags
 set FSTD       = "-Mfixed -Mextend"
 set F_FLAGS    = "${FSTD} -O2 -module ${MODLOC} -I."
 set CPP_FLAGS  = ""
 set C_FLAGS    = "-v -O2 -I${MPICH}/include"
 set LINK_FLAGS = "-Bstatic"

#> Set location of M3Bld executable
 set Blder = $M3LIB/build/$BLD_OS/m3bld

#> Set location of libraries/include files
 set STENEX = ${M3LIB}/stenex/Linux
 set IOAPI  = "${M3LIB}/ioapi3.1/Linux2_x86_64pg_pgcc_nomp -lioapi"
 set ICL_IOAPI = ${M3LIB}/ioapi3.1/ioapi/fixed_src
 set NETCDF = "${M3LIB}/netCDF/Linux -lnetcdff -lnetcdf"

Two things I would investigate.

  1. change
    #include SUBST_IODECL # I/O definitions and declarations
    to
    #include SUBST_IODECL ! # I/O definitions and declarations

  2. add the switches to fortran
    -Mpreprocess -Mbackslash

and see if the problems persist.

Dear jtull,

In fact, I just removed “# I/O definitions and declarations” and it worked. But… it appears in another part of the code…

It will be a hard work to change this statement in all code.

My point is, why did it work in the past? (PGI Version 2014-141)

Why doesn’t it work in PGI Version 2016-163?

Thank you.

The rules for preprocessing in Fortran are not as clear as you think,
and usually they are dictated by how gcc/gfortran/cpp preprocessing
handles the situations. I do not believe there is any standard for preprocessing in Fortran. If ‘configure/make’ works for gcc/gfortran, the syntax is considered
okay, and pgfortran has to adapt to it when it changes.

What does it mean if adding the ‘!’ or deleting the tail of the line,
causes both pgfortran AND gfortran to work on this code?
Is the source now ‘more correct’, or is pgfortran still defective?


dave