      subroutine parsecl(clstring,istrt,iend,narg)
c       vah 15:08:17.40, Mon, Apr 9, 1990
c       for the SUN
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      parameter (maxnarg=10)
      character*(*) clstring
      character*132 c132
      integer istrt(maxnarg),iend(maxnarg)
      narg=1
      is=1
 1    continue
      call getarg(narg,c132)
      if(c132(1:1).ne.' ') then
            l=ltrim(c132)
            clstring(is:is+l-1)=c132(1:l)
            istrt(narg)=is
            iend(narg)  =is+l-1
            is=is+l
      else
            narg=narg-1
            return
      endif
      narg=narg+1
      if(narg.gt.maxnarg) then
            print *,'Warning from routine PARSECL:'
            print *,'Limit of Maximum Command Line Arguments Exceeded.'
            print *,'Only first ',maxnarg,' processed.'
            return
      endif
      goto 1
      end
      SUBROUTINE TIMDAT(ITIM,IDAT)
C
C       SET OF ROUTINES TO DO TIMING ON A UNIX MACHINE
C
C       VASSILIS HAJIVASSILIOU 14:00:48.40, Sun, Jun 3, 1990
C
C      1.SUBROUTINE TIMDAT(ITIM,IDAT)
C         itim(1)=hours, itim(2)=minutes, itim(3)=secs,
C         itim(4)=1/100th secs, itim(5)=1/100th-secs-since-Jan1,1989
C         idat(1)=day, idat(2)=month, idat(3)=year (two digits)
C      2.DOUBLE PRECISION FUNCTION SEC()
C         number of seconds since a fixed point, typically midnight
C      3.DOUBLE PRECISION FUNCTION CPUSEC()
C         number of seconds of cpu since previous invocation
C  1,2, AND 3 ARE SYSTEM DEPENDENT ROUTINES, CALLED BY OTHERS
C
C      4.DOUBLE PRECISION FUNCTION SEED(ISEED)
C         calls the system clock to obtain a seed; returned also as I*4
C      5.SUBROUTINE TIMES(NFILE)
C         prints timing information (since last invocation if re-called)
C      6.SUBROUTINE WHEN(NFUNIT)
C         prints date and time
C      7.DOUBLE PRECISION FUNCTION HSEC()
C         number of 1/100th secs since fixed point (typically midnight)
C***********************************************************************
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      INTEGER*4 ITIM(5),IDAT(3)
      INTEGER*4 TIME,STIME,IARG(3)
      EXTERNAL ITIME,TIME,IDATE,SECMIC,SEC

C      DAY:
C      MONTH:
C      YEAR:
      CALL IDATE(IARG)
      IDAT(1)=IARG(1)
      IDAT(2)=IARG(2)
      IDAT(3)=IARG(3)-1900
c     to make idat(3) have two digits only
      dayfrm89=idat(1)+30*(idat(2)+12*(idat(3)-89))

      STIME=TIME()
      CALL ITIME(IARG)
C      HOURS:
      ITIM(1)=IARG(1)
C      MINUTES:
      ITIM(2)=IARG(2)
C      SECONDS:
      ITIM(3)=IARG(3)
C      HUNDREDTHS OF SEC: NOT IMPLEMENTED
      ITIM(4)=SECMIC()/10000.D0
C      TIME SINCE Jan 1, 1989
c             hun-secs     secs        mins       hours       days
      ITIM(5)=itim(4)+100*(itim(3)+60*(itim(2)+60*itim(1))+24*dayfrm89)

      RETURN
      END
       integer function ltrim(string)
c     vah 6:47 pm, saturday, february 27, 1988
      character*(*) string
c
c    return the blank-stripped length
c
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      do 10 l=len(string),1,-1
      ltrim=l
      if (string(l:l) .ne. ' ') return
10    continue
      return
      end
