How to use f77 common blocks through “include” statements in f90 ? PGI compiler produces an error.
E.g.
file1.cmn
C common blocks
real a,b,c
common / cb1 / a,b,c
cmntest.f90
program test1
! Include the common block here
include “file1.cmn”
!
a = 5.0
b = 1.0
c = a + b
write(,) 'sum of ‘,a,’ and ‘,b, ’ is :’,c
stop
end program test1
%pgf90 -I./file1.cmn cmntest.f90
PGF90-S-0034-Syntax error at or near identifier common (./file1.cmn: 1)
0 inform, 0 warnings, 1 severes, 0 fatal for test1
Whereas if “!” is used as comment in the file1.cmn file, instead of “C” it works and produces correct result.
sum of 5.000000 and 1.000000 is : 6.000000
FORTRAN STOP
Thanks,
Jawahar