Last change
on this file since 5218 was
5117,
checked in by abarral, 5 months ago
|
rename modules properly lmdz_*
move some unused files to obsolete/
(lint) uppercase fortran keywords
|
-
Property copyright set to
Name of program: LMDZ Creation date: 1984 Version: LMDZ5 License: CeCILL version 2 Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539 See the license file in the root directory
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
676 bytes
|
Line | |
---|
1 | |
---|
2 | ! $Header$ |
---|
3 | |
---|
4 | SUBROUTINE ran0_vec(npoints, idum, ran0) |
---|
5 | |
---|
6 | ! $Id: ran0_vec.F90 5117 2024-07-24 14:23:34Z abarral $ |
---|
7 | ! Platform independent random number generator from |
---|
8 | ! Numerical Recipies |
---|
9 | ! Mark Webb July 1999 |
---|
10 | |
---|
11 | IMPLICIT NONE |
---|
12 | |
---|
13 | INTEGER j, npoints, idum(npoints), ia, im, iq, ir, k(npoints) |
---|
14 | REAL ran0(npoints), am |
---|
15 | |
---|
16 | PARAMETER (ia=16807, im=2147483647, am=1.0/im, iq=127773, ir=2836) |
---|
17 | |
---|
18 | ! do j=1,npoints |
---|
19 | ! if (idum(j).EQ.0) THEN |
---|
20 | ! WRITE(6,*) 'idum=',idum |
---|
21 | ! WRITE(6,*) 'ZERO seed not allowed' |
---|
22 | ! stop |
---|
23 | ! END IF |
---|
24 | ! enddo |
---|
25 | |
---|
26 | DO j = 1, npoints |
---|
27 | k(j) = idum(j)/iq |
---|
28 | idum(j) = ia*(idum(j)-k(j)*iq) - ir*k(j) |
---|
29 | IF (idum(j)<0) idum(j) = idum(j) + im |
---|
30 | ran0(j) = am*idum(j) |
---|
31 | END DO |
---|
32 | |
---|
33 | END SUBROUTINE ran0_vec |
---|
34 | |
---|
Note: See
TracBrowser
for help on using the repository browser.