Merge branch 'release-v4.6.0'
[WPS.git] / ungrib / src / ngl / w3 / w3movdat.f
blob16cbade468615403dd8a624f730c3233c7f5e10c
1 !-----------------------------------------------------------------------
2 subroutine w3movdat(rinc,idat,jdat)
3 !$$$ SUBPROGRAM DOCUMENTATION BLOCK
5 ! SUBPROGRAM: W3MOVDAT RETURN A DATE FROM A TIME INTERVAL AND DATE
6 ! AUTHOR: MARK IREDELL ORG: WP23 DATE: 98-01-05
8 ! ABSTRACT: THIS SUBPROGRAM RETURNS THE DATE AND TIME THAT IS A GIVEN
9 ! NCEP RELATIVE TIME INTERVAL FROM AN NCEP ABSOLUTE DATE AND TIME.
10 ! THE OUTPUT IS IN THE NCEP ABSOLUTE DATE AND TIME DATA STRUCTURE.
12 ! PROGRAM HISTORY LOG:
13 ! 98-01-05 MARK IREDELL
15 ! USAGE: CALL W3MOVDAT(RINC,IDAT,JDAT)
17 ! INPUT VARIABLES:
18 ! RINC REAL (5) NCEP RELATIVE TIME INTERVAL
19 ! (DAYS, HOURS, MINUTES, SECONDS, MILLISECONDS)
20 ! IDAT INTEGER (8) NCEP ABSOLUTE DATE AND TIME
21 ! (YEAR, MONTH, DAY, TIME ZONE,
22 ! HOUR, MINUTE, SECOND, MILLISECOND)
24 ! OUTPUT VARIABLES:
25 ! JDAT INTEGER (8) NCEP ABSOLUTE DATE AND TIME
26 ! (YEAR, MONTH, DAY, TIME ZONE,
27 ! HOUR, MINUTE, SECOND, MILLISECOND)
28 ! (JDAT IS LATER THAN IDAT IF TIME INTERVAL IS POSITIVE.)
30 ! SUBPROGRAMS CALLED:
31 ! IW3JDN COMPUTE JULIAN DAY NUMBER
32 ! W3FS26 YEAR, MONTH, DAY FROM JULIAN DAY NUMBER
33 ! W3REDDAT REDUCE A TIME INTERVAL TO A CANONICAL FORM
35 ! ATTRIBUTES:
36 ! LANGUAGE: FORTRAN 90
38 !$$$
39 real rinc(5)
40 integer idat(8),jdat(8)
41 real rinc1(5),rinc2(5)
42 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
43 ! add the interval to the input time of day and put into reduced form
44 ! and then compute new date using julian day arithmetic.
45 rinc1(1)=rinc(1)
46 rinc1(2:5)=rinc(2:5)+idat(5:8)
47 call w3reddat(-1,rinc1,rinc2)
48 jldayn=iw3jdn(idat(1),idat(2),idat(3))+nint(rinc2(1))
49 call w3fs26(jldayn,jdat(1),jdat(2),jdat(3),jdow,jdoy)
50 jdat(4)=idat(4)
51 jdat(5:8)=nint(rinc2(2:5))
52 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
53 end