**==EXDELTMP.spg  processed by SPAG 3.09I  at 10:43 on 12 Jan 1993
      SUBROUTINE EXDELTMP(ctype)

      IMPLICIT NONE

      CHARACTER*(*) ctype
      CHARACTER*100 ctmp

      INTEGER LENACT
      EXTERNAL LENACT
 
      ctmp = ctype(:lenact(ctype))//'.tmp'
      call makefname(ctmp)
      call unlink(ctmp)
 
      RETURN
      END

      subroutine makefname(fname)

      implicit none

      character*(*) fname

      character*10  str
      integer*4 random, getpid, lenact

      logical*4 first

      save first,random
      data first /.true./

      if (first) then
         random = getpid()
         first = .false.
      end if

      write(str,'(i6.6)')random
      fname = fname(1:lenact(fname))//str(1:6)
      return
      end

      subroutine openfile(lun,fname,status,misc1,misc2,misc3,misc4,ier)

      implicit none

      integer*4 lun, misc3, misc4, ier
      character*(*) fname,status,misc1,misc2

      open(unit=lun,file=fname,status=status,iostat=ier)

      return
      end
