Hurricane Matthew may have wandered out to sea, but the watery mess it left behind in North Carolina keeps getting worse and worse.

The hurricane dumped record amounts of rainfall on the state over the weekend, and floodwaters are still rising as rivers continue to fill up and overtop their banks. These floods have already killed 17 people in North Carolina and left thousands stranded in their homes or on their rooftops, waiting to be rescued.

In some areas, the flooding isn’t likely to peak until Friday, as rivers keep swelling. President Barack Obama has declared a state of emergency in 31 counties:

“This storm is still impacting people in a big way,” said Gov. Pat McCrory. “You have got to see it to believe all the devastation that has occurred.”

How North Carolina got hit by record floods — unexpectedly

For those following Hurricane Matthew from the start, this was all a bit of a shock. The storm wasn’t expected to affect North Carolina much; instead, forecasters initially thought it would drift off into the Atlantic Ocean after running along the coast of Florida, Georgia, and South Carolina.

But the storm ended up veering onshore on Saturday, making landfall in South Carolina and dumping record amounts of rain on the region. Parts of the coastal Carolinas got 12 to 18 inches of rain, and the National Weather Service quickly warned of a “serious inland flooding event.”

Jeff Halverson of the Capital Weather Gang has an excellent breakdown of exactly how Hurricane Matthew created a record-breaking deluge. The western Atlantic Ocean has been exceptionally warm, and so there’s been a record amount of moisture in the air — which the hurricane converted into rain. The storm also moved extremely slowly over the Carolinas and faced just the right meteorological conditions to create massive flooding.

All told, meteorologist Ryan Maue estimates, Hurricane Matthew ended up dumping 14 trillion gallons of water on the Southeast — about 1 percent of what the entire country received over the course of the last year:

Rainfall from Hurricane #Matthew in trillions of gallons during last 3 days (Table: https://t.co/QxiAEh4gVn)

FL+GA+SC+NC+VA = 13.6 Trillon pic.twitter.com/3rPhsyOS0h — Ryan Maue (@RyanMaue) October 9, 2016

North Carolina bore the brunt of it. Rivers filled up and poured over their banks. Levees were breached. Thousands of people were stranded in their homes, and rescue crews had to pick them up by boat or air. Chico Harlan has an excellent piece in the Washington Post tagging along with one such rescue crew.

In the eastern part of the state, the towns of Tarboro and Princeville had to be emptied after the Tar River overflowed. In Moore County, a town had to be evacuated after officials noticed a leak in the nearby Woodlake Dam, which threatened to fail and flood places like Fort Bragg. (Officials have since said the dam has been stabilized.)

All told, these floods have killed 14 people so far — several people driving cars were killed after floodwaters engulfed their vehicles.

Damage to one road in #Simpson, NC, shot by a @wnct9 photojournalist. We spoke with the driver of the car, who just crashed this a.m. pic.twitter.com/4MUWHthHD2 — Lauren Sagl (@LaurenSagl) October 9, 2016

The National Weather Service will continue to send out flood warnings throughout the week, telling residents to move to higher ground and not try to drive during floods — a car can float in just two feet of water.

Some broader lessons from North Carolina’s floods

There are at least three points to consider here going forward:

1) Over at the Capital Weather Gang, Jason Samenow tries to draw lessons from the way the North Carolina floods took forecasters by surprise: “For now, meteorologists are stuck in a situation in which they will have to issue forecasts with imperfect information. This means becoming masters of communicating uncertainty and identifying situations in which the forecast could quickly change for the better or worse.”

2) As Andrew Freedman points out in an excellent piece at Mashable, this is a good reminder that the way we judge hurricanes can be a little misleading. Right now, hurricanes are ranked according to the Saffir-Simpson scale, which is mainly based on wind speed. A Category 1 hurricane has maximum sustained winds between 74-95 mph, while a Category 5 has maximum sustained winds over 155 mph. (That’s the difference between light damage to roofs and pulverizing homes.)

One flaw, though, is that this scale doesn’t say anything about the dangers from inland flooding — which can end up killing far more people. It’s reasonable to ask whether many people misjudged the threat from Hurricane Matthew because it landed in South Carolina as a “mere” Category 1, even though it brought extremely heavy bands of rain with it. Freedman discusses some of the alternative efforts to rank hurricanes, although unfortunately they’re not as elegant as the Saffir-Simpson scale.

3) It’s also worth thinking about the climate change context here. In the months ahead, scientists will no doubt debate whether and how global warming contributed to this particular record-breaking flood. But let’s set that aside for a second.

What we do know is that climate scientists are warning that North Carolina can expect to face both higher sea-level rise along the coasts and more rainfall in the heaviest storms as a result of global warming. As the atmosphere warms, it can hold more moisture, and the very heaviest storms in the Southeast now dump 27 percent more rain per event than they did in the 1950s, according to the government’s National Climate Assessment:

Trends like this absolutely need to be studied and incorporated into future planning. In Fayetteville — one of the North Carolina cities hard-hit by floods — city officials have been planning some $60 million in storm-water infrastructure improvements. “It's likely time to recalculate and re-engineer” for even worse future events, argues the Fayetteville Observer in an editorial penned during this week’s floods.

The editorial points out other areas where the region may need to take climate change into account: “Even I-95 itself was flooded and impassable in places during and after the storm. What additional protection do we need for the East Coast's most important north-south highway? Before these storms, reconstruction projects had raised the roadbed of the eastern sections of U.S. 64. Was it enough? Do many other roads need the same attention?”

There are also questions to be asked about how communities can better protect themselves against storms. As the Washington Post notes, these floods hit some of the poorest regions in the eastern and central part of the state — including areas that lack flood insurance.

That said, North Carolina’s conservative politicians have been famously reluctant to plan for climate change. In 2012, legislators made national headlines after they bristled against the use of sea-level rise projections in coastal planning. We’ll see if this storm spurs them to reconsider.

Further reading