anchor.diff:  !     into VLAG(NPT+I), I=1,2,...,N.
   !
           if (ntrits > 0) then
  -            do 570 k = 1, npt
  +            do k = 1, npt
                   vlag (k) = fval (k) - fval (kopt)
  -570         w (k) = zero
  -            do 590 j = 1, nptm
  +                w (k) = zero
  +            end do
  +            do j = 1, nptm
                   sum = zero
  -                do 580 k = 1, npt
  -580             sum = sum + zmat (k, j) * vlag (k)
  -                do 590 k = 1, npt
  -590         w (k) = w (k) + sum * zmat (k, j)
  -            do 610 k = 1, npt
  +                do k = 1, npt
  +                    sum = sum + zmat (k, j) * vlag (k)
  +                end do
  +                do k = 1, npt
  +                    w (k) = w (k) + sum * zmat (k, j)
  +                end do
  +            end do
  +            do k = 1, npt
                   sum = zero
  -                do 600 j = 1, n
  -600             sum = sum + xpt (k, j) * xopt (j)
  +                do j = 1, n
  +                     sum = sum + xpt (k, j) * xopt (j)
  +                end do
                   w (k+npt) = w (k)
  -610         w (k) = sum * w (k)
  +                w (k) = sum * w (k)
  +            end do
               gqsq = zero
               gisq = zero
  -            do 630 i = 1, n
  +            do i = 1, n
                   sum = zero
  -                do 620 k = 1, npt
  -620             sum = sum + bmat (k, i) * vlag (k) + xpt (k, i) * w (k)
  +                do k = 1, npt
  +                    sum = sum + bmat (k, i) * vlag (k) + xpt (k, i) * w (k)
  +                end do
                   if (xopt(i) == sl(i)) then
                       gqsq = gqsq + min (zero, gopt(i)) ** 2
                       gisq = gisq + min (zero, sum) ** 2
  
positive.code:             wsqsav = wfixsq
              step = sqrt (temp/ggfree)
              ggfree = zero
              do 130 i = 1, n
                  if (w(i) == bigstp) then
                      temp = xopt (i) - step * glag (i)
                      if (temp <= sl(i)) then
  
negative.code: !
  !     Revise SLBD and SUBD if necessary because of the bounds in SL and SU.
  !
              do i = 1, n
                  temp = xpt (k, i) - xopt (i)
                  if (temp > zero) then
                      if (slbd*temp < sl(i)-xopt(i)) then
  