Документ взят из кэша поисковой машины. Адрес оригинального документа : http://crydee.sai.msu.ru/f90/c5.html
Дата изменения: Sat Feb 10 20:29:30 1996
Дата индексирования: Mon Oct 1 19:42:27 2012
Кодировка:

Поисковые слова: diurnal motion
The same source code used for Fortran 77 and Fortran 90?

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) and on the Cray compiler CF77.

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


Last modified: 16 November 1995
boein@nsc.liu.se