How to use f77 common blocks through “include” statements in f90 ? PGI compiler produces an error.
C common blocks
common / cb1 / a,b,c
! Include the common block here
a = 5.0
b = 1.0
c = a + b
write(,) 'sum of ‘,a,’ and ‘,b, ’ is :’,c
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