Well I am trying to read a file and make it rank3 array.
forrtl: severe (24): end-of-file during read, unit 5, file /home/milenko/ircg/test_res1.dat
program praviar
implicit none
integer*4 k,n,m
integer,dimension(3) ::s
real,dimension(57,57,57) :: x
open(5,file='test_res1.dat',status='old')
do m=1,57
read(5,100)((x(k,n,m),n=1,57),k=1,57)
100 format(i7,f6.2,i5)
end do
close(5)
s=shape(x)
write(*,*)s
end
Input file:
2 1.00 0
3 1.80 0
4 63.69 0
5 472.97 0
6 801.43 0
7 3.71 0
8 35.07 0
9 15.63 0
10 6.15 0
11 170.03 0
12 1.96 1
13 47.99 0
14 55.85 1
15 268.35 0
16 59.79 1
17 34.29 0
18 426.48 0
19 966.75 1
20 150.88 0
21 794.58 1
22 7.79 0
23 18.97 0
24 499.75 1
25 90.99 0
26 506.33 1
27 766.85 1
28 3.27 1
29 374.94 0
30 525.45 0
31 7.62 0
32 643.81 1
33 17.54 0
34 8.27 1
35 35.05 0
36 15.36 0
37 234.07 0
38 116.79 0
39 42.94 0
40 59.87 0
41 1.93 1
42 67.37 0
43 19.81 0
44 62.90 0
45 342.80 1
46 30.00 0
47 208.50 1
48 1.70 1
49 3.76 1
50 4.88 1
51 219.32 1
52 1.88 1
53 3.50 0
54 70.81 0
55 54.88 1
56 165.17 0
57 8.76 0
58 21.45 1
forrtl: severe (24): end-of-file during read, unit 5, file /home/milenko/ircg/test_res1.dat
program praviar
implicit none
integer*4 k,n,m
integer,dimension(3) ::s
real,dimension(57,57,57) :: x
open(5,file='test_res1.dat',status='old')
do m=1,57
read(5,100)((x(k,n,m),n=1,57),k=1,57)
100 format(i7,f6.2,i5)
end do
close(5)
s=shape(x)
write(*,*)s
end
Input file:
2 1.00 0
3 1.80 0
4 63.69 0
5 472.97 0
6 801.43 0
7 3.71 0
8 35.07 0
9 15.63 0
10 6.15 0
11 170.03 0
12 1.96 1
13 47.99 0
14 55.85 1
15 268.35 0
16 59.79 1
17 34.29 0
18 426.48 0
19 966.75 1
20 150.88 0
21 794.58 1
22 7.79 0
23 18.97 0
24 499.75 1
25 90.99 0
26 506.33 1
27 766.85 1
28 3.27 1
29 374.94 0
30 525.45 0
31 7.62 0
32 643.81 1
33 17.54 0
34 8.27 1
35 35.05 0
36 15.36 0
37 234.07 0
38 116.79 0
39 42.94 0
40 59.87 0
41 1.93 1
42 67.37 0
43 19.81 0
44 62.90 0
45 342.80 1
46 30.00 0
47 208.50 1
48 1.70 1
49 3.76 1
50 4.88 1
51 219.32 1
52 1.88 1
53 3.50 0
54 70.81 0
55 54.88 1
56 165.17 0
57 8.76 0
58 21.45 1