Fish are coping with the adverse effects of climate change by setting their body defenses at night-time levels permanently, according to scientists.

A study published Monday in the journal Nature Climate Change said fish have begun to adapt to the increasing acidification of oceans — linked to global warming — by permanently keeping their guard up, something they usually do during the night when they find the waters least hospitable.

Carbon dioxide produced by burning fossil fuels forms a weak acid when it mixes with water. Fish naturally adjust their body defenses in the night when carbon dioxide levels in sea water are at their peak.

Researchers studied a species of spiny damselfish, or Acanthochromis polyacanthus, found along Australia’s Great Barrier Reef. The spiny damselfish is heavily driven by its circadian rhythm. They found that the fish produced offspring that can change its body clock at will to adapt to the increasing acidification of the oceans.

“It seems the tolerant offspring may have adjusted their circadian clocks as if it was always night,” one of the study’s authors, Timothy Ravasi

from the King Abdullah University of Science and Technology in Saudi Arabia, told Reuters.

Researchers bred and studied the fish in water containing the levels of carbon dioxide predicted for the coming years. They studied changes in the fish’s genes and changes in the protein in their brains.

Co-author Philip Munday from Australia’s James Cook University said the findings were “potentially good news.” He added that researchers needed to focus on figuring out how these beneficial genes are inherited.

Other problems, like rising ocean temperatures which are also linked to global warming, can prevent fish from breeding.