Hurricane Irma smashed into Florida over the weekend, directly hitting Key West and Naples on its way up the western Florida coast. Wind and flooding damage from torrential rains and a powerful storm surge was extensive, and at least five people have been killed in the state, in addition to 27 people in the Caribbean.

On Friday, Congress approved supplemental funding for the Federal Emergency Management Agency (FEMA), which had spent almost all its remaining cash responding to Hurricane Harvey. It was just in the nick of time, and badly needed as people begin to assess the wreckage left in the path of Irma.

All this also illustrates that Congress must change the way it funds FEMA. First, it ought to mandate the use of climate science in its funding estimates and program structures. Second, it needs to provide an automatic funding mechanism for when a serious disaster strikes.

What is FEMA? It conducts disaster relief when an emergency has outstripped the capacity of local agencies to respond. It runs the (highly dysfunctional) national flood insurance program, distributes supplies, deploys various search-and-rescue and medical teams, helps house displaced people, and so forth.

Its budget was about $14 billion last year. Roughly half of it went towards permanent programs, while the other half — $6.7 billion in 2016 — went to disaster relief. Huge storms like Harvey and Irma can easily burn through that entire amount, and more. Just gearing up for a major disaster can run to $200 million per day, according to a former FEMA administrator.

This disaster fund allotment is calculated based on past historical averages, which is the first problem with FEMA funding and practices. Disaster damages have been increasing sharply of late, far exceeding historical averages, and climate models suggest they will only continue to rise — especially from flooding.

The agency needs to incorporate climate change both in its permanent programs — above all the flood insurance program, which effectively subsidizes building in flood-prone areas — and in its estimates of disaster spending. (Naturally, President Trump recently rescinded an Obama executive order mandating consideration of climate change in federally funded construction projects.)

The second (and related) problem is that when FEMA burns through its disaster money, it has to run to Congress, hat in hand, for more cash — which, given increasing damages, has happened almost every year over the last decade. Obviously, 2017 is no exception. Indeed, given the destruction wreaked by Irma, and potentially by Jose soon, I would not be surprised if Congress has to appropriate even more disaster funds before the year is out.

This is a seriously sub-optimal way to fund disaster relief. Faced with massive, sudden expenses, FEMA has previously had to dip into its permanent program funding, or triage spending on only the most severely hit areas, as it did before this most recent appropriation. A better method would be to establish a permanent program budget and then a very large emergency appropriation authority — say $200 billion or so — that could be tapped as needed in case of a disaster declaration. The U.S. Congress is dysfunctional at best, and often takes weeks-long recesses. It's highly risky to allow disaster funding to hinge on that institution being able to take swift action.

Obviously such a huge pot of money would be vulnerable to abuse, so there would need to be an oversight board to make sure disaster funding was really necessary and spent appropriately. But in principle, it should be easy to ensure disaster relief promptly gets all the funding it needs without disturbing permanent programs.

Now, we are living under President Trump, and so the prospect of reforming FEMA practices in line with science and sensible payment structures is less than likely. Indeed, Trump's proposed budget sharply cut FEMA spending, as well as that of the EPA, which also does disaster response — and would abolish the Chemical Safety and Hazard Investigation Board, which is currently in Houston investigating multiple massive chemical spills.

But it's still worth thinking about what to do. Some sort of disaster relief agency is obviously indispensable, and will only become much more so as the years pass. As the Earth continues to warm, we will almost certainly see more extreme weather in the future. Even if America joins a global effort to ratchet down greenhouse gas emissions as fast as possible, as we surely must, we have already locked in a new disaster baseline, and will have to spend a lot to repair and adapt.

Once Trump is out of office, there will be a vast backlog of work needing to be done as fast as possible. We better start getting ready now.