fixed the omp barrier location to be outside the time loop