The Moroccan city of Ouarzazate is used to big productions. On the edge of the Sahara Desert and at the centre of the North African country’s “Ouallywood” film industry, it has played host to big-budget location shots in Lawrence of Arabia, The Mummy, The Living Daylights and even Game of Thrones. 
Now, the trading city, nicknamed the “door of the desert”, is the location for another blockbuster – a complex of four linked solar mega-plants, which, alongside hydro and wind, will help provide nearly half of Morocco’s electricity from renewables by 2020 with, it is hoped, some spare to export to Europe. The project is a key plank in Morocco’s ambitions to use its untapped deserts to become a global solar superpower. 
When the full complex is complete, it will be the largest concentrated solar power plant in the world and the first phase, called Noor 1, will go live in November 2015. The mirror technology it uses is less widespread and more expensive than the photovoltaic panels that are now familiar on roofs the world over but it will have the advantage of being able to continue producing power even after the sun goes down. 
The potential for solar power from the desert has been known for decades. In the days after the Chernobyl nuclear accident in 1986, the German particle physicist Gerhard Knies calculated that the world’s deserts receive enough energy in a few hours to provide for humanity’s power needs for a whole year. The challenge, though, has been capturing that energy and transporting it to the population centres where it is required. 
As engineers put the finishing touches to Noor 1, its 500,000 crescent-shaped solar mirrors glitter across the desert skyline. The 800 rows follow the sun as it tracks across the heavens, whirring quietly every few minutes as their shadows slip further east. 
When they are finished, the four plants at Ouarzazate will occupy a space as big as Morocco’s capital city, Rabat, and generate 580 mega-watts (MW) of electricity, enough to power a million homes. Noor 1 itself has a generating capacity of 160MW. 
Morocco’s Environment Minister, Hakima el-Haite, believes that solar energy could have the same impact on the region this century that oil production had in the last. But the $9bn project to make her country’s deserts boom was triggered by more immediate concerns, she said. 
“We are not an oil producer. We import 94% of our energy as fossil fuels from abroad and that has big consequences for our state budget,” el-Haite told the Guardian. “We also used to subsidize fossil fuels, which have a heavy cost, so when we heard about the potential of solar energy, we thought, 'Why not?'” 
Solar energy will make up a third of Morocco’s renewable energy supply by 2020, with wind and hydro taking the same share each. 
“We are very proud of this project,” el-Haite said. “I think it is the most important solar plant in the world.” 
Each parabolic mirror is 12 metres high and focused on a steel pipeline carrying a 'heat transfer solution' (HTF) that is warmed to 393C as it snakes along the trough before coiling into a heat engine. There, it is mixed with water to create steam that turns energy- generating turbines. 
The HTF is made up of a synthetic thermal oil solution that is pumped towards a heat tank containing molten sands that can store heat energy for three hours, allowing the plant to power homes into the night. The mirrors are spaced in tier formations to minimize damage from sand blown up by desert winds. 
Technicians say that the Noor 2 and 3 plants, due to open in 2017, will store energy for up to eight hours – opening the prospect of 24/7 solar energy in the Sahara and the surrounding region. 
“The biggest challenge we faced was being able to finish the project on time with the performance level we needed to achieve,” said Rashid al-Bayad, the project director. 
But, even as the first phase of the project nears completion, Morocco is eyeing grander international ambitions. “We are already involved in high tension transportation lines to cover the full south of Morocco and Mauritania as a first step,” says Ahmed Baroudi, manager of Société d’Investissements Energétiques, the national renewable energy investment firm. But he says the project’s ultimate impact will go far wider – even as far as the Middle East. “The ultimate objective given by his majesty the king is Mecca.” 
Whether that ambition is achieved remains to be seen but exporting solar energy could have stabilizing effects within and between countries, according to the Moroccan solar energy agency (Masen). Talks are ongoing with Tunisia and energy exports northwards across the Mediterranean remain a key goal. 
“We believe that it’s possible to export energy to Europe but, first, we would have to build the interconnectors which don’t yet exist,” said Maha el-Kadiri, a Masen spokeswoman. “Specifically, we would have to build interconnections, which would not go through the existing one in Spain, and, then, start exporting.” 
Spain has itself prohibited new solar projects because of a lack of interconnectors to transmit the energy to France. The EU has set a target of ensuring that 10% of each member country’s power can be transported abroad by cable by 2020. 
In the meantime, Morocco is focused on using solar to meet its own needs for resource independence. This could, one day, include water desalination, in a country that is increasingly being hit by drought as the climate warms. Officials are keenly aware of the running they are making in what is the most advanced renewable energy programme in the Middle East and North African region. “We are at the avante-garde of solar,” el-Kadiri says. 
About $9bn has been invested in the Noor Complex, much of it from international institutions such as the European Investment Bank and World Bank and backed by Moroccan government guarantees. Undisclosed energy subsidies from Morocco’s unelected ruler, King Mohammed VI, have prevented the cost from being transferred to energy consumers. 
One month before launch, over a thousand, mostly Moroccan, workers are still racing to fix electric wires, take down scaffolding and wrap rockwool insulation around steel pipelines. They bustle past in yellow and orange bibs, working 12-hour shifts against a backdrop of the Atlas Mountains. Harnesses with hammers and gloves strapped to their belts swing by their sides. Ubiquitous hard hats, safety shoes and ear plugs give the scene an air of theatrical camp. 
For Hajar Lakhael, a 25-year-old environment and security manager from Meknes, rehearsals are almost over and the blockbuster production is nearly ready for action. 
“We’ve done the construction and, now, we will see how these projects look when they start,” she says. “It is exactly like the preparation for a grand performance.” 
A global audience will be watching with interest.