libtime++: Date and time calculation

◆ time_getdate()

subroutine time_getdate ( integer  day,
integer  month,
integer, dimension(7)  date 
)

Definition at line 31 of file time_getdate.f.

References time_copy(), and time_norm().

31 c
32 c get day and month index for given doy (day of year) in date
33 c
34 c input:
35 c date: absolute date record
36 c output:
37 c day: day index within month
38 c month: month index within year
39 c
40 c last change: V2.00 (05/08/2000)
41 c
42  integer date(7), day, month
43 cE
44  integer days(12,2), d(7)
45  integer sel
46  logical time_isleapyear
47  data days/31,28,31,30,31,30,31,31,30,31,30,31,
48  & 31,29,31,30,31,30,31,31,30,31,30,31/
49 c
50  call time_copy(date, d)
51  call time_norm(d)
52  day=d(2)
53 c check for realtive date
54  if (d(1).gt.0) then
55  if (time_isleapyear(d(1))) then
56  sel=2
57  else
58  sel=1
59  endif
60  month=1
61  1 if (day.le.days(month,sel)) goto 2
62  day=day-days(month,sel)
63  month=month+1
64  goto 1
65  2 continue
66  else
67  month=0
68  endif
69  return
integer time_isleapyear(timeint year)
void time_copy(time_Ts Date1, time_Ts *Pdate2)
Definition: ctime_copy.c:33
void time_norm(time_Ts *Pdate)
Definition: ctime_norm.c:33
Here is the call graph for this function: