Silverfrost Forums

Welcome to our forums

What is the limit on amount of continuations

22 Jun 2012 10:41 #10401

in current Fortran standard and FTN95? Is it still 19?

23 Jun 2012 7:25 #10402

I have had a quick look at the Fortran 95 Standard and cannot see any mention of a limit.

23 Jun 2012 9:03 #10404

For FORTRAN 77

  maximum is 19

For Fortran 90 and Fortran 95

  maximum in fixed-form source files is 19 (same as FORTRAN 77)
  maximum in free-form source files is 39

For Fortran 2003 and Fortran 2008

  maximum in fixed-form [u:60fdc86efa]and[/u:60fdc86efa] free-form files is 255
25 Jun 2012 12:01 #10418

Based on this example, the limit is 99 for FTN95 free format. This appears arbitrary, but can have an effect in extended data statements or long COMMON definitions when using in-line comments (Modules do not have this problem).

  integer i
  character*5 aaa(101)
  data aaa /    &
     '   1 ',   &
     '   2 ',   &
     '   3 ',   &
     '   4 ',   &
     '   5 ',   &
     '   6 ',   &
     '   7 ',   &
     '   8 ',   &
     '   9 ',   &
     '  10 ',   &
     '  11 ',   &
     '  12 ',   &
     '  13 ',   &
     '  14 ',   &
     '  15 ',   &
     '  16 ',   &
     '  17 ',   &
     '  18 ',   &
     '  19 ',   &
     '  20 ',   &
     '  21 ',   &
     '  22 ',   &
     '  23 ',   &
     '  24 ',   &
     '  25 ',   &
     '  26 ',   &
     '  27 ',   &
     '  28 ',   &
     '  29 ',   &
     '  30 ',   &
     '  31 ',   &
     '  32 ',   &
     '  33 ',   &
     '  34 ',   &
     '  35 ',   &
     '  36 ',   &
     '  37 ',   &
     '  38 ',   &
     '  39 ',   &
     '  40 ',   &
     '  41 ',   &
     '  42 ',   &
     '  43 ',   &
     '  44 ',   &
     '  45 ',   &
     '  46 ',   &
     '  47 ',   &
     '  48 ',   &
     '  49 ',   &
     '  50 ',   &
     '  51 ',   &
     '  52 ',   &
     '  53 ',   &
     '  54 ',   &
     '  55 ',   &
     '  56 ',   &
     '  57 ',   &
     '  58 ',   &
     '  59 ',   &
     '  60 ',   &
     '  61 ',   &
     '  62 ',   &
     '  63 ',   &
     '  64 ',   &
     '  65 ',   &
     '  66 ',   &
     '  67 ',   &
     '  68 ',   &
     '  69 ',   &
     '  70 ',   &
     '  71 ',   &
     '  72 ',   &
     '  73 ',   &
     '  74 ',   &
     '  75 ',   &
     '  76 ',   &
     '  77 ',   &
     '  78 ',   &
     '  79 ',   &
     '  80 ',   &
     '  81 ',   &
     '  82 ',   &
     '  83 ',   &
     '  84 ',   &
     '  85 ',   &
     '  86 ',   &
     '  87 ',   &
     '  88 ',   &
     '  89 ',   &
     '  90 ',   &
     '  91 ',   &
     '  92 ',   &
     '  93 ',   &
     '  94 ',   &
     '  95 ',   &
     '  96 ',   &
     '  97 ',   &
     '  98 ',   &
     '  99 ',   &
     ' 100 ',   &
     ' 101 '  /
!
      do i = 1,size(aaa)
        write (*,*) i,aaa(i)
      end do
      end
25 Jun 2012 8:32 #10422

Thanks for the info. I find FTN95 often exceeds the Standard Fortran95 limits

25 Jun 2012 9:50 #10425

Johns example gives an error that the number of continuations is more than 99. However if you use the /ISO flag, the compiler gives the error that the number of lines is more than 39.

Please login to reply.