For indispensable reporting on the coronavirus crisis, the election, and more, subscribe to the Mother Jones Daily newsletter.

This story was originally published by Grist and appears here as part of the Climate Desk collaboration.

It’s a sunny October day on the outskirts of the west German town of Bottrop. A quiet, two-lane road leads me through farm pasture to a cluster of anonymous, low-lying buildings set among the trees. The highway hums in the distance. Looming above everything else is a green A-frame structure with four great pulley wheels to carry men and equipment into a mine shaft. It’s the only visible sign that, almost three quarters of a mile below, Germany’s last hard coal lies beneath this spot.

Bottrop sits in the Ruhr Valley, a dense stretch of towns and suburbs home to 5.5 million people. Some 500,000 miners once worked in the region’s nearly 200 mines, producing as much as 124 million tons of coal every year.

Next year, that era will come to an end when this mine closes. The Ruhr Valley is in the midst of a remarkable transformation. Coal and steel plants have fallen quiet, one by one, over the course of the last half-century. Wind turbines have sprung up among old shaft towers and coking plants as Germany strives to hit its renewable energy goals.

But the path from dirty coal to clean energy isn’t an easy one. Bottrop’s Prosper-Haniel coal mine is a symbol of the challenges and opportunities facing Germany —and coal-producing states everywhere.

Around the world, as governments shift away from the coal that fueled two ages of industrial revolution, more and more mines are falling silent. If there’s an afterlife for retired coal mines, one that could put them to work for the next revolution in energy, it will have to come soon.

The elevator that carries Germany’s last coal miners on their daily commute down the mine shaft travels at about 40 feet a second, nearly 30 miles an hour. “Like a motorcycle in a city,” says Christof Beicke, the public affairs officer for the Ruhr mining consortium, as the door rattles shut. It’s not a comforting analogy.

The brakes release and, for a moment, we bob gently on the end of the mile-and-a-half long cable, like a boat in dock. Then we drop. After an initial flutter in my stomach, the long minutes of the ride are marked only by a strong breeze through the elevator grilles and the loud rush of the shaft going by.

When the elevator finally stops, on the seventh and deepest level of the mine, we file into a high-ceilinged room that looks like a subway platform. One of the men who built this tunnel, Hamazan Atli, leads our small group of visitors through the hall. Standing in the fluorescent light and crisp, engineered breeze, I have the uncanny sense of walking into an environment that humans have designed down to the last detail, like a space station or a submarine.

A monorail train takes us the rest of the way to the coal seam. After about half an hour, we clamber out of the cars and clip our headlamps into the brackets on our hard hats. It is noticeably warmer here. There is a sulfurous smell that grows stronger as we walk down the slight incline toward the deepest point of our day, more than 4,000 feet below the surface, and duck under the first of the hydraulic presses that keep the ceiling from collapsing on us.

Because this seam is only about five feet high, we have to hunch as we move through the tunnel of presses, stepping through deep pools of water that swallow our boots. The coal-cutting machine is stalled today, otherwise it would be chewing its way along the 310-yard-long seam, mouthparts clamped to the coal like a snail to aquarium glass. The coal would be sluiced away on a conveyor belt to the surface, and the hydraulic presses would inch forward, maintaining space for the miners to work.

Instead, the mine is eerily quiet. Two miners, their faces black, squeeze past us. As we sit, sweating and cramped under the hydraulic presses, the bare ceiling above the coal seam gives up an occasional gasp of rock, showering down dust and debris.

Later, in a brightly lit room back on the surface, Beicke from the mining consortium asks me what I thought of the mine. I tell him that it seems like an extreme environment for humans. “Yes,” he nods, “it is like an old world.”

A few days earlier, Beicke and I had trekked to the top of a hill outside the long-shuttered Ewald Mine in Herten, a half-hour drive from Bottrop. We climbed a set of stairs to a platform with a view over the whole region, the fenced-off or leased-out buildings of the old mine sitting below us.

The Ruhr Valley encompasses 53 cities of Germany’s once-formidable industrial heartland, including Essen, Bochum, and Oberhausen. The whole region was once low-lying riverland, but these days large hills rear above the landscape. These are the heaps of rock removed from the mines, tons of slag excavated with the coal and piled up. It’s a stark visual reminder of what’s been emptied out from underneath.

As the mines have closed down, most of these heaps have been covered with grass, and many have been crowned with a statue or other landmark. On one hill outside Essen, there’s a 50-foot steel slab by the sculptor Richard Serra; on another, atop other heaps, wind turbines stand like giant mechanical daisies.

Germany has been hailed as a leader in the global shift to clean energy, putting aside its industrial past for a renewable future faster than most of the industrialized world. The country has spent more than $200 billion on renewable energy subsidies since 2000 (compare that to the United States, which spends an estimated $20 billion to subsidize fossil fuel production every year).

In 2011, Chancellor Angela Merkel’s government announced the beginning of a policy of “energiewende” to wean Germany off fossil fuels and nuclear power. Last year, wind, solar, and other renewables supplied nearly 30 percent of the country’s electricity. The goal now is to hit 40 percent in the next 10 years, while slashing carbon emissions 40 percent below 1990 levels by 2020.

That transition has happened alongside attempts to restore the Ruhr Valley’s landscape. For every hill raised above ground level, there is an accompanying depression where the land subsided as coal seams were emptied out. The land here sank as the coal seams closest to the surface were emptied out. Overall, the region has sunk about 80 feet.

Streams that enter the Ruhr Valley are no longer able to flow out the other side, Beicke explains, and now water pools in places it never used to. The mining company is responsible for pumping that water away, as well as pumping groundwater across the region, to keep the water table below the level of the existing mines. Any contaminated water in the old mines must be removed and treated to keep it from polluting the groundwater.

These are just a few of the mining company’s “ewigkeitsaufgaben”—literally, eternity tasks.

“As long as 5 or 6 million people want to live in this area, we will have to do that,” Beicke tells me, of the expensive water management. “Maybe 2,000 years in the future that will change, but until that happens, well.” He shrugs.

“Maybe 2,000 years in the future that will change, but until that happens, well.” He shrugs.

The government gives the mining consortium 220 million euros a year in subsidies to deal with all the consequences of coal mining. Unlike in the United States, where aging coal companies often sell off their assets or declare bankruptcy to dodge clean up bills, here the mining company will be pumping and treating water long after it has stopped being a mining company at all.

Despite a national commitment to a broad energy transition, many now think that Germany will fall short of its renewable energy targets, thanks to a number of confounding economic and social factors, including the continued use of a coal alternative called lignite, also known as “brown coal.” Germans have the highest electricity costs in Europe, and the rise of the country’s extreme right-wing party in the last election has been pinned, in part, on those high bills.

If Germany does continue to progress toward its climate goals, much of the new energy is sure to come from wind power. Germany has more wind turbines than any other country in Europe, many of them installed in the last six or seven years. But wind doesn’t blow consistently, so this shift has been a challenge for the electrical grid. Even slight disruptions in the power supply can have wide-ranging consequences.

As more wind turbines are turned on, and more coal plants are retired, this problem will only get bigger, and the challenge of storing all that intermittent energy will be even more important. Here’s where the country’s retired coal mines might prove useful again — as giant batteries for clean energy.

To turn a coal mine into a battery, all you need is gravity.

OK, you also need a lot of money (more about that later), but the basic principle is gravitational. When you lift a heavy object, it stores the power used to lift it as potential energy until it’s released and falls to the ground.

Let’s say the heavy object you’re lifting is water. When you want to store energy, you just have to pump the water uphill, into a reservoir. When you want to use that energy, you let the water flow back down through a series of turbines that turn the gravitational rush into electricity.

This is the basic plan André Niemann and Ulrich Schreiber conceived when they were dreaming up new ways to use old mines. It seemed intuitive to the two professors at the University of Essen-Duisburg: The bigger the distance between your upper and lower reservoirs, the more energy you can store, and what’s deeper than a coal mine?

Schreiber, a geologist, realized it was theoretically possible to fit a pumped storage reservoir into a mine, but it had never been done before. Niemann, a hydraulic engineer, thought the proposal was worth pursuing. He drummed up some research money, then spent a few years conducting feasibility studies, looking for a likely site in the Ruhr Valley and running the numbers on costs and benefits.

After studying the region’s web of fault lines and stratigraphic layers, Niemann’s team settled on the closing Prosper-Haniel mine. Their underground reservoir would be built like a massive highway tunnel, a reinforced concrete ring nine miles around and nearly 100 feet high, with a few feet difference in height from one side of the ring to the other to allow the water to flow, Niemann explains.

At max storage, the turbines could run for four hours, providing 800 megawatt-hours of reserve energy, enough to power 200,000 homes.

The appeal of pumped storage is obvious for Germany. Wind and sun are fickle energy sources—“intermittent” by industry lingo—and energy storage can help smooth out the dramatic spikes. When the wind gusts, you can stash that extra power in a battery. When a cloud moves over the sun, you can pull power back out. It’s simple and, as the grid handles more and more renewable energy, increasingly needed.

The only problem: It’s expensive.