      SUBROUTINE GETMAINPROBE(iyes,mainprobe,jp,nparm0)

c------------------------------------------------------------------
C     GETMAINPROBES GETS THE NUMBER AND NAMES OF EACH MAIN
C     PROBE TYPE
c------------------------------------------------------------------

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

      character*1 cchoice(maxlevel)
      character*11 ctype(maxprobe)
      character*80 text,text2

      character*80 filename  !- added by Todd 08-june-2000

      common /probes/ ctype

      dimension nopas(maxprobe), nprm(maxprobe,maxparm)
      dimension  nprec(maxcalc,maxprobe), npatot(maxparm)

      common /nopars/ nopas
      common /partype/ nprm
      common /parmord/ nprec
      common /totalparms/ npatot

      iyes=0
      call extraname('system/infofiles.dir'//CHAR(0),
     * 'probefile.d'//CHAR(0),filename)

      open(9,file=filename,status='old')
      read(9,'(a1)') text
      read(9,'(a1)') text
      read(9,*) nmain

      if ( mainprobe .gt. nmain ) then
       iyes=-1
       goto 4
      endif

      read(9,*) nparm

      do 10 nn=1,9
10     read(9,'(a1)') text

      do 15 nn=1,nparm
15     read(9,'(a1)') text

      do 20 nn=1,5
20     read(9,'(a1)') text

      do 25 nn=1,nmain

       call clearstring(text,80)
       read(9,'(a80)') text

       if ( nn .eq. mainprobe ) then

        call clearstring(text2,80)
        n3=0
        nspace1=0
        do 200 n2=2,80
         if ( nspace1 .eq. 0 .and. text(n2:n2) .ne. ' ' ) then
          n3=n3+1
          text2(n3:n3)=text(n2:n2)
         else
          nspace1=1
         endif
200     continue

        call findlastchar(nspc,text2,80)
        call findlastchar(nsp,ctype(jp),11) !- fixed (15-may-01 TOB)

        if ( nspc .eq. nsp .and. text2(1:nspc) .eq.
     *       ctype(jp)(1:nsp) ) then

         iyes=0

        else

         do 66 nb=1,nopas(jp)
          npatot(nprm(jp,nb))=npatot(nprm(jp,nb))-1
          nprm(jp,nb)=0
          nprec(nb,jp)=0
66       continue

         call readprobeinfo(jp,text,cchoice,ctype,nprm,nopas,
     *                      npatot,nprec,nparm0,0)
         iyes=1
         call findlastchar(nsp,ctype(jp),11) !- fixed (15-may-01 TOB)
c        ctype2=ctype(jp)(1:nsp)//CHAR(0)
         ctype(jp)(nsp+1:nsp+1)=CHAR(0)
         call cname2(ctype(jp),jp)

        endif

        goto 4

       endif

25    continue

4     close(9)

      return
      end




