- #1
Marco87
- 2
- 0
Hi,
I am a new Fortran User.
I have a problem when I run my code (not errors during building), in fact the code is stopped in the last line and this message appears "Error 112, Reference to undefined variable, array elements or function result"
...
write(number,100)k1
open (unit=12, file='diff//number//'.txt', status='old', POSITION='APPEND', iostat=ISTATUS, action='read',form='formatted')
READ (12,*, iostat=ISTATUS) i1r, i2r, i3r, sr, kr
close(12)
write(*,*) i1r
...
I checked the iostat value and it is 0 in open and -1 in read.
" 5 10 1 1.00000 1" (This is the first line of my txt file)
Where is the problem?
I am a new Fortran User.
I have a problem when I run my code (not errors during building), in fact the code is stopped in the last line and this message appears "Error 112, Reference to undefined variable, array elements or function result"
...
write(number,100)k1
open (unit=12, file='diff//number//'.txt', status='old', POSITION='APPEND', iostat=ISTATUS, action='read',form='formatted')
READ (12,*, iostat=ISTATUS) i1r, i2r, i3r, sr, kr
close(12)
write(*,*) i1r
...
I checked the iostat value and it is 0 in open and -1 in read.
" 5 10 1 1.00000 1" (This is the first line of my txt file)
Where is the problem?