      SUBROUTINE MAINPROBER(npro,nparms)

C     MAINPROBER SUBSTITUTES THE CORRECT MAIN PROBE TYPE
C     FOR THE FIRST MARKED PROBE.
C     THIS IS ONLY DONE IF FILE DUM.MAINPROBE EXISTS AND
C     CONTAINS A VALID VALUE
C  
C     MAINPROBER ALSO COPIES ALL PROBE INFORMATION FROM
C     THE MAIN PROBE  HOLDER (JP) TO THE ALL PROBE
C     HOLDER (JPM).  ALL INFORMATION FOR ALL PROBES BUT
C     THE FIRST ARE REMOVED FROM JP.

C     NUMBER OF WORKING PROBES (NPRO) IS RESET TO ONE

      parameter (maxlevel=6000, maxparm=100, maxprobe=100)
      parameter (maxcalc=200)

      character*11 ctype(maxprobe)

      common /probes/ ctype

      dimension nopas(maxprobe), nprm(maxprobe,maxparm)
      dimension  nprec(maxcalc,maxprobe), npatot(maxparm)
      dimension jpm(0:maxprobe),jp(0:maxprobe)

      common /nopars/ nopas
      common /partype/ nprm
      common /parmord/ nprec
      common /totalparms/ npatot
      common /allprobe/ jpm,npromax
      common /reqprobe/ jp

      open(19,file='./dum.mainprobe',status='old', iostat=ios)

      if ( ios .ne. 0 ) return

      read(19,*) mainprobe
      close(19)

      call getmainprobe(iyes,mainprobe,jp(1),nparms)

      if ( npromax .eq. 0 ) then

       do 50 nn=1,npro

        jpm(nn)=jp(nn)
        jp(nn)=0

        npromax=npromax+1

50     continue

      endif

      npro=1

      return
      end

