I have hundreds of files with file name fort.1, fort.2, fort.3 and so on until fort.5000. What I want is to open each file and operate that file and close. Then go on with next file. I want to do this in Fortran 90.
I have browsed but could not get what I want. I saw one thread for opening but it doesn't help me much.
I tried writing `
program openFile
IMPLICIT none
INTEGER(I-N), REAL*8(A-H,O-Z)
real,dimension(2000) :: angle
CHARACTER(len=10) FN
integer::I, k
integer,parameter :: N=102
DO I=101,N
!WRITE(FN,10) I
!WRITE(6,*) FN
OPEN(1,FILE=FN)
do k=1,200
read(1,'(F8.3)') angle(k)
print*,
end do
CLOSE(1)
enddo
10 FORMAT(5Hfort.I3)
STOP
END
` But seems it doesn't work. Is that possible me getting some help? Thanks in advance.