source: LMDZ5/branches/LMDZ6_rc0/libf/dyn3d_common/ran1.F @ 4085

Last change on this file since 4085 was 1999, checked in by Laurent Fairhead, 11 years ago

Merged trunk changes r1920:1997 into testing branch

  • 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: 891 bytes
Line 
1!
2! $Id: ran1.F 1999 2014-03-20 09:57:19Z fhourdin $
3!
4      FUNCTION RAN1(IDUM)
5      DIMENSION R(97)
6      save r
7      save iff,ix1,ix2,ix3
8      PARAMETER (M1=259200,IA1=7141,IC1=54773,RM1=3.8580247E-6)
9      PARAMETER (M2=134456,IA2=8121,IC2=28411,RM2=7.4373773E-6)
10      PARAMETER (M3=243000,IA3=4561,IC3=51349)
11      DATA IFF /0/
12      IF (IDUM.LT.0.OR.IFF.EQ.0) THEN
13        IFF=1
14        IX1=MOD(IC1-IDUM,M1)
15        IX1=MOD(IA1*IX1+IC1,M1)
16        IX2=MOD(IX1,M2)
17        IX1=MOD(IA1*IX1+IC1,M1)
18        IX3=MOD(IX1,M3)
19        DO 11 J=1,97
20          IX1=MOD(IA1*IX1+IC1,M1)
21          IX2=MOD(IA2*IX2+IC2,M2)
22          R(J)=(REAL(IX1)+REAL(IX2)*RM2)*RM1
2311      CONTINUE
24        IDUM=1
25      ENDIF
26      IX1=MOD(IA1*IX1+IC1,M1)
27      IX2=MOD(IA2*IX2+IC2,M2)
28      IX3=MOD(IA3*IX3+IC3,M3)
29      J=1+(97*IX3)/M3
30      IF(J.GT.97.OR.J.LT.1) stop 1
31      RAN1=R(J)
32      R(J)=(REAL(IX1)+REAL(IX2)*RM2)*RM1
33      RETURN
34      END
Note: See TracBrowser for help on using the repository browser.