As disaster costs keep rising across the United States, a troubling new debate has become urgent: if there’s not enough money to protect every coastal community from the effects of human-caused global warming, how should we decide which ones to save first?

After three years of brutal flooding and hurricanes, there is growing consensus among policymakers and scientists that coastal areas will require significant spending to ride out future storms and rising sea levels — not in decades but now and in the very near future.

There is also a growing realisation that some communities, even sizeable ones, will be left behind.

New research offers one way to look at the enormity of the cost as policymakers consider how to choose winners and losers in the race to adapt to climate change.

By 2040, simply providing basic storm-surge protection in the form of sea walls for all coastal cities with more than 25,000 residents will require at least $42bn (£33.1bn), according to new estimates from the Centre for Climate Integrity, an environmental advocacy group.

Glacier collapse shows climate impact Show all 20 1 /20 Glacier collapse shows climate impact Glacier collapse shows climate impact An iceberg floats in a fjord near the town of Tasiilaq Reuters Glacier collapse shows climate impact Meltwater pools on top of the Helheim glacier near Tasiilaq Reuters Glacier collapse shows climate impact Safety officer Brian Rougeux works with student Febin Magar to assemble a radar dome while working in a science camp on the side of the Helheim glacier Reuters Glacier collapse shows climate impact Airplane Mechanic, David Fuller, left, works with a local worker to move a Nasa Gulfstream III during a pre-flight inspection before a flight to support the Oceans Melting Greenland research mission Reuters Glacier collapse shows climate impact Meltwater pools on top of the Helheim glacier Reuters Glacier collapse shows climate impact Earth Science Flight Programs Director at Nasa, Eric Ianson, looks out at the Greenland ice sheet Reuters Glacier collapse shows climate impact Glacial ice is seen from the window during the Nasa flight Reuters Glacier collapse shows climate impact Oceanographer David Holland's science camp on the side of the Helheim glacier Reuters Glacier collapse shows climate impact An iceberg floats in a fjord near the town of Tasiilaq Reuters Glacier collapse shows climate impact A large crevasse forms near the calving front of the Helheim glacier Reuters Glacier collapse shows climate impact Safety officer Brian Rougeux uses a drill to install antennas for scientific instruments that will be left on top of the Helheim glacier Reuters Glacier collapse shows climate impact Tabular icebergs float in the Sermilik Fjord after a large calving event at the Helheim glacier Reuters Glacier collapse shows climate impact Radar Engineer, Ron Muellerschoen, monitors data collection inside a NASA Gulfstream III flying above Greenland to measure loss to the country's ice sheet Reuters Glacier collapse shows climate impact GPS tracking equipment is left on top of the Helheim glacier REUTERS Glacier collapse shows climate impact Sunshine lights up the Helheim glacier Reuters Glacier collapse shows climate impact A glacial terminus above the east coast of Greenland REUTERS Glacier collapse shows climate impact Student Febin Magar watches as leftover wood burns in a research camp Reuters Glacier collapse shows climate impact Tabular icebergs float in the Sermilik Fjord after a large calving event Reuters Glacier collapse shows climate impact Oceanographer David Holland repairs a broken GPS module at his research camp Reuters Glacier collapse shows climate impact An iceberg floats in a fjord near the town of Tasiilaq Reuters

Expanding the list to include communities smaller than 25,000 people would increase that cost to more than $400bn (£315bn).

“Once you get into it, you realise we’re just not going to protect a lot of these places,” said Richard Wiles, the centre’s executive director.

“This is the next wave of climate denial — denying the costs that we’re all facing.”

The research is limited in that it considers only sea walls, and not other methods for minimising flood risk that may be more practical in some places, such as moving homes and shops away from the most flood-prone areas.

The figures also don’t include the additional and costlier steps that will be required even with sea walls, such as revamping sewers, storm water and drinking water infrastructure.

Still, the data provides a powerful financial measuring stick for the tough decisions that countless communities — large and small — are starting to confront.

In March, New York City Mayor Bill de Blasio proposed a $10bn (£7.9bn) project to protect a slice of lower Manhattan from flooding, asking the federal government to pay for it.

In April, the Army Corps of Engineers said the levee system around New Orleans, upgraded after Hurricane Katrina at a cost of $14bn (£11bn), is sinking and could become inadequate in as little as four years.

In May, officials in Charleston, South Carolina, held a public meeting on where to find the estimated $2bn (£1.58bn) the city needs to prepare its drainage and water infrastructure for climate change.

The cities that are quick to adapt to climate risks “are going to attract the jobs and the factories of the future”, said Eric Smith, president and chief executive officer for the Americas at Swiss Re, one of the world’s largest reinsurance companies.

“There’s going to be communities that I think will be left way, way behind.”

The new research identifies 241 cities of 25,000 people or more that will require at least $10 million (£7.9 million) worth of sea walls by 2040 just to protect against a typical annual storm.

Many cities, especially small ones, will not be able to meet the costs facing them.

Those that can’t will depend on federal funding. The Trump administration is expected to soon unveil the details of two new large spending programmes to fund disaster mitigation.

15-year-old shakes her head as all five conservative leader candidates argue over climate change

The design of those programmes could help determine which places are best able to withstand the force of climate change.

The administration is working on rules governing $16bn (£12.6bn) in grants from the Department of Housing and Urban Development to help cities and states protect themselves against the effects of future natural disasters, the largest such award ever made by the department.

The Federal Emergency Management Agency (FEMA) is also preparing rules for grants to pay for climate-resilient infrastructure.

A FEMA spokeswoman, Abigail Dennis, said the agency is asking governments, businesses, academics and “vulnerable and at-risk populations” to provide input on the design of its new grant program, called Building Resilient Infrastructure and Communities.

“The increasing frequency, impact and cost of disasters demands that we invest in mitigation and reduce disaster suffering,” Ms Dennis said by email.

The program “will support measures to reduce the vulnerability of communities and public infrastructure before a disaster strikes”.

But even that funding is likely to fall far short of the vast need. So experts have proposed ways of focusing federal money where it can do the most good — even if that means some places are left out.

One approach would be for the federal government to spend the money based simply on where it would most reduce the future cost of damage, according to Craig Fugate, who ran FEMA during the Obama administration.

“The way I would do it is, how much risk avoidance do I get for every dollar I invest?” Mr Fugate said.

Many experts believe that there are hard choices ahead.

Robert Young, director of the Program for the Study of Developed Shorelines at Western Carolina University, said the US Congress should appoint a group of technical experts to decide which coastal communities the federal government should protect.

That decision would depend on which places are most important and also which are easiest to defend. Congress would then vote to accept or reject the list, similar to the process for deciding which military bases to close.

“We cannot protect all of those places where they are,” Mr Young said. “We should choose the places that are most sustainable.”

He acknowledged that the odds of Congress taking such an approach weren’t high, at least not yet.

“To be able to sensibly make these kinds of decisions in an organised fashion, using data?” Young said. “That’s a gigantic assumption, in my opinion.”

Mr Smith, of Swiss Re, said that cities should take responsibility for protecting themselves from the rising toll of disasters, rather than waiting for the federal government.

In his view, the chief obstacle is the refusal by some local officials to acknowledge what is happening.

“The challenge is, we’re fighting about whether or not there’s climate change,” Mr Smith said. “They don’t want to embrace what’s right in front of us.”