libtime++: Date and time calculation

◆ time_div()

subroutine time_div ( integer, dimension(7)  date1,
integer, dimension(7)  date2,
integer  n,
integer  rest 
)

Definition at line 32 of file time_div.f.

References time_norm(), and time_util_fatal().

32 c
33 c Divide relative time 'date1' by integer 'n' and store result in 'date2'.
34 c 'rest' gives the none dividable rest in microseconds.
35 c
36 c input:
37 c date1: relative time value to be divided
38 c n: divisor
39 c output:
40 c date2: date1/n regularized relative time value
41 c rest: date1-(n*date2) integer number of microseconds
42 c
43 c always: date1 >= (n*date2)
44 c
45 c last change: V2.00 (05/08/2000)
46 c
47  integer date1(7), date2(7), n, rest
48 cE
49  integer carry, limit(7), help, i
50  data limit/-1,-1,24,60,60,1000,1000/
51 c
52  if (date1(1).ne.0) then
53  call time_util_fatal('(time_div)','no absolute time allowed')
54  else
55  carry=0
56  do i=2,7
57  help=date1(i)+carry*limit(i)
58  date2(i)=int(help/n)
59  carry=help-n*date2(i)
60  enddo
61  rest=carry
62  date2(1)=0
63  call time_norm(date2)
64  endif
65  return
subroutine time_util_fatal(caller, text)
void time_norm(time_Ts *Pdate)
Definition: ctime_norm.c:33
Here is the call graph for this function: