      SUBROUTINE MATCHLOCKPROBE(icounter,probename,
     * ip,proberec,iprobe,maxprobe)

C     MATCHLOCKPROBE MATCHES THE GIVEN PROBE TO
C     THE APPROPRIATE PROBE FROM THE LOCK FILE

      character*(*) probename(maxprobe)
      character*(*) proberec

      iprobe=0

      call findlastchar(nsp,proberec,ip)
      do 50 nn=1,icounter
       call findlastchar(nsp2,probename(nn),ip)
       if ( nsp .eq. nsp2 .and.
     *  probename(nn)(1:nsp) .eq. proberec(1:nsp)) then
        iprobe=nn
        return
       endif

50    continue

      return
      end
       
