migrating code from f77 to f90

Tobias Schlüter Tobias.Schlueter@Physik.Uni-Muenchen.DE
Wed Mar 22 17:04:00 GMT 2006


Quoting Jack Howarth <howarth@bromo.msbb.uc.edu>:
>     Thanks for the clarification. One other question. I noticed that in XL
> Fortran I can use -qlanglvl=77std to check for deviations from the ANSI
> F77 standard. The manpage for gfortran 4.0.2 (I don't have access to
> gcc 4.1 here at work) shows gnu, f95, f2003 and legacy as options for
> the -std= flag. However 'gfortran -v --help' in 4.0.2 shows the options
> as c89, c99, c9x, gnu89, gnu99, gnu9x, iso9899:1990, iso9899:199409,
> iso9899:1999 and iso9899:199x. Is it safe to assume that a -std= option
> for the f77 standard itself was never added to gfortran? Such a feature
> would be nice to have for use in the first stages of migrating code to
> Fortran 90 (by allowing the user to make their f77 code conform to the
> standard before they attempt to migrate to f90).

(It's a bug that you get shown the different C standards.)

WRT a --std=f77 option, you're correct that it doesn't exist, but I think your
overestimating its usefulness.  First, there's very little Fortran 77 code that
doesn't use extension, IIRC REAL*8 would be an error by the Fortran 77 standard.
  Have you tried compiling your code with -qlanglvl=77std?  (I'm not sure if the
Fortran standard which is referred to as MIL-STD or something like that -- the
extended language required from US military contractors -- would be a more
interesting subset.)  Second, the amount of places that would need changing in
the compiler would be quite large, introducing lots and lots of possible
failure points.

- Tobi



More information about the Fortran mailing list