lecture9 - Random walk declarations ! Program to perform a...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Random walk declarations ! Program to perform a random walk in two dimensions ! repeats for many realizations and accumulates r**2 statistics IMPLICIT NONE INTEGER, PARAMETER :: Prec14=SELECTED_REAL_KIND(14) INTEGER :: i,j,is,ne,nt REAL(KIND=Prec14) :: rnd,rnds,r2,t INTEGER, PARAMETER :: ntmax=100 ! maximum number of time steps INTEGER, PARAMETER :: nemax=100000 ! number of walks in ensemble REAL(KIND=Prec14), DIMENSION(ntmax) :: r2a ! accumulated average of
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
! initialize random number generator call RANDOM_SEED Random number generator call RANDOM_NUMBER(rnd) call RANDOM_NUMBER(rnds) One random number (rnds) can be used to decide on +/- Step Other random number (rnd) can be used to decide whether we move walker in x or y direction
Background image of page 2
do ne=1,nemax ! nemax realizations of random walk do nt=1,ntmax 60 r2=real(i)**2+real(j)**2 r2a(nt)=r2a(nt)+r2/nemax enddo enddo
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
log <r 2 > log N Random walk results r 2 ~N • r 2 ~ N as expected
Background image of page 4
Declarations, Monte Carlo 2-D Ising model IMPLICIT NONE INTEGER, PARAMETER :: Prec14=SELECTED_REAL_KIND(14)
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 16

lecture9 - Random walk declarations ! Program to perform a...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online