I am new toFortran andworking with an application thatreads input files using a large number of read statements with the following form:
READ (5,*)input1, input2, ... , inputN
The problem is that if there is an error in the input files, I get a Fortranrun-time error that opens a message window. I would like to suppressthe message windowand exit the application with an error code in the case of input file errors. Because of the size of the code, I would like to avoid having toadd "ERR=" to every read statement.
I tired using the SETERRORMODEQQ(.FALSE.) function fromthe IFPORT library, but it does notprevent themessage window from opening. Is there a way to suppress error windows from the run-time without modifying the read statements?
链接已复制
2 回复数
I'd prefer inserting IOSTAT= or ERR= statements, but you can try your luck with calling
lret = SETENVQQ("FOR_DISABLE_DIAGNOSTIC_DISPLAY=TRUE")
somewhere at the start. If it fails, try setting that environment variable on the system level.
lret = SETENVQQ("FOR_DISABLE_DIAGNOSTIC_DISPLAY=TRUE")
somewhere at the start. If it fails, try setting that environment variable on the system level.