portion of the heating loop 56 to provide heat for the compressed gas 20 before it passes into the underground geologic formation 28 as described above heating loop 56 comprises a closed loop conduit filled with a heat conducting medium 58 such as for example air water carbon dioxide or any type of thermal storage comprising liquid or gas known in the art or later discovered the heating loop 56 travels underground to the high temperature region 26 passing therethrough and then back up to the surface 14 a pump 60 may be used to cycle the heat conducting medium 58 inside the heating loop 56 another conduit 52 b extends from the underground geologic formation 28 upwards to the surface and terminates in inlet 32 of pressure engine 34 the heated compressed gas 30 drives the pressure engine 34 as it passes therethrough to outlet 36 before being exhausted to the atmosphere preferably the heated compressed gas 30 is allowed to expand in the expander 38 associated with the pressure engine 34 prior to entering the pressure engine 34 the pressure engine 34 is operatively connected to and drives generator 40 which generates electricity which is then transmitted to a power grid through powerlines 42 in a known fashion as above heating loop 56 though shown in fig6 with a looped section 27 may in fact comprise two separate pipes within the high temperature region 26 and separated by a distance.