Last change
on this file since 2168 was
466,
checked in by (none), 21 years ago
|
This commit was manufactured by cvs2svn to create branch 'rel-LF'.
|
-
Property svn:eol-style set to
native
-
Property svn:executable set to
*
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
712 bytes
|
Line | |
---|
1 | subroutine ran0_vec(npoints,idum,ran0) |
---|
2 | |
---|
3 | ! $Id: ran0_vec.F 466 2003-08-06 14:50:49Z lguez $ |
---|
4 | ! Platform independent random number generator from |
---|
5 | ! Numerical Recipies |
---|
6 | ! Mark Webb July 1999 |
---|
7 | |
---|
8 | implicit none |
---|
9 | |
---|
10 | integer j,npoints,idum(npoints),IA,IM,IQ,IR,k(npoints) |
---|
11 | real ran0(npoints),AM |
---|
12 | |
---|
13 | parameter (IA=16807, IM=2147483647, AM=1.0/IM, IQ=127773, IR=2836) |
---|
14 | |
---|
15 | c do j=1,npoints |
---|
16 | c if (idum(j).eq.0) then |
---|
17 | c write(6,*) 'idum=',idum |
---|
18 | c write(6,*) 'ZERO seed not allowed' |
---|
19 | c stop |
---|
20 | c endif |
---|
21 | c enddo |
---|
22 | |
---|
23 | do j=1,npoints |
---|
24 | k(j)=idum(j)/IQ |
---|
25 | idum(j)=IA*(idum(j)-k(j)*IQ)-IR*k(j) |
---|
26 | if (idum(j).lt.0) idum(j)=idum(j)+IM |
---|
27 | ran0(j)=AM*idum(j) |
---|
28 | enddo |
---|
29 | |
---|
30 | end |
---|
31 | |
---|
Note: See
TracBrowser
for help on using the repository browser.