Below is my code, ef.txt is the file with my data. I do not know why the code below can only generate the files before the ef part. So if I run the code below, there is no error message but only mu.txt and mu2.txt appear in the folder. mu1 cannot be found in the folder...why..I really cannot figure out.
----------------------------------
PROGRAM Source1
implicit none
integer :: i
real*8, dimension(3) :: eta
open(21,file='mu.txt',form='formatted')
do i = 1,3
write(21,187) i, i+1
187 format(i5,i5)
end do
close(21)
open(24,file='mu2.txt',form='formatted')
do i = 1,3
write(24,13) i, i+1
13 format(i5,i5)
end do
close(24)
open(2,file='ef.txt',form='formatted')
do i = 1,3
read(2,8) eta(i)
8 format(f18.10)
end do
close(2)
open(23,file='mu1.txt',form='formatted')
do i = 1,3
write(23,12) i, i-1
12 format(i5,i2)
end do
close(23)
end program Source1
----------------------------------
PROGRAM Source1
implicit none
integer :: i
real*8, dimension(3) :: eta
open(21,file='mu.txt',form='formatted')
do i = 1,3
write(21,187) i, i+1
187 format(i5,i5)
end do
close(21)
open(24,file='mu2.txt',form='formatted')
do i = 1,3
write(24,13) i, i+1
13 format(i5,i5)
end do
close(24)
open(2,file='ef.txt',form='formatted')
do i = 1,3
read(2,8) eta(i)
8 format(f18.10)
end do
close(2)
open(23,file='mu1.txt',form='formatted')
do i = 1,3
write(23,12) i, i-1
12 format(i5,i2)
end do
close(23)
end program Source1