Search This Blog

Friday, June 29, 2007

Generation of Files with Sequential Names

CHARACTER (40) :: Fname='Move',str
INTEGER :: i,imax=1000000
INTEGER :: r,s

DO i = 1,10

WRITE(str,'(F7.6)') REAL(i)/REAL(imax)
r=scan(str,".")
s=len(str)
str=str(r+1:s)

WRITE(str,*) TRIM(Fname)//TRIM(str)//".dat"

OPEN(unit=imax+1,file=str)
WRITE(imax+1,*) TRIM(str)
CLOSE(unit=imax+1)

END DO

STOP
END

No comments:

Labels

Bacteria

Loading...