From g77 to gfortran

Lots of friends and colleagues have been happily using g77 as their fortran compiler for years. Now, however, you can’t find an up-to-date g77 compiler very easily and we’re all supposed to start using gfortran. Here’s some tips for getting your old .f files to compile:

  • Use the following command-line arguments when invoking the gfortran compiler to get better compatibility:
    gfortran -ffixed-line-length-none -fdefault-real-8 -std=legacy -fd-lines-as-comments
  • Two commonly used argument names for the OPEN() procedure have changed. Instead of specifying NAME=FNAME, use FILE=FNAME and instead of using TYPE=, use STATUS=.
This entry was posted in Uncategorized. Bookmark the permalink.

Comments are closed.