Thermal evolution of the earth