Line | |
---|
1 | subroutine lodgau(nbase,n,x,y,f,d,j) |
---|
2 | c----------------------------------------------------------------------- |
---|
3 | c |
---|
4 | c load a gaussian distribution using the hammersley's sequence. |
---|
5 | c (nbase=0 ==> random sampling !) |
---|
6 | c |
---|
7 | c----------------------------------------------------------------------- |
---|
8 | dimension x(*), y(*), f(*), d(*), j(*) |
---|
9 | data xbig/5./ |
---|
10 | c----------------------------------------------------------------------- |
---|
11 | c |
---|
12 | c cumulative distribution of gaussian |
---|
13 | c |
---|
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) |
---|
23 | c |
---|
24 | c uniform sampling |
---|
25 | c |
---|
26 | call loduni(nbase,n,y) |
---|
27 | c |
---|
28 | c inverse linear interpolation |
---|
29 | c |
---|
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) |
---|
35 | c |
---|
36 | return |
---|
37 | end |
---|
38 | c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++* |
---|
Note: See
TracBrowser
for help on using the repository browser.