cdeck homer9
      subroutine homer9 (idate,jdate)
c   homer9 takes a julian calender date and converts back to
c   year, month, day, hour, and minute in the array idate
c
      integer idate(5), j
      real jdate, hours
c   the following if-else clause corrects for the small
c   word size on some machines
c   the user can subtract yrmoda(50,1,1) (julian date for jan 1,1950)
c   from the date to provide minute accuracy in date
c   the constant 134123 is the value returned by
c      yrmoda(50,1,1)
c   the constant 578041 is the constant necessary to
c      correct the yrmoda function to the code of
c      this routine.
      if (int(jdate).lt.134123) then
         j=int(jdate)+134123+578041
      else
         j=int(jdate)+578041
      endif
      idate(1)=(4*j-1)/146097
      j=4*j-1-146097*idate(1)
      idate(3)=j/4
      j=(4*idate(3)+3)/1461
      idate(3)=4*idate(3)+3-1461*j
      idate(3)=(idate(3)+4)/4
      idate(2)=(5*idate(3)-3)/153
      idate(3)=5*idate(3)-3-153*idate(2)
      idate(3)=(idate(3)+5)/5
      idate(1)=100*idate(1)+j
      if (idate(2).lt.10) go to 10
      idate(2)=idate(2)-9
      idate(1)=idate(1)+1
      go to 20
   10 idate(2)=idate(2)+3
   20 idate(1)=idate(1)-1900
      hours=(jdate-float(int(jdate)))*24.+0.004
      idate(4)=int(hours)
      idate(5)=(hours-float(idate(4)))*60.+0.5
      return
      end
