IAP GITLAB

Commit 9cda202e authored by Colin Baus's avatar Colin Baus

replaced random number generator for dpmjet with the general one from crmc

git-svn-id: https://devel-ik.fzk.de/svn/mc/crmc/trunk@4130 c7a5e08c-de06-0410-9364-b41cf42a0b17
parent 6a10cbd5
......@@ -326,3 +326,17 @@ C CALL DT_EVTOUT(4)
RETURN
END
c--------------------------------------------------------------------
double precision function DT_RNDM(dum)
c--------------------------------------------------------------------
c random number generator
c--------------------------------------------------------------------
include 'epos.inc'
double precision dum,drangen
DT_RNDM=drangen(dum)
if(irandm.eq.1)write(ifch,*)'DT_RNDM()= ',DT_RNDM,dum
return
end
......@@ -27109,48 +27109,48 @@ C WRITE(LOUT,1000) DAT,TIM
*
*===rndm===============================================================*
*
DOUBLE PRECISION FUNCTION DT_RNDM(VDUMMY)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
SAVE
* random number generator
COMMON /DTRAND/ U(97),C,CD,CM,I,J
* counter of calls to random number generator
* uncomment if needed
C COMMON /DTRNCT/ IRNCT0,IRNCT1
C LOGICAL LFIRST
C DATA LFIRST /.TRUE./
* counter of calls to random number generator
* uncomment if needed
C IF (LFIRST) THEN
C IRNCT0 = 0
C IRNCT1 = 0
C LFIRST = .FALSE.
C ENDIF
100 CONTINUE
DT_RNDM = U(I)-U(J)
IF ( DT_RNDM.LT.0.0D0 ) DT_RNDM = DT_RNDM+1.0D0
U(I) = DT_RNDM
I = I-1
IF ( I.EQ.0 ) I = 97
J = J-1
IF ( J.EQ.0 ) J = 97
C = C-CD
IF ( C.LT.0.0D0 ) C = C+CM
DT_RNDM = DT_RNDM-C
IF ( DT_RNDM.LT.0.0D0 ) DT_RNDM = DT_RNDM+1.0D0
IF ((DT_RNDM.EQ.0.D0).OR.(DT_RNDM.EQ.1.D0)) GOTO 100
* counter of calls to random number generator
* uncomment if needed
C IRNCT0 = IRNCT0+1
RETURN
END
c$$$ DOUBLE PRECISION FUNCTION DT_RNDM(VDUMMY)
c$$$
c$$$ IMPLICIT DOUBLE PRECISION (A-H,O-Z)
c$$$ SAVE
c$$$
c$$$* random number generator
c$$$ COMMON /DTRAND/ U(97),C,CD,CM,I,J
c$$$
c$$$* counter of calls to random number generator
c$$$* uncomment if needed
c$$$C COMMON /DTRNCT/ IRNCT0,IRNCT1
c$$$C LOGICAL LFIRST
c$$$C DATA LFIRST /.TRUE./
c$$$
c$$$* counter of calls to random number generator
c$$$* uncomment if needed
c$$$C IF (LFIRST) THEN
c$$$C IRNCT0 = 0
c$$$C IRNCT1 = 0
c$$$C LFIRST = .FALSE.
c$$$C ENDIF
c$$$ 100 CONTINUE
c$$$ DT_RNDM = U(I)-U(J)
c$$$ IF ( DT_RNDM.LT.0.0D0 ) DT_RNDM = DT_RNDM+1.0D0
c$$$ U(I) = DT_RNDM
c$$$ I = I-1
c$$$ IF ( I.EQ.0 ) I = 97
c$$$ J = J-1
c$$$ IF ( J.EQ.0 ) J = 97
c$$$ C = C-CD
c$$$ IF ( C.LT.0.0D0 ) C = C+CM
c$$$ DT_RNDM = DT_RNDM-C
c$$$ IF ( DT_RNDM.LT.0.0D0 ) DT_RNDM = DT_RNDM+1.0D0
c$$$
c$$$ IF ((DT_RNDM.EQ.0.D0).OR.(DT_RNDM.EQ.1.D0)) GOTO 100
c$$$
c$$$* counter of calls to random number generator
c$$$* uncomment if needed
c$$$C IRNCT0 = IRNCT0+1
c$$$
c$$$ RETURN
c$$$ END
*$ CREATE DT_RNDMST.FOR
*COPY DT_RNDMST
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment