How is energy transferred from the sun to the atmosphere?