subroutine trunc_shift() implicit none integer :: run do run = 1, inum_runs ! remember that shiftLimit is the absolute value, but we are only ! interested in shifts that are too small if (DiagSft(run) < -1.0_dp * shiftLimit) then numCycShiftExcess(run) = numCycShiftExcess(run) + 1 if (numCycShiftExcess(run) > 20) DiagSft(run) = -0.95_dp * shiftLimit else numCycShiftExcess(run) = 0 end if end do end subroutine trunc_shift