A 30-year-old photograph taken from a nearby location is placed on the path to the Pastoruri glacier in Ancash, Peru, showing how far the ice has retreated. Credit:New York Times "If the water disappears, we'd have to go back to how it was before," said Miguel Beltran, a 62-year-old farmer who worries what will happen when water levels fall. "The land was empty, and people went hungry." In this part of Peru, climate change has been a blessing - but it may become a curse. In recent decades, accelerating glacial melt in the Andes has enabled a gold rush downstream, contributing to the irrigation and cultivation of more than 40,000 hectares since the 1980s. Yet the boon is temporary. The flow of water is already declining as the glacier vanishes, and scientists estimate that by 2050 much of the ice cap will be gone. Throughout the 20th century, enormous government development projects, from Australia to Africa, have diverted water to arid land. Much of Southern California was dry scrubland until canals brought water, inciting a storm of land speculation and growth - a time known as the "Water Wars" depicted in the 1974 film Chinatown.

Workers for a farming company harvest asparagus in the sand, near Trujillo, Peru. Credit:New York Times Yet climate change now threatens some of these ambitious undertakings, reducing lakes, diminishing aquifers and shrinking glaciers that feed crops. Here in Peru, the government irrigated the desert and turned it into farmland through an $US825 million ($1 billion) project that, in a few decades, could be under serious threat. "We're talking about the disappearance of frozen water towers that have supported vast populations," said Jeffrey Bury, a professor at the University of California at Santa Cruz who has spent years studying the effects of glacier melt on Peruvian agriculture. "That is the big-picture question related to climate change right now." A Quechua family harvests flowers at the foot of Huascaran, Peru, in the Cordillera Blanca region, where greenfields have been planted.. Credit:New York Times A changing climate has long haunted Peru. One past civilisation, the Moche people, built cities in the same deserts, only to collapse more than a millennium ago after the Pacific Ocean warmed, killing fish and causing flash floods, many archaeologists contend.

Now dwindling water is the threat. While more than half of Peru sits in the wet Amazon basin, few of its people ever settled there. Most inhabit the dry northern coast, cut off from most rain by the Andes range. While the region includes the capital, Lima, and 60 per cent of Peruvians, it holds only 2 per cent of the country's water supply. The glaciers are the source of water for much of the coast during Peru's dry season, which extends from May to September. But the ice cap of the Cordillera Blanca, long a supply of water for the Chavimochic irrigation project, has shrunk by 40 per cent since 1970 and is retreating at an ever-faster rate. It is currently receding by about 30 feet a year, scientists say. Farmers along the 160-kilometre watershed that winds its way from the snowcapped peaks to the desert dunes say they are already feeling the effects of the change. The retreat of the ice cap has exposed tracts of heavy metals, like lead and cadmium, that were locked under the glaciers for thousands of years, scientists say. They are now leaking into the ground water supply, turning entire streams red, killing livestock and crops, and making the water undrinkable. Temperatures in this area have risen sharply, leading to strange changes in crop cycles, farmers say. Over the past decade, corn - which since pre-colonial times was grown only once a year in the mountains - can now be harvested in two cycles, sometimes three.

That would be a windfall, said farmers like Francisco Castillo, if it were not for all the pests that now thrive in the warmer air. For Castillo, who plants corn and rice near the Santa River in Chimbote, it was a worm that became the scourge for him and neighbouring farmers. It suddenly started devouring their crops in the early 2000s. Then, last year, came the rats. "This wasn't a place you had rats before," Castillo said. For Justiniano Daga, a 72-year-old farmer, the breaking point for his cotton crops came when red ants ate away the buds. This year, he has decided to plant sugar cane instead and move some of his production to higher altitudes where it is colder.

"But the pests will arrive there, too," as temperatures keep rising, Daga said. The Chavimochic project, which lies just north of where the Santa River meets the Pacific Ocean, is a crown jewel of Peruvian agriculture and civil engineering. The government aimed to create industrial-scale agriculture in Peru's northern deserts through a sprawling system of locks and canals. The idea's supporters promised profits through exports to markets in North America, Asia and Europe, where the fruit seasons were reversed. The first phase of the project started in 1985 with a 80-kilometre canal that irrigated a valley and brought a large hydroelectric plant, providing electricity to residents. In the early 1990s, Peru began a second phase, which irrigated two more valleys and created a water treatment plant that served 70 per cent of the surrounding population. All told, more than 40,000 hectares of desert were brought into cultivation.

"Years ago, if I gave you a plot of land here, you'd have said, 'What do I do with this?'" said Osvaldo Talavera, a spokesman for the water district. "Now you'd say, 'Do you have another plot for me?'" Among the investors was Rafael Quevedo, a wealthy Peruvian landowner who began snapping up arid tracts after studying desert hydroponic techniques in Israel. His proposition was simple: With enough water and fertilizer, asparagus could be grown directly in the sand - and at yields far higher than in the United States because Peru has no cold season and more days of sun. "We've started a new chapter in the history of cultivation," said Quevedo, who runs a farming company called Talsa. Blueberries on a sandy hillside here grow to be five times as big as a normal-size blueberry before being sent to China, where they are prized for their size. A form of white asparagus, favoured by Europeans, is grown by burying the stalks in sand. A reservoir was created out of a dune. More than 8000 tonnes of produce grows here every year. Yet at the headwaters of the Santa River, in the mountain city of Huaraz, Cesar Portocarrero, a Peruvian climatologist, sees problems afoot for those downstream.

The temperature at the site of the glaciers rose 0.5 to 0.8 degrees Celsius from the 1970s to the early 2000s, causing the glaciers of the Cordillera Blanca to double the pace of their retreat in that period, Portocarrero said. Several times a year, he and other scientists would make brutal hikes into the glacial valleys, where they found entire sections of the ice cap gone. One part of an exposed glacier revealed fossils of dinosaur footprints. A 2012 study by scientists from the US and Canada showed that water flow in the Santa River was falling, and that at current rates, the river could lose 30 per cent of its water during Peru's dry season. "Each year, there is less water; each day, there is less water," Portocarrero said. When Odar Gimez headed to Chavimochic to look for work in 1997, he was only the third person to do so from his impoverished mountain town, where many eked out a living with the subsistence farming of corn. It was the start of a wave of migration from the mountainside to the coast set off by the arrival of the water.

One coastal town, Viru, went from a population of 9000 in the 1990s to 80,000 today. Another, Valle de Dios, was an empty desert canyon until it was invaded by squatters in the early 2000s. The new arrivals were mainly agricultural workers and transformed it into a full-fledged town with a pharmacy, a grocery store and a mechanic's garage. Gomez began to work at Talsa, and he headed to the mountains on weekends to recruit others to join him. "Now in my village you have empty homes where whole families have left," he said. "People are coming from the Amazon. Chavimochic was our salvation." The water has also transformed life on the coast. About a decade ago, a Danish-Peruvian operation installed running water and electricity in the town of Huancaquito Alto, where the business was employing many residents in its packing plant. The town of 2500 now has a municipal cleaning system that employs trash collectors.

"This was all grassland," said Edgar Garcia, a member of the town council, pointing at a new public plaza that was opened last year. Mercedes Beltran grew up in San Bartolome, which was barely a village, with only three families. Her grandfather fished from a traditional reed raft. "There was no market, we bartered between ourselves," she said. Now her family plants asparagus for the US market, benefiting from competition between buyers that keeps prices high, she said. Even the slightest reduction in the flow of the Santa River causes alarm here. The hydroelectric plant now provides power to 50,000 people; treated river water supplies 700,000 people. "In years to come, we will be fighting over water," said Gomez.

The government has struggled to offer solutions. One proposal would try to capture rain runoff from the Andes during the wet season in a large dam. But construction on the dam was led by Odebrecht, a Brazilian construction company that admitted to paying $US800 million ($1 billion) in bribes throughout Latin America. The dam is now "completely paralysed," with few signs that it will be starting again soon, said Miguel Chavez Castro, the director of the project. Meanwhile, planners here continue to push for more irrigation. They are now eyeing desert tracts farther to the south for a new canal that would, at least for now, supply another 20,000 hectares of desert with water. But Garcia, the council member in Huancaquito Alto, is not taking any chances. He has refurbished an old well used by his father to hold water in the days before this area was irrigated, and he is building a new one near his asparagus fields. "Because of this water, our children have been able to go to university," he said. "But if there is no water from the Santa River, that all changes."

Loading He added: "We have to get our wells ready. Sure, it's like going back in time, but what can we do?" New York Times