SUBROUTINE READPROBEINFO(n,cparm,cchoice,ctype,nprm,nopas, * npatot,nprec,numpar,isetadd) C READPROBEINFO READS PROBE INFORMATION FROM A LINE OF TEXT parameter (maxlevel=6000, maxparm=100, maxprobe=100) parameter (maxcalc=200) character*1 cchoice(maxlevel) character*11 ctype(maxprobe) character*80 cparm dimension nopas(maxprobe), nprm(maxprobe,maxparm) dimension nprec(maxcalc,maxprobe), npatot(maxparm) ispace = 0 imiddle = 0 cchoice(n)=cparm(1:1) ctype(n)=cparm(2:12) read(cparm(20:21),'(i2)') nopas(n) ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c The parameters which a probe measures are listed by c code number, separated either by a ',', a space, or c a '-'. A comma or a space just seperate two code numbers, c A hyphen means the probe measures each parameter whose c code number falls between the two values, including the c values themselves. c c Since a code may be 1-3 digits, these digits must all c be read together to form a code. So, the code is only read c when a comma, a space, or a hyphen is encountered. The c number of digits read is dependent on the distance between c hyphen, comma, and/or spaces. c c Reading the codes continues until the number of parameters c measured by a probe (nopas) is reached. c c Reset number of parameters (m) to zero c c nspace is set to 24 because this is the space of the first c digit of parameter code in cparm. nspace will be increased c as cparm is read. c ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc m=0 nspace=24 56 if ( cparm(nspace+1:nspace+1).eq.',' .or. * cparm(nspace+1:nspace+1).eq.' ') then ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c If a space or a comma is encountered, add one to the c parameter counter. Read the parameter code according c to how many digits since the last comma or space (ispace). c c Also increase nspace to the beginning of the next digit. c ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc m=m+1 if ( ispace.eq.0 ) then read(cparm(nspace:nspace),'(i1)') nprm(n,m) elseif ( ispace.eq.1 ) then read(cparm(nspace-1:nspace),'(i2)') nprm(n,m) elseif ( ispace.eq.2 ) then read(cparm(nspace-2:nspace),'(i3)') nprm(n,m) endif nspace=nspace+2 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c If this digit is to the right of a hyphen (imiddle=2), c set nprm (parameter codes by probe) for each number c between the last code read in and the latest code c read in successively, including these outside code c values. c ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc if ( imiddle.eq.2 ) then npholds=nprm(n,m-1) npholde=nprm(n,m) m=m-1 do 60 i=npholds+1,npholde m=m+1 nprm(n,m)=i 60 continue endif ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Reinitialize ispace. c If the last code read in was to the left of a hyphen, c (imiddle=1), set imiddle to 2, since the next entered c code will be to the right of the hyphen. c Otherwise reinitialize imiddle. c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc ispace=0 if ( imiddle.eq.1 ) then imiddle=2 else imiddle=0 endif elseif ( cparm(nspace+1:nspace+1).eq.'-' ) then cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c If the code to be entered is to the left of a hyphen, c record this information by making imiddle=1. Also c change the hyphen to a comma so the code can be entered. c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc imiddle=1 cparm(nspace+1:nspace+1)=',' else cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Bump ispace and nspace up one since this code must have c more digits. c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc ispace=ispace+1 nspace=nspace+1 endif ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c If all codes have not been read, read the next code. c ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc if ( m.lt.nopas(n)) goto 56 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Add one to counter npatot, which counts how many probes c measure each parameter, for each parameter measured. c c Also, invert nprm, that is, for each parameter, record c the order in which it was recorded. c ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc do 58 i=1,nopas(n) nprm(n,i) = nprm(n,i) + isetadd npatot(nprm(n,i))=npatot(nprm(n,i))+1 nprec(nprm(n,i),n)=i 58 continue ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Set nprec and nprm for the second header c ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc nprec(numpar+1,n)=nopas(n)+1 nprm(n,nopas(n)+1)=numpar+1 return end