NCEPLIBS-w3emc  2.11.0
w3valdat.f
Go to the documentation of this file.
1 
4 
17  logical function w3valdat(idat)
18  integer idat(8)
19  real rinc1(5),rinc2(5)
20  integer jdat(8)
21 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
22 ! essentially move the date and time by a zero time interval
23 ! and see if the same date and time is returned
24  rinc1(1)=0
25  rinc1(2:5)=idat(5:8)
26  call w3reddat(-1,rinc1,rinc2)
27  jldayn=iw3jdn(idat(1),idat(2),idat(3))+nint(rinc2(1))
28  call w3fs26(jldayn,jdat(1),jdat(2),jdat(3),jdow,jdoy)
29 ! the time zone is valid if it is in signed hhmm format
30 ! with hh between -23 and 23 and mm equal to 00 or 30
31  jdat(4)=mod(idat(4)/100,24)*100+mod(mod(idat(4),100),60)/30*30
32  jdat(5:8)=nint(rinc2(2:5))
33  w3valdat=all(idat.eq.jdat)
34 ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
35  end
function iw3jdn(IYEAR, MONTH, IDAY)
Computes julian day number from year (4 digits), month, and day.
Definition: iw3jdn.f:42
subroutine w3fs26(JLDAYN, IYEAR, MONTH, IDAY, IDAYWK, IDAYYR)
Computes year (4 digits), month, day, day of week, day of year from julian day number.
Definition: w3fs26.f:56
subroutine w3reddat(it, rinc, dinc)
This subprogram reduces an ncep relative time interval into one of seven canonical forms,...
Definition: w3reddat.f:86
logical function w3valdat(idat)
This logical function returns true if the input is a valid NCEP absolute date and time.
Definition: w3valdat.f:18