source: LMDZ5/trunk/libf/phylmd/ran0_vec.F @ 1907

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

Added a copyright property to every file of the distribution, except
for the fcm files (which have their own copyright). Use svn propget on
a file to see the copyright. For instance:

$ svn propget copyright libf/phylmd/physiq.F90
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

Also added the files defining the CeCILL version 2 license, in French
and English, at the top of the LMDZ tree.

  • 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: 727 bytes
Line 
1!
2! $Header$
3!
4      subroutine ran0_vec(npoints,idum,ran0)
5
6!     $Id: ran0_vec.F 1907 2013-11-26 13:10:46Z lguez $
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     
18c     do j=1,npoints
19c       if (idum(j).eq.0) then
20c         write(6,*) 'idum=',idum
21c  write(6,*) 'ZERO seed not allowed'
22c  stop
23c       endif
24c     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).lt.0) idum(j)=idum(j)+IM
30        ran0(j)=AM*idum(j)
31      enddo
32
33      end
34     
Note: See TracBrowser for help on using the repository browser.