Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INTEGER, PARAMETER :: n = 5
- REAL :: temp, mean = 0.0, sd = 0.5
- REAL,save :: array(n)
- if(g_time==0.0) then ! To run it only once
- CALL RANDOM_NUMBER(array) ! Uniform distribution
- ! Now convert to normal distribution
- DO i = 1, n-1, 2
- temp = sd * SQRT(-2.0*LOG(array(i))) * COS(2*PI*array(i+1)) + mean
- array(i+1) = sd * SQRT(-2.0*LOG(array(i))) * SIN(2*PI*array(i+1)) + mean
- array(i) = temp
- END DO
- endif
- do i=1, 5
- prof_temp = dexp( -( (x1 - i+n/2 -0.5*array(i))**2 /wx2 ) )
- profile=profile+prof_temp
- prof_temp=0.0
- end do
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement