source: PSPA/parmelaPSPA/trunk/lodgau.f @ 488

Last change on this file since 488 was 12, checked in by lemeur, 12 years ago

parmela pspa initial

File size: 1.1 KB
Line 
1      subroutine lodgau(nbase,n,x,y,f,d,j)
2c-----------------------------------------------------------------------
3c     
4c     load a gaussian distribution using the hammersley's sequence.
5c     (nbase=0 ==> random sampling !)
6c     
7c-----------------------------------------------------------------------
8      dimension       x(*), y(*), f(*), d(*), j(*)
9      data            xbig/5./
10c-----------------------------------------------------------------------
11c     
12c     cumulative distribution of gaussian
13c     
14      delx = 2.*xbig/(n-1)
15      xk = -xbig-0.5*delx
16      x(1) = 0.0
17      do 10 i=2,n
18         xk = xk+delx
19         x(i) = x(i-1) + exp(-0.5*xk*xk)
20 10   continue
21      zcons = 1./x(n)
22      call sscal(n,zcons,x,1)
23c     
24c     uniform sampling
25c     
26      call loduni(nbase,n,y)
27c     
28c     inverse linear interpolation
29c     
30      call srchfd(n,y,n,x,j,d,f)
31      do 200 i=1,n
32         x1 = -xbig+j(i)*delx
33         x0 = x1-delx
34 200  x(i) = x0*(1.-f(i)) + x1*f(i)
35c     
36      return
37      end
38c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
Note: See TracBrowser for help on using the repository browser.