MIAMI (AP) — Ten years ago, when scientists in South Florida began a massive rescue effort to rebuild the nation’s only inshore reef, replanting nursery-grown staghorn coral with a gardening technique perfected in the Pacific seemed like an easy solution.

“You can go to Home Depot to get everything you need,” said University of Miami marine biologist Diego Lirman. “And you don’t need to pay for this. People pay us to come out.”

From Key West to Fort Lauderdale, volunteers and scientists planted thousands of staghorns in reef rescues. More than 90 percent of Lirman’s corals survived — about 10 percent more than expected — signaling a rousing success. The work helped shift reef restoration from uglier, more costly engineered artificial reefs created with scuttled ships, which are also more susceptible to invasive species and vulnerable to sea rise. Labs expanded to meet the growing demand, added more kinds and perfected techniques.

Then came back-to-back bleaching events that started in 2014. In 2015, more than half of Lirman’s transplanted staghorns died. Suddenly, the reef gardeners were faced with a daunting new obstacle: climate change.

With ocean temperatures rising in the last century, and consistently higher than ever before over the last three decades, scientists realized replanting nursery-grown versions of wild coral would not be enough. They would need to weed out the weak coral, find a way to make the garden-grown variety more resilient to both temperature and rising acidity linked to more carbon in the atmosphere, and work faster. Much faster.

Welcome to Rescue a Reef 2.0.

What started as a citizen science project to rebuild the reef is now an all-hands-on-deck dash to not only replant but develop a crop of tough new coral with cutting-edge science.

In April, the National Oceanic and Atmospheric Administration signed off on a two-year project with UM to rebuild the reef, and one of South Florida’s economic engines, with 10,000 corals grown in Lirman’s lab. Mote Marine Laboratory opened a new 19,000-square-foot, $7 million lab on Summerland Key. And in August, Andrew Baker, another UM coral expert working with Lirman, will begin replicating a hardening method developed in his lab. Baker was also selected as the new Frost science museum’s first inventor-in-residence and will display the ongoing efforts in a new public lab at the downtown museum.

“We’ve done it in the lab,” Baker said. “Now we need to see if we can do it in the real world and scale it up.”

Scale was in fact one of the dilemmas that led to the early advances in coral gardening. When he started working with the Nature Conservancy ten years ago, Lirman’s goal was to save the staghorn coral thickets that in just 30 years had largely disappeared. Pollution, boat traffic and over-fishing had wiped out many that grew along the coast. Hardly any elkhorn corals, another once-common variety, were left. Both, which are federally listed as endangered, are branching coral that provide habitat for wildlife and helped build more reef volume. In low-lying South Florida and across the Caribbean, that can be critically important.

Reefs not only help break-up fierce hurricane waves but, more importantly, subdue everyday waves that erode beaches, which has cost taxpayers millions in South Florida. Last year, the U.S. Army Corps of Engineers spent $11.9 million just to shore up beaches in Miami-Dade County. It spent $7.1 million in Broward in 2013.

But Lirman needed to find a way to grow enough staghorns without poaching too much from the little that was left. So he collected 30 samples, enough for diversity. As disease and bleaching occurred, he was able to look more closely at the genotypes that fared better and focus on those.

“My nursery is now replanting close to 5,000 corals each year on 15 to 20 sites in Miami-Dade,” he said, which amounts to “ecologically relevant scales.”

So many divers wanted to participate that the project drew a months-long waiting list. Based on UM’s popular shark outreach, the effort for the last two years has taken volunteer divers on rescue missions that start at one of four offshore nurseries. Last month, a team of 10 divers led by research associate Dalton Hesley braved pouring rain to visit a sandy patch of ocean floor off Key Biscayne where PVC pipes are screwed together like plastic Christmas trees, with the branches dangling like ornaments.

After cleaning barnacles and algae from the pipes and clipping branches, the team headed to a nearby reef to replant the corals by zip-tying them to nails hammered into the reef. The pruned corals also regrow faster, Hesley said, not unlike a rose bush.

Lyanne Abreu, an environmental sciences teacher at TERRA, a Miami-Dade science magnet high school, had been trying to get on a dive for a year. Enrique Mercado, a financial adviser, waited five months for two openings so he could take his son.

“I’ve seen what we’ve done over 30 years. The kind of world we have now is nowhere near what I grew up with,” he said. “I have to go to untouched areas now to show him what I used to see right off my beach.”

While the dives gained popularity, Lirman knows the effort is just a Band-Aid. Since the early 1900s, the surface of the ocean, where most sea life lives, has risen on average 0.13 F each decade, according to the Environmental Protection Agency. Over the next century, ocean temperatures are expected to rise 3.6 F, which could mean big trouble for coral.

Tiny coral shelter algae in their anemone-like tentacles. The algae in return provide food. But when temperatures get too hot or too cold, coral spit out the algae and can die. A 2005 bleaching, the worst on record in the Atlantic basin, wiped out half the U.S. coral reefs in the Caribbean. In 2010, a South Florida cold snap killed up to 39 percent of inshore coral, Lirman reported. If his coral are to survive, they need to be a lot more resilient.

Enter Baker, Lirman’s colleague and an expert on how corals handle climate changes.

For years, scientists in labs have been looking at the relationship between coral and algae to try to get at what makes the coral eject the algae. Baker always believed the coral were capable of an “adaptive strategy.”

So he began intentionally stressing the coral — exposing them to heat and light — in his lab. Those that recover are more hardened to future stresses.

“We hit the corals with a kind of sweet spot, a Goldilocks zone where it expels some of its algae but not enough that it dies,” he said.

In August, he’ll take 1,600 of the corals covered under the NOAA project and float them on rafts near the surface at Lirman’s four offshore coral nurseries to replicate the stressing performed in his lab. The field trial is intended to use sunlight, rather than temperature, to stress and harden the corals against bleaching. He’ll then transplant them on the reef alongside Lirman’s. He is stressing boulder corals as well as the staghorns to diversify the reef. Coupled with Lirman’s work to pinpoint more genetically tolerant corals, they are hoping to repopulate pockets of the reef.

“One of the early points of criticism for reef restoration is you’re growing corals and then putting them back in the same environments where they declined in the first place, and that is true. But we can’t just wait,” Lirman said.

If his field trial works, Baker said it’s possible to replicate the hardening elsewhere in the world, like the Great Barrier Reef, where an ongoing bleaching has ravaged an area larger than Italy and covering two-thirds of the reef.

They’re also focusing on two spots off Key Biscayne and Miami Beach, where billions in property are vulnerable to sea rise, to see what impact the work has. Previous studies have shown that about 3 square feet of strategically placed reef can absorb 95 percent of a wave’s energy, Lirman said.

“We’re basically buying time for these larger issues to be resolved,” he said. “We need to be doing something, and active restoration is what we do.”