1 c.................... zpc.f
6 c (suggestions, problems -> bzhang@nt1.phys.columbia.edu)
8 cms dlw & gsfs Comments our writing of output files
10 implicit double precision (a-h, o-z)
11 clin-4/20/01 PARAMETER (NMAXGL = 16000)
12 parameter (MAXPTN=400001)
13 common /para3/ nsevt, nevnt, nsbrun, ievt, isbrun
20 c generation of the initial condition for one event
22 c loop over many runs of the same event
25 c initialization for one run of an event
40 c 5/17/01 calculate v2 for parton already frozen out:
42 c.....to get average values for different strings
47 ******************************************************************************
48 ******************************************************************************
51 c set initial values in block data
53 implicit double precision (a-h, o-z)
54 parameter (MAXPTN=400001)
55 PARAMETER (MAXSTR=150001)
58 common /para2/ xmp, xmu, alpha, rscut2, cutof2
60 common /para3/ nsevt, nevnt, nsbrun, ievt, isbrun
62 common /para4/ iftflg, ireflg, igeflg, ibstfg
64 common /para5/ iconfg, iordsc
68 clin-6/2009 nsmbbbar and nsmmeson respectively give the total number of
69 c baryons/anti-baryons and mesons for each event:
70 c common /para7/ ioscar
71 common /para7/ ioscar,nsmbbbar,nsmmeson
73 COMMON /prec1/GX0(MAXPTN),GY0(MAXPTN),GZ0(MAXPTN),FT0(MAXPTN),
74 & PX0(MAXPTN), PY0(MAXPTN), PZ0(MAXPTN), E0(MAXPTN),
75 & XMASS0(MAXPTN), ITYP0(MAXPTN)
77 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
78 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
79 & xmass(MAXPTN), ityp(MAXPTN)
81 common /prec3/gxs(MAXPTN),gys(MAXPTN),gzs(MAXPTN),fts(MAXPTN),
82 & pxs(MAXPTN), pys(MAXPTN), pzs(MAXPTN), es(MAXPTN),
83 & xmasss(MAXPTN), ityps(MAXPTN)
85 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
87 common /prec5/ eta(MAXPTN), rap(MAXPTN), tau(MAXPTN)
89 common /prec6/ etas(MAXPTN), raps(MAXPTN), taus(MAXPTN)
91 common /aurec1/ jxa, jya, jza
93 common /aurec2/ dgxa(MAXPTN), dgya(MAXPTN), dgza(MAXPTN)
96 & iscat, jscat, next(MAXPTN), last(MAXPTN),
97 & ictype, icsta(MAXPTN),
98 & nic(MAXPTN), icels(MAXPTN)
100 common /ilist2/ icell, icel(10,10,10)
102 common /ilist3/ size1, size2, size3, v1, v2, v3, size
104 common /ilist4/ ifmpt, ichkpt, indx(MAXPTN)
106 c 6/07/02 initialize in ftime to expedite compiling:
107 c common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
109 common /ilist6/ t, iopern, icolln
111 COMMON /ilist7/ LSTRG0(MAXPTN), LPART0(MAXPTN)
113 COMMON /ilist8/ LSTRG1(MAXPTN), LPART1(MAXPTN)
115 common /rndm1/ number
119 common /rndm3/ iseedp
124 & det(12), dn(12), detdy(12), detdn(12), dndy(12),
125 & det1(12), dn1(12), detdy1(12), detdn1(12), dndy1(12),
126 & det2(12), dn2(12), detdy2(12), detdn2(12), dndy2(12)
128 common /ana3/ em(4, 4, 12)
130 common /ana4/ fdetdy(24), fdndy(24), fdndpt(12)
134 c 6/07/02 initialize in ftime to expedite compiling:
135 c data (ct(i), i = 1, MAXPTN)/MAXPTN*0d0/
136 c data (ot(i), i = 1, MAXPTN)/MAXPTN*0d0/
137 c data tlarge/1000000.d0/
139 data ts/0.11d0, 0.12d0, 0.15d0, 0.2d0, 0.3d0, 0.4d0, 0.6d0,
140 & 0.8d0, 1d0, 2d0, 4d0, 6d0/
144 ******************************************************************************
145 ******************************************************************************
149 implicit double precision (a-h, o-z)
163 implicit double precision (a-h, o-z)
169 common /para2/ xmp, xmu, alpha, rscut2, cutof2
171 common /para3/ nsevt, nevnt, nsbrun, ievt, isbrun
173 common /para4/ iftflg, ireflg, igeflg, ibstfg
175 common /para5/ iconfg, iordsc
177 common /para7/ ioscar,nsmbbbar,nsmmeson
179 common /ilist3/ size1, size2, size3, v1, v2, v3, size
181 common /rndm1/ number
185 common /rndm3/ iseedp
191 c this is the initialization file containing the initial values of
194 c open (5, file = 'zpc.ini', status = 'unknown')
197 c this is the final data file containing general info about the cascade
199 c open (6, file = 'zpc.res', status = 'unknown')
200 cms open (25, file = 'ana/zpc.res', status = 'unknown')
203 c this is the input file containing initial particle records
205 c open (7, file = 'zpc.inp', status = 'unknown')
208 c this gives the optional OSCAR standard output
210 c open (8, file = 'zpc.oscar', status = 'unknown')
212 cms open (26, file = 'ana/parton.oscar', status = 'unknown')
213 cms open (19, file = 'ana/hadron.oscar', status = 'unknown')
217 c 2/11/03 combine zpc initialization into ampt.ini:
218 c open (29, file = 'zpc.ini', status = 'unknown')
219 c read (29, *) str, xmp
221 c read (29, *) str, xmu
222 c read (29, *) str, alpha
223 cutof2 = 4.5d0 * (alpha / xmu) ** 2
224 c read (29, *) str, rscut2
226 c read (29, *) str, nsevt
228 c read (29, *) str, nevnt
230 c read (29, *) str, nsbrun
232 c read (29, *) str, iftflg
234 c read (29, *) str, ireflg
237 IF (ireflg .EQ. 0) THEN
238 cms OPEN (27, FILE = 'zpc.inp', STATUS = 'UNKNOWN')
241 c read (29, *) str, igeflg
243 c read (29, *) str, ibstfg
245 c read (29, *) str, iconfg
247 c read (29, *) str, iordsc
249 c read (29, *) str, ioscar
250 c read (29, *) str, v1, v2, v3
254 c read (29, *) str, size1, size2, size3
258 if (size1 .eq. 0d0 .or. size2 .eq. 0d0 .or.
259 & size3 .eq. 0d0) then
260 if (size1 .ne. 0d0 .or. size2 .ne. 0d0 .or. size3 .ne. 0d0
261 & .or. v1 .ne. 0d0 .or. v2 .ne. 0d0 .or. v3 .ne. 0d0) then
262 print *, 'to get rid of space division:'
263 print *, 'set all sizes and vs to 0'
267 size = min(size1, size2, size3)
268 c read (29, *) str, iff
270 c read (29, *) str, iseed
272 c 10/24/02 get rid of argument usage mismatch in ran1():
276 c read (29, *) str, irused
278 do 1001 i = 1, irused - 1
285 if (iconfg .eq. 2 .or. iconfg .eq. 3) then
290 if (iconfg .eq. 4 .or. iconfg .eq. 5) then
303 implicit double precision (a-h,o-z)
305 common /para4/ iftflg, ireflg, igeflg, ibstfg
311 if (ibstfg .ne. 0) then
320 implicit double precision (a-h,o-z)
322 common /para4/ iftflg, ireflg, igeflg, ibstfg
327 if (ibstfg .ne. 0) then
337 ******************************************************************************
341 implicit double precision (a-h, o-z)
345 common /para4/ iftflg, ireflg, igeflg, ibstfg
352 if (ireflg .eq. 0) call readi
353 if (igeflg .ne. 0) call genei
354 if (ibstfg .ne. 0) call boosti
361 implicit double precision (a-h, o-z)
362 parameter (MAXPTN=400001)
363 double precision field(9)
366 common /para3/ nsevt, nevnt, nsbrun, ievt, isbrun
368 COMMON /prec1/GX0(MAXPTN),GY0(MAXPTN),GZ0(MAXPTN),FT0(MAXPTN),
369 & PX0(MAXPTN), PY0(MAXPTN), PZ0(MAXPTN), E0(MAXPTN),
370 & XMASS0(MAXPTN), ITYP0(MAXPTN)
373 do 1001 i = 1, MAXPTN
374 if (ievt .ne. 1 .and. i .eq. 1) then
387 900 read (27, *, end = 1000) neve, ntyp, field
388 if (neve .lt. nsevt) goto 900
390 & nsevt + ievt - 1) goto 1000
412 implicit double precision (a-h, o-z)
413 parameter (MAXPTN=400001)
416 common /para2/ xmp, xmu, alpha, rscut2, cutof2
418 common /para3/ nsevt, nevnt, nsbrun, ievt, isbrun
420 common /para5/ iconfg, iordsc
422 COMMON /prec1/GX0(MAXPTN),GY0(MAXPTN),GZ0(MAXPTN),FT0(MAXPTN),
423 & PX0(MAXPTN), PY0(MAXPTN), PZ0(MAXPTN), E0(MAXPTN),
424 & XMASS0(MAXPTN), ITYP0(MAXPTN)
426 common /prec5/ eta(MAXPTN), rap(MAXPTN), tau(MAXPTN)
428 common /lora/ enenew, pxnew, pynew, pznew
430 common /rndm3/ iseedp
443 deta = etamax - etamin
445 do 1001 i = mul + 1, mul + incmul
448 call energya(e, temp)
449 call momntm(px, py, pz, e)
451 c e = sqrt(e ** 2 + xmp ** 2)
452 e = dsqrt(e ** 2 + xmp ** 2)
453 if (iconfg .le. 3) then
454 eta(i) = etamin + deta * ran1(iseed)
458 call lorenza(e, px, py, pz, bex, bey, bez)
471 do 1002 i = mul + 1, mul + incmul
472 if (iconfg .le. 3) then
473 gz0(i) = tau0 * sinh(eta(i))
474 ft0(i) = tau0 * cosh(eta(i))
475 if (iconfg .eq. 1) then
476 call posit1(x, y, r0)
477 gx0(i) = x + px0(i) * ft0(i)/e0(i)
478 gy0(i) = y + py0(i) * ft0(i)/e0(i)
479 else if (iconfg .eq. 2 .or. iconfg .eq. 3) then
495 c check if it's necessary to adjust array size 'adarr'
496 if (mul .ge. MAXPTN .or. mul .eq. 0) then
497 print *, 'event',ievt,'has',mul,'number of gluon',
498 & 'adjusting counting is necessary'
505 subroutine posit1(x, y, r0)
507 implicit double precision (a-h, o-z)
510 common /rndm3/ iseedp
515 10 x = 2d0 * ran1(iseed) - 1d0
516 y = 2d0 * ran1(iseed) - 1d0
517 if (x ** 2 + y ** 2 .gt. 1d0) goto 10
524 subroutine posit2(x, y)
526 implicit double precision (a-h, o-z)
530 common /ilist3/ size1, size2, size3, v1, v2, v3, size
532 common /rndm3/ iseedp
536 x = 2d0 * ran1(iseed) - 1d0
537 y = 2d0 * ran1(iseed) - 1d0
544 subroutine posit3(x, y, z)
546 implicit double precision (a-h, o-z)
550 common /ilist3/ size1, size2, size3, v1, v2, v3, size
552 common /rndm3/ iseedp
557 x = 2d0 * ran1(iseed) - 1d0
558 y = 2d0 * ran1(iseed) - 1d0
559 z = 2d0 * ran1(iseed) - 1d0
567 subroutine energya(e, temp)
569 c to generate the magnitude of the momentum e,
570 c knowing the temperature of the local thermal distribution temp
572 implicit double precision (a-h, o-z)
576 common /para2/ xmp, xmu, alpha, rscut2, cutof2
578 common /rndm3/ iseedp
589 if (e .le. 0d0) goto 1000
592 & exp((e - dsqrt(e ** 2 + xmp ** 2))/temp)) then
599 subroutine momntm(px, py, pz, e)
601 c to generate the 3 components of the momentum px, py, pz,
602 c from the magnitude of the momentum e
604 implicit double precision (a-h,o-z)
608 parameter (pi = 3.14159265358979d0)
609 common /rndm3/ iseedp
614 cost = 2d0 * ran1(iseed) - 1d0
616 c sint = sqrt(1d0 - cost ** 2)
617 sint = dsqrt(1d0 - cost ** 2)
618 phi = 2d0 * pi * ran1(iseed)
620 px = e * sint * cos(phi)
621 py = e * sint * sin(phi)
629 implicit double precision (a-h, o-z)
630 parameter (MAXPTN=400001)
635 COMMON /prec1/GX0(MAXPTN),GY0(MAXPTN),GZ0(MAXPTN),FT0(MAXPTN),
636 & PX0(MAXPTN), PY0(MAXPTN), PZ0(MAXPTN), E0(MAXPTN),
637 & XMASS0(MAXPTN), ITYP0(MAXPTN)
639 common /lora/ enenew, pxnew, pynew, pznew
649 c save data for many runs of the same initial condition
655 call lorenza(e1, px1, py1, pz1, bex, bey, bez)
664 call lorenza(e1, px1, py1, pz1, bex, bey, bez)
674 ******************************************************************************
679 c sort prec2 according to increasing formation time
689 c this subroutine generates formation time for the particles
692 c output ft(i), indx(i)
694 implicit double precision (a-h, o-z)
697 parameter (MAXPTN=400001)
700 common /para2/ xmp, xmu, alpha, rscut2, cutof2
702 common /para4/ iftflg, ireflg, igeflg, ibstfg
704 COMMON /prec1/GX0(MAXPTN),GY0(MAXPTN),GZ0(MAXPTN),FT0(MAXPTN),
705 & PX0(MAXPTN), PY0(MAXPTN), PZ0(MAXPTN), E0(MAXPTN),
706 & XMASS0(MAXPTN), ITYP0(MAXPTN)
708 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
710 common /ilist4/ ifmpt, ichkpt, indx(MAXPTN)
712 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
716 common/anim/nevent,isoft,isflag,izpc
718 common /rndm3/ iseedp
723 clin-6/07/02 initialize here to expedite compiling, instead in zpcbdt:
724 do 1001 i = 1, MAXPTN
731 if (iftflg .eq. 0) then
732 c 5/01/01 different prescription for parton initial formation time:
733 if(isoft.eq.3.or.isoft.eq.4.or.isoft.eq.5) then
735 if (ft0(i) .gt. tlarge) ft0(i) = tlarge
741 do 1003 i = 1, MAXPTN
745 xmt2 = px0(i) ** 2 + py0(i) ** 2 + xmp ** 2
747 ft0(i) = ftime1(iseed)
748 if (ft0(i) .gt. tlarge) ft0(i) = tlarge
758 c call index1(MAXPTN, mul, ft0, indx)
760 call index1(MAXPTN, mul, ft0, indx)
762 clin-7/09/03: need to set value for mul=1:
771 implicit double precision (a-h, o-z)
773 parameter (MAXPTN=400001)
776 common /para4/ iftflg, ireflg, igeflg, ibstfg
778 common /para5/ iconfg, iordsc
780 COMMON /prec1/GX0(MAXPTN),GY0(MAXPTN),GZ0(MAXPTN),FT0(MAXPTN),
781 & PX0(MAXPTN), PY0(MAXPTN), PZ0(MAXPTN), E0(MAXPTN),
782 & XMASS0(MAXPTN), ITYP0(MAXPTN)
784 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
785 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
786 & xmass(MAXPTN), ityp(MAXPTN)
788 common /prec3/gxs(MAXPTN),gys(MAXPTN),gzs(MAXPTN),fts(MAXPTN),
789 & pxs(MAXPTN), pys(MAXPTN), pzs(MAXPTN), es(MAXPTN),
790 & xmasss(MAXPTN), ityps(MAXPTN)
792 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
794 common /prec5/ eta(MAXPTN), rap(MAXPTN), tau(MAXPTN)
796 common /prec6/ etas(MAXPTN), raps(MAXPTN), taus(MAXPTN)
798 common /ilist4/ ifmpt, ichkpt, indx(MAXPTN)
801 COMMON /ilist7/ LSTRG0(MAXPTN), LPART0(MAXPTN)
803 COMMON /ilist8/ LSTRG1(MAXPTN), LPART1(MAXPTN)
806 COMMON /smearz/smearp,smearh
808 dimension vxp(MAXPTN), vyp(MAXPTN), vzp(MAXPTN)
809 common /precpa/ vxp0(MAXPTN), vyp0(MAXPTN), vzp0(MAXPTN)
811 common/anim/nevent,isoft,isflag,izpc
813 clin-6/06/02 local parton freezeout:
815 & gxfrz(MAXPTN), gyfrz(MAXPTN), gzfrz(MAXPTN), ftfrz(MAXPTN),
816 & pxfrz(MAXPTN), pyfrz(MAXPTN), pzfrz(MAXPTN), efrz(MAXPTN),
818 & tfrz(302), ifrz(MAXPTN), idfrz(MAXPTN), itlast
820 common /rndm3/ iseedp
822 common /para7/ ioscar,nsmbbbar,nsmmeson
823 COMMON /AREVT/ IAEVT, IARUN, MISS
826 clin-6/06/02 local freezeout initialization:
833 clin-7/09/01 define indx(i) to save time:
834 c ityp(i) = ityp0(indx(i))
835 c gx(i) = gx0(indx(i))
836 c gy(i) = gy0(indx(i))
837 c gz(i) = gz0(indx(i))
838 c ft(i) = ft0(indx(i))
839 c px(i) = px0(indx(i))
840 c py(i) = py0(indx(i))
841 c pz(i) = pz0(indx(i))
843 c xmass(i) = xmass0(indx(i))
845 c LSTRG1(I) = LSTRG0(INDX(I))
846 c LPART1(I) = LPART0(INDX(I))
849 ityp(i) = ityp0(indxi)
858 xmass(i) = xmass0(indxi)
859 LSTRG1(I) = LSTRG0(INDXI)
860 LPART1(I) = LPART0(INDXI)
866 clin-6/06/02 local freezeout initialization:
883 c save particle info for fixed time analysis
898 cms if(isoft.eq.1.and.(ioscar.eq.2.or.ioscar.eq.3))
899 cms 1 write(92,*) iaevt,miss,mul
903 vx(i) = px(i) / energy
904 vy(i) = py(i) / energy
905 vz(i) = pz(i) / energy
906 if (iftflg .eq. 0) then
908 c 7/09/01 propagate partons with parent velocity till formation
909 c so that partons in same hadron have 0 distance:
910 c gx(i) = gx(i) + vx(i) * formt
911 c gy(i) = gy(i) + vy(i) * formt
912 c gz(i) = gz(i) + vz(i) * formt
913 if(isoft.eq.3.or.isoft.eq.4.or.isoft.eq.5) then
914 gx(i) = gx(i) + vxp(i) * formt
915 gy(i) = gy(i) + vyp(i) * formt
916 gz(i) = gz(i) + vzp(i) * formt
918 gx(i) = gx(i) + vx(i) * formt
919 gy(i) = gy(i) + vy(i) * formt
920 gz(i) = gz(i) + vz(i) * formt
924 c 3/27/00-ctest off no smear z on partons to avoid eta overflow:
925 c gz(i) = gz(i)+smearp*(2d0 * ran1(iseed) - 1d0)
926 c to give eta=y +- smearp*random:
927 c smeary=smearp*(2d0 * ran1(iseed) - 1d0)
928 c smearf=dexp(2*smeary)*(1+vz(i))/(1-vz(i)+1.d-8)
929 c gz(i) = gz(i)+formt*(smearf-1)/(smearf+1)
933 clin-6/2009 write out initial parton information after string melting
934 c and after propagating to its format time:
935 if(ioscar.eq.2.or.ioscar.eq.3) then
936 if(dmax1(abs(gx(i)),abs(gy(i)),
937 1 abs(gz(i)),abs(ft(i))).lt.9999) then
938 cms write(92,200) ityp(i),px(i),py(i),pz(i),xmass(i),
939 cms 1 gx(i),gy(i),gz(i),ft(i)
941 cms write(92,201) ityp(i),px(i),py(i),pz(i),xmass(i),
942 cms 1 gx(i),gy(i),gz(i),ft(i)
945 cyy 200 format(I6,2(1x,f8.3),1x,f10.3,1x,f6.3,4(1x,f8.2))
946 cyy 201 format(I6,2(1x,f8.3),1x,f10.3,1x,f6.3,4(1x,e8.2))
950 if (iconfg .le. 3) then
952 if (ft(i) .le. abs(gz(i))) then
955 eta(i) = 0.5d0 * log((ft(i) + gz(i)) / (ft(i) - gz(i)))
957 if (e(i) .le. abs(pz(i))) then
960 rap(i) = 0.5d0 * log((e(i) + pz(i)) / (e(i) - pz(i)))
962 tau(i) = ft(i) / cosh(eta(i))
977 implicit double precision (a-h, o-z)
978 parameter (MAXPTN=400001)
982 & iscat, jscat, next(MAXPTN), last(MAXPTN),
983 & ictype, icsta(MAXPTN),
984 & nic(MAXPTN), icels(MAXPTN)
986 common /ilist2/ icell, icel(10,10,10)
988 common /ilist4/ ifmpt, ichkpt, indx(MAXPTN)
990 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
992 common /ilist6/ t, iopern, icolln
1011 icel(i1, i2, i3) = 0
1033 implicit double precision (a-h, o-z)
1035 common /para5/ iconfg, iordsc
1038 & det(12), dn(12), detdy(12), detdn(12), dndy(12),
1039 & det1(12), dn1(12), detdy1(12), detdn1(12), dndy1(12),
1040 & det2(12), dn2(12), detdy2(12), detdn2(12), dndy2(12)
1044 if (iconfg .le. 3) then
1058 ******************************************************************************
1059 ******************************************************************************
1061 subroutine zpcrun(*)
1063 implicit double precision (a-h, o-z)
1064 parameter (MAXPTN=400001)
1065 parameter (tend1 = 250d0)
1066 parameter (tend2 = 6.1d0)
1069 common /para5/ iconfg, iordsc
1070 common /para7/ ioscar,nsmbbbar,nsmmeson
1072 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
1073 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
1074 & xmass(MAXPTN), ityp(MAXPTN)
1076 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
1078 common /prec5/ eta(MAXPTN), rap(MAXPTN), tau(MAXPTN)
1081 & iscat, jscat, next(MAXPTN), last(MAXPTN),
1082 & ictype, icsta(MAXPTN),
1083 & nic(MAXPTN), icels(MAXPTN)
1085 common /ilist4/ ifmpt, ichkpt, indx(MAXPTN)
1087 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
1089 common /ilist6/ t, iopern, icolln
1091 common /ana1/ ts(12)
1093 common/anim/nevent,isoft,isflag,izpc
1095 COMMON /AREVT/ IAEVT, IARUN, MISS
1098 c save last collision info
1099 if (mod(ictype, 2) .eq. 0) then
1104 c1 get operation type
1106 c2 check freezeout condition
1107 if (iconfg .eq. 1 .and. t1 .gt. tlarge / 2d0) return 1
1108 if (iconfg .eq. 2 .or. iconfg .eq. 3) then
1109 if (t1 .gt. tend1) return 1
1110 c if (ichkpt .eq. mul) then
1113 c gztemp = gz(i) + vz(i) * (t1 - ft(i))
1114 c if (sqrt(t1 ** 2 - gztemp ** 2) .lt. tend) then
1120 c if (ii .eq. 0) return 1
1123 if (iconfg .eq. 4 .or. iconfg .eq. 5) then
1124 if (t1 .gt. tend2) return 1
1127 clin-6/06/02 local freezeout for string melting,
1128 c decide what partons have frozen out at time t1:
1137 if (mod(ictype, 2) .eq. 0) then
1141 c write (2006, 1233) 'iscat=', iscat, 'jscat=', jscat,
1142 c write (2006, *) 'iscat=', iscat, ' jscat=', jscat,
1143 c 1 ityp(iscat), ityp(jscat)
1144 c write (2006, 1233) 'iscat=', max(indx(iscat), indx(jscat)),
1145 c & 'jscat=', min(indx(iscat), indx(jscat))
1147 c write (2006, 1234) ' icolln=', icolln, 't=', t
1149 c 1233 format (a10, i10, a10, i10)
1150 c 1234 format (a15, i10, a5, f23.17, a5, f23.17)
1153 c4.1 deal with formation
1155 & .or. iconfg .eq. 2
1156 & .or. iconfg .eq. 4) then
1157 if (ictype .eq. 1 .or. ictype .eq. 2 .or.
1158 & ictype .eq. 5 .or. ictype .eq. 6) then
1163 c4.2 deal with collisions
1165 if (ictype .ne. 1) then
1170 c iscat is the larger one so that if it's a wall collision,
1172 iscat = max0(iscat0, jscat0)
1173 jscat = min0(iscat0, jscat0)
1175 ctest off check icsta(i): 0 with f77 compiler
1176 c write(9,*) 'BB:ictype,t1,iscat,jscat,icsta(i)=',
1177 c 1 ictype,t1,iscat,jscat,icsta(iscat)
1179 c check collision time table error 'tterr'
1180 clin-4/2008 to avoid out-of-bound error in next():
1181 c if (jscat .ne. 0 .and. next(jscat) .ne. iscat)
1183 c print *, 'iscat=', iscat, 'jscat=', jscat,
1184 c & 'next(', jscat, ')=', next(jscat)
1186 c if (ct(iscat) .lt. tlarge / 2d0) stop 'tterr'
1187 c if (ct(jscat) .lt. tlarge / 2d0) stop 'tterr'
1189 if (jscat .ne. 0) then
1190 if(next(jscat) .ne. iscat) then
1191 print *, 'iscat=', iscat, 'jscat=', jscat,
1192 & 'next(', jscat, ')=', next(jscat)
1193 if (ct(iscat) .lt. tlarge / 2d0) stop 'tterr'
1194 if (ct(jscat) .lt. tlarge / 2d0) stop 'tterr'
1199 c4.2.1 collisions with wall
1201 c 8/19/02 avoid actual argument in common blocks of cellre:
1204 c if (icsta(iscat) .ne. 0) call cellre(iscat, t)
1205 c if (jscat .ne. 0) then
1206 c if (icsta(jscat) .ne. 0) call cellre(jscat, t)
1208 if (icsta(iscat) .ne. 0) call cellre(niscat, t)
1209 if (jscat .ne. 0) then
1210 if (icsta(jscat) .ne. 0) call cellre(njscat, t)
1213 c4.2.2 collision between particles
1215 clin-6/2009 write out info for each collision:
1216 c if (mod(ictype, 2) .eq. 0) call scat(t, iscat, jscat)
1217 if (mod(ictype, 2) .eq. 0) then
1218 if(ioscar.eq.3) then
1219 cms write(95,*) 'event,miss,iscat,jscat=',iaevt,miss,iscat,jscat
1220 if(dmax1(abs(gx(iscat)),abs(gy(iscat)),
1221 1 abs(gz(iscat)),abs(ft(iscat)),abs(gx(jscat)),
1222 2 abs(gy(jscat)),abs(gz(jscat)),abs(ft(jscat)))
1224 cms write(95,200) ityp(iscat),px(iscat),py(iscat),
1225 cms 1 pz(iscat),xmass(iscat),gx(iscat),gy(iscat),
1226 cms 2 gz(iscat),ft(iscat)
1227 cms write(95,200) ityp(jscat),px(jscat),py(jscat),
1228 cms 1 pz(jscat),xmass(jscat),gx(jscat),gy(jscat),
1229 cms 2 gz(jscat),ft(jscat)
1231 cms write(95,201) ityp(iscat),px(iscat),py(iscat),
1232 cms 1 pz(iscat),xmass(iscat),gx(iscat),gy(iscat),
1233 cms 2 gz(iscat),ft(iscat)
1234 cms write(95,201) ityp(jscat),px(jscat),py(jscat),
1235 cms 1 pz(jscat),xmass(jscat),gx(jscat),gy(jscat),
1236 cms 2 gz(jscat),ft(jscat)
1240 call scat(t, iscat, jscat)
1242 if(ioscar.eq.3) then
1243 if(dmax1(abs(gx(iscat)),abs(gy(iscat)),
1244 1 abs(gz(iscat)),abs(ft(iscat)),abs(gx(jscat)),
1245 2 abs(gy(jscat)),abs(gz(jscat)),abs(ft(jscat)))
1247 cms write(95,200) ityp(iscat),px(iscat),py(iscat),
1248 cms 1 pz(iscat),xmass(iscat),gx(iscat),gy(iscat),
1249 cms 2 gz(iscat),ft(iscat)
1250 cms write(95,200) ityp(jscat),px(jscat),py(jscat),
1251 cms 1 pz(jscat),xmass(jscat),gx(jscat),gy(jscat),
1252 cms 2 gz(jscat),ft(jscat)
1254 cms write(95,201) ityp(iscat),px(iscat),py(iscat),
1255 cms 1 pz(iscat),xmass(iscat),gx(iscat),gy(iscat),
1256 cms 2 gz(iscat),ft(iscat)
1257 cms write(95,201) ityp(jscat),px(jscat),py(jscat),
1258 cms 1 pz(jscat),xmass(jscat),gx(jscat),gy(jscat),
1259 cms 2 gz(jscat),ft(jscat)
1263 cyy format(I6,2(1x,f8.3),1x,f10.3,1x,f6.3,4(1x,f8.2))
1264 cyy format(I6,2(1x,f8.3),1x,f10.3,1x,f6.3,4(1x,e8.2))
1268 c5 update the interaction list
1271 c6 update ifmpt. ichkpt
1272 c old ichkpt and ifmpt are more conveniently used in ulist
1273 if (ifmpt .le. mul) then
1274 if (ictype .ne. 0 .and. ictype .ne. 3
1275 & .and. ictype .ne. 4) then
1284 subroutine savrec(i)
1286 implicit double precision (a-h, o-z)
1287 parameter (MAXPTN=400001)
1288 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
1289 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
1290 & xmass(MAXPTN), ityp(MAXPTN)
1292 common /prec3/gxs(MAXPTN),gys(MAXPTN),gzs(MAXPTN),fts(MAXPTN),
1293 & pxs(MAXPTN), pys(MAXPTN), pzs(MAXPTN), es(MAXPTN),
1294 & xmasss(MAXPTN), ityps(MAXPTN)
1296 common /prec5/ eta(MAXPTN), rap(MAXPTN), tau(MAXPTN)
1298 common /prec6/ etas(MAXPTN), raps(MAXPTN), taus(MAXPTN)
1311 xmasss(i) = xmass(i)
1319 subroutine getict(t1)
1320 implicit double precision (a-h, o-z)
1321 parameter (MAXPTN=400001)
1324 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
1325 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
1326 & xmass(MAXPTN), ityp(MAXPTN)
1329 & iscat, jscat, next(MAXPTN), last(MAXPTN),
1330 & ictype, icsta(MAXPTN),
1331 & nic(MAXPTN), icels(MAXPTN)
1333 common /ilist4/ ifmpt, ichkpt, indx(MAXPTN)
1335 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
1339 c neglect possibility of 2 collisions at the same time
1340 c0 set initial conditions
1346 c1 get next collision between particles
1347 do 1001 i = 1, ichkpt
1348 if (ot(i) .lt. t1) then
1353 if (iscat .ne. 0) jscat = next(iscat)
1356 c 10/30/02 ictype=0:collision; 1:parton formation
1357 if (iscat .ne. 0 .and. jscat .ne. 0) then
1358 if (icsta(iscat) .eq. 0 .and. icsta(jscat) .eq. 0) then
1363 else if (iscat .ne. 0 .or. jscat .ne. 0) then
1367 if (ifmpt .le. mul) then
1368 if (ft(ifmpt) .lt. t1) then
1371 else if (ft(ifmpt) .eq. t1) then
1372 if (ictype .eq. 0) ictype = 2
1373 if (ictype .eq. 3) ictype = 5
1374 if (ictype .eq. 4) ictype = 6
1382 c this subroutine is used to assign a cell for a newly formed particle
1383 c output: nic(MAXPTN) icels(MAXPTN) in the common /ilist1/
1384 c icell, and icel(10,10,10) in the common /ilist2/
1386 implicit double precision (a-h, o-z)
1387 parameter (MAXPTN=400001)
1390 common /para5/ iconfg, iordsc
1392 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
1393 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
1394 & xmass(MAXPTN), ityp(MAXPTN)
1396 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
1399 & iscat, jscat, next(MAXPTN), last(MAXPTN),
1400 & ictype, icsta(MAXPTN),
1401 & nic(MAXPTN), icels(MAXPTN)
1403 common /ilist2/ icell, icel(10,10,10)
1405 common /ilist3/ size1, size2, size3, v1, v2, v3, size
1407 common /ilist4/ ifmpt, ichkpt, indx(MAXPTN)
1416 if (iconfg .eq. 1 .and. (size1 .eq. 0d0 .or.
1417 & size2 .eq. 0d0 .or. size3 .eq. 0d0)) then
1421 else if (iconfg .eq. 4 .or. td .le. 0d0) then
1422 i1 = integ(gx(i) / size1) + 6
1423 i2 = integ(gy(i) / size2) + 6
1424 i3 = integ(gz(i) / size3) + 6
1425 if (integ(gx(i) / size1) .eq. gx(i) / size1 .and.
1428 if (integ(gy(i) / size2) .eq. gy(i) / size2 .and.
1431 if (integ(gz(i) / size3) .eq. gz(i) / size3 .and.
1435 i1 = integ(gx(i) / (size1 + v1 * td)) + 6
1436 i2 = integ(gy(i) / (size2 + v2 * td)) + 6
1437 i3 = integ(gz(i) / (size3 + v3 * td)) + 6
1438 if (integ(gx(i) / (size1 + v1 * td)) .eq. gx(i) /
1439 & (size1 + v1 * td) .and. vx(i) .lt. (i1 - 6) * v1)
1441 if (integ(gy(i) / (size2 + v2 * td)) .eq. gy(i)/
1442 & (size2 + v2 * td) .and. vy(i) .lt. (i2 - 6) * v2)
1444 if (integ(gz(i) / (size3 + v3 * td)) .eq. gz(i)/
1445 & (size3 + v3 * td) .and. vz(i) .lt. (i3 - 6) * v3)
1449 if (i1 .le. 0 .or. i1 .ge. 11 .or. i2 .le. 0 .or.
1450 & i2 .ge. 11 .or. i3 .le. 0 .or. i3 .ge. 11) then
1456 if (i1 .eq. 11) then
1462 j = icel(i1, i2, i3)
1464 icel(i1, i2, i3) = j
1465 icels(i) = i1 * 10000 + i2 * 100 + i3
1471 integer function integ(x)
1472 c this function is used to get the largest integer that is smaller than
1475 implicit double precision (a-h, o-z)
1478 if (x .lt. 0d0) then
1479 integ = int(x - 1d0)
1487 subroutine cellre(i, t)
1488 c this subroutine is used for changing the cell of a particle that
1489 c collide with the wall
1491 implicit double precision (a-h, o-z)
1492 parameter (MAXPTN=400001)
1493 common /para5/ iconfg, iordsc
1495 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
1496 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
1497 & xmass(MAXPTN), ityp(MAXPTN)
1499 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
1501 common /aurec1/ jxa, jya, jza
1503 common /aurec2/ dgxa(MAXPTN), dgya(MAXPTN), dgza(MAXPTN)
1506 & iscat, jscat, next(MAXPTN), last(MAXPTN),
1507 & ictype, icsta(MAXPTN),
1508 & nic(MAXPTN), icels(MAXPTN)
1510 common /ilist2/ icell, icel(10,10,10)
1512 common /ilist3/ size1, size2, size3, v1, v2, v3, size
1514 common /ilist4/ ifmpt, ichkpt, indx(MAXPTN)
1516 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
1524 c this happens before update the /prec2/ common; in contrast with
1525 c scat which happens after updating the glue common
1531 if (iconfg .eq. 3 .or. iconfg .eq. 5) then
1532 k = mod(icsta(i), 10)
1535 gx(i) = gx(i) - 10d0 * size1
1536 dgxa(i) = dgxa(i) + 10d0 * size1
1537 do 1001 ii = 1, ichkpt
1538 if (next(ii) .eq. i) then
1539 dgxa(ii) = dgxa(ii) - 10d0 * size1
1544 gx(i) = gx(i) + 10d0 * size1
1545 dgxa(i) = dgxa(i) - 10d0 * size1
1546 do 1002 ii = 1, ichkpt
1547 if (next(ii) .eq. i) then
1548 dgxa(ii) = dgxa(ii) + 10d0 * size1
1553 gy(i) = gy(i) - 10d0 * size2
1554 dgya(i) = dgya(i) + 10d0 * size2
1555 do 1003 ii = 1, ichkpt
1556 if (next(ii) .eq. i) then
1557 dgya(ii) = dgya(ii) - 10d0 * size2
1562 gy(i) = gy(i) + 10d0 * size2
1563 dgya(i) = dgya(i) - 10d0 * size2
1564 do 1004 ii = 1, ichkpt
1565 if (next(ii) .eq. i) then
1566 dgya(ii) = dgya(ii) + 10d0 * size2
1570 if (iconfg .eq. 5) then
1572 gz(i) = gz(i) - 10d0 * size3
1573 dgza(i) = dgza(i) + 10d0 * size3
1574 do 1005 ii = 1, ichkpt
1575 if (next(ii) .eq. i) then
1576 dgza(ii) = dgza(ii) - 10d0 * size3
1581 gz(i) = gz(i) + 10d0 * size3
1582 dgza(i) = dgza(i) - 10d0 * size3
1583 do 1006 ii = 1, ichkpt
1584 if (next(ii) .eq. i) then
1585 dgza(ii) = dgza(ii) + 10d0 * size3
1594 i2 = (icels0 - i1 * 10000) / 100
1595 i3 = icels0 - i1 * 10000 - i2 * 100
1597 cc for particle inside the cube
1598 if (i1 .ge. 1 .and. i1 .le. 10
1599 & .and. i2 .ge. 1 .and. i2 .le. 10
1600 & .and. i3 .ge. 1 .and. i3 .le. 10) then
1602 c this assignment takes care of nic(i)=0 automatically
1603 if (icel(i1, i2, i3) .eq. i) icel(i1, i2, i3) = nic(i)
1605 c1 rearrange the old cell
1609 c2 rearrange the new cell
1611 k = mod(icsta(i), 10)
1613 c2.1 particle goes out of the cube
1614 if (iconfg .eq. 1) then
1615 good = (i1 .eq. 1 .and. k .eq. 2)
1616 & .or. (i1 .eq. 10 .and. k .eq. 1)
1617 & .or. (i2 .eq. 1 .and. k .eq. 4)
1618 & .or. (i2 .eq. 10 .and. k .eq. 3)
1619 & .or. (i3 .eq. 1 .and. k .eq. 6)
1620 & .or. (i3 .eq. 10 .and. k .eq. 5)
1622 if (iconfg .eq. 2) then
1623 good = (i3 .eq. 1 .and. k .eq. 6)
1624 & .or. (i3 .eq. 10 .and. k .eq. 5)
1629 call newcre(i, icell)
1634 c2.2 particle moves inside the cube
1637 if (k .eq. 1) i1 = i1 + 1
1638 if (k .eq. 2) i1 = i1 - 1
1639 if (k .eq. 3) i2 = i2 + 1
1640 if (k .eq. 4) i2 = i2 - 1
1641 if (k .eq. 5) i3 = i3 + 1
1642 if (k .eq. 6) i3 = i3 - 1
1644 if (iconfg .eq. 2 .or. iconfg .eq. 4) then
1647 gx(i) = gx(i) + 10d0 * size1
1649 if (i1 .eq. 11) then
1651 gx(i) = gx(i) - 10d0 * size1
1655 gy(i) = gy(i) + 10d0 * size2
1657 if (i2 .eq. 11) then
1659 gy(i) = gy(i) - 10d0 * size2
1661 if (iconfg .eq. 4) then
1664 gz(i) = gz(i) + 10d0 * size3
1666 if (i3 .eq. 11) then
1668 gz(i) = gz(i) - 10d0 * size3
1673 j = icel(i1, i2, i3)
1676 c in case icel changes
1678 icel(i1 ,i2, i3) = j
1680 icels(i) = i1 * 10000 + i2 * 100 + i3
1684 cc for particles outside the cube
1687 if (icell .eq. i) icell = nic(i)
1691 k = mod(icsta(i), 10)
1695 if (dtt .le. 0d0) then
1696 i1 = integ((gx(i) + vx(i) * ddt) / size1) + 6
1697 i2 = integ((gy(i) + vy(i) * ddt) / size2) + 6
1698 i3 = integ((gz(i) + vz(i) * ddt) / size3) + 6
1700 i1 = integ((gx(i) + vx(i) * ddt) /
1701 & (size1 + v1 * dtt)) + 6
1702 i2 = integ((gy(i) + vy(i) * ddt) /
1703 & (size2 + v2 * dtt)) + 6
1704 i3 = integ((gz(i) + vz(i) * ddt) /
1705 & (size3 + v3 * dtt)) + 6
1709 if (k .eq. 1) i1 = 1
1710 if (k .eq. 2) i1 = 10
1711 if (k .eq. 3) i2 = 1
1712 if (k .eq. 4) i2 = 10
1713 if (k .eq. 5) i3 = 1
1714 if (k .eq. 6) i3 = 10
1716 j = icel(i1, i2, i3)
1718 icel(i1, i2, i3) = j
1720 icels(i) = i1 * 10000 + i2 * 100 + i3
1725 if (next(i) .ne. 0) then
1730 if (i1 .eq. 11 .and. i2 .eq. 11 .and. i3 .eq. 11) then
1731 call dchout(i, k, t)
1733 if (iconfg .eq. 1) then
1734 call dchin1(i, k, i1, i2, i3, t)
1735 else if (iconfg .eq. 2) then
1736 call dchin2(i, k, i1, i2, i3, t)
1737 else if (iconfg .eq. 4) then
1738 call dchin3(i, k, i1, i2, i3, t)
1742 if (icsta(i) / 10 .eq. 11) then
1746 call wallc(i, i1, i2, i3, t0, tmin1)
1747 if (tmin1 .lt. ct(i)) then
1748 icsta(i) = icsta(i) + 10
1757 subroutine oldcre(i)
1758 c this subroutine is used to rearrange the old cell nic when a particle
1759 c goes out of the cell
1761 implicit double precision (a-h, o-z)
1762 parameter (MAXPTN=400001)
1764 & iscat, jscat, next(MAXPTN), last(MAXPTN),
1765 & ictype, icsta(MAXPTN),
1766 & nic(MAXPTN), icels(MAXPTN)
1770 if (nic(i) .eq. 0) return
1774 if (nic(j) .eq. i) then
1779 do 10 while (nic(j) .ne. i)
1789 subroutine newcre(i, k)
1790 c this subroutine is used to mk rearrange of the new cell a particle
1795 implicit double precision (a-h, o-z)
1796 parameter (MAXPTN=400001)
1798 & iscat, jscat, next(MAXPTN), last(MAXPTN),
1799 & ictype, icsta(MAXPTN),
1800 & nic(MAXPTN), icels(MAXPTN)
1807 else if (nic(k) .eq. 0) then
1812 do 10 while (nic(j) .ne. k)
1824 subroutine scat(t, iscat, jscat)
1826 c this subroutine is used to calculate the 2 particle scattering
1828 implicit double precision (a-h, o-z)
1831 call newpos(t, iscat)
1832 call newpos(t, jscat)
1838 subroutine newpos(t, i)
1840 c this subroutine is used to calculate the 2 particle scattering
1843 implicit double precision (a-h, o-z)
1844 parameter (MAXPTN=400001)
1845 common /para5/ iconfg, iordsc
1847 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
1848 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
1849 & xmass(MAXPTN), ityp(MAXPTN)
1851 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
1853 common /prec5/ eta(MAXPTN), rap(MAXPTN), tau(MAXPTN)
1855 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
1862 gx(i) = gx(i) + vx(i) * dt1
1863 gy(i) = gy(i) + vy(i) * dt1
1864 gz(i) = gz(i) + vz(i) * dt1
1867 if (iconfg .le. 3) then
1868 if (ft(i) .le. abs(gz(i))) then
1871 eta(i) = 0.5d0 * log((ft(i) + gz(i)) / (ft(i) - gz(i)))
1873 tau(i) = ft(i) / cosh(eta(i))
1879 subroutine newmom(t)
1881 c this subroutine is used to calculate the 2 particle scattering
1883 implicit double precision (a-h, o-z)
1885 parameter (hbarc = 0.197327054d0)
1886 parameter (MAXPTN=400001)
1887 parameter (pi = 3.14159265358979d0)
1890 common /para2/ xmp, xmu, alpha, rscut2, cutof2
1892 common /para5/ iconfg, iordsc
1895 common /para6/ centy
1898 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
1899 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
1900 & xmass(MAXPTN), ityp(MAXPTN)
1902 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
1904 common /prec5/ eta(MAXPTN), rap(MAXPTN), tau(MAXPTN)
1906 common /aurec1/ jxa, jya, jza
1908 common /aurec2/ dgxa(MAXPTN), dgya(MAXPTN), dgza(MAXPTN)
1911 & iscat, jscat, next(MAXPTN), last(MAXPTN),
1912 & ictype, icsta(MAXPTN),
1913 & nic(MAXPTN), icels(MAXPTN)
1915 common /ilist3/ size1, size2, size3, v1, v2, v3, size
1917 common /lora/ enenew, pxnew, pynew, pznew
1919 common /cprod/ xn1, xn2, xn3
1923 common/anim/nevent,isoft,isflag,izpc
1926 & gxfrz(MAXPTN), gyfrz(MAXPTN), gzfrz(MAXPTN), ftfrz(MAXPTN),
1927 & pxfrz(MAXPTN), pyfrz(MAXPTN), pzfrz(MAXPTN), efrz(MAXPTN),
1929 & tfrz(302), ifrz(MAXPTN), idfrz(MAXPTN), itlast
1934 clin-6/06/02 no momentum change for partons already frozen out,
1935 c however, spatial upgrade is needed to ensure overall system freezeout:
1937 if(ifrz(iscat).eq.1.or.ifrz(jscat).eq.1) then
1945 c iff is used to randomize the interaction to have both attractive and
1950 if (iconfg .eq. 2 .or. iconfg .eq. 4) then
1951 icels1 = icels(iscat)
1953 j1 = (icels1 - i1 * 10000) / 100
1954 icels2 = icels(jscat)
1956 j2 = (icels2 - i2 * 10000) / 100
1957 if (iconfg .eq. 4) then
1958 k1 = icels1 - i1 * 10000 - j1 * 100
1959 k2 = icels2 - i2 * 10000 - j2 * 100
1976 if (iconfg .eq. 1) then
1980 else if (iconfg .eq. 2 .or. iconfg .eq. 4) then
1981 if (i1 - i2 .gt. 5) then
1982 x2 = gx(jscat) + 10d0 * size1
1983 else if (i1 - i2 .lt. -5) then
1984 x2 = gx(jscat) - 10d0 * size1
1988 if (j1 - j2 .gt. 5) then
1989 y2 = gy(jscat) + 10d0 * size2
1990 else if (j1 - j2 .lt. -5) then
1991 y2 = gy(jscat) - 10d0 * size2
1995 if (iconfg .eq. 4) then
1996 if (k1 - k2 .gt. 5) then
1997 z2 = gz(jscat) + 10d0 * size3
1998 else if (k1 - k2 .lt. -5) then
1999 z2 = gz(jscat) - 10d0 * size3
2006 else if (iconfg .eq. 3 .or. iconfg .eq. 5) then
2007 x2 = gx(jscat) + dgxa(jscat)
2008 y2 = gy(jscat) + dgya(jscat)
2009 if (iconfg .eq. 5) then
2010 z2 = gz(jscat) + dgza(jscat)
2017 rts2 = (e1 + e2) ** 2 - (px1 + px2) ** 2 -
2018 & (py1 + py2) ** 2 - (pz1 + pz2) ** 2
2020 bex = (px1 + px2) / (e1 + e2)
2021 bey = (py1 + py2) / (e1 + e2)
2022 bez = (pz1 + pz2) / (e1 + e2)
2024 call lorenza(e1, px1, py1, pz1, bex, bey, bez)
2025 cc SAVE pxnew, ..., values for later use.
2031 pp2 = pxnew ** 2 + pynew ** 2 + pznew ** 2
2032 call getht(iscat, jscat, pp2, that)
2033 theta = dacos(that / (2d0 * pp2) + 1d0)
2034 theta = dble(iff) * theta
2036 c we boost to the cm frame, get rotation axis, and rotate 1 particle
2039 call lorenza(t1, x1, y1, z1, bex, bey, bez)
2045 call lorenza(t2, x2, y2, z2, bex, bey, bez)
2051 c notice now pxnew, ..., are new positions
2052 call cropro(x1-x2, y1-y2, z1-z2, px1, py1, pz1)
2054 call xnormv(xn1, xn2, xn3)
2057 c call rotate(xn1, xn2, xn3, theta, px1, py1, pz1)
2058 call zprota(xn1, xn2, xn3, theta, px1, py1, pz1)
2061 c we invert the momentum to get the other particle's momentum
2065 clin-4/13/01: modify in case m1, m2 are different:
2067 e2 = dsqrt(px2**2+py2**2+pz2**2+xmass(jscat)**2)
2069 c boost the 2 particle 4 momentum back to lab frame
2070 call lorenza(e1, px1, py1, pz1, -bex, -bey, -bez)
2075 call lorenza(e2, px2, py2, pz2, -bex, -bey, -bez)
2081 vx(iscat) = px(iscat) / e(iscat)
2082 vy(iscat) = py(iscat) / e(iscat)
2083 vz(iscat) = pz(iscat) / e(iscat)
2084 vx(jscat) = px(jscat) / e(jscat)
2085 vy(jscat) = py(jscat) / e(jscat)
2086 vz(jscat) = pz(jscat) / e(jscat)
2091 if (iconfg .le. 3) then
2092 if (e(iscat) .le. abs(pz(iscat))) then
2093 rap(iscat) = 1000000.d0
2095 rap(iscat) = 0.5d0 * log((e(iscat) + pz(iscat)) /
2096 & (e(iscat) - pz(iscat)))
2099 if (e(jscat) .le. abs(pz(jscat))) then
2100 rap(jscat) = 1000000.d0
2102 rap(jscat) = 0.5d0 * log((e(jscat) + pz(jscat)) /
2103 & (e(jscat) - pz(jscat)))
2110 if ((rap1 .lt. centy + 0.5d0 .and.
2111 & rap1 .gt. centy - 0.5d0)) then
2112 c write (9, *) sqrt(ft(iscat) ** 2 - gz(iscat) ** 2), rts2
2114 if ((rap2 .lt. centy + 0.5d0 .and.
2115 & rap2 .gt. centy - 0.5d0)) then
2116 c write (9, *) sqrt(ft(jscat) ** 2 - gz(jscat) ** 2), rts2
2124 subroutine getht(iscat, jscat, pp2, that)
2126 c this subroutine is used to get \hat{t} for a particular processes
2128 implicit double precision (a-h, o-z)
2130 parameter (hbarc = 0.197327054d0)
2131 parameter (MAXPTN=400001)
2132 common /para2/ xmp, xmu, alpha, rscut2, cutof2
2134 common/anim/nevent,isoft,isflag,izpc
2137 common /rndm3/ iseedp
2144 xmu2 = (hbarc * xmu) ** 2
2148 that = xm2*(1d0+1d0/((1d0-xm2/(4d0*pp2+xm2))*rx-1d0))
2149 ctest off isotropic scattering:
2150 c & + 1d0/((1d0 - xm2 / (4d0 * pp2 + xm2)) * ran1(2) - 1d0))
2151 c if(izpc.eq.100) that=-4d0*pp2*ran1(2)
2152 if(izpc.eq.100) that=-4d0*pp2*rx
2158 c this subroutine is used to update a new collision time list
2159 c notice this t has been updated
2161 implicit double precision (a-h, o-z)
2162 parameter (MAXPTN=400001)
2164 & iscat, jscat, next(MAXPTN), last(MAXPTN),
2165 & ictype, icsta(MAXPTN),
2166 & nic(MAXPTN), icels(MAXPTN)
2168 common /ilist4/ ifmpt, ichkpt, indx(MAXPTN)
2172 if (ictype .eq. 1 .or. ictype .eq. 2 .or. ictype .eq. 5
2173 & .or. ictype .eq. 6) then
2177 if (ictype .ne. 1) then
2180 if (jscat .ne. 0) then
2189 subroutine ulist1(l, t)
2190 c this subroutine is used to update the interaction list when particle
2193 implicit double precision (a-h, o-z)
2194 parameter (MAXPTN=400001)
2195 common /para5/ iconfg, iordsc
2198 & iscat, jscat, next(MAXPTN), last(MAXPTN),
2199 & ictype, icsta(MAXPTN),
2200 & nic(MAXPTN), icels(MAXPTN)
2202 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
2208 i2 = (icels0 - i1 * 10000) / 100
2209 i3 = icels0 - i1 * 10000 - i2 * 100
2210 c save collision info for use when the collision is a collision with wall
2211 c otherwise wallc will change icsta
2212 k = mod(icsta(l), 10)
2214 call wallc(l, i1, i2, i3, t, tmin1)
2218 if (i1 .eq. 11 .and. i2 .eq. 11 .and. i3 .eq. 11) then
2219 call chkout(l, t, tmin, nc)
2221 if (iconfg .eq. 1) then
2222 call chkin1(l, i1, i2, i3, t, tmin, nc)
2223 else if (iconfg .eq. 2) then
2224 call chkin2(l, i1, i2, i3, t, tmin, nc)
2225 else if (iconfg .eq. 4) then
2226 call chkin3(l, i1, i2, i3, t, tmin, nc)
2227 else if (iconfg .eq. 3 .or. iconfg .eq. 5) then
2228 call chkcel(l, i1, i2, i3, t, tmin, nc)
2232 call fixtim(l, t, tmin1, tmin, nc)
2237 subroutine wallc(i, i1, i2, i3, t, tmin)
2238 c this subroutine calculates the next time for collision with wall
2240 c input particle label i,t
2241 c output tmin collision time with wall, icsta(i) wall collision
2244 implicit double precision (a-h, o-z)
2245 parameter (MAXPTN=400001)
2246 common /para5/ iconfg, iordsc
2248 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
2254 if (iconfg .le. 2 .or. iconfg .eq. 4) then
2255 c if particle is inside the cube
2256 if ((i1 .ge. 1 .and. i1 .le. 10)
2257 & .or. (i2 .ge. 1 .and. i2 .le. 10)
2258 & .or. (i3 .ge. 1 .and. i3 .le. 10)) then
2259 call wallc1(i, i1, i2, i3, t, tmin)
2260 c if particle is outside the cube
2262 call wallcb(i, t, tmin)
2264 else if (iconfg .eq. 3 .or. iconfg .eq. 5) then
2265 call wallc2(i, i1, i2, i3, t, tmin)
2271 subroutine wallc1(i, i1, i2, i3, t, tmin)
2272 c this subroutine is used to get wall collision time
2273 c when particle is inside the cube, it sets the icsta at the same time
2274 c input i,i1,i2,i3,t
2275 c output tmin, icsta(i)
2276 c note the icsta is not finally set. we need further judgement in
2279 implicit double precision (a-h, o-z)
2280 parameter (MAXPTN=400001)
2281 common /para5/ iconfg, iordsc
2283 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
2284 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
2285 & xmass(MAXPTN), ityp(MAXPTN)
2287 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
2290 & iscat, jscat, next(MAXPTN), last(MAXPTN),
2291 & ictype, icsta(MAXPTN),
2292 & nic(MAXPTN), icels(MAXPTN)
2294 common /ilist3/ size1, size2, size3, v1, v2, v3, size
2296 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
2308 if (t .lt. size .and. tf .lt. size) then
2310 if (v1p .gt. 0d0) then
2311 t1 = ((dble(i1) - 5d0) * size1 - x1p) / v1p + tf
2312 else if (v1p .lt. 0d0) then
2313 t1 = ((dble(i1) - 6d0) * size1 - x1p) / v1p + tf
2318 if (v2p .gt. 0d0) then
2319 t2 = ((dble(i2) - 5d0) * size2 - x2p) / v2p + tf
2320 else if (v2p .lt. 0d0) then
2321 t2 = ((dble(i2) - 6d0) * size2 - x2p) / v2p + tf
2326 if (v3p .gt. 0d0) then
2327 t3 = ((dble(i3) - 5d0) * size3 - x3p) / v3p + tf
2328 else if (v3p .lt. 0d0) then
2329 t3 = ((dble(i3) - 6d0) * size3 - x3p) / v3p + tf
2334 c if a particle is on the wall, we don't collide it on the same wall
2336 c if (t1 .eq. 0d0) t1 = tlarge
2337 c if (t2 .eq. 0d0) t2 = tlarge
2338 c if (t3 .eq. 0d0) t3 = tlarge
2340 tmin = min(t1, t2, t3)
2343 c after checking this is not an earlier collision comparing with
2344 c a collision with another particle, we need to set icsta=0
2345 c after checking whether there is also a particle collision
2346 c at the same time, we need to reset the second bit of icsta
2348 if (tmin .eq. t1) then
2349 if (v1p .gt. 0d0) then
2356 if (tmin .eq. t2) then
2357 if (v2p .gt. 0d0) then
2364 if (tmin .eq. t3) then
2365 if (v3p .gt. 0d0) then
2372 if (tmin .le. size) return
2376 if (v1p .gt. (i1 - 5) * v1) then
2377 t1 = ((i1 - 5) * (size1 - v1 * size) +
2378 & v1p * tf - x1p) / (v1p - (i1 - 5) * v1)
2379 else if (v1p .lt. (i1 - 6) * v1) then
2380 t1 = ((i1 - 6) * (size1 - v1 * size) +
2381 & v1p * tf - x1p) / (v1p - (i1 - 6) * v1)
2386 if (v2p .gt. (i2 - 5) * v2) then
2387 t2 = ((i2 - 5) * (size2 - v2 * size) +
2388 & v2p * tf - x2p) / (v2p - (i2 - 5) * v2)
2389 else if (v2p .lt. (i2 - 6) * v2) then
2390 t2 = ((i2 - 6) * (size2 - v2 * size) +
2391 & v2p * tf - x2p) / (v2p - (i2 - 6) * v2)
2396 if (v3p .gt. (i3 - 5) * v3) then
2397 t3 = ((i3 - 5) * (size3 - v3 * size) +
2398 & v3p * tf - x3p) / (v3p - (i3 - 5) * v3)
2399 else if (v3p .lt. (i3 - 6) * v3) then
2400 t3 = ((i3 - 6) * (size3 - v3 * size) +
2401 & v3p * tf - x3p) / (v3p - (i3 - 6) * v3)
2406 c if a particle is on the wall, we don't collide it on the same wall
2408 c if (t1 .eq. 0d0) t1 = tlarge
2409 c if (t2 .eq. 0d0) t2 = tlarge
2410 c if (t3 .eq. 0d0) t3 = tlarge
2412 tmin = min(t1, t2, t3)
2415 c after checking this is not an earlier collision comparing with
2416 c a collision with another particle, we need to set icsta=0
2417 c after checking whether there is also a particle collision
2418 c at the same time, we need to reset the second bit of icsta
2420 if (tmin .eq. t1) then
2421 if (v1p .gt. (i1 - 5) * v1) then
2428 if (tmin .eq. t2) then
2429 if (v2p .gt. (i2 - 5) * v2) then
2436 if (tmin .eq. t3) then
2437 if (v3p .gt. (i3 - 5) * v3) then
2447 subroutine wallc2(i, i1, i2, i3, t, tmin)
2448 c this subroutine is used to get wall collision time
2449 c when particle is inside the cube, it sets the icsta at the same time
2450 c input i,i1,i2,i3,t
2451 c output tmin, icsta(i)
2452 c note the icsta is not finally set. we need further judgement in
2455 implicit double precision (a-h, o-z)
2456 parameter (MAXPTN=400001)
2458 common /para5/ iconfg, iordsc
2460 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
2461 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
2462 & xmass(MAXPTN), ityp(MAXPTN)
2464 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
2467 & iscat, jscat, next(MAXPTN), last(MAXPTN),
2468 & ictype, icsta(MAXPTN),
2469 & nic(MAXPTN), icels(MAXPTN)
2471 common /ilist3/ size1, size2, size3, v1, v2, v3, size
2473 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
2489 if (v1p .gt. 0d0) then
2490 t1 = (5d0 * size1 - x1p) / v1p + tf
2491 else if (v1p .lt. 0d0) then
2492 t1 = (-5d0 * size1 - x1p) / v1p + tf
2497 if (v2p .gt. 0d0) then
2498 t2 = (5d0 * size2 - x2p) / v2p + tf
2499 else if (v2p .lt. 0d0) then
2500 t2 = (- 5d0 * size2 - x2p) / v2p +tf
2505 if (iconfg .eq. 5) then
2506 if (v3p .gt. 0d0) then
2507 t3 = (5d0 * size3 - x3p) / v3p + tf
2508 else if (v3p .lt. 0d0) then
2509 t3 = (- 5d0 * size3 - x3p) / v3p +tf
2517 tmin = min(t1, t2, t3)
2520 c after checking this is not an earlier collision comparing with
2521 c a collision with another particle, we need to set icsta=0
2522 c after checking whether there is also a particle collision
2523 c at the same time, we need to reset the second bit of icsta
2525 if (tmin .eq. t1) then
2526 if (v1p .gt. 0d0) then
2533 if (tmin .eq. t2) then
2534 if (v2p .gt. 0d0) then
2541 if (tmin .eq. t3) then
2542 if (v3p .gt. 0d0) then
2552 subroutine wallcb(i, t, tmin)
2553 c this subroutine is used to calculate the wall collision time
2554 c when the particle is outside the cube
2556 c output tmin,icsta(i)
2557 c note the icsta is not finally set. we need further judgement in
2560 implicit double precision (a-h, o-z)
2561 parameter (MAXPTN=400001)
2563 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
2564 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
2565 & xmass(MAXPTN), ityp(MAXPTN)
2567 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
2570 & iscat, jscat, next(MAXPTN), last(MAXPTN),
2571 & ictype, icsta(MAXPTN),
2572 & nic(MAXPTN), icels(MAXPTN)
2574 common /ilist3/ size1, size2, size3, v1, v2, v3, size
2576 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
2580 c check if there is a collision by looking at the closest approach point
2581 c and see if it's inside the cube
2583 if (size1 .eq. 0d0 .or. size2 .eq. 0d0 .or.
2584 & size3 .eq. 0d0) return
2594 if (t .lt. size .and. tf .lt. size) then
2595 if (x1p .lt. - 5d0 * size1 .and. v1p .gt. 0d0) then
2596 t1 = (- 5d0 * size1 - x1p) / v1p + tf
2597 else if(x1p .gt. 5d0 * size1 .and. v1p .lt. 0d0) then
2598 t1 = - (x1p - 5d0 * size1) / v1p + tf
2603 if (t1 .ne. tlarge) then
2604 x2pp = x2p + v2p * (t1 - tf)
2605 x3pp = x3p + v3p * (t1 - tf)
2606 if (x2pp .le. - 5d0 * size2 .or. x2pp .ge. 5d0 * size2
2607 & .or. x3pp .le. - 5d0 * size3
2608 & .or. x3pp .ge. 5d0 * size3)
2612 if (x2p .lt. - 5d0 * size2 .and. v2p .gt. 0d0) then
2613 t2 = (- 5d0 * size2 - x2p) / v2p + tf
2614 else if(x2p .gt. 5d0 * size2 .and. v2p .lt. 0d0) then
2615 t2 = - (x2p - 5d0 * size2) / v2p + tf
2620 if (t2 .ne. tlarge) then
2621 x1pp = x1p + v1p * (t2 - tf)
2622 x3pp = x3p + v3p * (t2 - tf)
2623 if (x1pp .le. - 5d0 * size1 .or. x1pp .ge. 5d0 * size1
2624 & .or. x3pp .le. - 5d0 * size3 .or. x3pp .ge. 5d0 * size3)
2628 if (x3p .lt. - 5d0 * size3 .and. v3p .gt. 0d0) then
2629 t3 = (- 5d0 * size3 - x3p) / v3p + tf
2630 else if(x3p .gt. 5d0 * size3 .and. v3p .lt. 0d0) then
2631 t3 = - (x3p - 5d0 * size3) / v3p + tf
2636 if (t3 .ne. tlarge) then
2637 x1pp = x1p + v1p * (t3 - tf)
2638 x2pp = x2p + v2p * (t3 - tf)
2639 if (x1pp .le. - 5d0 * size1 .or. x1pp .ge. 5d0 * size1
2640 & .or. x2pp .le. - 5d0 * size2 .or. x2pp .ge. 5d0 * size2)
2644 tmin = min(t1, t2, t3)
2647 c after checking this is not an earlier collision comparing with
2648 c a collision with another particle, we need to set icsta=0
2649 c after checking whether there is also a particle collision
2650 c at the same time, we need to reset the second bit of icsta
2652 if (tmin .eq. t1) then
2653 if (v1p .gt. 0d0) then
2660 if (tmin .eq. t2) then
2661 if (v2p .gt. 0d0) then
2668 if (tmin .eq. t3) then
2669 if (v3p .gt. 0d0) then
2676 if (tmin .le. size) return
2680 c notice now x1q, x2q, x3q are coordinates at time t
2681 x1q = x1p + v1p * (t - tf)
2682 x2q = x2p + v2p * (t - tf)
2683 x3q = x3p + v3p * (t - tf)
2685 if (x1q .lt. - 5d0 * (size1 + v1 * (t - size)) .and.
2686 & v1p .gt. - 5d0 * v1) then
2687 t1 = (- 5d0 * (size1 - v1 * size) + v1p * tf - x1p) /
2688 & (v1p - (- 5d0) * v1)
2690 else if (x1q .gt. 5d0 * (size1 + v1 * (t-size)) .and.
2691 & v1p .lt. 5d0 * v1) then
2692 t1 = (5d0 * (size1 - v1 * size) + v1p * tf - x1p) /
2699 if (t1 .ne. tlarge) then
2700 x2pp = x2p + v2p * (t1 - tf)
2701 x3pp = x3p + v3p * (t1 - tf)
2702 if (x2pp .le. - 5d0 * (size2 + v2 * (t1 - size))
2703 & .or. x2pp .ge. 5d0 * (size2 + v2 * (t1 - size))
2704 & .or. x3pp .le. - 5d0 * (size3 + v3 * (t1 - size))
2705 & .or. x3pp .ge. 5d0 * (size3 + v3 * (t1 - size)))
2709 if (x2q .lt. - 5d0 * (size2 + v2 * (t - size)) .and.
2710 & v2p .gt. - 5d0 * v2) then
2711 t2 = (- 5d0 * (size2 - v2 * size) + v2p * tf - x2p) /
2712 & (v2p - (- 5d0) * v2)
2714 else if (x2q .gt. 5d0 * (size2 + v2 * (t - size)) .and.
2715 & v2p .lt. 5d0 * v2) then
2716 t2 = (5d0 * (size2 - v2 * size) + v2p * tf - x2p) /
2723 if (t2 .ne. tlarge) then
2724 x1pp = x1p + v1p * (t2 - tf)
2725 x3pp = x3p + v3p * (t2 - tf)
2726 if (x1pp .le. - 5d0 * (size1 + v1 * (t2 - size))
2727 & .or. x1pp .ge. 5d0 * (size1 + v1 * (t2 - size))
2728 & .or. x3pp .le. - 5d0 * (size3 + v3 * (t2 - size))
2729 & .or. x3pp .ge. 5d0 * (size3 + v3 * (t2 - size)))
2733 if (x3q .lt. - 5d0 * (size3 + v3 * (t - size)) .and.
2734 & v3p .gt. - 5d0 * v3) then
2735 t3 = (- 5d0 * (size3 - v3 * size) + v3p * tf - x3p) /
2736 & (v3p - (- 5d0) * v3)
2738 else if (x3q .gt. 5d0 * (size3 + v3 * (t - size)) .and.
2739 & v3p .lt. 5d0 * v3) then
2740 t3 = (5d0 * (size3 - v3 * size) + v3p * tf - x3p) /
2747 if (t3 .ne. tlarge) then
2748 x2pp = x2p + v2p * (t3 - tf)
2749 x1pp = x1p + v1p * (t3 - tf)
2750 if (x2pp .le. - 5d0 * (size2 + v2 * (t3 - size))
2751 & .or. x2pp .ge. 5d0 * (size2 + v2 * (t3 - size))
2752 & .or. x1pp .le. - 5d0 * (size1 + v1 * (t3 - size))
2753 & .or. x1pp .ge. 5d0 * (size1 + v1 * (t3 - size)))
2757 tmin = min(t1, t2, t3)
2760 c after checking this is not an earlier collision comparing with
2761 c a collision with another particle, we need to set icsta=0
2762 c after checking whether there is also a particle collision
2763 c at the same time, we need to reset the second bit of icsta
2765 if (tmin .eq. t1) then
2767 else if (tmin .eq. t2) then
2769 else if (tmin .eq. t3) then
2776 subroutine chkout(l, t, tmin, nc)
2777 c this subroutine is used to check the collisions with particles in
2778 c surface cells to see if we can get a smaller collision time than tmin
2779 c with particle nc, when the colliding particle is outside the cube
2783 implicit double precision (a-h, o-z)
2784 parameter (MAXPTN=400001)
2786 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
2787 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
2788 & xmass(MAXPTN), ityp(MAXPTN)
2795 call chkcel(l, m1, m2, m3, t, tmin, nc)
2800 if (i .eq. 1 .or. i .eq. 10 .or. j .eq. 1
2801 & .or. j .eq. 10 .or. k .eq. 1 .or. k .eq. 10)
2802 & call chkcel(l, i, j, k, t, tmin, nc)
2810 subroutine chkin1(l, i1, i2, i3, t, tmin, nc)
2811 c this subroutine is used to check collisions for particle inside
2813 c and update the afftected particles through chkcel
2815 implicit double precision (a-h, o-z)
2818 c itest is a flag to make sure the 111111 cell is checked only once
2821 do 1003 i = i1 - 1, i1 + 1
2822 do 1002 j = i2 - 1, i2 + 1
2823 do 1001 k = i3 - 1, i3 + 1
2824 if (i .ge. 1 .and. i .le. 10 .and. j .ge. 1 .and.
2825 & j .le. 10 .and. k .ge. 1 .and. k .le. 10) then
2826 call chkcel(l, i, j, k, t, tmin, nc)
2827 else if (itest .eq. 0) then
2831 call chkcel(l, m1, m2, m3, t, tmin, nc)
2841 subroutine chkin2(l, i1, i2, i3, t, tmin, nc)
2842 c this subroutine is used to check collisions for particle inside
2844 c and update the afftected particles through chkcel
2846 implicit double precision (a-h, o-z)
2849 c itest is a flag to make sure the 111111 cell is checked only once
2852 do 1003 i = i1 - 1, i1 + 1
2853 do 1002 j = i2 - 1, i2 + 1
2854 do 1001 k = i3 - 1, i3 + 1
2858 if (k .ge. 1 .and. k .le. 10) then
2859 if (i .eq. 0) ia = 10
2860 if (i .eq. 11) ia = 1
2861 if (j .eq. 0) ib = 10
2862 if (j .eq. 11) ib = 1
2863 call chkcel(l, ia, ib, ic, t, tmin, nc)
2872 subroutine chkin3(l, i1, i2, i3, t, tmin, nc)
2873 c this subroutine is used to check collisions for particle inside
2875 c and update the afftected particles through chkcel
2877 implicit double precision (a-h, o-z)
2880 c itest is a flag to make sure the 111111 cell is checked only once
2883 do 1003 i = i1 - 1, i1 + 1
2884 do 1002 j = i2 - 1, i2 + 1
2885 do 1001 k = i3 - 1, i3 + 1
2888 else if (i .eq. 11) then
2895 else if (j .eq. 11) then
2902 else if (k .eq. 11) then
2907 call chkcel(l, ia, ib, ic, t, tmin, nc)
2915 subroutine chkcel(il, i1, i2, i3, t, tmin, nc)
2916 c this program is used to check through all the particles
2917 c in the cell (i1,i2,i3) and see if we can get a particle collision
2918 c with time less than the original input tmin ( the collision time of
2920 c and update the affected particles
2922 implicit double precision (a-h, o-z)
2923 parameter (MAXPTN=400001)
2925 common /para5/ iconfg, iordsc
2928 & iscat, jscat, next(MAXPTN), last(MAXPTN),
2929 & ictype, icsta(MAXPTN),
2930 & nic(MAXPTN), icels(MAXPTN)
2932 common /ilist2/ icell, icel(10, 10, 10)
2934 common /ilist4/ ifmpt, ichkpt, indx(MAXPTN)
2938 if (iconfg .eq. 3 .or. iconfg .eq. 5) then
2942 c 10/24/02 get rid of argument usage mismatch in ud2():
2944 c if (ick .eq. 1) call ud2(j, il, t, tmin, nc)
2945 if (ick .eq. 1) call ud2(jud2, il, t, tmin, nc)
2950 if (i1 .eq. 11 .and. i2 .eq. 11 .and. i3 .eq. 11) then
2953 l = icel(i1, i2, i3)
2956 c if there is no particle
2961 c if there is only one particle
2964 if (ick .eq. 1) call ud2(l, il, t, tmin, nc)
2966 c if there are many particles
2969 c we don't worry about the other colliding particle because it's
2970 c set in last(), and will be checked in ud2
2973 if (ick .eq. 1) call ud2(l, il, t, tmin, nc)
2975 do 10 while(j .ne. l)
2977 if (ick .eq. 1) call ud2(j, il, t, tmin, nc)
2985 subroutine ck(l, ick)
2986 c this subroutine is used for chcell to check whether l should be
2987 c checked or not for updating tmin, nc
2990 c if ick=1, l should be checked, otherwise it should not be.
2992 implicit double precision (a-h, o-z)
2993 parameter (MAXPTN=400001)
2996 & iscat, jscat, next(MAXPTN), last(MAXPTN),
2997 & ictype, icsta(MAXPTN),
2998 & nic(MAXPTN), icels(MAXPTN)
3000 common /ilist4/ ifmpt, ichkpt, indx(MAXPTN)
3005 if (ictype .eq. 1) then
3006 if (l .eq. ifmpt) ick = 0
3007 else if (ictype .eq. 0 .or. ictype .eq. 3 .or.
3008 & ictype .eq. 4) then
3009 if (l .eq. iscat .or. l .eq. jscat) ick = 0
3011 if (l .eq. iscat .or. l .eq. jscat .or.
3012 & l .eq. ifmpt) ick = 0
3014 c notice il is either iscat or jscat, or ifmpt, we deal with them
3015 c seperately according to ictype
3020 subroutine dchout(l, ii, t)
3021 c this subroutine is used to check collisions of l with particles when
3022 c l is outside the cube and the collision just happened is a collision
3023 c including a collision with wall (hence we need to use dcheck to throw
3024 c away old collisions that are not in the new neighboring cells.
3028 implicit double precision (a-h, o-z)
3029 parameter (MAXPTN=400001)
3031 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
3032 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
3033 & xmass(MAXPTN), ityp(MAXPTN)
3035 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
3037 common /ilist3/ size1, size2, size3, v1, v2, v3, size
3039 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
3047 x1 = gx(l) + vx(l) * (t - tt)
3048 x2 = gy(l) + vy(l) * (t - tt)
3049 x3 = gz(l) + vz(l) * (t - tt)
3050 if (td .le. 0d0) then
3051 i1 = integ(x1 / size1) + 6
3052 i2 = integ(x2 / size2 ) + 6
3053 i3 = integ(x3 / size3 ) + 6
3054 if (integ(x1 / size1) .eq. x1 / size1 .and. vx(l) .lt. 0d0)
3056 if (integ(x2 / size2) .eq. x2 / size2 .and. vy(l) .lt. 0d0)
3058 if (integ(x3 / size3) .eq. x3 / size3 .and. vz(l) .lt. 0d0)
3061 i1 = integ(x1 / (size1 + v1 * td)) + 6
3062 i2 = integ(x2 / (size2 + v2 * td)) + 6
3063 i3 = integ(x3 / (size3 + v3 * td)) + 6
3064 c 10/24/02 (i) below should be (l):
3065 if (integ(x1 / (size1 + v1 * td)) .eq.
3066 & x1 / (size1 +v1 * td) .and.
3067 & vx(l) .lt. (i1 - 6) * v1) i1 = i1 - 1
3068 c & vx(i) .lt. (i1 - 6) * v1) i1 = i1 - 1
3069 if (integ(x2 / (size2 + v2 * td)) .eq.
3070 & x2 / (size2 + v2 * td) .and.
3071 & vy(l) .lt. (i2 - 6) * v2) i2 = i2 - 1
3072 c & vy(i) .lt. (i2 - 6) * v2) i2 = i2 - 1
3073 if (integ(x3 / (size3 + v3 * td)) .eq.
3074 & x3 / (size3 + v3 * td) .and.
3075 & vz(l) .lt. (i3 - 6) * v3) i3 = i3 - 1
3076 c & vz(i) .lt. (i3 - 6) * v3) i3 = i3 - 1
3081 do 1002 j = i2 - 1, i2 + 1
3082 do 1001 k = i3 - 1, i3 + 1
3083 if (j .ge. 1 .and. j .le. 10 .and. k .ge. 1 .and.
3085 call dchcel(l, i, j, k, t)
3093 do 1004 j = i2 - 1, i2 + 1
3094 do 1003 k = i3 - 1, i3 + 1
3095 if (j .ge. 1 .and. j .le. 10 .and. k .ge. 1 .and.
3097 call dchcel(l, i, j, k, t)
3105 do 1006 i = i1 - 1, i1 + 1
3106 do 1005 k = i3 - 1, i3 + 1
3107 if (i .ge. 1 .and. i .le. 10 .and. k .ge. 1 .and.
3109 call dchcel(l, i, j, k, t)
3117 do 1008 i = i1 - 1, i1 + 1
3118 do 1007 k = i3 - 1, i3 + 1
3119 if (i .ge. 1 .and. i .le. 10 .and. k .ge. 1 .and.
3121 call dchcel(l, i, j, k, t)
3129 do 1010 i = i1 - 1, i1 + 1
3130 do 1009 j = i2 - 1, i2 + 1
3131 if (i .ge. 1 .and. i .le. 10 .and. j .ge. 1 .and.
3133 call dchcel(l, i, j, k, t)
3141 do 1012 i = i1 - 1, i1 + 1
3142 do 1011 j = i2 - 1, i2 + 1
3143 if (i .ge. 1 .and. i .le. 10 .and. j .ge. 1 .and.
3145 call dchcel(l, i, j, k, t)
3154 subroutine dchin1(l, ii, i1, i2, i3, t)
3155 c this subroutine is used to check collisions for particle inside
3156 c the cube when the collision just happened is a collision including
3157 c collision with wall
3158 c and update the afftected particles through chkcel
3160 c input l,ii(specifying the direction of the wall collision),
3161 c i1,i2,i3, (specifying the position of the cell
3162 c we are going to check)
3165 implicit double precision (a-h, o-z)
3168 c itest is a flag to make sure the 111111 cell is checked only once
3172 if (i1 .eq. 1) goto 100
3174 if (i2 .ge. 2 .and. i2 .le. 9 .and. i3 .ge. 2 .and.
3179 call dchcel(l, i, j, k, t)
3184 do 1002 j = i2 - 1, i2 + 1
3185 do 1001 k = i3 - 1, i3 + 1
3186 if (j .ge. 1 .and. j .le. 10 .and. k .ge. 1 .and.
3188 & call dchcel(l, i, j, k, t)
3194 if (i1 .eq. 10) goto 100
3196 if (i2 .ge. 2 .and. i2 .le. 9 .and. i3 .ge. 2 .and.
3201 call dchcel(l, i, j, k, t)
3206 do 1004 j = i2 - 1, i2 + 1
3207 do 1003 k = i3 - 1, i3 + 1
3208 if (j .ge. 1 .and. j .le. 10 .and. k .ge. 1 .and.
3210 & call dchcel(l, i, j, k, t)
3216 if (i2 .eq. 1) goto 100
3218 if (i1 .ge. 2 .and. i1 .le. 9 .and. i3 .ge. 2 .and.
3223 call dchcel(l, i, j, k, t)
3228 do 1006 i = i1 - 1, i1 + 1
3229 do 1005 k = i3 - 1, i3 + 1
3230 if (i .ge. 1 .and. i .le. 10 .and. k .ge. 1 .and.
3232 & call dchcel(l, i, j, k, t)
3238 if (i2 .eq. 10) goto 100
3240 if (i1 .ge. 2 .and. i1 .le. 9 .and. i3 .ge. 2 .and.
3245 call dchcel(l, i, j, k, t)
3250 do 1008 i = i1 - 1, i1 + 1
3251 do 1007 k = i3 - 1, i3 + 1
3252 if (i .ge. 1 .and. i .le. 10 .and. k .ge. 1 .and.
3254 & call dchcel(l, i, j, k, t)
3260 if (i3 .eq. 1) goto 100
3262 if (i1 .ge. 2 .and. i1 .le. 9 .and. i2 .ge. 2 .and.
3267 call dchcel(l, i, j, k, t)
3272 do 1010 i = i1 - 1, i1 + 1
3273 do 1009 j = i2 - 1, i2 + 1
3274 if (i .ge. 1 .and. i .le. 10 .and. j .ge. 1 .and.
3276 & call dchcel(l, i, j, k, t)
3282 if (i3 .eq. 10) goto 100
3284 if (i1 .ge. 2 .and. i1 .le. 9 .and. i2 .ge. 2 .and.
3289 call dchcel(l, i, j, k, t)
3294 do 1012 i = i1 - 1, i1 + 1
3295 do 1011 j = i2 - 1, i2 + 1
3296 if (i .ge. 1 .and. i .le. 10 .and. j .ge. 1 .and.
3298 & call dchcel(l, i, j, k, t)
3308 subroutine dchin2(l, ii, i1, i2, i3, t)
3309 c this subroutine is used to check collisions for particle inside
3310 c the cube when the collision just happened is a collision including
3311 c collision with wall
3312 c and update the afftected particles through chkcel
3314 c input l,ii(specifying the direction of the wall collision),
3315 c i1,i2,i3, (specifying the position of the cell
3316 c we are going to check)
3319 implicit double precision (a-h, o-z)
3324 if (i .le. 0) i = i + 10
3326 do 1002 j = i2 - 1, i2 + 1
3327 do 1001 k = i3 - 1, i3 + 1
3330 if (j .eq. 0) ib = 10
3331 if (j .eq. 11) ib = 1
3332 if (k .ge. 1 .and. k .le. 10) then
3333 call dchcel(l, ia, ib, ic, t)
3341 if (i .ge. 11) i = i - 10
3343 do 1004 j = i2 - 1, i2 + 1
3344 do 1003 k = i3 - 1, i3 + 1
3347 if (j .eq. 0) ib = 10
3348 if (j .eq. 11) ib = 1
3349 if (k .ge. 1 .and. k .le. 10) then
3350 call dchcel(l, ia, ib, ic, t)
3358 if (j .le. 0) j = j + 10
3360 do 1006 i = i1 - 1, i1 + 1
3361 do 1005 k = i3 - 1, i3 + 1
3364 if (i .eq. 0) ia = 10
3365 if (i .eq. 11) ia = 1
3366 if (k .ge. 1 .and. k .le. 10) then
3367 call dchcel(l, ia, ib, ic, t)
3375 if (j .ge. 11) j = j - 10
3377 do 1008 i = i1 - 1, i1 + 1
3378 do 1007 k = i3 - 1, i3 + 1
3381 if (i .eq. 0) ia = 10
3382 if (i .eq. 11) ia = 1
3383 if (k .ge. 1 .and. k .le. 10) then
3384 call dchcel(l, ia, ib, ic, t)
3391 if (i3 .eq. 2) goto 100
3394 do 1010 i = i1 - 1, i1 + 1
3395 do 1009 j = i2 - 1, i2 + 1
3398 if (i .eq. 0) ia = 10
3399 if (i .eq. 11) ia = 1
3400 if (j .eq. 0) ib = 10
3401 if (j .eq. 11) ib = 1
3402 call dchcel(l, ia, ib, ic, t)
3408 if (i3 .eq. 9) goto 100
3411 do 1012 i = i1 - 1, i1 + 1
3412 do 1011 j = i2 - 1, i2 + 1
3415 if (i .eq. 0) ia = 10
3416 if (i .eq. 11) ia = 1
3417 if (j .eq. 0) ib = 10
3418 if (j .eq. 11) ib = 1
3419 call dchcel(l, ia, ib, ic, t)
3429 subroutine dchin3(l, ii, i1, i2, i3, t)
3430 c this subroutine is used to check collisions for particle inside
3431 c the cube when the collision just happened is a collision including
3432 c collision with wall
3433 c and update the afftected particles through chkcel
3435 c input l,ii(specifying the direction of the wall collision),
3436 c i1,i2,i3, (specifying the position of the cell
3437 c we are going to check)
3440 implicit double precision (a-h, o-z)
3445 if (i .le. 0) i = i + 10
3447 do 1002 j = i2 - 1, i2 + 1
3448 do 1001 k = i3 - 1, i3 + 1
3451 if (j .eq. 0) ib = 10
3452 if (j .eq. 11) ib = 1
3453 if (k .eq. 0) ic = 10
3454 if (k .eq. 11) ic = 1
3455 call dchcel(l, ia, ib, ic, t)
3462 if (i .ge. 11) i = i - 10
3464 do 1004 j = i2 - 1, i2 + 1
3465 do 1003 k = i3 - 1, i3 + 1
3468 if (j .eq. 0) ib = 10
3469 if (j .eq. 11) ib = 1
3470 if (k .eq. 0) ic = 10
3471 if (k .eq. 11) ic = 1
3472 call dchcel(l, ia, ib, ic, t)
3479 if (j .le. 0) j = j + 10
3481 do 1006 i = i1 - 1, i1 + 1
3482 do 1005 k = i3 - 1, i3 + 1
3485 if (i .eq. 0) ia = 10
3486 if (i .eq. 11) ia = 1
3487 if (k .eq. 0) ic = 10
3488 if (k .eq. 11) ic = 1
3489 call dchcel(l, ia, ib, ic, t)
3496 if (j .ge. 11) j = j - 10
3498 do 1008 i = i1 - 1, i1 + 1
3499 do 1007 k = i3 - 1, i3 + 1
3502 if (i .eq. 0) ia = 10
3503 if (i .eq. 11) ia = 1
3504 if (k .eq. 0) ic = 10
3505 if (k .eq. 11) ic = 1
3506 call dchcel(l, ia, ib, ic, t)
3513 if (k .le. 0) k = k + 10
3515 do 1010 i = i1 - 1, i1 + 1
3516 do 1009 j = i2 - 1, i2 + 1
3519 if (i .eq. 0) ia = 10
3520 if (i .eq. 11) ia = 1
3521 if (j .eq. 0) ib = 10
3522 if (j .eq. 11) ib = 1
3523 call dchcel(l, ia, ib, ic, t)
3530 if (k .ge. 11) k = k - 10
3532 do 1012 i = i1 - 1, i1 + 1
3533 do 1011 j = i2 - 1, i2 + 1
3536 if (i .eq. 0) ia = 10
3537 if (i .eq. 11) ia = 1
3538 if (j .eq. 0) ib = 10
3539 if (j .eq. 11) ib = 1
3540 call dchcel(l, ia, ib, ic, t)
3548 subroutine dchcel(l, i, j, k, t)
3549 c this subroutine is used to recalculate next collision time for
3550 c particles in the cell i,j,k if the next collision partener is l
3552 implicit double precision (a-h, o-z)
3553 parameter (MAXPTN=400001)
3556 & iscat, jscat, next(MAXPTN), last(MAXPTN),
3557 & ictype, icsta(MAXPTN),
3558 & nic(MAXPTN), icels(MAXPTN)
3560 common /ilist2/ icell, icel(10, 10, 10)
3562 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
3566 if (i .eq. 11 .or. j .eq. 11 .or. k .eq. 11) then
3567 if ( .not. (i .eq. 11 .and. j .eq. 11 .and.
3568 & k .eq. 11)) stop 'cerr'
3574 if (m .eq. 0) return
3575 if (next(m) .eq. l) then
3578 call reor(t, tm, m, last0)
3581 if (n .eq. 0) return
3582 do 10 while(n .ne. m)
3583 if (next(n) .eq. l) then
3586 call reor(t, tm, n, last0)
3594 subroutine fixtim(l, t, tmin1, tmin, nc)
3595 c this subroutine is used to compare the collision time with wall tmin1
3596 c and new collision time with particles for particle l
3597 c when used in ulist, input nc may be 0, which indicates no particle
3598 c collisions happen before wall collision, of course, then tmin=tmin1
3600 implicit double precision (a-h, o-z)
3601 parameter (MAXPTN=400001)
3604 & iscat, jscat, next(MAXPTN), last(MAXPTN),
3605 & ictype, icsta(MAXPTN),
3606 & nic(MAXPTN), icels(MAXPTN)
3608 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
3614 if (tmin .lt. tmin1) then
3616 if (ct(l) .lt. tmin1) then
3619 icsta(l) = icsta(l) + 10
3622 else if (tmin .eq. tmin1) then
3627 icsta(l) = icsta(l) + 10
3638 subroutine ud2(i, j, t, tmin, nc)
3639 c this subroutine is used to update next(i), ct(i), ot(i),
3640 c and get tmin, nc for j
3642 implicit double precision (a-h, o-z)
3643 parameter (MAXPTN=400001)
3645 common /para5/ iconfg, iordsc
3647 common /aurec1/ jxa, jya, jza
3649 common /aurec2/ dgxa(MAXPTN), dgya(MAXPTN), dgza(MAXPTN)
3652 & iscat, jscat, next(MAXPTN), last(MAXPTN),
3653 & ictype, icsta(MAXPTN),
3654 & nic(MAXPTN), icels(MAXPTN)
3656 common /ilist3/ size1, size2, size3, v1, v2, v3, size
3658 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
3664 call isco(i, j, allok, tm, t1, t2)
3667 c tm eq tmin, change nc to make sure fixtime get the collision with both
3670 if (tm .lt. tmin) then
3674 if (iconfg .eq. 3 .or. iconfg .eq. 5) then
3675 dgxa(j) = jxa * 10d0 * size1
3676 dgya(j) = jya * 10d0 * size2
3677 if (iconfg .eq. 5) then
3678 dgza(j) = jza * 10d0 * size3
3683 if (tm .le. ot(i)) then
3687 i2 = (icels0 - i1 * 10000) / 100
3688 i3 = icels0 - i1 * 10000 - i2 * 100
3689 call wallc(i, i1, i2, i3, t, tmin1)
3690 call fixtim(i, t, tmin1, tm, j)
3691 if (iconfg .eq. 3 .or. iconfg .eq. 5) then
3692 dgxa(i) = - jxa * 10d0 * size1
3693 dgya(i) = - jya * 10d0 * size2
3694 if (iconfg .eq. 5) then
3695 dgza(i) = - jza * 10d0 * size3
3700 if (tm .gt. ot(i) .and. next(i) .eq. j) then
3702 call reor(t, tm, i, j)
3705 else if (next(i) .eq. j) then
3709 call reor(t, tm, i, j)
3716 subroutine isco(i, j, allok, tm, t1, t2)
3718 implicit double precision (a-h, o-z)
3720 common /para5/ iconfg, iordsc
3726 iorder = iordsc / 10
3727 if (iconfg .eq. 1) then
3728 if (iorder .eq. 1) then
3729 call isco1(i, j, allok, tm, t1, t2)
3730 else if (iorder .eq. 2) then
3731 call isco2(i, j, allok, tm, t1, t2)
3732 else if (iorder .eq. 3) then
3733 call isco3(i, j, allok, tm, t1, t2)
3735 else if (iconfg .eq. 2 .or. iconfg .eq. 4) then
3736 if (iorder .eq. 1) then
3737 call isco4(i, j, allok, tm, t1, t2)
3738 else if (iorder .eq. 2) then
3739 call isco5(i, j, allok, tm, t1, t2)
3740 else if (iorder .eq. 3) then
3741 call isco6(i, j, allok, tm, t1, t2)
3743 else if (iconfg .eq. 3) then
3744 if (iorder .eq. 1) then
3745 call isco7(i, j, allok, tm, t1, t2)
3746 else if (iorder .eq. 2) then
3747 call isco8(i, j, allok, tm, t1, t2)
3748 else if (iorder .eq. 3) then
3749 call isco9(i, j, allok, tm, t1, t2)
3751 else if (iconfg .eq. 5) then
3752 if (iorder .eq. 1) then
3753 call isco10(i, j, allok, tm, t1, t2)
3754 else if (iorder .eq. 2) then
3755 call isco11(i, j, allok, tm, t1, t2)
3756 else if (iorder .eq. 3) then
3757 call isco12(i, j, allok, tm, t1, t2)
3764 subroutine isco1(i, j, allok, tm, t1, t2)
3765 c this subroutine is used to decide whether there is a collision between
3766 c particle i and j, if there is one allok=1, and tm gives the
3767 c collision time, t1 the collision time for i,
3768 c t2 the collision time for j
3770 implicit double precision (a-h, o-z)
3771 parameter (MAXPTN=400001)
3773 common /para2/ xmp, xmu, alpha, rscut2, cutof2
3775 common /para5/ iconfg, iordsc
3777 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
3778 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
3779 & xmass(MAXPTN), ityp(MAXPTN)
3781 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
3784 & iscat, jscat, next(MAXPTN), last(MAXPTN),
3785 & ictype, icsta(MAXPTN),
3786 & nic(MAXPTN), icels(MAXPTN)
3788 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
3794 c preventing consecutive collisions
3795 allok = last(i) .ne. j .or. last(j) .ne. i
3797 c set up numbers for later calculations
3801 p4 = ft(i2) - ft(i1)
3802 p1 = gx(i2) - gx(i1)
3803 p2 = gy(i2) - gy(i1)
3804 p3 = gz(i2) - gz(i1)
3816 a = p4 * q4 - p1 * q1 - p2 * q2 - p3 * q3
3817 b = p4 * r4 - p1 * r1 - p2 * r2 - p3 * r3
3818 c = q4 * q4 - q1 * q1 - q2 * q2 - q3 * q3
3819 d = r4 * r4 - r1 * r1 - r2 * r2 - r3 * r3
3820 ee = q4 * r4 - q1 * r1 - q2 * r2 - q3 * r3
3821 f = p4 * p4 - p1 * p1 - p2 * p2 - p3 * p3
3823 c make sure particle 2 formed early
3825 if (h .gt. 0d0) then
3838 c check the approaching criteria
3843 allok = allok .and. vp .lt. 0d0
3847 c check the closest approach distance criteria
3850 dm2 = - f - (a ** 2 * d + b ** 2 * c - 2d0 * a * b * ee) /
3853 allok = allok .and. dm2 .lt. cutof2
3857 c check the time criteria
3860 tc1 = ft(i1) - e(i1) * (a * d - b * ee) / (ee ** 2 - c * d)
3861 tc2 = ft(i2) + e(i2) * (b * c - a * ee) / (ee ** 2 - c * d)
3862 tm = 0.5d0 * (tc1 + tc2)
3864 allok = allok .and. tm .gt. ft(i) .and. tm .gt. ft(j)
3871 rts2 = (q4 + r4) ** 2 - (q1 + r1) ** 2
3872 & - (q2 + r2) ** 2 - (q3 + r3) ** 2
3874 allok = allok .and. rts2 .gt. rscut2
3877 if (.not. allok) then
3881 else if (h .gt. 0d0) then
3892 subroutine isco2(i, j, allok, tm, t1, t2)
3893 c this subroutine is used to decide whether there is a collision between
3894 c particle i and j, if there is one allok=1, and tm gives the
3895 c collision time, t1 the collision time for i,
3896 c t2 the collision time for j
3898 implicit double precision (a-h, o-z)
3899 parameter (MAXPTN=400001)
3901 common /para2/ xmp, xmu, alpha, rscut2, cutof2
3903 common /para5/ iconfg, iordsc
3905 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
3906 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
3907 & xmass(MAXPTN), ityp(MAXPTN)
3909 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
3912 & iscat, jscat, next(MAXPTN), last(MAXPTN),
3913 & ictype, icsta(MAXPTN),
3914 & nic(MAXPTN), icels(MAXPTN)
3916 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
3922 c preventing consecutive collisions
3923 allok = last(i) .ne. j .or. last(j) .ne. i
3925 c set up numbers for later calculations
3929 p4 = ft(i2) - ft(i1)
3930 p1 = gx(i2) - gx(i1)
3931 p2 = gy(i2) - gy(i1)
3932 p3 = gz(i2) - gz(i1)
3944 a = p4 * q4 - p1 * q1 - p2 * q2 - p3 * q3
3945 b = p4 * r4 - p1 * r1 - p2 * r2 - p3 * r3
3946 c = q4 * q4 - q1 * q1 - q2 * q2 - q3 * q3
3947 d = r4 * r4 - r1 * r1 - r2 * r2 - r3 * r3
3948 ee = q4 * r4 - q1 * r1 - q2 * r2 - q3 * r3
3949 f = p4 * p4 - p1 * p1 - p2 * p2 - p3 * p3
3951 c make sure particle 2 formed early
3953 if (h .gt. 0d0) then
3966 c check the approaching criteria
3971 allok = allok .and. vp .lt. 0d0
3975 c check the closest approach distance criteria
3978 dm2 = - f - (a ** 2 * d + b ** 2 * c - 2d0 * a * b * ee) /
3981 allok = allok .and. dm2 .lt. cutof2
3985 c check the time criteria
3988 tc1 = ft(i1) - e(i1) * (a * d - b * ee)/(ee ** 2 - c * d)
3989 tc2 = ft(i2) + e(i2) * (b * c - a * ee)/(ee ** 2 - c * d)
3990 if (iordsc .eq. 20) then
3992 else if (iordsc .eq. 21) then
3993 tm = 0.5d0 * (tc1 + tc2)
3998 allok = allok .and. tm .gt. ft(i) .and. tm .gt. ft(j)
4005 rts2 = (q4 + r4) ** 2 - (q1 + r1) ** 2
4006 & - (q2 + r2) ** 2 - (q3 + r3) ** 2
4008 allok = allok .and. rts2 .gt. rscut2
4011 if (.not. allok) then
4015 else if (h .gt. 0d0) then
4026 subroutine isco3(i, j, allok, tm, t1, t2)
4027 c this subroutine is used to decide whether there is a collision between
4028 c particle i and j, if there is one allok=1, and tm gives the
4029 c collision time, t1 the collision time for i,
4030 c t2 the collision time for j
4032 implicit double precision (a-h, o-z)
4033 parameter (MAXPTN=400001)
4035 common /para2/ xmp, xmu, alpha, rscut2, cutof2
4037 common /para5/ iconfg, iordsc
4039 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
4040 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
4041 & xmass(MAXPTN), ityp(MAXPTN)
4043 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
4046 & iscat, jscat, next(MAXPTN), last(MAXPTN),
4047 & ictype, icsta(MAXPTN),
4048 & nic(MAXPTN), icels(MAXPTN)
4050 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
4056 c preventing consecutive collisions
4057 allok = last(i) .ne. j .or. last(j) .ne. i
4059 if (ft(i) .ge. ft(j)) then
4082 dx = gx(i2) - gx(i1) - vx1 * dt
4083 dy = gy(i2) - gy(i1) - vy1 * dt
4084 dz = gz(i2) - gz(i1) - vz1 * dt
4086 vp = dvx * dx + dvy * dy + dvz * dz
4088 allok = allok .and. vp .lt. 0d0
4094 v2= dvx * dvx + dvy * dvy + dvz * dvz
4096 if (v2 .eq. 0d0) then
4102 c note now tm is the absolute time
4104 allok = allok .and. tm .gt. t1 .and. tm .gt. t2
4114 dm2 = - v2 * tm ** 2 + dgx * dgx + dgy * dgy + dgz * dgz
4116 allok = allok .and. dm2 .lt. cutof2
4131 rts2 = (e1 + e2) ** 2 - (px1 + px2) ** 2
4132 & - (py1 + py2) ** 2 - (pz1 + pz2) ** 2
4134 allok = allok .and. rts2 .gt. rscut2
4137 if (.not. allok) then
4149 subroutine isco4(i, j, allok, tm, t1, t2)
4150 c this subroutine is used to decide whether there is a collision between
4151 c particle i and j, if there is one allok=1, and tm gives the
4152 c collision time, t1 the collision time for i,
4153 c t2 the collision time for j
4155 implicit double precision (a-h, o-z)
4156 parameter (MAXPTN=400001)
4158 common /para2/ xmp, xmu, alpha, rscut2, cutof2
4160 common /para5/ iconfg, iordsc
4162 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
4163 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
4164 & xmass(MAXPTN), ityp(MAXPTN)
4166 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
4169 & iscat, jscat, next(MAXPTN), last(MAXPTN),
4170 & ictype, icsta(MAXPTN),
4171 & nic(MAXPTN), icels(MAXPTN)
4173 common /ilist3/ size1, size2, size3, v1, v2, v3, size
4175 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
4181 c preventing consecutive collisions
4182 allok = last(i) .ne. j .or. last(j) .ne. i
4184 c set up numbers for later calculations
4187 ii1 = icels1 / 10000
4188 jj1 = (icels1 - ii1 * 10000) / 100
4189 kk1 = icels1 - ii1 * 10000 - jj1 * 100
4191 ii2 = icels2 / 10000
4192 jj2 = (icels2 - ii2 * 10000) / 100
4193 kk2 = icels2 - ii2 * 10000 - jj2 * 100
4198 p4 = ft(i2) - ft(i1)
4199 p1 = gx(i2) - gx(i1)
4200 p2 = gy(i2) - gy(i1)
4201 p3 = gz(i2) - gz(i1)
4203 if (ii1 - ii2 .gt. 5) then
4204 p1 = p1 + 10d0 * size1
4205 else if (ii1 - ii2 .lt. -5) then
4206 p1 = p1 - 10d0 * size1
4208 if (jj1 - jj2 .gt. 5) then
4209 p2 = p2 + 10d0 * size2
4210 else if (jj1 - jj2 .lt. -5) then
4211 p2 = p2 - 10d0 * size2
4213 if (kk1 - kk2 .gt. 5) then
4214 p3 = p3 + 10d0 * size3
4215 else if (kk1 - kk2 .lt. -5) then
4216 p3 = p3 - 10d0 * size3
4229 a = p4 * q4 - p1 * q1 - p2 * q2 - p3 * q3
4230 b = p4 * r4 - p1 * r1 - p2 * r2 - p3 * r3
4231 c = q4 * q4 - q1 * q1 - q2 * q2 - q3 * q3
4232 d = r4 * r4 - r1 * r1 - r2 * r2 - r3 * r3
4233 ee = q4 * r4 - q1 * r1 - q2 * r2 - q3 * r3
4234 f = p4 * p4 - p1 * p1 - p2 * p2 - p3 * p3
4236 c make sure particle 2 formed early
4238 if (h .gt. 0d0) then
4251 c check the approaching criteria
4256 allok = allok .and. vp .lt. 0d0
4260 c check the closest approach distance criteria
4263 dm2 = - f - (a ** 2 * d + b ** 2 * c - 2d0 * a * b * ee) /
4266 allok = allok .and. dm2 .lt. cutof2
4270 c check the time criteria
4273 tc1 = ft(i1) - e(i1) * (a * d - b * ee) / (ee ** 2 - c * d)
4274 tc2 = ft(i2) + e(i2) * (b * c - a * ee) / (ee ** 2 - c * d)
4275 tm = 0.5d0 * (tc1 + tc2)
4277 allok = allok .and. tm .gt. ft(i) .and. tm .gt. ft(j)
4284 rts2 = (q4 + r4) ** 2 - (q1 + r1) ** 2
4285 & - (q2 + r2) ** 2 - (q3 + r3) ** 2
4287 allok = allok .and. rts2 .gt. rscut2
4290 if (.not. allok) then
4294 else if (h .gt. 0d0) then
4305 subroutine isco5(i, j, allok, tm, t1, t2)
4306 c this subroutine is used to decide whether there is a collision between
4307 c particle i and j, if there is one allok=1, and tm gives the
4308 c collision time, t1 the collision time for i,
4309 c t2 the collision time for j
4311 implicit double precision (a-h, o-z)
4312 parameter (MAXPTN=400001)
4314 common /para2/ xmp, xmu, alpha, rscut2, cutof2
4316 common /para5/ iconfg, iordsc
4318 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
4319 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
4320 & xmass(MAXPTN), ityp(MAXPTN)
4322 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
4325 & iscat, jscat, next(MAXPTN), last(MAXPTN),
4326 & ictype, icsta(MAXPTN),
4327 & nic(MAXPTN), icels(MAXPTN)
4329 common /ilist3/ size1, size2, size3, v1, v2, v3, size
4331 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
4337 c preventing consecutive collisions
4338 allok = last(i) .ne. j .or. last(j) .ne. i
4340 c set up numbers for later calculations
4343 ii1 = icels1 / 10000
4344 jj1 = (icels1 - ii1 * 10000) / 100
4345 kk1 = icels1 - ii1 * 10000 - jj1 * 100
4347 ii2 = icels2 / 10000
4348 jj2 = (icels2 - ii2 * 10000) / 100
4349 kk2 = icels2 - ii2 * 10000 - jj2 * 100
4354 p4 = ft(i2) - ft(i1)
4355 p1 = gx(i2) - gx(i1)
4356 p2 = gy(i2) - gy(i1)
4357 p3 = gz(i2) - gz(i1)
4359 if (ii1 - ii2 .gt. 5) then
4360 p1 = p1 + 10d0 * size1
4361 else if (ii1 - ii2 .lt. -5) then
4362 p1 = p1 - 10d0 * size1
4364 if (jj1 - jj2 .gt. 5) then
4365 p2 = p2 + 10d0 * size2
4366 else if (jj1 - jj2 .lt. -5) then
4367 p2 = p2 - 10d0 * size2
4369 if (kk1 - kk2 .gt. 5) then
4370 p3 = p3 + 10d0 * size3
4371 else if (kk1 - kk2 .lt. -5) then
4372 p3 = p3 - 10d0 * size3
4385 a = p4 * q4 - p1 * q1 - p2 * q2 - p3 * q3
4386 b = p4 * r4 - p1 * r1 - p2 * r2 - p3 * r3
4387 c = q4 * q4 - q1 * q1 - q2 * q2 - q3 * q3
4388 d = r4 * r4 - r1 * r1 - r2 * r2 - r3 * r3
4389 ee = q4 * r4 - q1 * r1 - q2 * r2 - q3 * r3
4390 f = p4 * p4 - p1 * p1 - p2 * p2 - p3 * p3
4392 c make sure particle 2 formed early
4394 if (h .gt. 0d0) then
4407 c check the approaching criteria
4412 allok = allok .and. vp .lt. 0d0
4416 c check the closest approach distance criteria
4419 dm2 = - f - (a ** 2 * d + b ** 2 * c - 2d0 * a * b * ee) /
4422 allok = allok .and. dm2 .lt. cutof2
4426 c check the time criteria
4429 tc1 = ft(i1) - e(i1) * (a * d - b * ee) / (ee ** 2 - c * d)
4430 tc2 = ft(i2) + e(i2) * (b * c - a * ee) / (ee ** 2 - c * d)
4431 if (iordsc .eq. 20) then
4433 else if (iordsc .eq. 21) then
4434 tm = 0.5d0 * (tc1 + tc2)
4439 allok = allok .and. tm .gt. ft(i) .and. tm .gt. ft(j)
4446 rts2 = (q4 + r4) ** 2 - (q1 + r1) ** 2
4447 & - (q2 + r2) ** 2 - (q3 + r3) ** 2
4449 allok = allok .and. rts2 .gt. rscut2
4452 if (.not. allok) then
4456 else if (h .gt. 0d0) then
4467 subroutine isco6(i, j, allok, tm, t1, t2)
4468 c this subroutine is used to decide whether there is a collision between
4469 c particle i and j, if there is one allok=1, and tm gives the
4470 c collision time, t1 the collision time for i,
4471 c t2 the collision time for j
4473 implicit double precision (a-h, o-z)
4474 parameter (MAXPTN=400001)
4476 common /para2/ xmp, xmu, alpha, rscut2, cutof2
4478 common /para5/ iconfg, iordsc
4480 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
4481 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
4482 & xmass(MAXPTN), ityp(MAXPTN)
4484 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
4487 & iscat, jscat, next(MAXPTN), last(MAXPTN),
4488 & ictype, icsta(MAXPTN),
4489 & nic(MAXPTN), icels(MAXPTN)
4491 common /ilist3/ size1, size2, size3, v1, v2, v3, size
4493 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
4499 c preventing consecutive collisions
4500 allok = last(i) .ne. j .or. last(j) .ne. i
4502 if (ft(i) .ge. ft(j)) then
4511 ii1 = icels1 / 10000
4512 jj1 = (icels1 - ii1 * 10000) / 100
4513 kk1 = icels1 - ii1 * 10000 - jj1 * 100
4515 ii2 = icels2 / 10000
4516 jj2 = (icels2 - ii2 * 10000) / 100
4517 kk2 = icels2 - ii2 * 10000 - jj2 * 100
4534 dx = gx(i2) - gx(i1) - vx1 * dt
4535 dy = gy(i2) - gy(i1) - vy1 * dt
4536 dz = gz(i2) - gz(i1) - vz1 * dt
4538 if (ii1 - ii2 .gt. 5) then
4539 dx = dx + 10d0 * size1
4540 else if (ii1 - ii2 .lt. - 5) then
4541 dx = dx - 10d0 * size1
4544 if (jj1 - jj2 .gt. 5) then
4545 dy = dy + 10d0 * size2
4546 else if (jj1 - jj2 .lt. - 5) then
4547 dy = dy - 10d0 * size2
4550 if (kk1 - kk2 .gt. 5) then
4551 dz = dz + 10d0 * size3
4552 else if (kk1 - kk2 .lt. -5) then
4553 dz = dz - 10d0 * size3
4556 vp = dvx * dx + dvy * dy + dvz * dz
4558 allok = allok .and. vp .lt. 0d0
4564 v2p = dvx * dvx + dvy * dvy + dvz * dvz
4566 if (v2p .eq. 0d0) then
4572 c note now tm is the absolute time
4574 allok = allok .and. tm .gt. t1 .and. tm .gt. t2
4584 dm2 = - v2p * tm ** 2 + dgx * dgx + dgy * dgy + dgz * dgz
4586 allok = allok .and. dm2 .lt. cutof2
4601 rts2 = (e1 + e2) ** 2 - (px1 + px2) ** 2
4602 & - (py1 + py2) ** 2 - (pz1 + pz2) ** 2
4604 allok = allok .and. rts2 .gt. rscut2
4607 if (.not. allok) then
4619 subroutine isco7(i, j, allok, tm, t1, t2)
4620 c this subroutine is used to decide whether there is a collision between
4621 c particle i and j, if there is one allok=1, and tm gives the
4622 c collision time, t1 the collision time for i,
4623 c t2 the collision time for j
4625 implicit double precision (a-h, o-z)
4626 parameter (MAXPTN=400001)
4628 common /para2/ xmp, xmu, alpha, rscut2, cutof2
4630 common /para5/ iconfg, iordsc
4632 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
4633 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
4634 & xmass(MAXPTN), ityp(MAXPTN)
4636 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
4638 common /aurec1/ jxa, jya, jza
4640 common /aurec2/ dgxa(MAXPTN), dgya(MAXPTN), dgza(MAXPTN)
4643 & iscat, jscat, next(MAXPTN), last(MAXPTN),
4644 & ictype, icsta(MAXPTN),
4645 & nic(MAXPTN), icels(MAXPTN)
4647 common /ilist3/ size1, size2, size3, v1, v2, v3, size
4649 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
4653 logical allok, allokp
4655 c preventing consecutive collisions
4656 allok = last(i) .ne. j .or. last(j) .ne. i
4658 c set up numbers for later calculations
4676 p1 = p1 + ii * 10d0 * size1
4677 p2 = p2 + jj * 10d0 * size2
4689 a = p4 * q4 - p1 * q1 - p2 * q2 - p3 * q3
4690 b = p4 * r4 - p1 * r1 - p2 * r2 - p3 * r3
4691 c = q4 * q4 - q1 * q1 - q2 * q2 - q3 * q3
4692 d = r4 * r4 - r1 * r1 - r2 * r2 - r3 * r3
4693 ee = q4 * r4 - q1 * r1 - q2 * r2 - q3 * r3
4694 f = p4 * p4 - p1 * p1 - p2 * p2 - p3 * p3
4696 c make sure particle 2 formed early
4698 if (h .gt. 0d0) then
4709 c check the approaching criteria
4712 allokp = allokp .and. vp .lt. 0d0
4715 c check the closest approach distance criteria
4717 dm2 = - f - (a ** 2 * d + b ** 2 * c - 2d0 * a * b * ee) /
4719 allokp = allokp .and. dm2 .lt. cutof2
4722 c check the time criteria
4724 tc1 = ft(i1) - e(i1) * (a * d - b * ee) / (ee ** 2 - c * d)
4725 tc2 = ft(i2) + e(i2) * (b * c - a * ee) / (ee ** 2 - c * d)
4726 tmp = 0.5d0 * (tc1 + tc2)
4727 allokp = allokp .and. tmp .gt. ft(i) .and. tmp .gt. ft(j)
4730 if (allokp .and. tmp .lt. tm) then
4734 cd dgxa(j) = ii * 10d0 * size1
4735 cd dgya(j) = jj * 10d0 * size2
4736 cd dgxa(i) = - dgxa(j)
4737 cd dgya(i) = - dgya(j)
4743 if (tm .eq. tlarge) then
4762 rts2 = (q4 + r4) ** 2 - (q1 + r1) ** 2
4763 & - (q2 + r2) ** 2 - (q3 + r3) ** 2
4765 allok = allok .and. rts2 .gt. rscut2
4768 if (.not. allok) then
4772 else if (h .gt. 0d0) then
4783 subroutine isco8(i, j, allok, tm, t1, t2)
4784 c this subroutine is used to decide whether there is a collision between
4785 c particle i and j, if there is one allok=1, and tm gives the
4786 c collision time, t1 the collision time for i,
4787 c t2 the collision time for j
4789 implicit double precision (a-h, o-z)
4790 parameter (MAXPTN=400001)
4792 common /para2/ xmp, xmu, alpha, rscut2, cutof2
4794 common /para5/ iconfg, iordsc
4796 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
4797 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
4798 & xmass(MAXPTN), ityp(MAXPTN)
4800 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
4802 common /aurec1/ jxa, jya, jza
4804 common /aurec2/ dgxa(MAXPTN), dgya(MAXPTN), dgza(MAXPTN)
4807 & iscat, jscat, next(MAXPTN), last(MAXPTN),
4808 & ictype, icsta(MAXPTN),
4809 & nic(MAXPTN), icels(MAXPTN)
4811 common /ilist3/ size1, size2, size3, v1, v2, v3, size
4813 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
4817 logical allok, allokp
4819 c preventing consecutive collisions
4820 allok = last(i) .ne. j .or. last(j) .ne. i
4822 c set up numbers for later calculations
4840 p1 = p1 + ii * 10d0 * size1
4841 p2 = p2 + jj * 10d0 * size2
4853 a = p4 * q4 - p1 * q1 - p2 * q2 - p3 * q3
4854 b = p4 * r4 - p1 * r1 - p2 * r2 - p3 * r3
4855 c = q4 * q4 - q1 * q1 - q2 * q2 - q3 * q3
4856 d = r4 * r4 - r1 * r1 - r2 * r2 - r3 * r3
4857 ee = q4 * r4 - q1 * r1 - q2 * r2 - q3 * r3
4858 f = p4 * p4 - p1 * p1 - p2 * p2 - p3 * p3
4860 c make sure particle 2 formed early
4862 if (h .gt. 0d0) then
4873 c check the approaching criteria
4876 allokp = allokp .and. vp .lt. 0d0
4879 c check the closest approach distance criteria
4881 dm2 = - f - (a ** 2 * d + b ** 2 * c - 2d0 * a * b * ee) /
4883 allokp = allokp .and. dm2 .lt. cutof2
4886 c check the time criteria
4888 tc1 = ft(i1) - e(i1) * (a * d - b * ee) / (ee ** 2 - c * d)
4889 tc2 = ft(i2) + e(i2) * (b * c - a * ee) / (ee ** 2 - c * d)
4890 if (iordsc .eq. 20) then
4892 else if (iordsc .eq. 21) then
4893 tmp = 0.5d0 * (tc1 + tc2)
4897 allokp = allokp .and. tmp .gt. ft(i) .and. tmp .gt. ft(j)
4900 if (allokp .and. tmp .lt. tm) then
4907 cd dgxa(j) = ii * 10d0 * size1
4908 cd dgya(j) = jj * 10d0 * size2
4909 cd dgxa(i) = - dgxa(j)
4910 cd dgya(i) = - dgya(j)
4916 if (tm .eq. tlarge) then
4935 rts2 = (q4 + r4) ** 2 - (q1 + r1) ** 2
4936 & - (q2 + r2) ** 2 - (q3 + r3) ** 2
4938 allok = allok .and. rts2 .gt. rscut2
4941 if (.not. allok) then
4945 else if (ha .gt. 0d0) then
4956 subroutine isco9(i, j, allok, tm, t1, t2)
4957 c this subroutine is used to decide whether there is a collision between
4958 c particle i and j, if there is one allok=1, and tm gives the
4959 c collision time, t1 the collision time for i,
4960 c t2 the collision time for j
4962 implicit double precision (a-h, o-z)
4963 parameter (MAXPTN=400001)
4965 common /para2/ xmp, xmu, alpha, rscut2, cutof2
4967 common /para5/ iconfg, iordsc
4969 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
4970 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
4971 & xmass(MAXPTN), ityp(MAXPTN)
4973 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
4975 common /aurec1/ jxa, jya, jza
4977 common /aurec2/ dgxa(MAXPTN), dgya(MAXPTN), dgza(MAXPTN)
4980 & iscat, jscat, next(MAXPTN), last(MAXPTN),
4981 & ictype, icsta(MAXPTN),
4982 & nic(MAXPTN), icels(MAXPTN)
4984 common /ilist3/ size1, size2, size3, v1, v2, v3, size
4986 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
4990 logical allok, allokp
4992 c preventing consecutive collisions
4993 allok = last(i) .ne. j .or. last(j) .ne. i
4995 if (ft(i) .ge. ft(j)) then
5026 dx = gx(i2) - gx(i1) - vx1 * dt
5027 dy = gy(i2) - gy(i1) - vy1 * dt
5028 dz = gz(i2) - gz(i1) - vz1 * dt
5030 dx = dx + ii * 10d0 * size1
5031 dy = dy + jj * 10d0 * size2
5033 vp = dvx * dx + dvy * dy + dvz * dz
5035 allokp = allokp .and. vp .lt. 0d0
5039 v2 = dvx * dvx + dvy * dvy + dvz * dvz
5041 if (v2 .eq. 0d0) then
5047 c note now tm is the absolute time
5049 allokp = allokp .and. tmp .gt. t1 .and.
5060 dm2 = - v2 * tmp ** 2 + dgx * dgx +
5061 & dgy * dgy + dgz * dgz
5063 allokp = allokp .and. dm2 .lt. cutof2
5067 if (allokp .and. tmp .lt. tm) then
5076 if (tm .eq. tlarge) then
5092 rts2 = (e1 + e2) ** 2 - (px1 + px2) ** 2
5093 & - (py1 + py2) ** 2 - (pz1 + pz2) ** 2
5095 allok = allok .and. rts2 .gt. rscut2
5098 if (.not. allok) then
5110 subroutine isco10(i, j, allok, tm, t1, t2)
5111 c this subroutine is used to decide whether there is a collision between
5112 c particle i and j, if there is one allok=1, and tm gives the
5113 c collision time, t1 the collision time for i,
5114 c t2 the collision time for j
5116 implicit double precision (a-h, o-z)
5117 parameter (MAXPTN=400001)
5119 common /para2/ xmp, xmu, alpha, rscut2, cutof2
5121 common /para5/ iconfg, iordsc
5123 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
5124 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
5125 & xmass(MAXPTN), ityp(MAXPTN)
5127 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
5129 common /aurec1/ jxa, jya, jza
5131 common /aurec2/ dgxa(MAXPTN), dgya(MAXPTN), dgza(MAXPTN)
5134 & iscat, jscat, next(MAXPTN), last(MAXPTN),
5135 & ictype, icsta(MAXPTN),
5136 & nic(MAXPTN), icels(MAXPTN)
5138 common /ilist3/ size1, size2, size3, v1, v2, v3, size
5140 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
5144 logical allok, allokp
5146 c preventing consecutive collisions
5147 allok = last(i) .ne. j .or. last(j) .ne. i
5149 c set up numbers for later calculations
5167 p1 = p1 + ii * 10d0 * size1
5168 p2 = p2 + jj * 10d0 * size2
5169 p3 = p3 + kk * 10d0 * size3
5181 a = p4 * q4 - p1 * q1 - p2 * q2 - p3 * q3
5182 b = p4 * r4 - p1 * r1 - p2 * r2 - p3 * r3
5183 c = q4 * q4 - q1 * q1 - q2 * q2 - q3 * q3
5184 d = r4 * r4 - r1 * r1 - r2 * r2 - r3 * r3
5185 ee = q4 * r4 - q1 * r1 - q2 * r2 - q3 * r3
5186 f = p4 * p4 - p1 * p1 - p2 * p2 - p3 * p3
5188 c make sure particle 2 formed early
5190 if (h .gt. 0d0) then
5201 c check the approaching criteria
5204 allokp = allokp .and. vp .lt. 0d0
5207 c check the closest approach distance criteria
5209 dm2 = - f - (a ** 2 * d + b ** 2 * c - 2d0 * a * b * ee) /
5211 allokp = allokp .and. dm2 .lt. cutof2
5214 c check the time criteria
5216 tc1 = ft(i1) - e(i1) * (a * d - b * ee) / (ee ** 2 - c * d)
5217 tc2 = ft(i2) + e(i2) * (b * c - a * ee) / (ee ** 2 - c * d)
5218 tmp = 0.5d0 * (tc1 + tc2)
5219 allokp = allokp .and. tmp .gt. ft(i) .and. tmp .gt. ft(j)
5222 if (allokp .and. tmp .lt. tm) then
5227 cd dgxa(j) = ii * 10d0 * size1
5228 cd dgya(j) = jj * 10d0 * size2
5229 cd dgxa(i) = - dgxa(j)
5230 cd dgya(i) = - dgya(j)
5237 if (tm .eq. tlarge) then
5256 rts2 = (q4 + r4) ** 2 - (q1 + r1) ** 2
5257 & - (q2 + r2) ** 2 - (q3 + r3) ** 2
5259 allok = allok .and. rts2 .gt. rscut2
5262 if (.not. allok) then
5266 else if (h .gt. 0d0) then
5277 subroutine isco11(i, j, allok, tm, t1, t2)
5278 c this subroutine is used to decide whether there is a collision between
5279 c particle i and j, if there is one allok=1, and tm gives the
5280 c collision time, t1 the collision time for i,
5281 c t2 the collision time for j
5283 implicit double precision (a-h, o-z)
5284 parameter (MAXPTN=400001)
5286 common /para2/ xmp, xmu, alpha, rscut2, cutof2
5288 common /para5/ iconfg, iordsc
5290 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
5291 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
5292 & xmass(MAXPTN), ityp(MAXPTN)
5294 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
5296 common /aurec1/ jxa, jya, jza
5298 common /aurec2/ dgxa(MAXPTN), dgya(MAXPTN), dgza(MAXPTN)
5301 & iscat, jscat, next(MAXPTN), last(MAXPTN),
5302 & ictype, icsta(MAXPTN),
5303 & nic(MAXPTN), icels(MAXPTN)
5305 common /ilist3/ size1, size2, size3, v1, v2, v3, size
5307 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
5311 logical allok, allokp
5313 c preventing consecutive collisions
5314 allok = last(i) .ne. j .or. last(j) .ne. i
5316 c set up numbers for later calculations
5335 p1 = p1 + ii * 10d0 * size1
5336 p2 = p2 + jj * 10d0 * size2
5337 p3 = p3 + kk * 10d0 * size3
5349 a = p4 * q4 - p1 * q1 - p2 * q2 - p3 * q3
5350 b = p4 * r4 - p1 * r1 - p2 * r2 - p3 * r3
5351 c = q4 * q4 - q1 * q1 - q2 * q2 - q3 * q3
5352 d = r4 * r4 - r1 * r1 - r2 * r2 - r3 * r3
5353 ee = q4 * r4 - q1 * r1 - q2 * r2 - q3 * r3
5354 f = p4 * p4 - p1 * p1 - p2 * p2 - p3 * p3
5356 c make sure particle 2 formed early
5358 if (h .gt. 0d0) then
5369 c check the approaching criteria
5372 allokp = allokp .and. vp .lt. 0d0
5375 c check the closest approach distance criteria
5377 dm2 = - f - (a ** 2 * d + b ** 2 * c - 2d0 * a * b * ee) /
5379 allokp = allokp .and. dm2 .lt. cutof2
5382 c check the time criteria
5384 tc1 = ft(i1) - e(i1) * (a * d - b * ee) / (ee ** 2 - c * d)
5385 tc2 = ft(i2) + e(i2) * (b * c - a * ee) / (ee ** 2 - c * d)
5386 if (iordsc .eq. 20) then
5388 else if (iordsc .eq. 21) then
5389 tmp = 0.5d0 * (tc1 + tc2)
5393 allokp = allokp .and. tmp .gt. ft(i) .and. tmp .gt. ft(j)
5396 if (allokp .and. tmp .lt. tm) then
5404 cd dgxa(j) = ii * 10d0 * size1
5405 cd dgya(j) = jj * 10d0 * size2
5406 cd dgxa(i) = - dgxa(j)
5407 cd dgya(i) = - dgya(j)
5414 if (tm .eq. tlarge) then
5433 rts2 = (q4 + r4) ** 2 - (q1 + r1) ** 2
5434 & - (q2 + r2) ** 2 - (q3 + r3) ** 2
5436 allok = allok .and. rts2 .gt. rscut2
5439 if (.not. allok) then
5443 else if (ha .gt. 0d0) then
5454 subroutine isco12(i, j, allok, tm, t1, t2)
5455 c this subroutine is used to decide whether there is a collision between
5456 c particle i and j, if there is one allok=1, and tm gives the
5457 c collision time, t1 the collision time for i,
5458 c t2 the collision time for j
5460 implicit double precision (a-h, o-z)
5461 parameter (MAXPTN=400001)
5463 common /para2/ xmp, xmu, alpha, rscut2, cutof2
5465 common /para5/ iconfg, iordsc
5467 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
5468 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
5469 & xmass(MAXPTN), ityp(MAXPTN)
5471 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
5473 common /aurec1/ jxa, jya, jza
5475 common /aurec2/ dgxa(MAXPTN), dgya(MAXPTN), dgza(MAXPTN)
5478 & iscat, jscat, next(MAXPTN), last(MAXPTN),
5479 & ictype, icsta(MAXPTN),
5480 & nic(MAXPTN), icels(MAXPTN)
5482 common /ilist3/ size1, size2, size3, v1, v2, v3, size
5484 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
5488 logical allok, allokp
5490 c preventing consecutive collisions
5491 allok = last(i) .ne. j .or. last(j) .ne. i
5493 if (ft(i) .ge. ft(j)) then
5525 dx = gx(i2) - gx(i1) - vx1 * dt
5526 dy = gy(i2) - gy(i1) - vy1 * dt
5527 dz = gz(i2) - gz(i1) - vz1 * dt
5529 dx = dx + ii * 10d0 * size1
5530 dy = dy + jj * 10d0 * size2
5531 dz = dz + kk * 10d0 * size3
5533 vp = dvx * dx + dvy * dy + dvz * dz
5535 allokp = allokp .and. vp .lt. 0d0
5539 v2 = dvx * dvx + dvy * dvy + dvz * dvz
5541 if (v2 .eq. 0d0) then
5547 c note now tm is the absolute time
5549 allokp = allokp .and. tmp .gt. t1 .and.
5560 dm2 = - v2 * tmp ** 2 + dgx * dgx +
5561 & dgy * dgy + dgz * dgz
5563 allokp = allokp .and. dm2 .lt. cutof2
5567 if (allokp .and. tmp .lt. tm) then
5578 if (tm .eq. tlarge) then
5594 rts2 = (e1 + e2) ** 2 - (px1 + px2) ** 2
5595 & - (py1 + py2) ** 2 - (pz1 + pz2) ** 2
5597 allok = allok .and. rts2 .gt. rscut2
5600 if (.not. allok) then
5612 subroutine reor(t, tmin, j, last0)
5613 c this subroutine is used to fix ct(i) when tm is greater than ct(i)
5614 c next(i) is last1 or last2
5616 implicit double precision (a-h, o-z)
5617 parameter (MAXPTN=400001)
5619 common /para5/ iconfg, iordsc
5622 & iscat, jscat, next(MAXPTN), last(MAXPTN),
5623 & ictype, icsta(MAXPTN),
5624 & nic(MAXPTN), icels(MAXPTN)
5626 cd common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
5633 i2 = (icels0 - i1 * 10000) / 100
5634 i3 = icels0 - i1 * 10000 - i2 * 100
5636 call wallc(j, i1, i2, i3, t, tmin1)
5638 if (tmin .le. tmin1) then
5645 if (iconfg .eq. 3 .or. iconfg .eq. 5) then
5646 call chcell(j, i1, i2, i3, last0, t, tmin, nc)
5648 if (i1 .eq. 11 .and. i2 .eq. 11 .and. i3 .eq. 11) then
5649 call chout(j, last0, t, tmin, nc)
5651 if (iconfg .eq. 1) then
5652 call chin1(j, i1, i2, i3, last0, t, tmin, nc)
5653 else if (iconfg .eq. 2) then
5654 call chin2(j, i1, i2, i3, last0, t, tmin, nc)
5655 else if (iconfg .eq. 4) then
5656 call chin3(j, i1, i2, i3, last0, t, tmin, nc)
5661 call fixtim(j, t, tmin1, tmin, nc)
5666 subroutine chout(l, last0, t, tmin, nc)
5667 c this subroutine is used to check the surface when the colliding
5668 c particle is outside the cube
5670 implicit double precision (a-h, o-z)
5671 parameter (MAXPTN=400001)
5673 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
5674 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
5675 & xmass(MAXPTN), ityp(MAXPTN)
5682 call chcell(l, m1, m2, m3, last0, t, tmin, nc)
5687 if (i .eq. 1 .or. i .eq. 10 .or. j .eq. 1 .or.
5688 & j .eq. 10 .or. k .eq. 1 .or. k. eq. 10)
5689 & call chcell(l, i, j, k, last0, t, tmin, nc)
5697 subroutine chin1(l, i1, i2, i3, last0, t, tmin, nc)
5698 c this subroutine is used to check collisions for particle inside
5700 c and update the afftected particles through chcell
5702 implicit double precision (a-h, o-z)
5705 c itest is a flag to make sure the 111111 cell is checked only once
5708 do 1003 i = i1 - 1, i1 + 1
5709 do 1002 j = i2 - 1, i2 + 1
5710 do 1001 k = i3 - 1, i3 + 1
5711 if (i .ge. 1 .and. i .le. 10
5712 & .and. j .ge. 1 .and. j .le. 10
5713 & .and. k .ge. 1 .and. k .le. 10) then
5714 call chcell(l, i, j, k, last0, t, tmin, nc)
5715 else if (itest .eq. 0) then
5719 call chcell(l, m1, m2, m3, last0, t, tmin, nc)
5729 subroutine chin2(l, i1, i2, i3, last0, t, tmin, nc)
5730 c this subroutine is used to check collisions for particle inside
5732 c and update the afftected particles through chcell
5734 implicit double precision (a-h, o-z)
5737 c itest is a flag to make sure the 111111 cell is checked only once
5740 do 1003 i = i1 - 1, i1 + 1
5741 do 1002 j = i2 - 1, i2 + 1
5742 do 1001 k = i3 - 1, i3 + 1
5746 if (k .ge. 1 .and. k .le. 10) then
5747 if (i .eq. 0) ia = 10
5748 if (i .eq. 11) ia = 1
5749 if (j .eq. 0) ib = 10
5750 if (j .eq. 11) ib = 1
5751 call chcell(l, ia, ib, ic, last0, t, tmin, nc)
5760 subroutine chin3(l, i1, i2, i3, last0, t, tmin, nc)
5761 c this subroutine is used to check collisions for particle inside
5763 c and update the afftected particles through chcell
5765 implicit double precision (a-h, o-z)
5768 c itest is a flag to make sure the 111111 cell is checked only once
5771 do 1003 i = i1 - 1, i1 + 1
5772 do 1002 j = i2 - 1, i2 + 1
5773 do 1001 k = i3 - 1, i3 + 1
5776 else if (i .eq. 11) then
5783 else if (j .eq. 11) then
5790 else if (k .eq. 11) then
5795 call chcell(l, ia, ib, ic, last0, t, tmin, nc)
5803 subroutine chcell(il, i1, i2, i3, last0, t, tmin, nc)
5804 c this program is used to check through all the particles, except last0
5805 c in the cell (i1,i2,i3) and see if we can get a particle collision
5806 c with time less than the original input tmin ( the collision time of
5808 c last0 cas be set to 0 if we don't want to exclude last0
5810 implicit double precision (a-h, o-z)
5811 parameter (MAXPTN=400001)
5813 common /para5/ iconfg, iordsc
5816 & iscat, jscat, next(MAXPTN), last(MAXPTN),
5817 & ictype, icsta(MAXPTN),
5818 & nic(MAXPTN), icels(MAXPTN)
5820 common /ilist2/ icell, icel(10, 10, 10)
5822 common /ilist4/ ifmpt, ichkpt, indx(MAXPTN)
5827 if (iconfg .eq. 3 .or. iconfg .eq. 5) then
5830 c 10/24/02 get rid of argument usage mismatch in mintm():
5832 if (j .ne. il .and. j .ne. last0)
5833 & call mintm(il, jmintm, tmin, nc)
5834 c & call mintm(il, j, tmin, nc)
5841 if (i1 .eq. 11 .and. i2 .eq. 11 .and. i3 .eq. 11) then
5844 l = icel(i1 ,i2, i3)
5847 if (l .eq. 0) return
5851 c if there is only one particle
5854 c if it's not il or last0,when last is not wall
5855 if (l .eq. il .or. l .eq. last0) return
5856 call mintm(il, l, tmin, nc)
5858 c if there are many particles
5860 if (l .ne. il .and. l .ne. last0)
5861 & call mintm(il, l, tmin, nc)
5862 do 10 while(j .ne. l)
5863 if (j .ne. il .and. j .ne. last0)
5864 & call mintm(il, j, tmin, nc)
5872 subroutine mintm(i, j, tmin, nc)
5873 c this subroutine is used to check whether particle j has smaller
5874 c collision time with particle i than other particles
5875 c or in other words, update next(i)
5880 implicit double precision (a-h, o-z)
5881 parameter (MAXPTN=400001)
5883 common /para5/ iconfg, iordsc
5885 common /aurec1/ jxa, jya, jza
5887 common /aurec2/ dgxa(MAXPTN), dgya(MAXPTN), dgza(MAXPTN)
5890 & iscat, jscat, next(MAXPTN), last(MAXPTN),
5891 & ictype, icsta(MAXPTN),
5892 & nic(MAXPTN), icels(MAXPTN)
5894 common /ilist3/ size1, size2, size3, v1, v2, v3, size
5896 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
5902 call isco(i, j, allok, tm, t1, t2)
5904 if (allok .and. tm .lt. tmin) then
5908 if (iconfg .eq. 3 .or. iconfg .eq. 5) then
5909 dgxa(i) = - jxa * 10d0 * size1
5910 dgya(i) = - jya * 10d0 * size2
5911 if (iconfg .eq. 5) then
5912 dgza(i) = - jza * 10d0 * size3
5920 ******************************************************************************
5921 ******************************************************************************
5925 implicit double precision (a-h, o-z)
5926 parameter (MAXPTN=400001)
5929 & iscat, jscat, next(MAXPTN), last(MAXPTN),
5930 & ictype, icsta(MAXPTN),
5931 & nic(MAXPTN), icels(MAXPTN)
5935 if (mod(ictype,2) .eq. 0) then
5938 clin-5/2009 ctest off v2 for parton:
5945 subroutine zpca1a(i)
5947 implicit double precision (a-h, o-z)
5948 parameter (MAXPTN=400001)
5950 common /para2/ xmp, xmu, alpha, rscut2, cutof2
5952 common /para5/ iconfg, iordsc
5954 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
5955 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
5956 & xmass(MAXPTN), ityp(MAXPTN)
5958 common /prec3/gxs(MAXPTN),gys(MAXPTN),gzs(MAXPTN),fts(MAXPTN),
5959 & pxs(MAXPTN), pys(MAXPTN), pzs(MAXPTN), es(MAXPTN),
5960 & xmasss(MAXPTN), ityps(MAXPTN)
5962 common /prec5/ eta(MAXPTN), rap(MAXPTN), tau(MAXPTN)
5964 common /prec6/ etas(MAXPTN), raps(MAXPTN), taus(MAXPTN)
5966 common /ana1/ ts(12)
5970 if (iconfg .eq. 1) then
5974 else if (iconfg .eq. 2 .or.
5975 & iconfg .eq. 3) then
5981 else if (iconfg .eq. 4 .or.
5982 & iconfg .eq. 5) then
5988 if (iconfg .le. 3) then
5989 do 1002 ian = 1, ipic
5990 if (t1 .le. ts(ian) .and.
5991 & t2 .gt. ts(ian)) then
5994 c et = sqrt(pxs(i) ** 2 + pys(i) ** 2 + xmp ** 2)
5995 et = dsqrt(pxs(i) ** 2 + pys(i) ** 2 + xmp ** 2)
5996 call zpca1b(rapi, et, ian)
6000 do 1003 ian = 1, ipic
6001 if (t1 .le. ts(ian) .and.
6002 & t2 .gt. ts(ian)) then
6007 call zpca1c(p0, p1, p2, p3, ian)
6015 subroutine zpca1b(rapi, et, ian)
6017 implicit double precision (a-h, o-z)
6018 parameter (MAXPTN=400001)
6020 common /para6/ centy
6022 common /ilist6/ t, iopern, icolln
6025 & det(12), dn(12), detdy(12), detdn(12), dndy(12),
6026 & det1(12), dn1(12), detdy1(12), detdn1(12), dndy1(12),
6027 & det2(12), dn2(12), detdy2(12), detdn2(12), dndy2(12)
6031 if (rapi .gt. centy - 0.5d0 .and.
6032 & rapi .lt. centy + 0.5d0) then
6033 det2(ian) = det2(ian) + et
6034 dn2(ian) = dn2(ian) + 1d0
6036 if (ian .eq. 10) then
6037 cd write (10, *) t, det2(ian)
6039 if (ian .eq. 11) then
6040 cd write (11, *) t, det2(ian)
6042 if (ian .eq. 12) then
6043 cd write (12, *) t, det2(ian)
6046 if (rapi .gt. centy - 0.25d0 .and.
6047 & rapi .lt. centy + 0.25d0) then
6048 det1(ian) = det1(ian) + et
6049 dn1(ian) = dn1(ian) + 1d0
6050 if (rapi .gt. centy - 0.1d0 .and.
6051 & rapi .lt. centy + 0.1d0) then
6052 det(ian) = det(ian) + et
6053 dn(ian) = dn(ian) + 1d0
6061 subroutine zpca1c(p0, p1, p2, p3, ian)
6063 implicit double precision (a-h, o-z)
6065 common /ana3/ em(4, 4, 12)
6078 em(i, j, ian) = em(i, j, ian) + en(i) * en(j) / p0
6085 ******************************************************************************
6089 implicit double precision (a-h, o-z)
6090 parameter (MAXPTN=400001)
6092 common /para3/ nsevt, nevnt, nsbrun, ievt, isbrun
6094 common /para5/ iconfg, iordsc
6096 common /para7/ ioscar,nsmbbbar,nsmmeson
6098 common /ilist6/ t, iopern, icolln
6100 common /rndm1/ number
6104 common /rndm3/ iseedp
6106 COMMON /AREVT/ IAEVT, IARUN, MISS
6110 if (iconfg .le. 3) then
6116 if (ioscar .eq. 1) then
6121 c write (25, *) 'Event', nsevt - 1 + ievt,
6122 c & ', run', isbrun,
6123 c WRITE (25, *) ' Event ', IAEVT, ', run ', IARUN,
6124 c & ',\n\t number of operations = ', iopern,
6125 c & ',\n\t number of collisions between particles = ',
6127 c & ',\n\t freezeout time=', t,
6128 c & ',\n\t ending at the ', number, 'th random number',
6129 c & ',\n\t ending collision iff=', iff
6130 cms WRITE (25, *) ' Event ', IAEVT, ', run ', IARUN
6131 cms WRITE (25, *) ' number of operations = ', iopern
6132 cms WRITE (25, *) ' number of collisions between particles = ',
6134 cms WRITE (25, *) ' freezeout time=', t
6135 cms WRITE (25, *) ' ending at the ', number, 'th random number'
6136 cms WRITE (25, *) ' ending collision iff=', iff
6143 implicit double precision (a-h, o-z)
6144 parameter (MAXPTN=400001)
6148 common /para2/ xmp, xmu, alpha, rscut2, cutof2
6150 common /para3/ nsevt, nevnt, nsbrun, ievt, isbrun
6152 common /para5/ iconfg, iordsc
6154 common /para6/ centy
6156 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
6157 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
6158 & xmass(MAXPTN), ityp(MAXPTN)
6160 common /prec5/ eta(MAXPTN), rap(MAXPTN), tau(MAXPTN)
6162 common /ilist4/ ifmpt, ichkpt, indx(MAXPTN)
6164 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
6166 common /ilist6/ t, iopern, icolln
6168 common /rndm1/ number
6172 common /rndm3/ iseedp
6174 common /ana1/ ts(12)
6177 & det(12), dn(12), detdy(12), detdn(12), dndy(12),
6178 & det1(12), dn1(12), detdy1(12), detdn1(12), dndy1(12),
6179 & det2(12), dn2(12), detdy2(12), detdn2(12), dndy2(12)
6181 common /ana4/ fdetdy(24), fdndy(24), fdndpt(12)
6185 do 1004 i = 1, ichkpt
6188 c et = sqrt(px(i) ** 2 + py(i) ** 2 + xmp ** 2)
6189 et = dsqrt(px(i) ** 2 + py(i) ** 2 + xmp ** 2)
6192 if (rapi .gt. j + centy - 13d0
6193 & .and. rapi .lt. j + centy - 12d0) then
6194 fdetdy(j) = fdetdy(j) + et
6195 fdndy(j) = fdndy(j) + 1d0
6200 if (et .gt. 0.5d0 * (j - 1) .and.
6201 & et .lt. 0.5d0 * j ) then
6202 fdndpt(j) = fdndpt(j) + 1d0
6206 if (iconfg .eq. 1) then
6216 do 1003 ian = 1, ipic
6217 if (t1 .le. ts(ian) .and.
6218 & t2 .gt. ts(ian)) then
6219 call zpca1b(rapi, et, ian)
6223 if (iconfg .eq. 1) then
6224 call zpca1b(rapi, et, 12)
6229 c if (dn(ian) .eq. 0d0 .or. dn1(ian) .eq. 0d0 .or.
6230 c & dn2(ian) .eq. 0d0) then
6231 c print *, 'event=', ievt
6232 c print *, 'dn(', ian, ')=', dn(ian), 'dn1(', ian,
6233 c & ')=', dn1(ian), 'dn2(', ian, ')=', dn2(ian)
6235 detdy(ian) = detdy(ian) + det(ian)
6236 if (dn(ian) .ne. 0) then
6237 detdn(ian) = detdn(ian) + det(ian) / dn(ian)
6239 dndy(ian) = dndy(ian) + dn(ian)
6240 detdy1(ian) = detdy1(ian) + det1(ian)
6241 if (dn1(ian) .ne. 0) then
6242 detdn1(ian) = detdn1(ian) + det1(ian) / dn1(ian)
6244 dndy1(ian) = dndy1(ian) + dn1(ian)
6245 detdy2(ian) = detdy2(ian) + det2(ian)
6246 if (dn2(ian) .ne. 0) then
6247 detdn2(ian) = detdn2(ian) + det2(ian) / dn2(ian)
6249 dndy2(ian) = dndy2(ian) + dn2(ian)
6257 implicit double precision (a-h, o-z)
6258 parameter (MAXPTN=400001)
6260 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
6261 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
6262 & xmass(MAXPTN), ityp(MAXPTN)
6264 common /ilist4/ ifmpt, ichkpt, indx(MAXPTN)
6266 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
6268 common /ana1/ ts(12)
6272 do 1002 i = 1, ichkpt
6277 do 1001 ian = 1, ipic
6278 if (t1 .le. ts(ian) .and.
6279 & t2 .gt. ts(ian)) then
6284 call zpca1c(p0, p1, p2, p3, ian)
6294 implicit double precision (a-h, o-z)
6296 character*8 code, versn
6298 integer aproj, zproj, atarg, ztarg, event
6299 parameter (MAXPTN=400001)
6303 common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
6304 & px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
6305 & xmass(MAXPTN), ityp(MAXPTN)
6311 if (nff .eq. 0) then
6312 cms write (26, 101) 'OSCAR1997A'
6313 cms write (26, 101) 'final_id_p_x'
6323 cms write (26, 102) code, versn, aproj, zproj, atarg, ztarg,
6324 cms & reffra, ebeam, ntestp
6334 cms write (26, 103) event, mul, bimp, phi
6338 cms write (26, 104) i, ityp(i),
6339 cms & px(i), py(i), pz(i), e(i), xmass(i),
6340 cms & gx(i), gy(i), gz(i), ft(i)
6345 cyy 101 format (a12)
6346 cyy 102 format (2(a8, 2x), '(',i3, ',',i6, ')+(',i3, ',', i6, ')',
6347 cyy & 2x, a4, 2x, e10.4, 2x, i8)
6348 cyy 103 format (i10, 2x, i10, 2x, f8.3, 2x, f8.3)
6349 cyy 104 format (i10, 2x, i10, 2x, 9(e12.6, 2x))
6354 ******************************************************************************
6358 implicit double precision (a-h, o-z)
6360 common /para5/ iconfg, iordsc
6364 if (iconfg .le. 3) then
6375 implicit double precision (a-h, o-z)
6377 common /para3/ nsevt, nevnt, nsbrun, ievt, isbrun
6379 common /ana1/ ts(12)
6382 & det(12), dn(12), detdy(12), detdn(12), dndy(12),
6383 & det1(12), dn1(12), detdy1(12), detdn1(12), dndy1(12),
6384 & det2(12), dn2(12), detdy2(12), detdn2(12), dndy2(12)
6386 common /ana4/ fdetdy(24), fdndy(24), fdndpt(12)
6394 ntotal = nevnt * nsbrun
6401 implicit double precision (a-h, o-z)
6403 common /para3/ nsevt, nevnt, nsbrun, ievt, isbrun
6405 common /ilist3/ size1, size2, size3, v1, v2, v3, size
6407 common /ana1/ ts(12)
6409 common /ana3/ em(4, 4, 12)
6413 cms open (28, file = 'ana4/em.dat', status = 'unknown')
6414 vol = 1000.d0 * size1 * size2 * size3
6415 ntotal = nevnt * nsbrun
6418 cms write (28, *) '*** for time ', ts(ian), 'fm(s)'
6420 cms write (28, *) em(i, 1, ian) / vol / ntotal,
6421 cms & em(i, 2, ian) / vol / ntotal,
6422 cms & em(i, 3, ian) / vol / ntotal,
6423 cms & em(i, 4, ian) / vol / ntotal
6430 ******************************************************************************
6432 subroutine lorenza(energy, px, py, pz, bex, bey, bez)
6434 c add in a cut for beta2 to prevent gam to be nan (infinity)
6436 implicit double precision (a-h, o-z)
6438 common /lora/ enenew, pxnew, pynew, pznew
6442 beta2 = bex ** 2 + bey ** 2 + bez ** 2
6443 if (beta2 .eq. 0d0) then
6449 if (beta2 .gt. 0.999999999999999d0) then
6450 beta2 = 0.999999999999999d0
6451 print *,'beta2=0.999999999999999'
6454 c gam = 1.d0 / sqrt(1.d0 - beta2)
6455 gam = 1.d0 / dsqrt(1.d0 - beta2)
6456 enenew = gam * (energy - bex * px - bey * py - bez * pz)
6457 pxnew = - gam * bex * energy + (1.d0
6458 & + (gam - 1.d0) * bex ** 2 / beta2) * px
6459 & + (gam - 1.d0) * bex * bey/beta2 * py
6460 & + (gam - 1.d0) * bex * bez/beta2 * pz
6461 pynew = - gam * bey * energy
6462 & + (gam - 1.d0) * bex * bey / beta2 * px
6463 & + (1.d0 + (gam - 1.d0) * bey ** 2 / beta2) * py
6464 & + (gam - 1.d0) * bey * bez / beta2 * pz
6465 pznew = - gam * bez * energy
6466 & + (gam - 1.d0) * bex * bez / beta2 * px
6467 & + (gam - 1.d0) * bey * bez / beta2 * py
6468 & + (1.d0 + (gam - 1.d0) * bez ** 2 / beta2) * pz
6474 subroutine index1(n, m, arrin, indx)
6475 c indexes the first m elements of ARRIN of length n, i.e., outputs INDX
6476 c such that ARRIN(INDEX(J)) is in ascending order for J=1,...,m
6478 implicit double precision (a-h, o-z)
6480 dimension arrin(n), indx(n)
6504 20 if (j .le. ir) then
6506 if (arrin(indx(j)) .lt. arrin(indx(j + 1))) j = j + 1
6508 if (q .lt. arrin(indx(j))) then
6523 double precision function ftime1(iseed)
6525 c this program is used to generate formation time
6526 c the calling program needs a common /par1/
6527 c and declare external ftime1
6530 implicit double precision (a-h, o-z)
6534 parameter (hbarc = 0.197327054d0)
6543 c ftime1 = aa * sqrt(1d0 / ran1(iseed) - 1d0)
6544 ftime1 = aa * dsqrt(1d0 / ran1(iseed) - 1d0)
6549 subroutine cropro(vx1, vy1, vz1, vx2, vy2, vz2)
6551 c this subroutine is used to calculate the cross product of
6552 c (vx1,vy1,vz1) and (vx2,vy2,vz2) and get the result (vx3,vy3,vz3)
6553 c and put the vector into common /cprod/
6555 implicit double precision (a-h, o-z)
6557 common/cprod/ vx3, vy3, vz3
6561 vx3 = vy1 * vz2 - vz1 * vy2
6562 vy3 = vz1 * vx2 - vx1 * vz2
6563 vz3 = vx1 * vy2 - vy1 * vx2
6568 subroutine xnormv(vx, vy, vz)
6570 c this subroutine is used to get a normalized vector
6572 implicit double precision (a-h, o-z)
6576 c vv = sqrt(vx ** 2 + vy ** 2 + vz ** 2)
6577 vv = dsqrt(vx ** 2 + vy ** 2 + vz ** 2)
6586 c subroutine rotate(xn1, xn2, xn3, theta, v1, v2, v3)
6587 subroutine zprota(xn1, xn2, xn3, theta, v1, v2, v3)
6590 c this subroutine is used to rotate the vector (v1,v2,v3) by an angle theta
6591 c around the unit vector (xn1, xn2, xn3)
6593 implicit double precision (a-h, o-z)
6602 a11 = xn1 ** 2 * omc + c
6603 a12 = xn1 * xn2 * omc - s * xn3
6604 a13 = xn1 * xn3 * omc + s * xn2
6605 a21 = xn1 * xn2 * omc + s * xn3
6606 a22 = xn2 **2 * omc + c
6607 a23 = xn2 * xn3 * omc - s * xn1
6608 a31 = xn1 * xn3 * omc - s * xn2
6609 a32 = xn3 * xn2 * omc + s * xn1
6610 a33 = xn3 ** 2 * omc + c
6611 v1 = vx * a11 + vy * a12 + vz * a13
6612 v2 = vx * a21 + vy * a22 + vz * a23
6613 v3 = vx * a31 + vy * a32 + vz * a33
6618 c double precision function ran1(idum)
6620 c* return a uniform random deviate between 0.0 and 1.0. set idum to
6621 c* any negative value to initialize or reinitialize the sequence.
6623 c implicit double precision (a-h, o-z)
6627 c common /rndm1/ number
6629 c parameter (m1 = 259200, ia1 = 7141, ic1 = 54773, rm1 = 1d0 / m1)
6630 c parameter (m2 = 134456, ia2 = 8121, ic2 = 28411, rm2 = 1d0 / m2)
6631 c parameter (m3 = 243000, ia3 = 4561, ic3 = 51349)
6632 clin-6/23/00 save ix1-3:
6633 clin-10/30/02 r unsaved, causing wrong values for ran1 when compiled with f77:
6634 cc SAVE ix1,ix2,ix3,r
6638 c if (idum .lt. 0 .or. iff .eq. 0) then
6640 c ix1 = mod(ic1 - idum, m1)
6641 c ix1 = mod(ia1 * ix1 + ic1, m1)
6642 c ix2 = mod(ix1, m2)
6643 c ix1 = mod(ia1 * ix1 + ic1, m1)
6644 c ix3 = mod(ix1, m3)
6646 c ix1 = mod(ia1 * ix1 + ic1, m1)
6647 c ix2 = mod(ia2 * ix2 + ic2, m2)
6648 c r(j) = (dble(ix1) + dble(ix2) * rm2) * rm1
6652 c ix1 = mod(ia1 * ix1 + ic1, m1)
6653 c ix2 = mod(ia2 * ix2 + ic2, m2)
6654 c ix3 = mod(ia3 * ix3 + ic3, m3)
6655 clin-7/01/02 j = 1 + (97 * i x 3) / m3
6658 c if (j .gt. 97 .or. j .lt. 1) pause
6659 c if (j .gt. 97 .or. j .lt. 1) print *, 'In zpc ran1, j<1 or j>97',j
6661 c r(j) = (dble(ix1) + dble(ix2) * rm2) * rm1
6663 clin-6/23/00 check random number generator:
6664 c number = number + 1
6665 c if(number.le.100000) write(99,*) 'number, ran1=', number,ran1