Thermal structure and geodynamics of subduction zones