subroutine split4(header,argout,nw,ier) c c split a character string in words and put them in vector argout*200 c if the first character of the first word is: " c then everything up to the next " is considered as one single token c (i.e. blank in filenames) c c a.tento 2/04 v.1.0 c implicit none character header*(*) character*200 argout(*) integer nw, ier c integer mlength parameter (mlength = 200) integer inhb, inhe dimension inhb(mlength), inhe(mlength) integer flag, i, length, j, nw2, k character*1 sep1, bkf parameter ( sep1 = ' ', bkf = '"' ) c c ier = 0 length = len(header) flag = 0 nw = 0 do 1 i = 1, length if ( header(i:i) .eq. sep1 ) then flag = 0 else if(flag .eq. 0) then nw = nw + 1 inhb(nw) = i inhe(nw) = i flag = 1 else inhe(nw) = i endif endif 1 continue c c if (header(inhb(1):inhb(1)) .eq. bkf) then k = 1 if ( header(inhe(1):inhe(1)) .eq. bkf # .and. # (inhe(1) - inhb(1)) .eq. 0 ) k = 2 inhb(1) = inhb(1) + 1 do 3 i = k, nw j = i if (header(inhe(i):inhe(i)) .eq. bkf) goto 4 3 continue ier = 1 return 4 continue inhe(1) = inhe(j) - 1 nw2 = 1 j = j + 1 do 5 i = j, nw nw2 = nw2 + 1 inhb(nw2) = inhb(i) inhe(nw2) = inhe(i) 5 continue nw = nw2 endif c c do 2 i = 1, nw argout(i) = header(inhb(i):inhe(i)) 2 continue c c return c end