source: LMDZ.3.3/trunk/libf/phylmd/ran0_vec.F @ 580

Last change on this file since 580 was 465, checked in by lmdzadmin, 21 years ago

Initial insert
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 465 2003-08-06 14:45:44Z fairhead $
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.