      subroutine enlarge(iunit,iexpc,iexpr)
      dimension z(1000),z1(1000)
      character*40 ifile,ifile1
      character*64 title
      logical iopen

      inquire(unit=iunit,opened=iopen)
      if(.not.iopen) then
      write(*,'(a\)') ' enter input file name: '
      read(*,'(a)') ifile
      open(iunit,file=ifile,status='old',form='unformatted')
      else
      rewind iunit
      endif

      ifile1='enlarge.exp'
      open(iunit+1,file=ifile1,status='unknown',
     & form='unformatted')
      read(iunit) title,ncol,nrow,nz,xo,dx,yo,dy
      write(iunit+1) title,ncol*iexpc,nrow*iexpr,nz,xo,dx/iexpc,
     & yo,dy/iexpr
      do 40 i=1,nrow
       call rrows(z,ncol,iunit,'r')
       n=0
        do 30 j=1,ncol
          do 20 k=1,iexpc
            n=n+1
            z1(n)=z(j)
20        continue
30     continue
      do 10 m=1,iexpr
       call rrows(z1,n,iunit+1,'w')
10    continue
40    continue
      return
      end
c******************************************************************************
      subroutine rrows(z,n,idev,t)
      dimension z(n)
      character*1 t
      if(t.eq.'r') then
        read(idev,end=10) y,z
      else
        write(idev) y,z
      endif
      return
10    print *,'end of file reading in subroutine rrows'
      return
      end
