Apple grower David Casadella curses to himself as he walks the rows of his orchards in the northern Spanish region of Catalonia. He idly kicks one of the many rotten apples that have fallen to the ground, before plucking another from a tree.
"These apples are overmature," he says. "When the summer is hotter than it should be, the apples fall down much more easily than usual. There's maybe 10-15% of apples that are lost."
He blames the falling yield on climate change. Summer temperatures in Catalonia have risen by 2.5 degrees Celsius since 1950, with more and more tropical nights — where the temperature does not fall below 20 C — being recorded.
Read more: IPCC report: The world gets hungrier, but the land is exhausted
Losing 10-15% of apples is a severe knock to Casadella's business, but he and other apple growers in the region worry that further rises in temperature could wipe out their livelihoods altogether.
As well as causing fruit to mature too quickly, extreme heat can lead to sunburn or discoloration of the apple skins, making them harder to sell in an increasingly competitive market.
Hotter weather is making it more difficult for farmers to grow good-looking, ripened apples
Spanish apples feel the heat
Catalonia's warm climate means the region has always been at the hotter end of the temperature spectrum where apples and pears will grow. Any subtle change can have a big impact on the fruit, and therefore, the farmer.
Between 2002 and 2015, annual apple production across Spain fell from 650,000 to 450,000 tons. Casadella sees his hope for a secure harvest in a high-tech laboratory just five minutes by car from his orchard.
Read more: Is the sellout of genes a threat to farmers and global food security?
Inside, precision instruments whir as scientists in white coats record measurements. It's a world away from the heavy machinery and manual labor of the farm, but the two places share a common goal.
The lab is run by Catalonia's Institute for Agrifood Research and Technology (IRTA), and is home to the Hot Climate Program, which partnered with growers like Casadella to tackle the challenge of climate change.
Spanish apple growers are looking to genetic modification to weather their apple harvests against increasing temperatures
"This is a program to breed new apples and pears that basically are adapted to the warm weather conditions," says Joan Bonany, director of the Hot Climate Program. "The forecast is that we will experience an even higher increase in temperature, so we need to do something and one of the solutions is genetics."
The breeding initiative, launched in 2002, is a joint venture between IRTA, New Zealand-based research institute Plant & Food Research, and the Spanish fruit growers' association Fruit Futur.
Read more: Do vegans help prevent climate change?
Apples for the senses
Casadella is one of a number of farmers who are now growing the new fruit varieties in experimental testing fields, to prepare for further temperature increases.
"We all know that the world is heating up," says Richard Volz, senior scientist at Plant & Food Research, in a Hot Climate Program explainer video. "It could be a big problem for us if the climate changed dramatically over the next 20 years and we haven't got varieties adapted to those conditions."
Read more: Wind farms: climate protection vs. nature protection
The scientists meticulously measure the qualities of different apple species in the breeding program, using specialized machines and chemical tests to determine which can excel in hot climates. But Bonany is clear that determining fruit quality requires more than a mechanical touch.
Genetically-modified apples are tested for taste, texture and consistency
"It's also very important that we do it sensorially because there is no machine that is able to reproduce what the human feels."
His team slices up segments of apples and pears, before assiduously tasting for qualities like sweetness, sourness, juiciness, firmness and crispiness, scoring each on a scale of one to nine.
The instrumental and sensorial data are combined, and the apples and pears with favorable attributes are crossed with others deemed to have complementary qualities, to create new, hot-climate-adapted varieties.
"We take two good apple varieties, take the pollen from one of them and put it in the flower of the other," Bonany explains. "Those flowers will produce fruit and those fruits will produce seeds. We introduce into the system around 10,000 seeds, 10,000 potential varieties every year, and only a few will make it to the end."