1
$\begingroup$

I am contacting research and I came across an algorithm in FORTRAN, with which I am not familiar.

enter image description here

For the code above I have two questions:

  1. What does "DO 1 (...)" mean? I see that there is a "1" on the left of line 6. Does that mean it references line 6?

  2. Shouldn't DO statements close with "END DO" ?

Thank you in advance.

$\endgroup$

1 Answer 1

2
$\begingroup$

This is very old Fortran (note the spelling, it has been officially lower case for over 30 years) and is no longer legal according to the most current standard. It is equivalent to

Do m = l, kp
   a( is, l, m ) = a( ib, l, m ) - a( ib, ip, m ) * a( is, ip, l )
End Do

So

  1. You are correct, this indicates that the command continues onto the next line. This is a "feature" of fixed format Fortran, as required before Fortran 90
  2. End Do is not required, a label can be used instead. Using this ugly latter method before 2018 multiple loops could share the same final line. This horrible feature was deleted from the standard in Fortran 2018
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.