      subroutine ecribl(mat,long,ifil)
      parameter(ngru3=2048)
      dimension mat(long)
      ifin=0
      do k=1,long,ngru3
         ideb=ifin+1
         ifin=ideb+ngru3-1
         call ecri(mat(ideb),ngru3,ifil)
      enddo
      return
      end
      subroutine ecri(mat,long,ifil)
      dimension mat(long)
c      if(ifil.eq.77) then
c         write(6,*)'ecri long,ifil',long,ifil
c         print'(10i8)',(mat(k),k=1,min(10,long))
c      endif
c      print*,'mat',mat
      write(ifil) mat
      return
      end
       subroutine ecrc(c,long,ifil)
      character(1) c(long)
c     write(6,*)'ecri long,ifil',long,ifil
      write(ifil) c
      return
      end
      subroutine ecr8(amat,long,ifil)
      double precision amat(long)
      write(ifil) amat
      return
      end
      subroutine ecr8bl(amat,long,ifil)
      parameter(ngru3=2048)
      double precision amat(long)
      ifin=0
c       write(6,*)'ecr8bl long ifil',long,ifil,amat(1),amat(326)
      do k=1,long,ngru3
         ideb=ifin+1
         ifin=min0(ideb+ngru3-1,long)
         ll=ifin-ideb+1
         call ecr8(amat(ideb),ll,ifil)
      enddo
      return
      end
       subroutine lir8bl(amat,long,ifil)
      parameter(ngru3=2048)
      double precision amat(long)
      ifin=0
c      write(6,*)'lir8bl av long,ifil',long,ifil,amat(1),amat(326)
      do k=1,long,ngru3
         ideb=ifin+1
         ifin=min0(ideb+ngru3-1,long)
         ll=ifin-ideb+1
         call lir8(amat(ideb),ll,ifil)
      enddo
c      write(6,*)'lir8bl ap long,ifil',long,ifil,amat(1),amat(326)
      return
      end
