title: Outdated DO loops in Fortran 2018+
body: <p>I am working with a source code that might have been written before the most recent version of gfortran. I'm aware that the way DO, END DO, and CONTINUE has changed so that there can not be shared loop termination. There's a handy link <a href="http://fortranwiki.org/fortran/show/Modernizing+Old+Fortran" rel="noreferrer">here</a>. The thing is, I don't know what the explanation really is telling me to do on that page. If I set up a really basic DO loop in a new script, it compiles with no error. I'm not sure how to reverse engineer this to find what the problem is.</p>
  <p>Here is one part of the code that returns an error message.</p>
  <pre><code>              DO 20 II = I1, I2
                IW = ICN(II)
  !             Has node iw been on stack already?
                IF (NUMB(IW)==0) GOTO 70
  !             Update value of LOWL(IV) if necessary.
  20          LOWL(IV) = MIN(LOWL(IV),LOWL(IW))
  
  !           There are no more edges leaving node IV.
              ARP(IV) = -1
  !           Is node IV the root of a block.
  30          IF (LOWL(IV)&lt;NUMB(IV)) GOTO 60
  
  !           Order nodes in a block.
              NUM = NUM + 1
              IST1 = N + 1 - IST
              LCNT = ICNT + 1
  !           Peel block off the top of the stack starting at the
  !           top and working down to the root of the block.
              DO STP = IST1, N
                IW = IB(STP)
                LOWL(IW) = N + 1
                ICNT = ICNT + 1
                NUMB(IW) = ICNT
                IF (IW==IV) GOTO 50
              END DO
  </code></pre>
  <p>The error looks like this. Basically the same error repeats for any outdated DO loops that come up and is the only type of error that comes up when compiling.</p>
  <pre><code>dvode_f90_m.f90:15865:45:
  
  15865 | 20          LOWL(IV) = MIN(LOWL(IV),LOWL(IW))
        |                                             1
  Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 20 at (1)
  </code></pre>
  <p>I would like to know how to rework the DO loops in this code chunk so that I can go through and update this source code. If it's relevant, I'm running GFortran9.3.0 on Cygwin.</p>