私が改善しているプログラムでは、Fortranが既存のファイルを検出しないことに気付きました。これは修正されていない論理エラーにつながった。あなたが問題やエラーを指摘し、私にあなたの訂正を与えることができれば非常に感謝します。ファイルが存在しないことを検出できません。
open(unit=nhist,file=history,iostat=ierr)!This setting cannot exit program if file does not exist because ierr is always 0
if (ierr /=0) then
write(*,*)'!!! error#',ierr,'- Dump file not found'
stop
endif
!I used below statement, the program exits even though a file is existing
open(unit=nhist,file=history,err=700)
700 ierr=-1
if (ierr /=0) then
write(*,*)'!!! error#',ierr,'- Dump file not found'
stop
endif
Francescalus様、ありがとうございました!はい。これは、 'status = old'を追加すると動作します。 – Leon