      subroutine timdat(itim,idat)
c===============================================================c
c     written by Vassilis Hajivassiliou                         c
c     with the aid of Yoosoon Chang.                            c
c     version 1.0, March 22, 1992                               c
c     version 1.1, July 11, 1992                                c
c===============================================================c
c
c       set of dummy routines to stand in for timing ones
c
c       vassilis hajivassiliou jun 1, 95
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         *** dummy version returns 0 0 0 0 ***
c         idat(1)=day, idat(2)=month, idat(3)=year (two digits)
c         *** dummy version returns 1-1-70 ***
c      2.double precision function sec()
c         number of seconds since a fixed point, typically midnight
c         *** dummy version returns 1 ***
c      3.double precision function cpusec()
c         number of seconds of cpu since previous invocation
c         *** dummy version returns 1 ***
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:
      idat(1)=1
c      month:
      idat(2)=1
c      year:
      idat(3)=70

c      hours:
      itim(1)=0
c      minutes:
      itim(2)=0
c      seconds:
      itim(3)=0
c      hundredths of sec: not implemented
      itim(4)=0
c      time since jan 1, 1989
c             hun-secs     secs        mins       hours       days
      itim(5)=0

      return
      end
c===============================================================c
c     written by Vassilis Hajivassiliou and Yoosoon Chang.      c
c     version 1.0, March 22, 1992                               c
c===============================================================c
c      2.double precision function sec()
c         number of seconds since a fixed point, typically midnight
c         *** dummy version returns 1 ***
      double precision function sec()
      sec=1.d0
      return
      end
c      3.double precision function cpusec()
c         number of seconds of cpu since previous invocation
c         *** dummy version returns 1 ***
      double precision function cpusec()
      cpusec=1.d0
      return
      end
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      subroutine getevar(cvname,cvvalue)
c===============================================================c
c     written by Vassilis Hajivassiliou and Yoosoon Chang.      c
c     version 1.0, March 22, 1992                               c
c===============================================================c
c
c     vah 8:34:21.59, Tue, Mar 24, 1992
c     UNIX version
c
c     cvvalue must be a character variable declared in the calling 
c     program.
c
c     if cvname is not set, cvvalue will be '?' upon return.
c
c     requires subprograms system, icoccfst, and ltrim
c
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      character*(*) cvname,cvvalue
      character*80 line,ctemp
      lcvn=ltrim(cvname)
      cvvalue='?'
      call system('set>/tmp/tmpevar')
      call system('setenv>>/tmp/tmpevar')
ccc      call system('more /tmp/tmpevar')
      open(99,file='/tmp/tmpevar')
    1 continue 
ccc      read(99,'(a)',end=2) line
      read(99,'(a)',err=2) line
c     first search set environment
      ctemp=cvname(1:lcvn)//char(9)
      ltemp=ltrim(ctemp)
      l2=icoccfst(ctemp(1:ltemp),line)
      if(l2.gt.0) then
         l1=icoccfst(char(9),line)+1
         l2=ltrim(line)
         cvvalue=line(l1:l2)
         goto 2
      endif
c     now search setenv environment
      ctemp=cvname(1:lcvn)//'='
      ltemp=ltrim(ctemp)
      l2=icoccfst(ctemp(1:ltemp),line)
      if(l2.gt.0) then
         l1=icoccfst('=',line)+1
         l2=ltrim(line)
         cvvalue=line(l1:l2)
         goto 2
      endif
      goto 1
    2 continue
      close(99,status='delete')
      return
      end
      subroutine fsize(fname,nbytes)
c     Returns size of file fname in bytes.  
c     Returns -1 if file does not exist
c
c       vassilis hajivassiliou jun 1, 95
c
c     dummy version.  Returns 0 bytes for any file that exists.
c
c+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      character*(*) fname

      call cexist(fname,icode)

      if(icode.ge.0) then
         nbytes=0
      else
         nbytes=-1
      endif

      return
      end
