With a climate changing faster than most crops can adapt and food security under threat around the world, scientists have found hope in a living museum dedicated to a staple eaten by millions daily: the humble potato.

High in the Peruvian Andes, agronomists are looking to the ancestral knowledge of farmers to identify genetic strains which could help the tubers survive increasingly frequent and intense droughts, floods and frosts.

The Potato Park in Cusco is a 90 sq km (35 sq mile) expanse ranging from 3,400 to 4,900 metres (16,000 feet) above sea level. It has “maintained one of the highest diversities of native potatoes in the world, in a constant process of evolution,” says Alejandro Argumedo, the founder of Asociación Andes, an NGO which supports the park.

“By sowing potatoes at different altitudes and in different combinations, these potatoes create new genetic expressions which will be very important to respond to the challenges of climate change.”

Under a cobalt sky by an icy mountain lagoon, a father and his son-in-law hoe thick brown soil. They pull out reddish potatoes and throw them into waiting sacks.

The pucasawsiray potatoes they gather are among the 1,367 varieties in the park, which lies in the Sacred Valley of the Incas. The intensely cultivated patchwork of tiny fields and graded terraces is a living laboratory of potato diversity.

Facebook Twitter Pinterest A worker picking potatoes high in the Andes. Photograph: The International Potato Centre

The potato was domesticated 7,000 years ago by the ancestors of these Peruvian peasant farmers on the shores of Lake Titicaca, between modern-day Peru and Bolivia, say archaeologists. The Potato Park is considered a secondary centre of origin for the potato, which today is grown on every continent on Earth except Antarctica. Scientists at the US space agency Nasa and the Peru-based International Potato Centre have even been testing whether potatoes can be grown on Mars.

The Quechua-speaking descendants of the Incas have myriad descriptive names for the cornucopia of potatoes grown and eaten in Peru’s southern Andes, from a squat, greyish tuber named after an alpaca’s nose to a yellow indented tatty called puma maqui, or puma’s paw. There is even a maddeningly knobbly potato known as pusi qhachun wachachi, whose name literally means “make your daughter-in-law cry”, as it has frustrated so many prospective wives who have tried to pass the test of trying to peel it.

They come in every colour and texture; reds, yellows, blues and purples, sometimes shocking pink ringed with white when cut in half. Some have a powdery texture, others are waxy and some moray or chuño are are too bitter to eat until they are soaked, freeze-dried on rooftops and trampled on to remove their skins. These can be stored for months and used in winter soups.

But now these potatoes are bearing the brunt of global heating, which is drawing pests further uphill, forcing farmers to sow the crop in the upper reaches of the park on the limit of arable land. The park residents are conducting tests to see how resistant the native varieties are to frost, hail and intense sunlight and also to the Andean potato weevil, whose larvae eat through the tubers underground.

“These crops have always adapted,” says Marie Haga, the executive director of the Crop Trust. “Now climate change is so fast that these poor plants are not able to adapt.

“That’s why we need the diversity, because the diversity is what we use when we breed new plants which can tolerate new climates,” she adds.

Facebook Twitter Pinterest A selection of native potato varieties including the cuchipa acan, alq’a piña, puka piña, conejito, condor huarmi, lleque and chiquibonita. Photograph: The International Potato Centre

The possible solution may be in what locals call the wild “grandfather” of the domesticated potato, which still grows in the highlands and is grazed on by alpacas and donkeys. The plant’s green fruit looks more like a very small tomato than a potato but, as villager Nazario Quispe explains, its seed is spread in animal dung and it often grows in their corrals. Quispe says they continue to mix the crops with the wild relatives to make them more resistant.

“In laboratories, scientists are trying to solve this through gene transfer and genetic engineering, but the peasants here have been doing this kind of work for thousands of years,” says Argumedo.

The results are stored in an on-site seed bank where each potato is kept in carefully coded paper bags, cooled by trenches filled with icy water and lit by rooftop windows to prevent them from taking seed. In 2017, 650 examples were taken to the global seed vault on the Norwegian island of Svalbard inside the Arctic circle, where they are stored at -18C.

At the same time in Peru’s capital, Lima, the International Potato Centre, known by its Spanish acronym CIP, houses more than 4,600 types of potato and has the world’s largest in vitro gene bank.

Facebook Twitter Pinterest A selection of biofortified potatoes, grown to be higher in zinc and iron. Photograph: David Dudenhoeffer/The International Potato Centre

The CIP is working in Africa and Asia where the potato is helping to combat hunger and generate income as a cash crop. It produces fast-maturing, biofortified potatoes which have improved productivity – particularly in China, which is the world’s biggest grower, accounting for 22% of global potato production.

“China suffers from a severe shortage of land and water and the potato is particularly resilient to droughts,” says Mei Xurong, the vice-president of the country’s Academy of Agricultural Sciences.

“The question for China is how to enrich the biodiversity when you produce potatoes,” he says. “This is a major challenge.”

The UN Food and Agriculture Organization estimates that 75% of crop diversity was lost between 1900 and 2000 and that as much as 22% of the wild relatives of food crops will disappear by 2055 because of the changing climate.

As soil degradation intensifies and crop resilience becomes ever more important, the work being done by the potato guardians in a small park in Peru may play an important role in feeding the rest of the world.