      program part

c     Program to split files with crossovers into smaller ones

      implicit real*8(a-h,o-z)
      character * 60 ifile,ofile1,ofile2 

c  central loop for reading data
c  -----------------------------

      write(*,*) 'Enter input filename' 
      read(*,'(A)') ifile
      read(*,'(A)') ofile1
      read(*,*) a1,a2,a3,a4
 
      open(10,file=ifile,status='old',form='formatted',err=9004)
      open(20,file=ofile1,form='formatted',err=9004)
9001  continue
      read(10,*,end=9003) irev,ala,alo,b1,b2,b3
9002  continue
      if (ala.gt.a1.and.ala.lt.a2.and.alo.gt.a3.and.alo.lt.a4)
     . then 
       write(20,550) irev,ala,alo,b1,b2,b3
       end if 
      goto 9001
 550  format(i8,2f11.5,6f10.4)
9003  continue
9004  continue
      close(10)
      close(20)
      end
