gfortran and f77 line continuation

Brooks Moses brooks.moses@codesourcery.com
Tue Nov 28 21:36:00 GMT 2006


Ewan wrote:
> My problem now is that I cannot get my Fortran77 code to compile 
> properly as the gfortran compiler seems to no longer accept the f77 
> method of line continuation.  I have tried using the f90 mode of using 
> the ampersand, the f77 method of placing a character in column 6, or an 
> integer in column 7.  Nothing seems to get the code to compile.
> 
> Code sample:
> 
>           const = (m_ho(MA_NO,band)**1.5)*(d_o_ho(MA_NO,phon_mode)**2.0)
>      1      *N_op_h/(2.0d0**1.5)/pi/density(MA_NO)/
>      2      hw_op_ho(MA_NO,phon_mode)
> 
> 
> Above is a code sample that will not compile with gfortran(4.1.12) in a 
> file with the extension .f

Gfortran should definitely be accepting a character in column 6 as an 
indication of line continuation in files with .f extensions unless 
you're using a compiler option that tells it to treat the file as 
free-form source.

(One possible problem is if you have tabs instead of spaces in your 
file, however.)

Could you please report the compiler options you are using, and the 
exact error message that you're getting with characters in column 6?

Thanks,
- Brooks



More information about the Fortran mailing list