Implement temperature averages in Fortran