ON A BREEZY, sunny day in north-east Germany it seems as though the world is running on renewable energy. Near Altentreptow 50-odd giant wind turbines, the tallest 200 metres high, spin above a potato field, making a gentle swishing sound. The hum from the base of each turbine is the sound of electricity being generated, much of it bound for Berlin. The view from the wind farm, across flat fields, is of another wind farm.

Sadly, this is not how the world’s power is generated. In truth, the view from Altentreptow does not even properly reflect how Germany’s power is generated. The battle to drive carbon dioxide out of the world energy system, which accounts for about two-thirds of human greenhouse-gas emissions, has seen some heartening and visible advances. But clean energy is still being soundly thrashed by the dirty sort.

Even as the wind turbines and solar panels began to spread across the fields of Europe, an ancient black fuel was making a comeback (see chart). In 2000 the world’s coal-fired power stations were capable of producing 1,132 gigawatts of electricity between them, according to Enerdata, a Paris-based research firm. By 2014 so many new power stations had been built that they could put out 1,980 gigawatts. Coal, which is about twice as polluting as natural gas, now supplies 41% of the world’s electricity and 30% of its overall energy needs.

The biggest single cause of the fossil-fuel boom is China, which is examined in the next article. But rich Western countries are more culpable than they think. They have transformed their rural landscapes with wind farms and pushed up electricity prices for consumers, yet have managed to drive surprisingly little carbon out of the energy system. The record would look even worse if Western countries had not simultaneously exported much of their heavy industry, and thus much of their pollution, to China and other emerging countries.

The large wind farm near Altentreptow is one of hundreds in Germany. Helped by some big storms, these turbines produced 41,000 gigawatt-hours of electricity in the first half of this year, 15% of Germany’s total electricity output. Add hydro-electric power stations, solar farms and biomass, and the country derived 35% of its electricity from renewable sources. Germany has become a world leader in green power, but also a warning about what can go wrong.

Wind and sunshine have two big drawbacks as sources of power. First, they are erratic. The sun shines weakly in winter when it shines at all, and the wind can drop. On January 20th this year the output from all of Germany’s solar and wind farms peaked at just over 2.5 gigawatts—a small proportion of the 77 gigawatts Germany produced that day. A few months later, during a sunny, windy spell in early June, the combined wind and solar output jumped to 42 gigawatts.

The second problem with wind and solar energy, oddly, is that it is free. Wind turbines and solar panels are not free, of course. Although the cost of solar photovoltaic panels has plunged in the past few years, largely because Germany bought so many, wind and solar farms still tend to produce more expensive electricity than coal or gas power stations on a “levelised cost” basis, which includes the expense of building them. But once a wind or solar farm is up, the marginal cost of its power output is close to zero.

The problem lies with the effect of renewables on energy markets. Because their power is free at the margin, green-power producers offer it for next to nothing in wholesale markets (they will go on to make money from subsidies, known as feed-in tariffs). Nuclear power stations also enter low bids. The next-lowest bids tend to come from power stations burning lignite coal—a cheap but especially dirty fuel. They are followed by the power stations burning hard coal, then the gas-fired power stations. The energy companies start by accepting the lowest bids. When they have filled the day’s requirements, they pay all successful bidders the highest price required to clear the market.

The surge of solar and wind power is pushing down the clearing price and bending Germany’s energy market out of shape. Power stations burning natural gas increasingly find no takers for their electricity, so they sit idle. Meanwhile the cheap, carboniferous lignite power stations burn on (see chart). Coal-fired power capacity has actually increased in the past few years. Coal is likely to become even more important to Germany’s energy supply in future because the government is committed to phasing out nuclear power by 2022. One of Germany’s biggest coal-fired power stations, Jänschwalde, sits near the border with Poland. Built in the 1980s, it burns 80,000 tonnes of lignite a day and can put out three gigawatts of power. Jänschwalde has also become ever more flexible, ramping up and down speedily as the weather changes. Lignite is proving to be an excellent partner for erratic wind and solar power, argues Olaf Adermann of Vattenfall, the firm that owns Jänschwalde. Sadly for the environment, he is right. Earlier this year a shamefaced German government moved to regulate lignite-burning power stations out of existence, but after thousands of miners protested in Berlin, it dropped that policy. The country appears to be stuck with coal. It is likely to miss its self-imposed target for reducing greenhouse-gas emissions, reckons McKinsey, a consultancy. And because of generous feed-in tariffs for renewables that are guaranteed for 20 years, consumers in Germany are paying high prices for their not especially clean power. In the first half of this year households there paid €0.30 for a kilowatt-hour of electricity, whereas the French paid a mere €0.16. Germany has made unusually big mistakes. Handing out enormous long-term subsidies to solar farms was unwise; abolishing nuclear power so quickly is crazy. It has also been unlucky. The price of globally traded hard coal has dropped in the past few years, partly because shale-gas-rich America is exporting so much. But Germany’s biggest error is one commonly committed by countries that are trying to move away from fossil fuels and towards renewables. It is to ignore the fact that wind and solar power impose costs on the entire energy system, which go up more than proportionately as they add more.

Many wealthy countries have too many power stations, the result of a building boom before the financial crisis. This oversupply, combined with the solar- and wind-power boom and the falling wholesale price of electricity, has crushed investment in modern, efficient power stations. It has also turned all energy producers into beggars. Owners of power stations burning coal and gas point out that if they are frequently undercut by wind and solar farms, their costs per watt of electricity produced rise. The government ought to compensate them for that, they say, otherwise they might have to close down.

Terrified of looming blackouts, many Western governments are increasingly paying fossil-fuel power stations to stay open

Terrified of looming blackouts, Western governments are increasingly paying fossil-fuel power stations to stay open. Some offer “capacity payments”—money for standing by. Texas tries to keep the power stations open by promising higher prices at times of strong demand. These payments are a hidden cost of using more wind and solar energy.

Moreover, in many countries, including America, renewable-power producers rely on coal- and gas-fired power stations to set the market price of electricity at a healthy level, points out Frank O’Sullivan, an energy researcher at the Massachusetts Institute of Technology. Solar farms that offer their power for next to nothing will eventually depress the market so much that they render themselves uneconomic without heavy subsidies.

There are ways out of this mess. If governments were to levy a hefty tax on carbon, they would drive the most polluting power stations off the system. Germany does not do this: it relies on the European Emissions Trading System, which sets a rock-bottom carbon price. But Sweden does, and Britain has a floor price, which amounts to the same thing. Better still, says Mr Helm at Oxford University, a heavy carbon tax could be combined with market reforms that would force renewable power producers to bear the costs of their intermittency.

It would help if electricity grids were bigger and more efficient. The larger the grid, and the less power lost per kilometre of transmission, the less intermittency matters: cloudy and windless conditions rarely prevail across an entire continent. Denmark gets away with relying heavily on wind turbines because it has a connection to Norway, which can supply hydro-electric power on demand. But Germany’s efforts to build long-distance transmission lines have been stymied by not-in-my-backyard protests.

Better energy storage would help, too. Hydro-electric power stations have been used to store energy for decades. But there is not always an uphill reservoir handy, and other ways of storing energy, such as lithium-ion batteries, are expensive. More promising, probably, is automatic demand reduction. Smart meters can turn down household freezers and air-conditioning units briefly when power is in short supply and then power them up again, thereby shifting demand. Sia Partners, a consultancy, estimates that European countries could cut peak demand by 9% with such methods.

But they can do only so much. Energy storage and demand-response technologies are good for matching supply with demand during the course of a single day. In a place like California, power demand is highest on sunny summer afternoons, when people turn up their air-conditioners. Solar farms produce most of their power around the same time, so with a bit of clever demand adjustment the peaks of supply and demand could be aligned. In northern Europe, however, electricity demand is highest in the early evening in winter, when solar farms are producing no power.

Near Altentreptow, electricity from the wind farm is being used to turn water into hydrogen and oxygen. The hydrogen is stored in tanks and burned to produce power when the wind drops. The firm doing this, WIND-Projekt, just wants to be able to keep the lights on. The process is inefficient: 84% of the original electricity gets lost in being converted and reconverted. But perhaps the hydrogen could be sold directly to consumers, or the heat could be captured. At any rate, suggests Marcus Heinicke of WIND-Projekt, the days of being able to sell power only when the wind blows will not last for ever.