The loop ends here
subroutine end_loop() !! The loop ends here implicit none integer(kind=I4) :: i_ligne if ( I_ITER < NB_ITER ) then rewind(JOB) ! the maximum number of loops is not reached, ! go to the begining of the script else I_ITER = NB_ITER ! the maximum number of loops is reached return endif ! return to the beginning of the loop LINE_READ = SAVE_LINE_READ do i_ligne = 1, SAVE_LINE_READ read(JOB,*) enddo I_ITER = I_ITER + 1 return endsubroutine end_loop