r=function(a,b,c);
open (11,file='r.txt',status='replace',action='write')
if (r==0) then
write(11,*) r;
else
write(11,*) 1;
end if]
li913 发表于 2017-3-7 14:37
求解失败,能正常返回吗?看起来可能是求解失败就崩掉了。
试试在前面加一句
r=-1
PROGRAM iostat
IMPLICIT NONE
INTEGER :: stat, i(50)
OPEN(88, FILE='test.dat', FORM='UNFORMATTED')
READ(88, IOSTAT=stat) i
IF(IS_IOSTAT_EOR(stat)) STOP 'END OF RECORD'
END PROGRAM
pasuka 发表于 2017-3-7 15:13
判断文件是否为空呗
http://www.lahey.com/docs/lfpro77help/gfortran/IS_005fIOSTAT_005fEOR.html#IS_005f ...
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |