fix loop start value and condition to avoid compile error for OpenMP