GRANTS PASS, Ore. — Salmon have long been known to use their sense of smell to find their home river when it comes time to spawn, but how do they get close enough to smell the river?

A new study suggests that, like birds migrating over long distances, salmon use the earth’s magnetic field.

The study published this week in the journal Current Biology looked at 56 years of fisheries data about which route sockeye salmon used when they returned to the Fraser River in British Columbia.

Scientists found that which way the salmon chose to go around Vancouver Island matched natural shifts in the geomagnetic field.

When the magnetic field shifted to the north, the fish swam by the north shore of the island. When it shifted to the south, the fish swam by the south side.

By a smaller degree, fish tended to take the northern route when ocean surface temperatures were warmer, presumably because they were trying to stay in colder water, the study found.

“What we think happens is that when salmon leave the river system as juveniles and enter the ocean, they imprint the magnetic field — logging it in as a waypoint,” which they can follow home from their travels around the Pacific Ocean, said lead author Nathan Putman, a researcher at Oregon State University.

“That should get them to within (30 to 60 miles) of their own river system and then olfactory cues or some other sense kicks on.”

Peter B. Moyle, professor of fisheries at the University of California at Davis, said the study was convincing’ and came to a conclusion that scientists have long suspected.

Moyle noted that other fish, including Atlantic salmon, sharks and tuna, are known to have magnetic particles in their bodies, which could figure in their ability to migrate long distances to return to a specific place.

Some sharks, for instance, return to the same underwater mountains, which produce a change in the magnetic field.

“If you have the right equipment in the brain to detect these fields, it’s like having your built-in GPS system,” Moyle said.