Predicting the survival of coral reefs