source: PSPA/parmelaPSPA/trunk/loduni.f @ 409

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

parmela pspa initial

File size: 1.0 KB
Line 
1      subroutine loduni(nbase,n,y)
2C-----------------------------------------------------------------------
3C     Quiet start
4C     Load an uniform distribution using the Hammersley's sequence.
5C     (NBASE=0 ==> Random sampling !)
6C-----------------------------------------------------------------------     
7      dimension       y(*)
8C     
9C     
10C----Random and Quasi-Random Loading
11C     
12      if(nbase.eq.0)  then
13c     
14c     Random
15         do 100 i=1,n
16 100     y(i)=ranf()
17c     
18c     First element of Hammersley's sequence
19      else if(nbase.eq.1) then
20         do 110 i=1,n
21 110     y(i) = (i-0.5)/n
22c     
23c     Radical-inverse Function in base NBASE
24      else if(nbase.gt.1)  then
25         do 120 i=1,n
26            xs = 0.
27            xsi = 1.0
28            j2 = i
29 1          xsi = xsi/nbase
30            j1 = j2/nbase
31            xs = xs + (j2-nbase*j1)*xsi
32            j2 = j1
33            if( j2.gt.0 )  goto 1
34 120     y(i) = xs
35      end if
36c     
37      return
38        end
39c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
Note: See TracBrowser for help on using the repository browser.