anchor.diff:    if(st_quiet > 0 .and. iunit == 6) return
     write(iunit,1984) '#', 'name', 'aptype', 's[m]', 'aper1[mm]', 'aper2[mm]', &
    &                  'aper3[mm][rad]', 'aper4[mm][rad]', 'aper5[mm][rad]', 'aper6[mm][rad]', &
  - &                  'angle[rad]', 'xoff[mm]', 'yoff[mm]'
  -  return
  - 1984 format (a1,a48,1x,a6,1x,10(1x,a15))
  + &                  'angle[rad]', 'xoff[mm]', 'yoff[mm]', 'aper7[mm][rad]', 'aper8[mm][rad]'
  +  return
  + 1984 format (a1,a,1x,a6,1x,12(1x,a15))
   end subroutine dump_aperture_header
   
   subroutine dump_aperture_xsecs
  
positive.code: 
    ! dump info
    if(ldmpaperMem) then
       write(iunit,1984) name, apeName(aptype), spos, ape(1), ape(2), ape(3), ape(4), ape(5), ape(6), ape(7), ape(8), ape(9)
    else
       select case(aptype)
       case(-1) ! transition
          write(iunit,1984) name, apeName(aptype), spos, ape(1), ape(2), ape(3), ape(4), ape(5), ape(6), ape(7), ape(8), ape(9)
       case(0) ! not an aperture marker
          write(iunit,1984) name, apeName(aptype), spos, ape(1), ape(2), ape(3), ape(4), ape(5), ape(6), ape(7), ape(8), ape(9)
       case(1) ! Circle
          write(iunit,1984) name, apeName(aptype), spos, ape(1),   zero,   zero,   zero,   zero,   zero, ape(7), ape(8), ape(9)
       case(2) ! Rectangle
          write(iunit,1984) name, apeName(aptype), spos, ape(1), ape(2),   zero,   zero,   zero,   zero, ape(7), ape(8), ape(9)
       case(3) ! Ellipse
          write(iunit,1984) name, apeName(aptype), spos, ape(3), ape(4),   zero,   zero,   zero,   zero, ape(7), ape(8), ape(9)
       case(4) ! Rectellipse
          write(iunit,1984) name, apeName(aptype), spos, ape(1), ape(2), ape(3), ape(4),   zero,   zero, ape(7), ape(8), ape(9)
       case(5) ! Octagon
          ! get angles from points passing through x1,y1 and x2,y2
          ! x1=ape(1)
  
negative.code:           else
              call roffpos(xv1(j),xv2(j),xchk(1),xchk(2),ape(7,ix),ape(8,ix),ape(9,ix))
            end if
            llostp(j)=checkRT(xchk(1),xchk(2),ape(10,ix),ape(11,ix),ape(3,ix),ape(4,ix),apxx,apyy,apxy).or. &
              isnan_mb(xchk(1)).or.isnan_mb(xchk(2))
          else
            if(lbacktracking) then
              llostp(j)=checkRT(xLast(1,j),xLast(2,j),ape(10,ix),ape(11,ix),ape(3,ix),ape(4,ix),apxx,apyy,apxy).or. &
                isnan_mb(xLast(1,j)).or.isnan_mb(xLast(2,j))
            else
              llostp(j)=checkRT(xv1(j),xv2(j),ape(10,ix),ape(11,ix),ape(3,ix),ape(4,ix),apxx,apyy,apxy).or. &
                isnan_mb(xv1(j)).or.isnan_mb(xv2(j))
            end if
          end if
  