Here is the file to be read, a.tab
:
7.600000e-05
1.580000e-04
1.384140e-01
4.566700e-02
1.530000e-04
1.374210e-01
2.238700e-02
3.871300e-02
1.339930e-01
-2.231400e-02
3.835000e-02
1.313520e-01
-4.551300e-02
2.350000e-04
1.327270e-01
-2.207500e-02
-3.697500e-02
1.261490e-01
My program:
PROGRAM MAIN
implicit none
integer :: j,iostatus
double precision :: test(18)
open(unit = 100, file = 'a.tab', status = 'old', action = 'read',iostat=iostatus)
write(*,*) iostatus
do j = 1,18
read(100,*,end=10) test
end do
10 close(100)
write(*,*)test
end
the output is:
0
0
Why not read the file correctly if the iostat is equal to 0? The same program run on Windows works.