I had already produce an open file with data in the main program, but
I want to use the data in the file in the subroutine. However,it seems
didn't use when I call it. I don't know what's wrong,please help me!
Thank you very much!
subroutine get_trio
.......
open(111, file="surf_111_3.dat")
open(112, file="random.dat")
do i=1,200
read (111,*) k, posx(i),
posy(i)
end do
read(111,*) a
do i =1, 25
write (112,"(25( i3,f6.1,f6.1))") a(i), posx(a(i)), posy(a(i))
end do
.......
do i = 1, n
do j = i + 1, n
rxij = posx(a(i)) - posx(a(j))
if (abs(rxij) .gt. l/2) then
rxij = l - abs(rxij)
end if
ryij = posy(a(i)) - posy(a(j))
if (abs(ryij) .gt. l/2) then
ryij = l - abs(ryij)
end if
disij = sqrt(rxij**2 + ryij**2)
.......
It said that a scalar-valued expression is required in this context.


|