Now new British-led research has offered a plausible solution to the mystery that will, it’s hoped, help to prevent possibly catastrophic falls in populations of a species that has already declined by 63% in the past 75 years.

Whale sharks travel all over the world when swimming solo - one was recently tracked covering the record 12,000-mile trans-Pacific distance from Panama to the Philippines.

But gatherings of anything from 10 to 500 whale sharks are known to occur only at 20 hotspots, mainly off Australia, Belize, the Maldives and Mexico. Only occasionally are these aggregations linked to specific shallow-water feeding opportunities.

The answer is now thought to lie in bathymetry, or the physical features of the hotspots.

Scientists led by Joshua Copping from the University of Salford and Bryce Stewart from the University of York collaborated with the Maldives Whale Shark Research Programme to carry out a global study seeking common denominators between the hotspots.

All of them turned out to be shallow-water sites that led rapidly via steep slopes to areas usually between 200 and 1000m deep.

It was concluded that there were three main reasons for the whale sharks to select these venues: they used the deep water for feeding on zooplankton and squid; the steep slopes acted to bring nutrients from depth towards the surface, in turn attracting plankton; and in the shallows the whales sharks were not only able to consume coral- and fish-spawn but to warm themselves up after their deep dives into waters as cold as 4°C.

While eco-tourism has made whale sharks an asset to be preserved, it also presents dangers for them, note the scientists, with crowds of snorkellers and tourist vessels at the hotspots disturbing them and increasing the risk of boat-strikes.

The study recommends that marine protected areas should be set up around all whale shark gathering sites not already protected, with codes of practice strictly enforced during interactions.

The scientists also acknowledge remaining whale shark mysteries to be solved.

These include the question of whether the world's biggest fish travel solo between hotspots; why coastal aggregations usually consist of immature (4-5m) males; and, most puzzling of all, where do whale sharks mate?

Up to 90% of the whale sharks passing through the Galapagos marine reserve are female and thought to be pregnant, note the authors, but no-one has yet succeeded in observing whale sharks mating and pupping in the wild.

The study “Does Bathymetry Drive Coastal Whale Shark (Rhincodon typus) Aggregations?” is published in PeerJ here

Divernet - The Biggest Online Resource for Scuba Divers