I am trying to include a file 'a.h' into a Fortran program 'b.f' The contents of the files are as follows:
a.h
c This is a comment
k = 10
100 format( I5 )
b.f
program test_include
include 'a.h'
write(*,100) k
end program test_include
When I try to compile the file 'b.f' using the following command
gfortran -ffree-form b.f
The compiler gives the error
Included at b.f:2:
c This is a comment
1
Error: Unclassifiable statement at (1)
But when I change the comment line to
!c This is a comment
gfortran compiles it successfully and the program runs correctly.
Can someone tell me how to make gfortran recognize lines beginning with 'c' in a '*.h' file as a comment. I am trying to include a similar file (with comments beginning with 'c') from a library into my free-form fortran code, and I can't really make all the comments beginning with 'c' in that file, to begin with '!'.