Corals thrive in the marine protected area of Votua Village in Fiji, one of the three protected areas used in the study.

Young corals and fish in the Pacific Ocean can smell a bad neighborhood. When looking for a place to settle down, these animals use chemical cues to avoid reefs that are littered with seaweed and flock to healthy habitats instead, according to a new study.

Scientists have seen corals decline around the world over the past several decades, and the new findings help explain why some reefs aren't recovering or recruiting new corals, despite conservation efforts.

Fiji's "Coral Coast" might be an ideal lab to look at the difference between bad underwater neighborhoods and good ones. [Photos: Underwater Google Street View Reveals Stunning Corals]

"The reefs in Fiji have such a stark contrast between the healthy areas and the degraded areas," said Danielle Dixson, an assistant professor of biology at the Georgia Institute of Technology in Atlanta, who led the study.

Dixson and colleagues studied the waters off of three villages along the southern side of Fiji's main island, Viti Levu, which each managed a small marine protected area, or MPA, next to another area where fishing was allowed. Each MPA was a little less than a square kilometer in size (about 0.3 square miles) and had someone on patrol to enforce no-fishing laws 24 hours a day, Dixson told Live Science. Life thrives inside the MPAs, but the nonprotected areas often lack the large populations of herbivores, such as parrotfish, which would normally trim the seaweed from corals and keep them healthy, Dixson explained.

"If you're snorkeling on those reefs, it's almost like you can see where the line of protection stops," Dixson said.

Snorkelers and scientists aren't the only ones who are able to notice the difference; fish and corals can sense it, too, even in a lab setting.

Dixson and colleagues collected 15 different species of fish — 20 specimens of each — from both the healthy, protected areas and the degraded, nonprotected areas. The team set up a tank that had one plume of water from the healthy habitat and another plume from the degraded habitat. Given a choice, the fish consistently preferred to swim in streams of water from the healthy habitats, even if they had grown accustomed to swimming in a degraded, seaweed-choked habitat in the wild.

The same was true for coral larvae. Before they settle on a reef and morph into hardened polyps, coral larvae look like free-floating, popcorn-shaped blobs covered in hairlike cilia. They can't see or swim, but they can decipher chemical cues in their surroundings and control when they settle down.

"Settlement selection is one of their most important decisions, and it really dictates whether they'll live or die," Dixson said.

When dropped into the same two-flume tank, coral larvae overwhelmingly chose to swim in the water from healthy areas, the researchers found.

"Seaweed has practically become synonymous with the degradation of coral reefs globally," Bob Steneck, a professor in the School of Marine Sciences at the University of Maine, who was not involved in the study, told Live Science. "This is a very elegant experiment suggesting that the larval coral and the fish are choosing not to be in a harmful environment. It makes perfectly good evolutionary sense."

Dixson and colleagues also showed that coral have very nuanced preferences for the surfaces they choose to call home. In the field, the researchers put raised, square tiles in both the protected and nonprotected habitats. They found that in the nonprotected areas, the corals tended to settle on the artificial tiles, a sign that the animals were avoiding the seaweed-strangled natural reef. But the tiles in the protected areas remained coral free, indicating the corals were joining the rest of the coral colony, the researchers found. [In Photos: Bizarre-Looking Reef Fish]

When sniffing out a potential home, fish and corals can even smell which kinds of corals and seaweed are already living there. The researchers found that the creatures were more attracted to water from degraded habitats if an Acropora coral had been soaked in the tank before the experiment.

Acropora corals are very sensitive to changes in temperature. They're usually the first to get eaten when crown-of-thorns starfish invade a reef, and they're vulnerable to bleaching, a phenomenon in which corals kick out the tiny symbiotic algae that provide them with food. Because of their vulnerability, these corals can only thrive in the healthiest reefs, and the coral larvae and fish seemed to sense that.

"That's a very a surprising result," Steneck said. "I take graduate students down to the Caribbean every year, and most of them can't identify coral species as well as coral larvae can."

The researchers also found that the fish and baby corals were less attracted to water that had been imbued with chemical cues from the common seaweed Sargassum polycystum, which blooms and can take over a reef.

The findings, published in the journal Science today (Aug. 21), suggest conservation efforts that involve removing harmful seaweed from reefs might be most effective at boosting healthy coral populations.

Follow Megan Gannon on Twitter and Google+. Follow us @livescience, Facebook& Google+. Original article on Live Science.