12 integer(I4B),
dimension(8) ::
ibdt
20 character(len=LINELENGTH) :: line
23 character(len=*),
parameter :: fmtdt = &
24 "(1X,'Run start date and time (yyyy/mm/dd hh:mm:ss): ', &
25 &I4,'/',I2.2,'/',I2.2,1X,I2,':',I2.2,':',I2.2)"
28 call date_and_time(values=
ibdt)
29 write (line, fmtdt) (
ibdt(i), i=1, 3), (
ibdt(i), i=5, 7)
40 integer(I4B),
intent(in) :: iout
41 integer(I4B),
intent(in) :: iprtim
43 character(len=LINELENGTH) :: line
44 integer(I4B) :: iedt(8), idpm(12)
47 integer(I4B) :: ndays, leap, ibd, ied, mb, me, nm, mc, m
48 integer(I4B) :: nhours, nmins, nsecs, msecs, nrsecs
49 real(dp) :: elsec, rsecs
50 data idpm/31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31/
53 character(len=*),
parameter :: fmtdt = &
54 "(1x,'Run end date and time (yyyy/mm/dd hh:mm:ss): ', &
55 &I4,'/',I2.2,'/',I2.2,1x,I2,':',I2.2,':',I2.2)"
56 character(len=*),
parameter :: fmttma = &
57 "(1x,'Elapsed run time: ',I3,' Days, ',I2,' Hours, ',I2, &
58 &' Minutes, ', I2, ' Seconds')"
59 character(len=*),
parameter :: fmttmb = &
60 &
"(1x,'Elapsed run time: ',I2,' Hours, ',I2,' Minutes, ',I2,' Seconds')"
61 character(len=*),
parameter :: fmttmc = &
62 &
"(1x,'Elapsed run time: ',I2,' Minutes, ',I2,'.',I3.3,' Seconds')"
63 character(len=*),
parameter :: fmttmd = &
64 &
"(1x,'Elapsed run time: ',I2,'.',I3.3,' Seconds')"
67 call date_and_time(values=iedt)
70 write (line, fmtdt) (iedt(i), i=1, 3), (iedt(i), i=5, 7)
81 if (mod(iedt(1), 4) == 0) leap = 1
86 if (
ibdt(2) /= iedt(2))
then
91 if (mb > me) nm = nm + 12
97 ndays = ndays + idpm(mc) - ibd
98 if (mc == 2) ndays = ndays + leap
99 elseif (mc == me)
then
102 ndays = ndays + idpm(mc)
103 if (mc == 2) ndays = ndays + leap
106 elseif (ibd < ied)
then
113 elsec = elsec + (iedt(5) -
ibdt(5)) * 3600.0
114 elsec = elsec + (iedt(6) -
ibdt(6)) * 60.0
115 elsec = elsec + (iedt(7) -
ibdt(7))
116 elsec = elsec + (iedt(8) -
ibdt(8)) * 0.001
119 ndays = int(elsec / nspd)
121 nhours = int(rsecs / 3600.0)
123 nmins = int(rsecs / 60.0)
124 rsecs = mod(rsecs,
dsixty)
126 rsecs = mod(rsecs,
done)
127 msecs = nint(rsecs * 1000.0)
129 if (rsecs > 0.5) nrsecs = nrsecs + 1
133 write (line, fmttma) ndays, nhours, nmins, nrsecs
134 elseif (nhours > 0)
then
135 write (line, fmttmb) nhours, nmins, nrsecs
136 elseif (nmins > 0)
then
137 write (line, fmttmc) nmins, nsecs, msecs
139 write (line, fmttmd) nsecs, msecs
146 WRITE (iout, fmttma) ndays, nhours, nmins, nrsecs
147 ELSEIF (nhours > 0)
THEN
148 WRITE (iout, fmttmb) nhours, nmins, nrsecs
149 ELSEIF (nmins > 0)
THEN
150 WRITE (iout, fmttmc) nmins, nsecs, msecs
152 WRITE (iout, fmttmd) nsecs, msecs
166 integer(I4B),
intent(in) :: it
167 real(dp),
intent(inout) :: t1
168 real(dp),
intent(inout) :: ts
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
real(dp), parameter dsixty
real constant 60
real(dp), parameter dsecperdy
real constant representing the number of seconds per day (used in tdis)
real(dp), parameter dsecperhr
real constant representing number of seconds per hour (used in tdis)
real(dp), parameter dzero
real constant zero
real(dp), parameter done
real constant 1
This module defines variable data types.
Store and issue logging messages to output units.
subroutine, public write_message(text, iunit, fmt, skipbefore, skipafter, advance)
Write a message to an output unit.
subroutine, public elapsed_time(iout, iprtim)
Get end time and calculate elapsed time.
subroutine, public code_timer(it, t1, ts)
Get end time and calculate elapsed time.
integer(i4b), dimension(8) ibdt
subroutine, public print_start_time()
Start simulation timer.