This program calculates when to avoid pregnancy by counting days and considering the length of recent months. The algorithm is common, see the book Contraceptive Technologies by Robert A. Hatcher for example; the code for Julian dates is from Stephen Luse.