各种拼写错误吧。
IOUTFILE1 写成了 IOUTFIEL1 之类的。
建议你用 Implicit None
[Fortran] 纯文本查看 复制代码 PROGRAM TEST
Implicit None
integer :: IOUTFILE , IOUTFILE1
!IN THE MAIN BODY
IOUTFILE=100
IOUTFILE1=101
OPEN(IOUTFILE,File='file1.txt')
OPEN(IOUTFILE1,File='file2.txt')
CALL PRNT(IOUTFILE,IOUTFILE1)
! THE MAIN BODY IGNORED FOR THIS MOMENT……
STOP
END PROGRAM
SUBROUTINE PRNT(IOUTFILE,IOUTFILE1)
Implicit None
integer :: IOUTFILE , IOUTFILE1
Integer :: n , i
n = 3
DO I=1,N
WRITE(IOUTFILE,*) 's'
ENDDO
!THE PREVIOUS PART WORK NORMALLY
WRITE(IOUTFILE1,*) 'vs'!SOME FACTOR !THE ERROR
!THIS 'WRITE' DOESN'T WORK, WHY?
RETURN
END
!AND THE FUNNY THING IS, IF THE PROGRAM WORK PERFECTLY, THE "WRITE" COULD BE EXCUTED.. |