fixcon, a Fortran90 code 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 information on this web page is distributed under the MIT license.


fixcon is available in a Fortran90 version

Related Data and Programs:


catalog, a C++ code 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 code which extracts one routine from a Fortran77 or Fortran90 file;

f77_cleanup, a Fortran90 code which makes a copy of a Fortran77 file in which some minor cleanups have been made.

f77split, a C code which splits a file containing multiple Fortran77 routines into separate files;

f90split, a C code which splits a file containing multiple Fortran90 routines into separate files;

f90split, a Fortran90 code which reads a Fortran file and creates individual files for every subroutine or function in the file.

include_files, a Fortran90 code which reads a Fortran file with INCLUDE statements, and makes a copy in which the indicated files have been included;

module_mark, a Fortran90 code which replaces bare "END" statements by "END (module name)" statements in a Fortran90 file.

recomment, a C++ code which converts C style comments to C++ style.

Source code:

Last revised on 16 June 2024.