By Christopher Flavelle

As disaster costs keep rising nationwide, 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 in the United States, 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 realization that some communities, even sizable 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 $42 billion, according to new estimates from the Center for Climate Integrity, an environmental advocacy group. Expanding the list to include communities smaller than 25,000 people would increase that cost to more than $400 billion.

“Once you get into it, you realize we’re just not going to protect a lot of these places,” said Richard Wiles, the center’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 minimizing 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.