Climate change, which could transform the Iberian peninsula into a semi-desert, is forcing winemakers in Spain to consider moving their vines to higher ground to escape the blistering heat.
Spain, which has more hectares (acres) of vineyard than any other country in the world, "is in the frontline of climate change," said Juan Francisco Cacho, a wine expert at the University of Zaragoza.
The country, already the driest in Europe, is threatened with "Africanisation" of its climate and up to one third of its territory risks "severe" desertification, according to the environment ministry.
Now, the big wineries and the Spanish Wine Federation are looking into a project, called Demeter, aimed at "gathering the knowledge necessary to face the challenge of climate change."
Vines love the sun, as all vintners know well. But too much heat is harmful to the proper ripening of the grapes, said Cacho.
Heat waves rob the grapes of sugar while the elements that give wine its aroma, its consistency and its colour ripen more slowly.
Spanish vintners must choose between an early harvest that produces wine with the right amount of alcohol but is still "green" or a later one in which the grapes produce a better quality wine but have more alcohol.
"The wineries prefer to wait... So much that the wines produced today are often are 14, 15 or even 16 percent of alcohol compared to 12 previously," said Cacho.
The Demeter project is aimed at "looking into winemaking practices that delay maturation," said Mireia Torres, technical director of the Bodegas Torres winery in the northeastern region of Catalonia.
"We have an experimental area where we analyse the different effects of the viticultural practices in relation to climate," she said.
One possible solution they are exploring is altitude. At a higher level, vines suffer less from the heat, the nights are cooler, which allow the grapes to ripen better.
At Bodegas Perez Pascuas in the northern Ribera del Duero region, three generations of winemakers have come to the same conclusion: "the vines at a higher level mean a better quality wine," said Jose Manuel Perez Ovejas, the grandson of the founder.
The vines are situated at an altitude of more than 820 metres (2,690 feet) and relatively spared from summer heat waves.
"The (Spanish) vineyards are at a maximum of 800 metres above sea level. In 15 years, they will have to plant the vines at between 800 and 1,000 metres and the great winemakers are already buying land at higher altitudes," said Cacho.
Frenchman Lionel Gourgue, a wine expert for the "Vinedos Alonso del Yerro" of the Ribera del Duero region, believes that a shift to higher ground would be just a return of good sense.
"The vine has always been planted on the hillsides... In the 1980s, mistakes were made, and we planted them anywhere."