Fortran Wiki
Continuation lines

A continuation line in free-form Fortran is created with an ampersand as follows:

integer, dimension(5) :: foo = (/ 1, 2, &
    3, 4, 5 /)

There is also an optional ampersand at the beginning of the continuation line. For example:

integer, dimension(5) :: foo = (/ 1, 2, &
   & 3, 4, 5 /)

Comments are allowed after the ampersand. Continuation lines may be separated by blank or comment lines. Note: Blank lines within a continuation are not that useful, but can occur with preprocessors.

integer, dimension(5) :: foo = (/ 1, 2, & ! a comment
   ! another comment, followed by a blank line

   & 3, 4, 5 /)

Lines can be broken within a string constant, in which case the initiating ampersand is mandatory. For example, string1 and string2 are equivalent:

character(len=*), parameter :: string1 = "hello world", string2 = "hello &
                                        &world"

An interesting feature, which is not a coincidence, is that source code can be formatted in an “intersection” format. It is essentially fixed format with an ampersand at column 73 of any continued line, and with ampersand always used in column 6 (columns 1-5 are reserved for labels) for starting a continuation line.

The intersection format can be useful for INCLUDE files in a mixed-format environment. You may want to disable long-line warnings. Obviously, this is not compatible with extended length fixed-format source files unless the ampersand is shifted beyond column 73.

For example, the following line is equivalent in fixed and free-format parsing:

      character(len=*), parameter :: string1="hello world", string2="hel&
     &lo world"

In the Fortran 95 standard, a maximum of 39 continuation lines are allowed. In Fortran 2003 and Fortran 2008, a maximum of 255 are allowed.

GFortran will allow more than 39 continuation lines even with -std=f95, but it will issue the following warning:

Warning: Limit of 39 continuations exceeded in statement

The Intel Fortran compiler allows up to 511 lines by default, or 255 with -stand f95. The warning message is:

warning #5199: Too many continuation lines