anchor.diff:  
        ! actual interpolation
        ddcum = spos-dcum(iUp)
  -     if( ddcum.lt.zero ) ddcum=tlen+ddcum
  +     if( ddcum.lt.zero ) ddcum=dcum(iu)+ddcum
        mdcum = dcum(iDw)-dcum(iUp)
  -     if( mdcum.lt.zero ) mdcum=tlen+mdcum
  +     if( mdcum.lt.zero ) mdcum=dcum(iu)+mdcum
        do jj=1,9
           oApe(jj)=((ape(jj,ixDw)-ape(jj,ixUp))/mdcum)*ddcum+ape(jj,ixUp)
        end do
  
positive.code:         end do !do jj=1,niter
  
          ! pay attention to overflow
          if( slos.gt.tlen ) then
            slos=slos-tlen
          end if
  
        else !if(lback)
  
negative.code: ! . iNew is iApeUp
    lApeUp=iApeUp.eq.iNew.and.ixApeUp.eq.ixNew
  
  ! . iNew is at the same s as iApeUp (inlcuding ring overflow)
    lAupDcum=abs(dcum(iNew)-dcum(iApeUp)).lt.sPrec.or.abs(dcum(iNew)-dcum(iApeUp)-dcum(iu)).lt.sPrec
  
  ! . iNew is iApeDw
    lApeDw=iApeDw.eq.iNew.and.ixApeDw.eq.ixNew
  
  ! . iNew is at the same s as ApeDw (inlcuding ring overflow)
    lAdwDcum=abs(dcum(iNew)-dcum(iApeDw)).lt.sPrec.or.abs(dcum(iNew)-dcum(iApeDw)-dcum(iu)).lt.sPrec
  
  ! . constant aperture?
    lconst = sameAperture( ixApeUp, ixApeDw )
  