If magma remains beneath the Earth's surface within the crust, the heat energy is released slowly over time to the local and even regional area. This residual heat energy transfers to adjacent rock and groundwater , heating them to temperatures exceeding 370°C (700°F).