The following FORTRAN subroutine implements the approximate formulas for photoelectric heating and recombination cooling in Weingartner & Draine (2001, ApJS, 134, 263), equations 44 and 45: peheat.f