160 |
c if (switch .eq. 1) li = cal_IsLeap( yi, mythid ) |
c if (switch .eq. 1) li = cal_IsLeap( yi, mythid ) |
161 |
c enddo |
c enddo |
162 |
|
|
163 |
c First take care of February 29 |
c Set start value |
164 |
ndays_left=ndays |
ndays_left=ndays |
165 |
if ( mi.eq.2 .and. di.eq.29 .and. ndays_left.gt.1 ) then |
|
166 |
mi = 3 |
c First take care of February 29 |
167 |
di = 1 |
if ( usingGregorianCalendar ) then |
168 |
ndays_left = ndays_left - 1 |
if ( mi.eq.2 .and. di.eq.29 .and. ndays_left.gt.1 ) then |
169 |
|
mi = 3 |
170 |
|
di = 1 |
171 |
|
ndays_left = ndays_left - 1 |
172 |
|
endif |
173 |
endif |
endif |
174 |
|
|
175 |
c Next compute year |
c Next compute year |
176 |
days_in_year=365 |
days_in_year=ndaysnoleap |
177 |
if ((mi.gt.2.and.cal_IsLeap(yi+1,mythid).eq.2).or. |
if ((mi.gt.2.and.cal_IsLeap(yi+1,mythid).eq.2).or. |
178 |
& (mi.le.2.and.cal_IsLeap(yi,mythid).eq.2) ) |
& (mi.le.2.and.cal_IsLeap(yi,mythid).eq.2) ) |
179 |
& days_in_year=366 |
& days_in_year=ndaysleap |
180 |
do while (ndays_left .ge. days_in_year) |
do while (ndays_left .ge. days_in_year) |
181 |
ndays_left = ndays_left - days_in_year |
ndays_left = ndays_left - days_in_year |
182 |
yi = yi + 1 |
yi = yi + 1 |
183 |
days_in_year=365 |
days_in_year=ndaysnoleap |
184 |
if ((mi.gt.2.and.cal_IsLeap(yi+1,mythid).eq.2).or. |
if ((mi.gt.2.and.cal_IsLeap(yi+1,mythid).eq.2).or. |
185 |
& (mi.le.2.and.cal_IsLeap(yi,mythid).eq.2) ) |
& (mi.le.2.and.cal_IsLeap(yi,mythid).eq.2) ) |
186 |
& days_in_year=366 |
& days_in_year=ndaysleap |
187 |
enddo |
enddo |
188 |
li = cal_IsLeap( yi, mythid ) |
li = cal_IsLeap( yi, mythid ) |
189 |
|
|