conflicts between fortran and c in reset_distance