      subroutine lire(b,l,n,ifil)
      parameter (ngru3=2048)
      IMPLICIT REAL*8(A-H,O-Z)
      dimension b(n)
c      write(6,*)'lire l,n,ifil',l,n,ifil
      nn=n/ngru3
      ll=(l-1)*(n/ngru3+1)
      do k=1,n,ngru3
         ll=ll+1
c          read(ifil,rec=l) b
         long=min0(ngru3,n-k+1)
         call lirec(b(k),ll,long,ifil)
      enddo
      return
      end
       subroutine lirec(b,ll,long,ifil)
      IMPLICIT REAL*8(A-H,O-Z)
      dimension b(long)
c       print*,'lirec ll',ll,ifil,long
      read(ifil,rec=ll) b
      return
      end
