Fortran-stop
提供:Dev Guides
Fortran-停止ステートメント
プログラムの実行を停止したい場合は、stopステートメントを挿入できます。
例
program stop_example
implicit none
integer :: i
do i = 1, 20
if (i == 5) then
stop
end if
print*, i
end do
end program stop_example
上記のコードをコンパイルして実行すると、次の結果が生成されます-
1
2
3
4