      SUBROUTINE MASKERASE(nm,nt,nmask,ifn,iparm2,ipro2)

C     MASKERASE ERASES A MASK FROM THE SET OF MASKS OPENED FOR
C     A PROBE TYPE

      parameter (maxmask=100)
      dimension nmask(5),ifn(maxmask)
      dimension iparm2(maxmask),ipro2(maxmask)

      if ( nt .eq. 1 ) then
       ns=1
      else
       ns=nmask(nt-1)+1
      endif

      ns=ns+nm-1 
      ne=nmask(5)-1

      call onefilecloseft(ifn(ns))
      do 40 n=ns,ne

       ifn(n) = ifn(n+1)
       ipro2(n) = ipro2(n+1)
       iparm2(n) = iparm2(n+1)

40    continue

      do 45 n=nt,5
45     nmask(n)=nmask(n)-1

      return
      end

