1 subroutine build_hdate(hdate, iyr, imo, idy, ihr, imi, isc)
4 ! From the Year, Month, Day, Hour, Minute, and Second values,
5 ! creates a 19-character string representing the date, in the
6 ! format: "YYYY-MM-DD hh:mm:ss"
9 integer iyr ! year (e.g., 1997, 2001)
10 integer imo ! month (01 - 12)
11 integer idy ! day of the month (01 - 31)
12 integer ihr ! hour (00-23)
13 integer imi ! minute (00-59)
14 integer isc ! second (00-59)
16 character*(*) hdate ! 'YYYY-MM-DD hh:mm:ss'
19 integer i ! Loop counter.
20 integer hlen ! Length of hdate string
25 write(hdate,19) iyr, imo, idy, ihr, imi, isc
26 19 format(i4.4,'-',i2.2,'-',i2.2,'_',i2.2,':',i2.2,':',i2.2)
28 elseif (hlen.eq.16) then
29 write(hdate,16) iyr, imo, idy, ihr, imi
30 16 format(i4.4,'-',i2.2,'-',i2.2,'_',i2.2,':',i2.2)
32 elseif (hlen.eq.13) then
33 write(hdate,13) iyr, imo, idy, ihr
34 13 format(i4.4,'-',i2.2,'-',i2.2,'_',i2.2)
36 elseif (hlen.eq.10) then
37 write(hdate,10) iyr, imo, idy
38 10 format(i4.4,'-',i2.2,'-',i2.2)