libtime++: Date and time calculation

◆ time_setdoy()

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

Definition at line 33 of file time_setdoy.f.

References time_fullyear(), time_util_fatal(), time_util_warning(), time_util_warning_n(), and time_util_warning_report_time().

33 c
34 c Set doy in date from day and month (january first is doy 1).
35 c This routine will call time_fullyear first!
36 c
37 c This routine is senseless in combination with relative times!
38 c
39 c input:
40 c day: day index within month
41 c month: month index within year (contained in date)
42 c input/output:
43 c date: doy index in time record is changed according to given day and
44 c month index and year value in date
45 c
46 c last change: V2.10 (25/12/2012)
47 c
48  integer day, month, date(7)
49 cE
50  integer result
51  integer sel, mon
52  logical time_isleapyear
53  integer days(12,2)
54  data days/31,28,31,30,31,30,31,31,30,31,30,31,
55  & 31,29,31,30,31,30,31,31,30,31,30,31/
56 c
57  if (date(1).eq.0) then
58  call time_util_warning('time_setdoy',
59  & 'do not use this with relative times')
60  call time_util_warning('time_setdoy',
61  & 'routine skipped...')
62  else
63  call time_fullyear(date(1))
64  if (time_isleapyear(date(1))) then
65  sel=2
66  else
67  sel=1
68  endif
69  result=0
70  mon=1
71  1 if (mon.ge.month) goto 2
72  result=result+days(mon,sel)
73  mon=mon+1
74  if (mon.gt.13) then
75  call time_util_warning_report_time('time_setdoy',
76  & date)
77  call time_util_warning_n('time_setdoy',
78  & 'month value',month)
79  call time_util_fatal('time_setdoy',
80  & 'month value out of range')
81  endif
82  goto 1
83  2 continue
84  result=result+day
85  date(2)=result
86  endif
87  return
integer time_isleapyear(timeint year)
subroutine time_util_warning_report_time(caller, date)
subroutine time_util_fatal(caller, text)
subroutine time_util_warning(caller, text)
subroutine time_util_warning_n(caller, text, n)
void time_fullyear(timeint *year)
Here is the call graph for this function: