Adding the boundscheck=True kwarg to the @jit calls also causes Numba to report the issue:
$ python repro.py
compiled
debug: IndexError: index 0 is out of bounds for axis 0 with size 0
Traceback (most recent call last):
File "/home/gmarkall/numbadev/issues/discourse-1563/repro.py", line 347, in <module>
pos,vel,ang=iterate(pos,vel,ang,Nrun=10000); ##this fails
IndexError: index is out of bounds
So, it looks like your np.where() call to calculate part_neigh in calc_force() sometimes returns an array of size 0, which the following code assumes is not of size 0.