      SUBROUTINE GETDAT (IDATE,IIN,DELMIN,NOUT,NTIME)
C 
C     CALCULATES TIME, DAY, MONTH AND YEAR OF DATA POINT NOUT 
C     GIVEN TIME, DAY, MONTH, AND YEAR OF REFERENCE POINT IIN.
C     TIME INTERVAL (IN MINUTES) BETWEEN DATA POINTS IS MINDEL. 
C 
C     IDATE(1)     = TWO DIGIT HOUR OF REFERENCE POINT IIN.
C     IDATE(2)     = TWO DIGIT MINUTE OF REFERENCE POINT IIN.
C     IDATE(3)     = TWO DIGIT DAY OF REFERENCE POINT IIN.
C     IDATE(4)     = TWO DIGIT MONTH OF REFERENCE POINT IIN.
C     IDATE(5)     = TWO DIGIT YEAR OF REFERENCE POINT IIN. 
C     IIN          = ARRAY NUMBER OF REFERENCE POINT. 
C     NTIME        = 14 CHARACTER TIME/DATE OF DESIRED ARRAY NUMBER NOUT
C                    (EXAMPLE - '0030 28 AUG 72' 
C     DELMIN       = TIME INTERVAL (IN MINUTES BETWEEN DATA POINTS. 
C 
C     PROGRAMMED BY JIM HOLBROOK, DEC 72. 
C	MODIFIED FOR VAX BY P. FREITAG, JUNE 84
C 
	CHARACTER*3 MON(12)
	CHARACTER*14 NTIME
      DIMENSION NDAY(12),NTIME2(2),IDATE(5)
      DATA MON/'JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG', 
     *'SEP','OCT','NOV','DEC'/
      DATA NDAY/31,28,31,30,31,30,31,31,30,31,30,31/
C 
C     ADJUST FOR LEAP YEAR. 
C 
      NDAY(2)=28
      IF (MOD(IDATE(5),4).EQ.0) NDAY(2)=29
C 
C     CALCULATE INTERVAL IN MINUTES, HOURS, DAYS, AND MONTHS. 
C 
      NMMTOT=(NOUT-IIN)*DELMIN
      NHRTOT=NMMTOT/60
      NDYTOT=NHRTOT/24
      NMMLT=NMMTOT-NHRTOT*60
      NHRLT=NHRTOT-NDYTOT*24
C 
C     CALCULATE TIME OF DESIRED DATA POINT. 
C 
      NH1=IDATE(1) 
      NM2=IDATE(2) 
      NM3=NM2+NMMLT 
      IF (NM3.LT.60) GO TO 910
      NM3=NM3-60
      NH1=NH1+1 
 910  NH2=NH1+NHRLT 
      IF (NH2.LT.24) GO TO 920
      NH2=NH2-24
      NDYTOT=NDYTOT+1 
 920  NTIME1=NH2*100+NM3
C 
C     CALCULATE DATE OF DESIRED DATA POINT. 
C 
      IY1=IDATE(5) 
      NMON1=IDATE(4)
      ND1=IDATE(3)+NDYTOT 
 960  IF (ND1.LE.NDAY(NMON1)) GO TO 940 
 930  ND1=ND1-NDAY(NMON1) 
      NMON1=NMON1+1 
      IF (NMON1.LE.12) GO TO 960
      IY1=IY1+1 
      NDAY(2)=28
      IF (MOD(1900+IY1,4).EQ.0) NDAY(2)=29
      NMON1=1 
      IF (IY1.GE.100) IY1=0 
      GO TO 960 
 940  ENCODE (10,100,NTIME(5:14)) ND1,MON(NMON1),IY1
 100  FORMAT (1X,I2,1X,A3,1X,I2)
      NTIME1=NTIME1+10000 
      ENCODE(5,102,NTIME2) NTIME1 
 102  FORMAT (I5) 
      DECODE (5,103,NTIME2) DUM,NTIME(1:4) 
 103  FORMAT (A1,A4)
      RETURN
      END 
