Advertisement
Guest User

Untitled

a guest
Dec 30th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     INTEGER, PARAMETER :: n = 5
  2.  
  3.     REAL :: temp, mean = 0.0, sd = 0.5
  4.     REAL,save :: array(n)
  5.  
  6. if(g_time==0.0) then ! To run it only once
  7.  
  8. CALL RANDOM_NUMBER(array) ! Uniform distribution
  9.  
  10. ! Now convert to normal distribution
  11.  
  12. DO i = 1, n-1, 2
  13.  
  14. temp = sd * SQRT(-2.0*LOG(array(i))) * COS(2*PI*array(i+1)) + mean
  15.  
  16. array(i+1) = sd * SQRT(-2.0*LOG(array(i))) * SIN(2*PI*array(i+1)) + mean
  17.  
  18. array(i) = temp
  19.  
  20. END DO
  21.  
  22. endif
  23.  
  24. do i=1, 5
  25.  
  26. prof_temp  =  dexp( -( (x1 - i+n/2 -0.5*array(i))**2 /wx2 ) )
  27.  
  28. profile=profile+prof_temp
  29.  
  30. prof_temp=0.0
  31.  
  32. end do
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement