Peter's code, modified by me to implement periodic tidal heating of planet interiors