      SUBROUTINE SPACEFINDl(iend,imax,ncomma,icomma,clocal)

C     SPACEFIND FINDS SPACINGS FOR SPACE DELINEATED DATA
C     THIS VERSION IS FOR A PASSED CHARACTER VARIABLE

c********************************************************
c   
c   Passed Variables:
c
c    iend - size of line
c    ncomma - number of space delineated parameters found
c    imax - maximum number of comma delineated parameters
c    icomma - 1. starting point of each space delineated parameter
c             2. number of characters in each parameter
c    clocal - local character array
c
c********************************************************

      character*1 c
      character*(*) clocal
      dimension icomma(imax,2)

      ncomma=0
c     nfirst=0
      icomma(1,1)=1

c    skip opening spaces

      ichar=0
      do 50 nn=1,iend

       c=clocal(nn:nn)
       if ( c .eq. ' ' ) then

        if ( ichar .gt. 0 ) then
         ichar=0
         ncomma=ncomma+1
         icomma(ncomma,2)=nn-icomma(ncomma,1)
         icomma(ncomma+1,1)=nn+1
        else
         icomma(ncomma+1,1)=icomma(ncomma+1,1)+1
        endif

       else
    
        ichar=1

       endif

50    continue

      if ( iend-icomma(ncomma+1,1) .ge. 0 ) then
       ncomma=ncomma+1
       icomma(ncomma,2)=(iend-icomma(ncomma,1))+1
      endif
 
      return
      end

