High in Spain’s southern mountains, 40 or so people armed with pitchforks and spades cleared stones and piles of grass from an earthwork channel built centuries ago and still keeping the slopes green.
“It’s a matter of life,” said Antonio Jesús Rodríguez García, a farmer from the nearby village of Pitres, population 400. “Without this water, the farmers can’t grow anything, the village can’t survive.”
The extreme heat sweeping across much of southern Europe this week is just the latest reminder of the challenges that climate change has foisted on Spain, where temperatures reached 109 degrees Fahrenheit on Tuesday, putting half of the territory on orange and red weather alert. Such heat and extended droughts have presented the threat that three-quarters of the country could be engulfed by creeping deserts over this century.
Faced with that reality, Spanish farmers, volunteers and researchers have reached deep into history for solutions, turning to a sprawling network of irrigation canals built by the Moors, the Muslim population that conquered and settled in the Iberian Peninsula in the Middle Ages.
The channels — called “acequias,” from the Arabic “as-saqiya,” which means water conduit — have made life possible in one of Europe’s driest regions, supplying the fountains of the majestic Alhambra palace and turning the region, Andalusia, into an agricultural powerhouse.
Many acequias fell into disuse around the 1960s, when Spain turned to an agricultural model that favored reservoirs and pushed many Spaniards to leave rural areas for cities. As use of the network faded, so did the ancient knowledge and traditions that had brought water to the remotest corners of Andalusia.
Now, the intricate system, seen as a low-cost and effective tool for mitigating drought, is being revived, one abandoned acequia at a time.
“The acequias have been able to withstand at least a thousand years of climate, social and political change,” said José María Martín Civantos, an archaeologist and historian who is coordinating a major restoration project. “So why do without it now?”
Mr. Civantos, a stocky man with a goatee, said the Moors had built at least 15,000 miles of acequias across the Andalusian provinces of Granada and Almeria, in what was then Al-Andalus. He explained that before the acequias, it was hard to grow food in the unstable climate of the Mediterranean, with periodic droughts.
The “genius of the system,” he said, is that it slows down the water flow from the mountains to the plains in order to better retain and distribute it.
Without acequias, snowmelt from mountain peaks would flow directly into rivers and lakes that dry up during the summer. With them, the melt is diverted to multiple acequias winding through the hills. The water soaks into the ground in a “sponge effect,” and then circulates slowly through aquifers and shows up months later, downslope, in springs that irrigate crops during the dry season.
Traces of the system are everywhere in the southern Alpujarra Mountains, on the south slopes of the Sierra Nevada. Water gushes out of the mountains at every road bend. It softens the soil of the high plains. It spurts from fountains in the region’s typical whitewashed villages.
“The Moors didn’t just leave us the acequias, but also the landscape they created with them,” said Elena Correa Jiménez, a researcher on the restoration project, which is being led by the University of Granada.
Holding a shovel, she pointed to the verdant lands that stretched below. “None of this would exist without the acequias,” she said. “There would be no water to drink, no fountains, no crops. It would almost be a desert.”
Water has been so essential here that locals speak of it as if it were a crop itself. Water is not absorbed by the subsoil, it is “sown.” It is not collected for irrigation, it is “harvested.”
When Spain replaced many acequias with the more modern water management systems, in the Sierra Nevada alone, up to a fifth of the acequias were abandoned, according to government data.
The agricultural revolution helped turned Andalusia into Europe’s back garden, with huge quantities of pomegranates, lemons and barley sent across the continent. But it also led to an insatiable thirst for water that has depleted the region’s aquifers, exacerbating droughts.
To make matters worse, climate change has exposed Spain to increasingly frequent heat waves. This spring was the hottest on record in Spain, according to the country’s meteorological agency, with April temperatures exceeding 100 degrees in Andalusia.
Cañar, a small village nestled in the Alpujarra, has been hard hit by the combination of intensive farming, higher temperatures and the abandonment of a nearby acequia.
Several of the village’s agricultural plots are now desolate. In a cafe, a sign reads, “I’m looking for an irrigated farm.” And most of the area’s mountain streams now bypass Cañar, feeding a river in a valley below that supplies greenhouses growing avocados. No one in the village works there.
Ramón Fernández Fernández, 69, a farmer, said he remembered when village houses would collapse under the weight of winter snow. Asked when it had last snowed in the area, he laughed.
“The bad years then are the good years now,” he said of the droughts.
In 2014, the village became the testing ground for Mr. Civantos’s acequia restoration project. For a month, he and 180 volunteers excavated the earth under a scorching sun to recover the channel.
“Some farmers who were 80 or so were crying because they thought they would never see the water flowing again,” Mr. Civantos said. He recalled an older resident standing in the ditch as water began to pour in, gesturing with his arms as if to guide the water toward the village.
Francisco Vílchez Álvarez, a member of a group of residents who manage irrigation networks in Cañar, said restoring the acequia had enabled some residents to grow cherries and kiwis again.
To date, Mr. Civantos and his team have recovered more than 60 miles of irrigation channels, taking motley groups of researchers, farmers, environmental activists and locals across the Alpujarra, gardening tools in hands.
The initiative has spread to Spanish regions in the east and north. But Mr. Civantos and several farmers said they still lacked financial support because politicians and businesses often regard acequias as inefficient compared with modern hydraulic networks.
“It’s hard to change mentalities,” he said. “But if you understand efficiency in terms of multifunctionality, then the traditional irrigation systems are much more efficient. They better retain water, they recharge the aquifers, they improve the fertility of the soils.”
But the biggest challenge to saving acequias may be preserving the age-old knowledge behind their existence.
In villages like Cañar, where residents still use a 19th-century logbook to allocate water to farmers, the rural exodus has threatened the transmission of techniques that were passed on orally.
One resident, who knew every branch along 22 miles of acequias in the area, recently died, taking “precious knowledge, ancestral knowledge” with him to his grave, Mr. Vílchez said.
Taking a break during the cleanup operation, Mayor José Antonio García of Pitres, 58, said that “a lot of wisdom” had gone into the acequias.
“Now we have the opportunity to use this ancient wisdom to fight climate change,” he said. “Pues, vamos.”