Image copyright Getty Images

The UK's new £200m polar research ship has officially been named the "Sir David Attenborough" after the famous BBC broadcaster and naturalist.

A bottle of champagne was smashed against the hull of the vessel by the Duchess of Cambridge.

Several thousand people had gathered at the Cammell Laird shipyard on the Wirral to witness the event.

Sir David was there also and spoke of the "greatest possible honour" that had been bestowed on him.

Media playback is unsupported on your device Media caption The RRS Sir David Attenborough was nearly named Boaty McBoatface following an online poll

The ship's role, he said, would be to address the climate crisis. "This astonishing ship... will find the science with which to deal with the problems that are facing the world today and will increasingly do so tomorrow."

Just before his wife pressed a big yellow button to unleash the bottle against the paintwork, the Duke of Cambridge paid his own tribute to the naturalist and also referenced the growing concern about the pace of climate change.

"There has never been a more important moment for this ship to get to work, and there is no person more fitting for this beacon of scientific research to be named after than you, David," he said.

Image copyright Reuters

A big crowd had turned out on what was a grey, drizzly day. But their enthusiasm was undimmed and they cheered the Royal couple, the speeches - and the Cybermen drummers and children dressed as penguins.

Image copyright EPA

The Royal Research Ship (RRS) was commissioned to replace the James Clark Ross and the Ernest Shackleton, which between them gave almost 50 years' service in support of UK polar science.

The RRS Sir David Attenborough will now carry the union flag into the Arctic and the Antarctic.

This is the vessel an online poll had cheekily suggested be called "Boaty McBoatface" before ministers stepped in to end the joke.

That humorous moniker was given instead to the long-range robotic yellow submarines that will in future operate from the Attenborough.

Image copyright Reuters

The naming ceremony was a moment for great celebration and pride in Birkenhead.

Yard workers, their families, VIPs and local residents thronged the quayside to see the royals inaugurate the vessel.

Mackenzie Boyd joined Cammell Laird as an apprentice. This has been his first project, working as a plater. "It's amazing," he told BBC News.

"This ship is already famous and it hasn't even gone to sea yet. But it's going to have a massive impact."

The 130m-long, 15,000-tonne "floating science lab" represents the largest commercial ship built in Britain in three decades.

Its initial keel block was laid in October 2016, with the 10,000-tonne completed hull section entering the River Mersey in July last year. Final fixtures and fittings are almost done (it took 60,000 litres to paint the outside and inside), and it is expected commissioning trials will get under way in the coming weeks.

Its entry into service comes not a moment too soon.

Wednesday witnessed the publication of the Intergovernmental Panel on Climate Change's (IPCC) special report on Earth's oceans and frozen regions.

This document paints a grim picture of rapid and accelerating losses from the ice sheets of both the far north and the far south.

It will be the job of the RRS Sir David Attenborough to go document the changes that are occurring and to help scientists work out how fast the melting will impinge on lower latitudes.

Image caption Commemorative coins: A £2 Sir David Attenborough piece; and a 50p Boaty McBoatface

Already sea levels are rising globally by about 5mm per year (taken over the past five years), with ice losses at the poles now considered to be the major driver of this trend.

By the year 2100, according to some scenarios, the oceans could be 1.1m higher than they are now, which would pose a major challenge to the viability of many coastal settlements worldwide.

"The oceans take up a lot of the carbon dioxide and the heat that we generate, but we don't really know how and where it goes, particularly in the Southern Ocean - this big, deep ocean around Antarctica," said Dame Jane Francis, director of the British Antarctic Survey (BAS).

"We're talking about big numbers and they're critical to understanding how the whole climate system operates."

And Dr Kelly Hogan, a BAS marine geophysicist, added: "What's different about the way we'll do research with the Attenborough is we're going to be able to use a lot of different instruments and technologies to study a large number of components, including the atmosphere, the ice itself, the surface ocean, the deep ocean and the muds at the bottom of the sea; and that way we'll be able to tackle the really big questions."

Media playback is unsupported on your device Media caption A three-year build: This is how the completed hull entered the water

Why does this ship matter?

BAS, which manages the UK's polar fleet, needs a modern platform from which to conduct world-leading research.

Image caption There is 750km of power and data cabling running through the ship

The chartered RRS Ernest Shackleton has already been returned to its owner; the RSS James Clark Ross will be sold next year.

It is the view of the funding agency, the Natural Environment Research Council, that the more advanced Attenborough can fulfil the tasks of both the earlier vessels - in research and in logistics. So, not only can its gear and labs do cutting-edge science, but it can carry numerous freight containers to resupply bases and expeditions in the field.

How special is the ship?

It is an icebreaker. There are different classes for this type of vessel but the specification says the Attenborough should be able to plough through 1m-thick sea ice at three knots (3.5mph/5.5km/h).

This will soon be tested when the ship is taken out on trials in the Arctic. "That's an exciting prospect. Our careers are spent trying to avoid things but in the Arctic and the Antarctic we get to throw our ships at the ice," said BAS Captain John Harper who'll lead the first polar trials.

The Attenborough also has a helipad (helicopters are essential), cranes and onboard labs, and it has the ability to deploy subs and other ocean survey and sampling equipment.

Image copyright BAS Image caption Silent running: The ship is designed to cut through the water with minimal noise

One of its key features is an enclosed "moon pool". This is essentially a huge hole running right through the middle of the hull. It will allow instruments to be lowered into - and recovered from - the sea when weather or dense sea-ice conditions would normally make such work very difficult.

The ship design, put together by Rolls-Royce, also enables near-silent running when required, meaning scientists can study sea creatures without disturbing them.

What happened to the "Boaty" name?

Boaty McBoatface lives on in the form of yellow submarines. The National Oceanography Centre in Southampton has several of these long-range autonomous underwater vehicles.

When one of these is out on patrol, it carries the Boaty moniker.

The intention is that these Boaty-class subs will frequently operate from the Attenborough. They will be asked to go into places the ship itself cannot reach, such as under the colossal floating ice shelves that surround Antarctica.

Image copyright P.Abrahamsen/BAS Image caption Boaty McBoatface: The submarines can go places the ship cannot

Media playback is unsupported on your device Media caption Take a flight over the RRS Sir David Attenborough

Jonathan.Amos-INTERNET@bbc.co.uk and follow me on Twitter: @BBCAmos