As climate change heats our oceans, you’d expect temperature-sensitive marine species to flee poleward to cooler waters. So why have some headed to warmer regions toward the equator?

Scientists have solved the puzzle. For the most part, these animals are relocating to cooler waters. But since the effects of climate change can vary widely across regions, sometimes those cooler regions are closer to the poles and sometimes they’re closer to the equator.

In other words, marine animals are still reacting to climate change, but at a local scale. And they’re doing it so reliably that you can actually measure the speed and direction of those changes by watching where animals go, according to a study published Thursday in the journal Science.

The mystery began with observations of species such as the shortbelly rockfish and torpedo ray, which live along the California coast. As Pacific waters got warmer, these creatures moved farther south, to seemingly warmer waters.

Experts struggled to explain this behavior. Some suggested that the animals were moving toward food sources or that some species had delayed responses to climate shifts, said Malin Pinsky, a marine ecologist at Rutgers University in New Jersey.

So Pinsky and his colleagues set out to determine which model best predicted the movements of marine species. They first analyzed surveys of trawler hauls from North American waters dating to 1968, which included 360 species of fish and marine invertebrates. This told them how many and what kinds of animals were in certain places, and how that changed over time. Then they ran models that earlier studies had proposed to see which one best fit the survey data.

The model that came out on top was climate velocity, the name for the idea that animals move toward their preferred water temperatures. More than 70 percent of the species migrated in the same direction the model had predicted.

Climate velocity can be thought of as which way and how fast different temperatures “move,” Pinksy said. Mapped out, climate velocities look much like the temperature contours on a weather map.

The new findings indicate that marine species tend to “follow” these climate velocities. For example, the preferred water temperatures of many species on the California coast — which has cooled in recent years — have “moved” south. Sure enough, the coastal species have followed.

“You have to figure out what individual fish and other species are experiencing” to explain how they move, Pinsky said, “so we looked at climate change in a more detailed way and a finer scale than other people have.”

Paying more attention to climate velocity could help ecologists understand how species might respond to future climate change. It could also help ensure that marine areas designated for protection include regions where species aren’t currently found but may appear in the future, Pinsky said.

The climate velocity model probably applies only to cold-blooded marine animals, said Daniel Pauly, a fisheries scientist at the University of British Columbia who wasn’t involved in the study. Warm-blooded marine mammals “are a different story,” he said. Since they can withstand bigger fluctuations in water temperature, they don’t need to relocate.