      SUBROUTINE TIMKA(KEY,TARR)
c
c SHF KEY TO I*4 ARRAY = yr, dat, hr, mn ,sc
c
c modified by Nick 26/7/89 to start at 1976. 
c modified by paul, 21/6/90 to start from 1971. 
c Nick, 14/10/92 to make valid from 1971-2000
c modified by pat, 4/1/93 to start from 1968
c modified by micah, 7/10/98 to extend to 2007
c modified by bryan, 2/27/08 to extend to 2031
c
      INTEGER*4 KEY,KEY4(64),D
      INTEGER*4 nkeys, sub
      INTEGER*4 TARR(5)
c
      DATA nkeys/64/
      DATA KEY4 /-378691200,-347068800,-315532800,-283996800,
     &           -252460800,-220838400,-189302400,-157766400,
     &           -126230400, -94608000, -63072000, -31536000,
     &                    0,  31622400,  63158400,  94694400,
     &            126230400, 157852800, 189388800, 220924800,
     &            252460800, 284083200, 315619200, 347155200,
     &            378691200, 410313600, 441849600, 473385600,
     &            504921600, 536544000, 568080000, 599616000,
     &            631152000, 662774400, 694310400, 725846400,
     &            757382400, 789004800, 820540800, 852076800,
     &            883612800, 915235200, 946771200, 978307200,
     &        1009843200, 1041465600, 1073001600, 1104537600,
     &        1136073600, 1167696000, 1199232000, 1230768000,
     &        1262304000, 1293926400, 1325462400, 1356998400,
     &        1388534400, 1420156800, 1451692800, 1483228800,
     &        1514764800, 1546387200, 1577923200, 1609459200/

      SUB=NKEYS
      DO WHILE (KEY.LT.KEY4(SUB).AND.SUB.NE.1)
        SUB = SUB-1
      END DO
      TARR(1) =1967+SUB
      D = KEY-KEY4(SUB)
      TARR(5) = MOD(D,60)
      D = D/60
      TARR(4) = MOD(D,60)
      D = D/60
      TARR(3) = MOD(D,24)
      TARR(2) = D/24+1
      RETURN
      END
