Convert F77 to F90 Continuation

FIXCON is a FORTRAN90 program which converts the line continuation scheme used in a FORTRAN77 file to that used in FORTRAN90 files.

In FORTRAN77, if a line is not a comment line, then a nonblank character (actually, the character can't be '0' either) in column six indicates that the current line is a continuation of the previous one. (Complications include what happens when the previous line is a comment, and how you deal with the joy of TAB characters). For example, the following would be a legally continued line in FORTRAN 77 (assuming that the dollar sign is actually in column 6):

            x = 1 + 2 + 3 + 4
           $  + 5 + 6

In FORTRAN90, a line can extend to the next line by having an ampersand as its last character. Thus, the FORTRAN90 version of the same line looks like this:

            x = 1 + 2 + 3 + 4 &
              + 5 + 6

FIXCON reads a file that uses the FORTRAN77 convention, and writes a copy that uses the F90 convention. If you've ever tried to do this by hand on a substantial file, it might be worth your while to try this program instead.

With nose firmly squeezed shut, the program has been modified to try to deal with the evil of TAB characters. The program's treatment is simply to replace each TAB by six blanks.

Two other small fixes are applied.


fixcon file.f file.f90
The input file, which uses the FORTRAN77 convention.
The output file, which uses the FORTRAN90 convention.


The computer code and data files made available on this web page are distributed under the GNU LGPL license.


FIXCON is available in a FORTRAN90 version

Related Data and Programs:

CATALOG, a C++ program which reads a C, C++, FORTRAN77 or FORTRAN90 program and prints every line that begins with a special index tag. If the program has been marked up expecting this convention, it is a handy way of making a table of contents of a program file.

EXTRACT, a FORTRAN90 program which extracts one routine from a FORTRAN77 or FORTRAN90 file;

F77_CLEANUP, a FORTRAN90 program which makes a copy of a FORTRAN77 file in which some minor cleanups have been made.

F77SPLIT, a C program which splits a file containing multiple FORTRAN77 routines into separate files;

F90SPLIT, a C program which splits a file containing multiple FORTRAN90 routines into separate files;

F90SPLIT, a FORTRAN90 program which reads a FORTRAN file and creates individual files for every subroutine or function in the file.

INCLUDE_FILES, a FORTRAN90 program which reads a FORTRAN file with INCLUDE statements, and makes a copy in which the indicated files have been included;

MODULE_MARK, a FORTRAN90 program which replaces bare "END" statements by "END (module name)" statements in a FORTRAN90 file.

RECOMMENT, a C++ program which converts C style comments to C++ style.

Source code:

Examples and Tests:

Another test works with TAB characters. Files you may copy include:

List of Routines:

Last revised on 27 January 2003.