      double precision function trndat(rdate)
      double precision rdate
c
c   function trndat converts a date and time specified
c   in rdate (yymmdd.hhmm) into a julian calender date with
c   time of day as a fractional part
c
      integer idate(5),y,c,ya,m
      character*11 string
c   first we must strip out the 5 values all contained in rdate
c   correct for cases with yymmddhhmm instead of yymmdd.hhmm
      if (rdate.gt.1000000.) rdate=rdate/1000.
      write(string,fmt='(f11.4)') rdate
      read(string,fmt='(3i2,1x,2i2)') idate
      if (idate(2).le.2) then
         m=idate(2)+9
         y=1900+idate(1)-1
      else
         m=idate(2)-3
         y=1900+idate(1)
      endif
      c=y/100
      ya=y-100*c
      y=(146097*c)/4+(1461*ya)/4+(153*m+2)/5+idate(3)-578041
c   correct to jan 1, 1950 to avoid loss of minutes
c   through roundoff errors
c   the constant 134123 = yrmoda(50,1,1)
      y=y-134123
      trndat=real(y)+(real(idate(4))+(real(idate(5))/60.))/24.
      return
 99   trndat=0.
      return
      end
