Energy flow to and from the earth