- #1
Saxby
- 45
- 0
Hello, I've been playing around with some code (as shown below) and for some reason everytime i run this code I am told:
At line 11 of file tester.f90
Fortran runtime error: End of file
I'm not really sure what's causing it, is it the position of my Open file?
Any help would be much aprrieiated :)
PROGRAM tester
!Turn off implicit typing
IMPLICIT NONE
INTEGER :: a, b
OPEN(10,FILE='tester.out')
WRITE(10,*) 'Please give value for a'
READ(10,*) a
IF (a < 0) THEN
WRITE(10,*) 'Wrong number'
STOP
END IF
WRITE(10,*) 'Please give value for b'
READ(10,*) b
IF (b > 0) THEN
WRITE(10,*) 'Wrong number'
STOP
END IF
WRITE(10,*) a * b
CLOSE(10)
END PROGRAM tester
At line 11 of file tester.f90
Fortran runtime error: End of file
I'm not really sure what's causing it, is it the position of my Open file?
Any help would be much aprrieiated :)
PROGRAM tester
!Turn off implicit typing
IMPLICIT NONE
INTEGER :: a, b
OPEN(10,FILE='tester.out')
WRITE(10,*) 'Please give value for a'
READ(10,*) a
IF (a < 0) THEN
WRITE(10,*) 'Wrong number'
STOP
END IF
WRITE(10,*) 'Please give value for b'
READ(10,*) b
IF (b > 0) THEN
WRITE(10,*) 'Wrong number'
STOP
END IF
WRITE(10,*) a * b
CLOSE(10)
END PROGRAM tester