Source Code Form

As shown in the examples earlier in this chapter, GNU Fortran accepts source in ANSI Fortran 77 format and in a free form format. The free form format is very much like the Fortran 90 format, but GNU Fortran is a bit more forgiving with things such as tabs. The following list summarizes the special situations of both the free form and fixed form formats:

■ Carriage returns Any carriage return characters in the source are ignored.

■ Tabs Each tab is expanded into the appropriate number of spaces to expand to an eight-character boundary.

■ Ampersands An ampersand in column 1 of the fixed form format designates that the line is a continuation of the previous line.

■ Short lines The line length has no meaning in the free form format, but fixed form lines are all 72 characters long. A line shorter than 72 characters is automatically padded with spaces on the right to fit the 72-character requirement. This can only have an effect on continued characters and Hollerith constants. This fixed line requirement can be modified or eliminated by using the command-line option -ffixed-line-length.

■ Long lines Lines longer than the designated length are truncated without warning. This is mostly to accommodate legacy Fortran code that may have other information in columns 73 through 80 (usually source code sequence numbers). The fixed-line requirement can be modified or eliminated by using the command-line option -ffixed-line-length.

Was this article helpful?

0 0

Post a comment