source: LMDZ.3.3/branches/rel-LF/libf/phylmd/ran0_vec.F @ 535

Last change on this file since 535 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 lmdzadmin $
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     
15c     do j=1,npoints
16c       if (idum(j).eq.0) then
17c         write(6,*) 'idum=',idum
18c  write(6,*) 'ZERO seed not allowed'
19c  stop
20c       endif
21c     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.