1 C $Date: 1994/10/12 17:24:21 $
6 logical function find_arg(ipos,line,errflag)
9 character*1 empty /' '/,equal /'='/
11 * This function returns .TRUE., if an argument follows keyword keywd; if so
12 * IPOS will point to the first non-blank character of the argument. Returns
13 * .FALSE., if no argument follows the keyword; in this case IPOS points
14 * to the first non-blank character of the next keyword.
15 do while (line(ipos:ipos) .eq. empty .and. ipos.le.maxlen)
19 if (line(ipos:ipos).eq.equal) then
22 do while (line(ipos:ipos) .eq. empty .and. ipos.le.maxlen)
25 if (ipos.gt.maxlen) errflag=.true.
31 logical function find_group(iunit,jout,key1)
33 character*80 karta,ucase
40 do while (index(ucase(karta),key1(1:ll)).eq.0.or.lcom(1,karta))
41 read (iunit,'(a)',end=10) karta
43 write (jout,'(2a)') '> ',karta(1:78)
49 logical function iblnk(charc)
53 iblnk = (n.eq.9) .or. (n.eq.10) .or. (charc.eq. ' ')
56 integer function ilen(string)
61 1 if ( ilen .gt. 0 ) then
62 if ( iblnk( string(ilen:ilen) ) ) then
69 integer function in_keywd_set(nkey,ikey,narg,keywd,keywdset)
70 character*16 keywd,keywdset(1:nkey,0:nkey)
73 if (ucase(keywd).eq.keywdset(i,ikey)) then
79 * No match to the allowed set of keywords if this point is reached.
83 character*(*) function lcase(string)
93 if (string(k+1:) .ne. ' ') then
97 idiff = ichar('a') - ichar('A')
101 if (lge(c,'A') .and. lle(c,'Z')) then
102 lcase(i:i) = char(ichar(c) + idiff)
107 logical function lcom(ipos,karta)
109 character koment(2) /'!','#'/
112 if (karta(ipos:ipos).eq.koment(i)) lcom=.true.
116 logical function lower_case(ch)
118 lower_case=(ch.ge.'a' .and. ch.le.'z')
121 subroutine mykey(line,keywd,ipos,blankline,errflag)
122 * This subroutine seeks a non-empty substring keywd in the string LINE.
123 * The substring begins with the first character different from blank and
124 * "=" encountered right to the pointer IPOS (inclusively) and terminates
125 * at the character left to the first blank or "=". When the subroutine is
126 * exited, the pointer IPOS is moved to the position of the terminator in LINE.
127 * The logical variable BLANKLINE is set at .TRUE., if LINE(IPOS:) contains
128 * only separators or the maximum length of the data line (80) has been reached.
129 * The logical variable ERRFLAG is set at .TRUE. if the string
130 * consists only from a "=".
131 parameter (maxlen=80)
132 character*1 empty /' '/,equal /'='/,comma /','/
135 logical blankline,errflag,lcom
137 do while (line(ipos:ipos).eq.empty .and. (ipos.le.maxlen))
140 if (ipos.gt.maxlen .or. lcom(ipos,line) ) then
141 * At this point the rest of the input line turned out to contain only blanks
142 * or to be commented out.
148 * Checks whether the current char is a separator.
149 do while (line(ipos:ipos).ne.empty .and. line(ipos:ipos).ne.equal
150 & .and. line(ipos:ipos).ne.comma .and. ipos.le.maxlen)
154 * Error flag set to .true., if the length of the keyword was found less than 1.
155 if (iend.lt.istart) then
159 keywd=line(istart:iend)
162 subroutine numstr(inum,numm)
163 character*10 huj /'0123456789'/
169 numm(3:3)=huj(inum2+1:inum2+1)
173 numm(2:2)=huj(inum2+1:inum2+1)
177 numm(1:1)=huj(inum2+1:inum2+1)
180 character*(*) function ucase(string)
190 if (string(k+1:) .ne. ' ') then
194 idiff = ichar('a') - ichar('A')
198 if (lge(c,'a') .and. lle(c,'z')) then
199 ucase(i:i) = char(ichar(c) - idiff)