anchor.diff:          endif
       elseif (labelAll) then
           if (printRecord) then
  -            write(luout,*) irecord,inout
  -        else
  -            write(luout,*) inout
  +            if (multiPoly) then
  +                write(luout,*) irecord,inout,ipoly
  +            else
  +                write(luout,*) irecord,inout
  +            endif
  +        else
  +            if (multiPoly) then
  +                write(luout,*) inout,ipoly
  +            else
  +                write(luout,*) inout
  +            endif
           endif
       endif
   enddo
  
positive.code: implicit none
  
  ! Local variables
  integer :: i, ios, luin, luout, nclip, inout, irecord
  character(len=512) :: line
  double precision :: x, y
  double precision, allocatable :: polygon(:,:)
  
  
  ! Parse command line
  
negative.code:     call usage('clip: no polygon file found named "'//trim(poly_file)//'"')
  endif
  nclip = line_count(poly_file)
  
  ! Check to see whether file contains single or multiple polygons
  open(unit=21,file=poly_file,status='old')
  read(21,'(A)') ch1
  npoly = 1
  if (ch1.eq.'>') then
      multiPoly = .true.
      do i = 1,nclip
          read(21,'(A)')
          if (ch1.eq.'>') then
              npoly = npoly + 1
          endif
      enddo
      allocate(polygon(npoly,nclip,2))
  else
      multiPoly = .false.
      allocate(polygon(npoly,nclip,2))
  endif
  rewind(21)
  
  npoly = 1
  do i = 1,nclip
      read(21,'(A)') line
      if (line.eq.'>'.and.i.gt.1) then
          npoly = npoly + 1
          cycle
      endif
      read(line,*,iostat=ios) polygon(npoly,i,1),polygon(npoly,i,2)
      if (ios.ne.0) then
          write(stderr,*) 'clip: error reading polygon file coordinates at line ',i
          call usage(     'Offending line: '//trim(line))
  