Thermal structure and dynamics of the Jovian atmosphere 1. The great red spot