65
72 implicit none
73 logical:: result
74 real(DP), intent(in):: elapse_sec
75 type(DC_CAL_DATE), intent(in), optional, target:: date
76 type(DC_CAL), intent(in), optional, target:: cal
77
78
79
80
81 type(DC_CAL_DATE), pointer:: datep =>null()
82 type(DC_CAL), pointer:: calp =>null()
83 integer:: year, month, day, hour, min
84 real(DP):: sec
85continue
86
87
88
89
90 if ( present( date ) ) then
91 datep => date
92 else
94 end if
95
96 if ( present( cal ) ) then
97 calp => cal
98 else
101 end if
102
103
104
105
106 result = .false.
107 if ( .not. datep % initialized ) return
108 if ( .not. calp % initialized ) return
109
110
111
112
114 & elapse_sec = elapse_sec, date = datep , cal = calp )
115
116
117
118
119 select case( calp % cal_type )
121 if ( mod( year, 4 ) == 0 ) then
122 result = .true.
123 else
124 result = .false.
125 end if
126
128 if ( mod( year, 400 ) == 0 ) then
129 result = .true.
130 elseif ( mod( year, 100 ) == 0 ) then
131 result = .false.
132 elseif ( mod( year, 4 ) == 0 ) then
133 result = .true.
134 else
135 result = .false.
136 end if
137
138 case default
139 result = .false.
140 end select
141
dc_calendar 手続のインターフェース宣言
integer function, public dccaldate_normalize(year, month, day, hour, min, sec, cal)
integer function, public dccaldate_ym2d(year, month, day, cal, day_of_year)
type(dc_cal), target, save, public default_cal
デフォルトの暦. DCCal で始まる手続のうち, DC_CAL 型の省略可能引数が与えられない 場合にはこの暦が設定もしくは利用される.
subroutine, public default_cal_set
type(dc_cal_date), target, save, public default_date
デフォルトの日時. DCCalDate で始まる手続のうち, DC_CAL_DATE 型の省略可能引数が 与えられない場合にはこの日時が設定もしくは利用される.
integer, parameter, public cal_julian
integer, parameter, public cal_gregorian
integer, parameter, public dp
倍精度実数型変数