fortranfortran95

How to write a Fortran 95 line of code on multiple line?


I want to write my line of code on multiple line like the code below :

print *, v1, v2, v3 &
  & v4,v5

Solution

  • Not 100 percent sure what you want but the way of writing a code line over multiple lines is dependent on whether you are using fixed formatted or free formatted code.

    In fixed formatted code one would write e.g.

          print *, v1, v2, v3,
         1 v4,v5
    

    note: the requirement of 6 spaces at the beginning of the line or 5 spaces plus the continuation character (here a 1)

    in free formatted code (advised to use):

      print *, v1, v2, v3, &
        v4,v5
    

    The continuation character (&) should be the last non blank character on the line (before optional comment on the line after the &).

    Hope this solves your problem.