integer year,month,day
1 print *,' enter year to find easter for.'
read (5,*)year
if(year .le. 0 ) stop
call easter(year,month,day)
print *,' easter for year ',year,' is in month ',month
print *,' and day ',day
go to 1
end
subroutine easter(year,month,day)
integer year,month,day
integer cent,greg,gold,clav,leaperr,epact,e0,d,a
* step 1. Calculate century of given year
cent = int(year/100) + 1
* step 2. Calculate Gregorian correction.
greg = int ( ( 3 * cent) / 4 ) - 12
* step 3. Calculate the number of the year within the Metonic 19 year
* cycle.
gold = year + 1 - 19 * int(year/19)
* step 4. Calculate the Clavian Correction which compensates for the
* moon cycle not being exactly 19 years.
clav = int ( (8 * cent + 5) / 25 ) - 5 - greg
* step 5. Calculate the leap year correction.
leaperr = int( 5 * year / 4) - greg - 10
* step 6. Calculate position of moon on January First.
e0 = 11 * gold + 20 + clav
epact = e0 - 30 * int ( e0/30)
* step 7. Correction for special cases.
if( (epact .eq. 25) .and. (gold .gt. 11) ) epact = 26
if (epact .eq. 24) epact = 25
* step 8. Calculate # days past last day of February.
d = 44 - epact
* step 9. position for correct month and day of week.
if (d .lt. 21) d = d + 30
a = d + leaperr
d = d + 7 - ( a - 7 * int (a/7) )
* step 10. Calculate month and day.
if (d .gt. 31 ) go to 1
month = 3
day = d
return
1 continue
month = 4
day = d - 31
return
end