      subroutine delfil(fil)
      character*(*) fil
      logical y
      inquire(file=fil,opened=y)
      if(y) then
         inquire(file=fil,number=n)
         close(n,status='delete')
      else
         open(34,file=fil,status='unknown',form='unformatted')
         close(34,status='delete')
c         write(6,*)'fichier ',fil,' detruit'
      endif
      return
      end
       subroutine lisfiles
      logical opened,lex
      character(300) name
!
!---------------------------------------------
! Liste de toutes les files ouvertes
!---------------------------------------------
!
      do i=1,99
         inquire(unit=i,opened=opened)
         if(opened) then
            inquire(unit=i,name=name)
            print'(a,i3,2a)','file',i,'   Name= ',trim(name)
         endif
      enddo
      return
      end
