source: LMDZ5/trunk/libf/phylmd/ran0_vec.F90 @ 2850

Last change on this file since 2850 was 1992, checked in by lguez, 11 years ago

Converted to free source form files in libf/phylmd which were still in
fixed source form. The conversion was done using the polish mode of
the NAG Fortran Compiler.

In addition to converting to free source form, the processing of the
files also:

-- indented the code (including comments);

-- set Fortran keywords to uppercase, and set all other identifiers
to lower case;

-- added qualifiers to end statements (for example "end subroutine
conflx", instead of "end");

-- changed the terminating statements of all DO loops so that each
loop ends with an ENDDO statement (instead of a labeled continue).

-- replaced #include by include.

  • 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: 675 bytes
Line 
1
2! $Header$
3
4SUBROUTINE ran0_vec(npoints, idum, ran0)
5
6  ! $Id: ran0_vec.F90 1992 2014-03-05 13:19:12Z jyg $
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  ! endif
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
33END SUBROUTINE ran0_vec
34
Note: See TracBrowser for help on using the repository browser.