       SUBROUTINE READMAINPROBES(ctypemain,maxmain,nmain)

C      READMAINPROBES READS MAIN PROBE NAMES FROM SYSTEM FILE

       parameter (icmax=50)
       character*(*) ctypemain(maxmain)
       character*80 filename,text
       dimension icomma(icmax,2)

       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
       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 ( text(1:1) .eq. 'x' ) text(1:1)=' '

       call spacefindl(80,icmax,ncomma,icomma,text)
       call clearstring(ctypemain(nn),11)
       i1=icomma(1,1)
       i2=icomma(1,1)+icomma(1,2)-1
       ctypemain(nn)(1:icomma(1,2))=text(i1:i2)

25    continue
      close(9)

      return
      end
