anchor.diff:          endif
           dp1=dp00
           dp0=dp00
  -        ddp1 = zero ! -Wmaybe-uninitialized
  -        do 250 ib=1,1
  +
  +! ================================================================================================================================ !
  +
             dp10=dp1
  -!-----------------------------------------------------------------------
             if(idp /= 1 .or. iation /= 1) iclo6=0
             if(iclo6 == 1 .or. iclo6 == 2) then
  -            if(ib == 1) then
  -              if(iclo6r == 0) then
  -                clo6(1)  = clo(1)
  -                clop6(1) = clop(1)
  -                clo6(2)  = clo(2)
  -                clop6(2) = clop(2)
  -                clo6(3)  = zero
  -                clop6(3) = zero
  -              else
  -                write(lout,"(a)") "MAINCR> Reading closed orbit guess from fort.33"
  -                call readFort33
  -              end if
  -              call clorb(zero)
  -              call betalf(zero,qw)
  -              call phasad(zero,qwc)
  -              sigm(1) = clo6(3)
  -              dps(1)  = clop6(3)
  -              call qmodda(3,qwc)
  -              if(ilin >= 2) then
  -                nlinoo = nlin
  -                nlin   = nlino
  -                ilinc  = 1
  -                call mydaini(2,2,6,3,6,1)
  -                nlin   = nlinoo
  -              end if
  -              dp1 = dp10+clop6(3)
  +            if(iclo6r == 0) then
  +              clo6(1)  = clo(1)
  +              clop6(1) = clop(1)
  +              clo6(2)  = clo(2)
  +              clop6(2) = clop(2)
  +              clo6(3)  = zero
  +              clop6(3) = zero
  +            else
  +              write(lout,"(a)") "MAINCR> Reading closed orbit guess from fort.33"
  +              call readFort33
               end if
  +            call clorb(zero)
  +            call betalf(zero,qw)
  +            call phasad(zero,qwc)
  +            sigm(1) = clo6(3)
  +            dps(1)  = clop6(3)
  +            call qmodda(3,qwc)
  +            if(ilin >= 2) then
  +              nlinoo = nlin
  +              nlin   = nlino
  +              ilinc  = 1
  +              call mydaini(2,2,6,3,6,1)
  +              nlin   = nlinoo
  +            end if
  +            dp1 = dp10+clop6(3)
  +
               if(iqmod6 == 1) then
                 do ncrr=1,iu
                   ix=ic(ncrr)
  
positive.code: !     call abend('after bib1                                        ')
  #endif
            do 220 ib1=1,napx
              iar=ib1+(ib-1)*napx
  
              do ib2=1,6
                do ib3=1,6
  
negative.code:               enddo
              endif
  
              do i=1,napx
                clo6v(1,i)  = clo(1)
                clop6v(1,i) = clop(1)
                clo6v(2,i)  = clo(2)
                clop6v(2,i) = clop(2)
                di0xs(i)    = di0(1)
                di0zs(i)    = di0(2)
                dip0xs(i)   = dip0(1)
                dip0zs(i)   = dip0(2)
                qwcs(i,1)   = qwc(1)
                qwcs(i,2)   = qwc(2)
                qwcs(i,3)   = zero
  
                do i2=1,4
                  do j2=1,4
                    tas(i,i2,j2)=tasm(i2,j2)
                  end do
                end do
              end do
            endif
            iar=1
  
  ! save tas matrix and closed orbit for later dumping of the beam
  ! distribution at the first element (i=-1)
  