abort if nr of grains is too large