1 !-----------------------------------------------------------------------
2 subroutine w3utcdat
(idat
)
3 !$$$ SUBPROGRAM DOCUMENTATION BLOCK
5 ! SUBPROGRAM
: W3UTCDAT
RETURN THE UTC
DATE AND TIME
6 ! AUTHOR
: MARK IREDELL ORG
: WP23
DATE: 98-01-05
8 ! ABSTRACT
: THIS SUBPROGRAM RETURNS THE UTC
(GREENWICH
) DATE AND TIME
9 ! IN THE NCEP ABSOLUTE
DATE AND TIME DATA STRUCTURE
.
11 ! PROGRAM HISTORY LOG
:
12 ! 98-01-05 MARK IREDELL
13 ! 1999-04-28 Gilbert
- added a patch
to check
for the proper
14 ! UTC offset
. Needed until the IBM bug
15 ! in date_and_time is fixed
. The patch
16 ! can
then be removed
. See comments in
17 ! the section blocked with
"&&&&&&&&&&&".
18 ! 1999-08-12 Gilbert
- Changed so that czone variable is saved
19 ! and the system
call is only done
for
20 ! first invocation of this routine
.
22 ! USAGE
: CALL W3UTCDAT
(IDAT
)
25 ! IDAT
INTEGER (8) NCEP ABSOLUTE
DATE AND TIME
26 ! (YEAR
, MONTH
, DAY
, TIME ZONE
,
27 ! HOUR
, MINUTE
, SECOND
, MILLISECOND
)
30 ! DATE_AND_TIME FORTRAN
90 SYSTEM
DATE INTRINSIC
31 ! IW3JDN COMPUTE JULIAN DAY NUMBER
32 ! W3FS26 YEAR
, MONTH
, DAY FROM JULIAN DAY NUMBER
35 ! LANGUAGE
: FORTRAN
90
39 character cdate*8
,ctime*10
,czone*5
40 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
41 ! get local
date and time but use the
character time zone
42 call date_and_time
(cdate
,ctime
,czone
,idat
)
43 read(czone
,'(i5)') idat
(4)
44 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
45 ! convert
to hours and minutes
to UTC time
46 ! and possibly adjust the
date as well
47 idat
(6)=idat
(6)-mod
(idat
(4),100)
48 idat
(5)=idat
(5)-idat
(4)/100
50 if(idat
(6).lt
.00) then
53 elseif
(idat
(6).ge
.60) then
57 if(idat
(5).lt
.00) then
59 jldayn
=iw3jdn
(idat
(1),idat
(2),idat
(3))-1
60 call w3fs26
(jldayn
,idat
(1),idat
(2),idat
(3),idaywk
,idayyr
)
61 elseif
(idat
(5).ge
.24) then
63 jldayn
=iw3jdn
(idat
(1),idat
(2),idat
(3))+1
64 call w3fs26
(jldayn
,idat
(1),idat
(2),idat
(3),idaywk
,idayyr
)
66 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -