5. The same source code used for Fortran 77 and Fortran 90?

This is possible if you do it in the following way, that is if you use the new continuation sign "&" at the end of the old line, but in position 73 so that it doesn't conflict with Fortran 77, and also choose the "&" sign as the almost arbitrary character in column 6, in order to get continuation according to Fortran 77. An introductory "&" is "in principle" neglected by Fortran 90.
     program TEST             !    column 73
!                                  |
     write(*,*)                    &
    &     ' test '
     end
!   |
! column 6
This is really not standard Fortran 77 since neither "&" nor "!" are in the standardized character set. On the other hand, these constructs are perfect for program segments that are to be included in Fortran 90 program units using the INCLUDE statement (refer to Appendix 3, section 1), sometimes using the old form and sometimes using the new form of the source code. The program segment is then supposed to be written as if blanks were significant.

Comments are an incompatibility problem between Fortran 77 and Fortran 90, but of course not between fixed and free forms of Fortran 90 since the "!" is permitted in both. The exclamation mark is also permitted in Sun and DEC Fortran 77 (both DEC Station ULTRIX and VAX VMS), the Cray compiler CF77, and the Absoft Fortran 77 compiler.

Another important condition is of course that the program really obeys the standard.


Last modified: 3 February 1997
boein@nsc.liu.se