I am having trouble compiling a F90 code with a #insert directive, as follows.
In the main code (mod_incupd.F90):
"...
logical, parameter :: lpipe_incupd=.false. !extra checking
!
character utxt*12,vtxt*12
integer i,j,k
real q,utotij,vtotij
!
# include "stmt_fns.h"
…"
In the inserted code (stmt_fns.h):
"...
!-----------------------------------------------------------------------------
integer, parameter :: &
#if defined (EOS_SIG0)
# if defined (EOS_7T)
sigver=1 !7-term sigma-0
# elif defined (EOS_9T)
sigver=3 !9-term sigma-0
# elif defined (EOS_12T)
sigver=7 !12-term sigma-0
# elif defined (EOS_17T)
sigver=5 !17-term sigma-0
# endif
#elif defined (EOS_SIG2)
# if defined (EOS_7T)
sigver=2 !7-term sigma-2
# elif defined (EOS_9T)
sigver=4 !9-term sigma-2
# elif defined (EOS_12T)
sigver=8 !12-term sigma-2
# elif defined (EOS_17T)
sigver=6 !17-term sigma-2
# endif
#endif
real sig,dsigdt,dsigds,tofsig,sofsig, &
sigloc,dsiglocdt,dsiglocds,tofsigloc
…"
The compilation error is:
“…
mpif90 -DIA32 -DREAL8 -DMPI -DSERIAL_IO -DTIMER -fno-strict-aliasing -L/usr/local/nvidia/hpc_sdk/Linux_x86_64/24.11/compilers/lib -c mod_incupd.F90
NVFORTRAN-S-0034-Syntax error at or near identifier sig (./stmt_fns.h: 2)
…”
The funny is that, if I just cut & past the lines of codes from the *.h file into the *.F90, it works.