JMH,
I compared the results of the astro.f file that you posted with pyEphem and found that the calculated AS (right ascension of the sun) varies between –pi/2 and pi/2 because it is calculated with atan. It should vary between –pi and pi (or between 0 and 2pi). This matter because in marast.f, FYS is calculated with cos(AHS), and a difference of pi in AS thus gives a sign error in FYS.
I propose to also calculate AS using ATAN2, just like we do with AL. Thus, replacing line 212 with
AS = ATAN2(COS(OM)*SIN(LS),COS(LS))
gives a result that matches the results of pyEphem. See the file astro.f that is attached.