The midnight sun hangs low in the sky on this November evening. A plain of flat ice sweeps in all directions and mountains rise in the distance. Perched on the sea ice is a massive, teepee-shaped tent. A mechanised rumble emanates from within.

Inside the tent, men in hard hats tend a rotating shaft of steel. This drill turns day and night through 8 metres of sea ice covering the surface of McMurdo Sound, off the coast of Antarctica, and through 400 metres of water beneath it and into the seabed.

It's not oil these men are drilling for, but another precious resource - historical perspective that could help us to predict the future of sea level rise. Welcome to the Antarctic Geological Drilling project, or Andrill.

This international team is extracting two columns of stone from the sea floor. A few kilometres away, scientists at McMurdo Station, a US research base, work 24 hours a day to analyse them. The cores of stone are providing them with a record peering 19 million years into Antarctica's history.

We know that Antarctica froze 35 million years ago, when its detachment from South America unleashed a circumpolar ocean current that isolated it from warmer parts of the world. What we do not know is whether its ice sheets have stayed frozen or melted and reformed many times since then.

It is an urgent question. Understanding how Antarctica's ice responded to past climate swings will help us to predict how it will react as temperatures rise in the coming decades. The mighty ice sheet covering West Antarctica could unleash enough water to raise sea levels by 5 metres were it to melt.

Andrill's results reveal a breathtaking picture. They show how the West Antarctic ice sheet has collapsed and regrown at least 60 times in the past few million years. Andrill predicts that it could once again tip toward collapse by the year 2100.

"There seems to be a lot more variability in the ice sheet than anyone pictured," says Robert DeConto, a glaciologist at the University of Massachusetts Amherst. "That's what's so exciting about this. But it's also kind of scary."

Other ocean cores have been extracted from hundreds, and thousands, of miles north of here. They trace past changes in sea level by measuring ratios of oxygen isotopes in the layers of the cores. Since the ice sheets preferentially incorporate water molecules containing oxygen-16, spikes in the rock layers' oxygen-16:oxygen-18 ratio pinpoint episodes when disintegrating ice sheets injected meltwater into the oceans.

Readings of these isotopic tea leaves reveal many spikes in sea level, from 5 to 30 metres. But no one has figured out where on the meltwater fuelling any given spike came from - whether Antarctica, Greenland, or any of the other ice sheets that have sprawled over parts of Asia, North America and Europe.

That's why Andrill's record may be the most convincing. "What's unique is that we're drilling right next to the ice sheets," says David Harwood, a palaeoecologist at the University of Nebraska-Lincoln and a founding member of the Andrill project. "So we can see the sea level come and go and we can see the ice sheets advance and retreat."

The two Andrill cores come from a pair of holes drilled near the edge of a slab of floating ice called the Ross ice shelf, which hangs off the edge of Antarctica and bobs atop the Southern Ocean.

If you want to reconstruct the history of West Antarctica, then the Ross ice shelf is a good place to start. It is the largest ice shelf on Earth, about the size of Spain and up to 700 metres thick in places. Five massive glaciers that flow off the edge of West Antarctica, 800 kilometres south of here, ooze into the Ross ice shelf, which buttresses the glaciers' flow and slows their tumble into the ocean. West Antarctica's ice sheet simply could not survive for long without the Ross and several other ice shelves stabilising its edges, says Douglas MacAyeal, a glaciologist at the University of Chicago. By drilling into the seabed here, the Andrill team believes they can reconstruct West Antarctica's history.

Antarctica's ice sheet is really two sheets that join together like a giant figure eight. Glaciologists have good reason to believe that the smaller West Antarctic ice sheet is especially vulnerable to collapse. Most of the ice here slides across land that sits below sea level, at depths of 2000 metres in some locations. Without its ice, West Antarctica would appear on maps not as a substantial body of land but as an archipelago.

The ice sheet's exposure to warming ocean currents means that parts of West Antarctica are already melting from underneath. Satellite surveys show it sweating 130 cubic kilometres of its ice per year, while East Antarctica's ice sits high, dry, and largely intact.

Last year I visited McMurdo Station and dropped in on the stratigraphy lab, where scientists work around the clock analysing the Andrill cores. Sunlight slants in through the windows of the lab at 2 am, creating a false impression of late afternoon. Sections of the core a little narrower than a telegraph pole lie end-to-end on tables and half a dozen scientists are pouring over them.

"We do about 30 metres of core each night," says Chris Fielding of the University of Nebraska, Lincoln. A new batch of core arrives here every night at 10.30 pm, by helicopter.

For the next 2 hours I watch the night shift work. Fielding inches his way along the core, recording in his notebook the alternating layers of gravel conglomerate, mudstone and diatomite, a stone rich in the fossilied shells of marine micro-organisms called diatoms. Layers of diatomite indicate times when the Ross ice shelf had retreated far away, allowing the ocean to teem with life. Gravelly conglomerates laid down on top of these layers show debris swept in by advancing glaciers, and a higher layer of diatomite shows the Ross ice shelf has once again retreated.

Around 3 am, Fielding looks up from the core, rubs his eyes, and says: "When I close my eyes I see conglomerate. After a long time, everything you see turns to conglomerate."

At another table Sonia Sandroni, a petrologist with the University of Siena in Italy, sketches pictures in her notebook of marble-sized rocks suspended in the fossilised mud of the core: red pencil for granite, blue pencil for sandstone, and so on. She has sketched 30,000 rocks this past month. Many are "dropstones", carried by the ice shelf from hundreds of kilometres away and then plunked on the sea floor as icebergs calve off the ice shelf and melt. Sandroni and her colleagues match the minerals in these rocks to the places in Antarctica where they originated to provide a record of how patterns of glacial flow have changed over time.

Stones from far away indicate a robust Ross ice shelf channelling the flow of distant glaciers toward the drill sites. Stones from nearby indicate an absence of the Ross ice shelf. And a total absence of dropstones reveals times when the glaciers retreated so far they no longer calved icebergs into the ocean.

Other scientists in the room catalogue fossils of shells, worms, and tiny amoeboid creatures called foraminifers. Identifying the species reveals not only the prevailing climates when the critters lived, but also how much sea ice covered the ocean.

The scientists work till morning. At 8.30 am, Fielding presents a slide show of photographed fossils and stripy sediment layers from last night's core to two dozen freshly awakened scientists. He departs for dinner and bed, leaving the day shift to examine the core until evening. At 10.30 pm another 30 metres of core will arrive and the cycle will begin anew until the team has examined all 1100 metres.

Shape of things to come

The Andrill team has focused on a period of time called the Pliocene, from 5 million to 2 million years ago. The 2007 report from the Intergovernmental Panel on Climate Change cites the Pliocene as an important analogue to climates that Earth might see as it warms in the coming decades. Global temperatures during that time peaked at 3 °C to 5 °C warmer than today - temperatures that the IPCC predicts could return by the year 2100. That warmth was driven by higher levels of carbon dioxide in the atmosphere.

Harwood, Fielding and 50 other scientists have detailed their findings from this critical period in a paper in Nature last month (vol 458, p 322). The cores show at least 60 cycles of glacial collapse, retreat, and re-advance during the last 14 million years, with 40 of them occurring during the early Pliocene. "It was spectacular," says Timothy Naish of Victoria University of Wellington in New Zealand and Andrill's scientific director. "To see the physical evidence for what we had suspected from other information was pretty exciting."

The big deglaciations seen by Andrill also line up with rises and falls in sea level read from ocean cores drilled in other parts of the world. Together the results show that expansions and collapses of the West Antarctic ice sheet really were helping to drive changes in sea level.

But most striking of all is a 60-metre segment of deep green diatomite in the core, laid down 4 million years ago. This shows the Ross sea continuously free of an ice shelf and brimming with life for 200,000 years.

Compare the climate conditions of the Pliocene with those predicted for the next few decades and the implications are unmistakable. "We know that CO2 was around 400 or 450 parts per million in the atmosphere, and there was no ice sheet on West Antarctica," says Naish. "That's where we're almost at now. So it's a really important window into what we'll be facing in the next 100 years." The results are significant when you consider the IPCC's latest report, published in 2007.

Depending on the future climate scenario, the IPCC predicted sea level rises between 18 and 59 centimetres by 2100 - with Antarctic melting contributing little or nothing to those amounts. But these estimates omit some huge factors. While they predict increased snowfall in Antarctica, they fail to account for an opposing effect: the increased loss of ice that could result from glaciers accelerating as their ice-shelf buffers around the edges of West Antarctica collapse.

The panel sidestepped these issues because the ice sheet models they would have used to calculate such effects had proved unreliable. They successfully predicted snow fall and surface melting on ice sheets. However, they failed to predict factors such as warming ocean currents, thought to underlie the recent thinning of ice shelves and accelerations in ice loss observed since about 2000 in parts of Greenland and parts of West Antarctica.

Richard Alley is a glaciologist at Pennsylvania State University in University Park who helped write the IPCC section on sea level rise. Those older models' biggest weakness, he says, "is this business of warm water getting at the edge of the ice sheet and triggering changes that propagate inward".

Andrill will help fill this gap, says Alley. Climate scientists validate their models by showing that they can reproduce what's seen in palaeo-records drilled from sea floors and ice sheets. DeConto and David Pollard of Pennsylvania State University are now using Andrill's record to do the same with a model that predicts ice sheet changes.

Their model of Antarctica's ice sheets includes forces that most other models leave out, such as underside melting by ocean currents and rapid acceleration and thinning of glaciers when ice shelves collapse. In a Nature paper last month, they show that their model successfully reproduces the sequence of ice sheet collapses and expansions seen over the last 5 million years in the Andrill cores (vol 458, p 332).

They'll soon run their model into the future and they expect it to predict more rapid ice loss than previous models have. "I think that the numbers over the next 100 years or so are going to raise a few eyebrows," DeConto warns.

According to the Andrill cores, each collapse of the West Antarctic ice sheet happened over 1000 to 3000 years, seemingly placing any crisis far into the future. But even that slow collapse could translate into 10 to 50 centimetres of sea level rise per century. Combine that with increased ice loss from Greenland and the sea level could rise to 50 or 100 centimetres by 2100 - the same amount predicted by another group at a climate change conference in Copenhagen last month.

To someone standing atop an ice shelf, the mischief that ocean currents are inflicting on its underside seems a world away. One day during my McMurdo Station stay, a group of us drives far out onto the Ross ice shelf for an overnight survival course. The ice shelf that we eat, sleep, and wield our ice axes upon seems as sturdy as bedrock. But if Andrill is right, the Ross ice shelf and West Antarctic's ice sheet are nowhere near as timeless as they seem.

High, dry and cold

At first glance, Andrill's results would seem to contradict some climate observations taken nearby. Take the Olympus mountain range, located in a frigid corner of East Antarctica just 100 kilometres from the Andrill sites.

Some of the glaciers buried beneath rocks here are more than 7 million years of age - dated from the ages of the volcanic ash lying on top of them - making this the oldest known ice on Earth. So cold is the ice here that it never melts, though it does gradually evaporate.

Freeze-dried bits of tundra protruding from the gravel are dated at 14 million years. None of these features would have survived had summer temperatures consistently warmed above freezing in the last few million years.

So what gives? According to Boston University geologist David Marchant, East Antarctica need not contradict Andrill's findings. The Olympus range sits high, dry, and inland, next to a plateau of bedrock that has almost certainly huddled beneath kilometres of ice for millions of years.

The environment here is a world apart from that of the Ross ice shelf. "They're both reflecting processes that are very different," says Marchant. The key processes in the East Antarctic ice sheet and the Olympus range are atmospheric, he says, whereas changes in the West Antarctic ice sheet are largely down to the ocean.