A quantitative criterion to predict the occurrence of tidal bores