subroutine Box_Muller_seed (icount) integer :: icount,k integer,parameter :: iseed=33 !! integer :: DATE_TIME(8) !! character(len=10):: b1,b2,b3 real,dimension(:),allocatable :: x integer, dimension(:), allocatable :: seed CLOSE(iseed) OPEN(iseed,FILE='seedfile',FORM='FORMATTED',IOSTAT=IER) IF(IER.NE.0)WRITE(*,*) iseed,' OPEN UNIT ERROR IER=',IER read(iseed,*) itime !-------------------------------------------------- !! call DATE_AND_TIME (b1,b2,b3,DATE_TIME) !! itime=DATE_TIME(8)+1 !-------------------------------------------------- !------------------------------------------- CLOSE(331) OPEN(331,file='put_seed',status='unknown',form='formatted') read(331,*) k allocate(seed(1:k)) read(331,*) seed(1:k) close(331,status='keep') ! write(*,*) k ! write(*,*) seed(1:k) call random_seed(put=seed(1:k)) !------------------------------------------- allocate(x(1:itime)) call random_number(x(1:itime)) ! write(*,*) "=====random seed=======" ! do i=1,itime ! write(*,*) i,x(i) ! end do ! write(*,*) "=======================" deallocate(x) if(icount.gt.1000) then itime=itime+icount/1000 else itime=itime+icount endif rewind iseed write(iseed,*) itime CLOSE(iseed,status='keep') end subroutine Box_Muller_seed