Ignore:
Timestamp:
Jul 23, 2024, 7:14:34 PM (3 months ago)
Author:
abarral
Message:

Replace 1DUTILS.h by module lmdz_1dutils.f90
Replace 1DConv.h by module lmdz_old_1dconv.f90 (it's only used by old_* files)
Convert *.F to *.f90
Fix gradsdef.h formatting
Remove unnecessary "RETURN" at the end of functions/subroutines

File:
1 moved

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Amaury_dev/libf/misc/ran1.f90

    r5104 r5105  
    22! $Id$
    33
    4       FUNCTION RAN1(IDUM)
    5       IMPLICIT NONE
    6       REAL RAN1
    7       REAL,SAVE :: R(97)
    8       REAL,PARAMETER :: RM1=3.8580247E-6,RM2=7.4373773E-6
    9       INTEGER,SAVE :: IFF=0
    10       integer,save :: ix1,ix2,ix3
    11       INTEGER,PARAMETER :: M1=259200,IA1=7141,IC1=54773
    12       INTEGER,PARAMETER :: M2=134456,IA2=8121,IC2=28411
    13       INTEGER,PARAMETER :: M3=243000,IA3=4561,IC3=51349
    14       INTEGER :: IDUM,J
     4FUNCTION RAN1(IDUM)
     5  IMPLICIT NONE
     6  REAL :: RAN1
     7  REAL,SAVE :: R(97)
     8  REAL,PARAMETER :: RM1=3.8580247E-6,RM2=7.4373773E-6
     9  INTEGER,SAVE :: IFF=0
     10  integer,save :: ix1,ix2,ix3
     11  INTEGER,PARAMETER :: M1=259200,IA1=7141,IC1=54773
     12  INTEGER,PARAMETER :: M2=134456,IA2=8121,IC2=28411
     13  INTEGER,PARAMETER :: M3=243000,IA3=4561,IC3=51349
     14  INTEGER :: IDUM,J
    1515
    16       IF (IDUM<0.OR.IFF==0) THEN
    17         IFF=1
    18         IX1=MOD(IC1-IDUM,M1)
    19         IX1=MOD(IA1*IX1+IC1,M1)
    20         IX2=MOD(IX1,M2)
    21         IX1=MOD(IA1*IX1+IC1,M1)
    22         IX3=MOD(IX1,M3)
    23         DO J=1,97
    24           IX1=MOD(IA1*IX1+IC1,M1)
    25           IX2=MOD(IA2*IX2+IC2,M2)
    26           R(J)=(REAL(IX1)+REAL(IX2)*RM2)*RM1
    27       END DO
    28         IDUM=1
    29       ENDIF
     16  IF (IDUM<0.OR.IFF==0) THEN
     17    IFF=1
     18    IX1=MOD(IC1-IDUM,M1)
     19    IX1=MOD(IA1*IX1+IC1,M1)
     20    IX2=MOD(IX1,M2)
     21    IX1=MOD(IA1*IX1+IC1,M1)
     22    IX3=MOD(IX1,M3)
     23    DO J=1,97
    3024      IX1=MOD(IA1*IX1+IC1,M1)
    3125      IX2=MOD(IA2*IX2+IC2,M2)
    32       IX3=MOD(IA3*IX3+IC3,M3)
    33       J=1+(97*IX3)/M3
    34       IF(J>97.OR.J<1) stop 1
    35       RAN1=R(J)
    3626      R(J)=(REAL(IX1)+REAL(IX2)*RM2)*RM1
    37       RETURN
    38       END
     27  END DO
     28    IDUM=1
     29  ENDIF
     30  IX1=MOD(IA1*IX1+IC1,M1)
     31  IX2=MOD(IA2*IX2+IC2,M2)
     32  IX3=MOD(IA3*IX3+IC3,M3)
     33  J=1+(97*IX3)/M3
     34  IF(J>97.OR.J<1) stop 1
     35  RAN1=R(J)
     36  R(J)=(REAL(IX1)+REAL(IX2)*RM2)*RM1
     37
     38END FUNCTION RAN1
Note: See TracChangeset for help on using the changeset viewer.