Changeset 4144 for palm/trunk/SOURCE/random_function_mod.f90
- Timestamp:
- Aug 6, 2019 9:11:47 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/random_function_mod.f90
r3802 r4144 25 25 ! ----------------- 26 26 ! $Id$ 27 ! relational operators .EQ., .NE., etc. replaced by ==, /=, etc. 28 ! 29 ! 3802 2019-03-17 13:33:42Z raasch 27 30 ! type conversion added to avoid compiler warning about constant integer 28 31 ! division truncation … … 73 76 ! ------------ 74 77 !> Random number generator, produces numbers equally distributed in interval [0,1] 75 !> This routine is taken from the "numerical recip ies"78 !> This routine is taken from the "numerical recipes" 76 79 !------------------------------------------------------------------------------! 77 80 MODULE random_function_mod … … 137 140 ntab=32, ndiv=1+INT(REAL(im-1)/ntab), eps=1.2e-7_wp, rnmx=1.0_wp-eps ) 138 141 139 IF ( idum .le. 0 .or. random_iy .eq.0 ) THEN142 IF ( idum <= 0 .OR. random_iy == 0 ) THEN 140 143 idum = max (-idum,1) 141 144 DO j = ntab+8,1,-1 142 145 k = idum / iq 143 146 idum = ia * ( idum - k * iq ) - ir * k 144 IF ( idum .lt.0 ) idum = idum + im145 IF ( j .le.ntab ) random_iv(j) = idum147 IF ( idum < 0 ) idum = idum + im 148 IF ( j <= ntab ) random_iv(j) = idum 146 149 ENDDO 147 150 random_iy = random_iv(1) … … 150 153 k = idum / iq 151 154 idum = ia * ( idum - k * iq ) - ir * k 152 IF ( idum .lt.0 ) idum = idum + im155 IF ( idum < 0 ) idum = idum + im 153 156 j = 1 + random_iy / ndiv 154 157 random_iy = random_iv(j) 155 158 random_iv(j) = idum 156 random_function = min( am * random_iy , rnmx )159 random_function = MIN( am * random_iy , rnmx ) 157 160 158 161 END FUNCTION random_function
Note: See TracChangeset
for help on using the changeset viewer.