forked from alisw/ampt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zpc.f
executable file
·6706 lines (5666 loc) · 192 KB
/
zpc.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
c.................... zpc.f
c PROGRAM ZPC
SUBROUTINE ZPCMN
c Version: 1.0.1
c Author: Bin Zhang
c (suggestions, problems -> bzhang@nt1.phys.columbia.edu)
implicit double precision (a-h, o-z)
clin-4/20/01 PARAMETER (NMAXGL = 16000)
parameter (MAXPTN=400001)
common /para3/ nsevt, nevnt, nsbrun, ievt, isbrun
cc SAVE /para3/
SAVE
c
c loop over events
do 1000 i = 1, nevnt
ievt = i
c generation of the initial condition for one event
call inievt
c loop over many runs of the same event
do 2000 j = 1, nsbrun
isbrun = j
c initialization for one run of an event
call inirun
clin-4/2008 not used:
c CALL HJAN1A
3000 continue
c do one collision
call zpcrun(*4000)
call zpca1
goto 3000
4000 continue
call zpca2
2000 continue
1000 continue
call zpcou
clin-5/2009 ctest off
c 5/17/01 calculate v2 for parton already frozen out:
c call flowp(3)
c.....to get average values for different strings
CALL zpstrg
RETURN
end
******************************************************************************
******************************************************************************
block data zpcbdt
c set initial values in block data
implicit double precision (a-h, o-z)
parameter (MAXPTN=400001)
PARAMETER (MAXSTR=150001)
common /para1/ mul
cc SAVE /para1/
common /para2/ xmp, xmu, alpha, rscut2, cutof2
cc SAVE /para2/
common /para3/ nsevt, nevnt, nsbrun, ievt, isbrun
cc SAVE /para3/
common /para4/ iftflg, ireflg, igeflg, ibstfg
cc SAVE /para4/
common /para5/ iconfg, iordsc
cc SAVE /para5/
common /para6/ centy
cc SAVE /para6/
clin-6/2009 nsmbbbar and nsmmeson respectively give the total number of
c baryons/anti-baryons and mesons for each event:
c common /para7/ ioscar
common /para7/ ioscar,nsmbbbar,nsmmeson
cc SAVE /para7/
COMMON /prec1/GX0(MAXPTN),GY0(MAXPTN),GZ0(MAXPTN),FT0(MAXPTN),
& PX0(MAXPTN), PY0(MAXPTN), PZ0(MAXPTN), E0(MAXPTN),
& XMASS0(MAXPTN), ITYP0(MAXPTN)
cc SAVE /prec1/
common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
& px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
& xmass(MAXPTN), ityp(MAXPTN)
cc SAVE /prec2/
common /prec3/gxs(MAXPTN),gys(MAXPTN),gzs(MAXPTN),fts(MAXPTN),
& pxs(MAXPTN), pys(MAXPTN), pzs(MAXPTN), es(MAXPTN),
& xmasss(MAXPTN), ityps(MAXPTN)
cc SAVE /prec3/
common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
cc SAVE /prec4/
common /prec5/ eta(MAXPTN), rap(MAXPTN), tau(MAXPTN)
cc SAVE /prec5/
common /prec6/ etas(MAXPTN), raps(MAXPTN), taus(MAXPTN)
cc SAVE /prec6/
common /aurec1/ jxa, jya, jza
cc SAVE /aurec1/
common /aurec2/ dgxa(MAXPTN), dgya(MAXPTN), dgza(MAXPTN)
cc SAVE /aurec2/
common /ilist1/
& iscat, jscat, next(MAXPTN), last(MAXPTN),
& ictype, icsta(MAXPTN),
& nic(MAXPTN), icels(MAXPTN)
cc SAVE /ilist1/
common /ilist2/ icell, icel(10,10,10)
cc SAVE /ilist2/
common /ilist3/ size1, size2, size3, v1, v2, v3, size
cc SAVE /ilist3/
common /ilist4/ ifmpt, ichkpt, indx(MAXPTN)
cc SAVE /ilist4/
c 6/07/02 initialize in ftime to expedite compiling:
c common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
cc SAVE /ilist5/
common /ilist6/ t, iopern, icolln
cc SAVE /ilist6/
COMMON /ilist7/ LSTRG0(MAXPTN), LPART0(MAXPTN)
cc SAVE /ilist7/
COMMON /ilist8/ LSTRG1(MAXPTN), LPART1(MAXPTN)
cc SAVE /ilist8/
common /rndm1/ number
cc SAVE /rndm1/
common /rndm2/ iff
cc SAVE /rndm2/
common /rndm3/ iseedp
cc SAVE /rndm3/
common /ana1/ ts(12)
cc SAVE /ana1/
common /ana2/
& det(12), dn(12), detdy(12), detdn(12), dndy(12),
& det1(12), dn1(12), detdy1(12), detdn1(12), dndy1(12),
& det2(12), dn2(12), detdy2(12), detdn2(12), dndy2(12)
cc SAVE /ana2/
common /ana3/ em(4, 4, 12)
cc SAVE /ana3/
common /ana4/ fdetdy(24), fdndy(24), fdndpt(12)
cc SAVE /ana4/
SAVE
data centy/0d0/
c 6/07/02 initialize in ftime to expedite compiling:
c data (ct(i), i = 1, MAXPTN)/MAXPTN*0d0/
c data (ot(i), i = 1, MAXPTN)/MAXPTN*0d0/
c data tlarge/1000000.d0/
data number/0/
data ts/0.11d0, 0.12d0, 0.15d0, 0.2d0, 0.3d0, 0.4d0, 0.6d0,
& 0.8d0, 1d0, 2d0, 4d0, 6d0/
c
end
******************************************************************************
******************************************************************************
subroutine inizpc
implicit double precision (a-h, o-z)
SAVE
call readpa
call inipar
call inian1
return
end
subroutine readpa
implicit double precision (a-h, o-z)
external ran1
character*50 str
common /para2/ xmp, xmu, alpha, rscut2, cutof2
cc SAVE /para2/
common /para3/ nsevt, nevnt, nsbrun, ievt, isbrun
cc SAVE /para3/
common /para4/ iftflg, ireflg, igeflg, ibstfg
cc SAVE /para4/
common /para5/ iconfg, iordsc
cc SAVE /para5/
common /para7/ ioscar,nsmbbbar,nsmmeson
cc SAVE /para7/
common /ilist3/ size1, size2, size3, v1, v2, v3, size
cc SAVE /ilist3/
common /rndm1/ number
cc SAVE /rndm1/
common /rndm2/ iff
cc SAVE /rndm2/
common /rndm3/ iseedp
cc SAVE /rndm3/
SAVE
iseed=iseedp
c this is the initialization file containing the initial values of
c the parameters
cbz1/31/99
c open (5, file = 'zpc.ini', status = 'unknown')
cbz1/31/99end
c this is the final data file containing general info about the cascade
cbz1/31/99
c open (6, file = 'zpc.res', status = 'unknown')
open (25, file = 'ana/zpc.res', status = 'unknown')
cbz1/31/99end
c this is the input file containing initial particle records
cbz1/25/99
c open (7, file = 'zpc.inp', status = 'unknown')
cbz1/25/99end
c this gives the optional OSCAR standard output
cbz1/31/99
c open (8, file = 'zpc.oscar', status = 'unknown')
if(ioscar.eq.1) then
open (26, file = 'ana/parton.oscar', status = 'unknown')
open (19, file = 'ana/hadron.oscar', status = 'unknown')
endif
cbz1/31/99end
c 2/11/03 combine zpc initialization into ampt.ini:
c open (29, file = 'zpc.ini', status = 'unknown')
c read (29, *) str, xmp
xmp=0d0
c read (29, *) str, xmu
c read (29, *) str, alpha
cutof2 = 4.5d0 * (alpha / xmu) ** 2
c read (29, *) str, rscut2
rscut2=0.01d0
c read (29, *) str, nsevt
nsevt=1
c read (29, *) str, nevnt
nevnt=1
c read (29, *) str, nsbrun
nsbrun=1
c read (29, *) str, iftflg
iftflg=0
c read (29, *) str, ireflg
ireflg=1
cbz1/31/99
IF (ireflg .EQ. 0) THEN
OPEN (27, FILE = 'zpc.inp', STATUS = 'UNKNOWN')
END IF
cbz1/31/99end
c read (29, *) str, igeflg
igeflg=0
c read (29, *) str, ibstfg
ibstfg=0
c read (29, *) str, iconfg
iconfg=1
c read (29, *) str, iordsc
iordsc=11
c read (29, *) str, ioscar
c read (29, *) str, v1, v2, v3
v1=0.2d0
v2=0.2d0
v3=0.2d0
c read (29, *) str, size1, size2, size3
size1=1.5d0
size2=1.5d0
size3=0.7d0
if (size1 .eq. 0d0 .or. size2 .eq. 0d0 .or.
& size3 .eq. 0d0) then
if (size1 .ne. 0d0 .or. size2 .ne. 0d0 .or. size3 .ne. 0d0
& .or. v1 .ne. 0d0 .or. v2 .ne. 0d0 .or. v3 .ne. 0d0) then
print *, 'to get rid of space division:'
print *, 'set all sizes and vs to 0'
stop 'chker'
end if
end if
size = min(size1, size2, size3)
c read (29, *) str, iff
iff=-1
c read (29, *) str, iseed
c 10/24/02 get rid of argument usage mismatch in ran1():
isedng=-iseed
c a = ran1(-iseed)
a = ran1(isedng)
c read (29, *) str, irused
irused=2
do 1001 i = 1, irused - 1
c a = ran1(2)
iseed2=2
a = ran1(iseed2)
1001 continue
c 10/24/02-end
if (iconfg .eq. 2 .or. iconfg .eq. 3) then
v1 = 0d0
v2 = 0d0
end if
if (iconfg .eq. 4 .or. iconfg .eq. 5) then
v1 = 0d0
v2 = 0d0
v3 = 0d0
end if
close(5)
return
end
subroutine inipar
implicit double precision (a-h,o-z)
common /para4/ iftflg, ireflg, igeflg, ibstfg
cc SAVE /para4/
common /para6/ centy
cc SAVE /para6/
SAVE
if (ibstfg .ne. 0) then
centy = -6d0
end if
return
end
subroutine inian1
implicit double precision (a-h,o-z)
common /para4/ iftflg, ireflg, igeflg, ibstfg
cc SAVE /para4/
common /ana1/ ts(12)
cc SAVE /ana1/
SAVE
if (ibstfg .ne. 0) then
a = cosh(6d0)
do 1001 i = 1, 12
ts(i) = ts(i) * a
1001 continue
end if
return
end
******************************************************************************
subroutine inievt
implicit double precision (a-h, o-z)
COMMON /para1/ mul
cc SAVE /para1/
common /para4/ iftflg, ireflg, igeflg, ibstfg
cc SAVE /para4/
SAVE
cbz1/25/99
c mul = 0
cbz1/25/99
if (ireflg .eq. 0) call readi
if (igeflg .ne. 0) call genei
if (ibstfg .ne. 0) call boosti
return
end
subroutine readi
implicit double precision (a-h, o-z)
parameter (MAXPTN=400001)
double precision field(9)
common /para1/ mul
cc SAVE /para1/
common /para3/ nsevt, nevnt, nsbrun, ievt, isbrun
cc SAVE /para3/
COMMON /prec1/GX0(MAXPTN),GY0(MAXPTN),GZ0(MAXPTN),FT0(MAXPTN),
& PX0(MAXPTN), PY0(MAXPTN), PZ0(MAXPTN), E0(MAXPTN),
& XMASS0(MAXPTN), ITYP0(MAXPTN)
cc SAVE /prec1/
SAVE
do 1001 i = 1, MAXPTN
if (ievt .ne. 1 .and. i .eq. 1) then
ityp0(i) = ntyp
gx0(1) = field(1)
gy0(1) = field(2)
gz0(1) = field(3)
ft0(1) = field(4)
px0(1) = field(5)
py0(1) = field(6)
pz0(1) = field(7)
e0(1) = field(8)
xmass0(i) = field(9)
mul = 1
else
900 read (27, *, end = 1000) neve, ntyp, field
if (neve .lt. nsevt) goto 900
if (neve .gt.
& nsevt + ievt - 1) goto 1000
ityp0(i) = ntyp
gx0(i) = field(1)
gy0(i) = field(2)
gz0(i) = field(3)
ft0(i) = field(4)
px0(i) = field(5)
py0(i) = field(6)
pz0(i) = field(7)
e0(i) = field(8)
xmass0(i) = field(9)
mul = mul + 1
end if
1001 continue
1000 continue
return
end
subroutine genei
implicit double precision (a-h, o-z)
parameter (MAXPTN=400001)
common /para1/ mul
cc SAVE /para1/
common /para2/ xmp, xmu, alpha, rscut2, cutof2
cc SAVE /para2/
common /para3/ nsevt, nevnt, nsbrun, ievt, isbrun
cc SAVE /para3/
common /para5/ iconfg, iordsc
cc SAVE /para5/
COMMON /prec1/GX0(MAXPTN),GY0(MAXPTN),GZ0(MAXPTN),FT0(MAXPTN),
& PX0(MAXPTN), PY0(MAXPTN), PZ0(MAXPTN), E0(MAXPTN),
& XMASS0(MAXPTN), ITYP0(MAXPTN)
cc SAVE /prec1/
common /prec5/ eta(MAXPTN), rap(MAXPTN), tau(MAXPTN)
cc SAVE /prec5/
common /lor/ enenew, pxnew, pynew, pznew
cc SAVE /lor/
common /rndm3/ iseedp
cc SAVE /rndm3/
SAVE
external ran1
iseed=iseedp
incmul = 4000
temp = 0.5d0
etamin = -5d0
etamax = 5d0
r0 = 5d0
tau0 = 0.1d0
deta = etamax - etamin
do 1001 i = mul + 1, mul + incmul
ityp0(i) = 21
xmass0(i) = xmp
call energy(e, temp)
call momntm(px, py, pz, e)
c 7/20/01:
c e = sqrt(e ** 2 + xmp ** 2)
e = dsqrt(e ** 2 + xmp ** 2)
if (iconfg .le. 3) then
eta(i) = etamin + deta * ran1(iseed)
bex = 0d0
bey = 0d0
bez = -tanh(eta(i))
call lorenz(e, px, py, pz, bex, bey, bez)
px0(i) = pxnew
py0(i) = pynew
pz0(i) = pznew
e0(i) = enenew
else
px0(i) = px
py0(i) = py
pz0(i) = pz
e0(i) = e
end if
1001 continue
do 1002 i = mul + 1, mul + incmul
if (iconfg .le. 3) then
gz0(i) = tau0 * sinh(eta(i))
ft0(i) = tau0 * cosh(eta(i))
if (iconfg .eq. 1) then
call posit1(x, y, r0)
gx0(i) = x + px0(i) * ft0(i)/e0(i)
gy0(i) = y + py0(i) * ft0(i)/e0(i)
else if (iconfg .eq. 2 .or. iconfg .eq. 3) then
call posit2(x, y)
gx0(i) = x
gy0(i) = y
end if
else
ft0(i) = 0d0
call posit3(x, y, z)
gx0(i) = x
gy0(i) = y
gz0(i) = z
end if
1002 continue
mul = mul + incmul
c check if it's necessary to adjust array size 'adarr'
if (mul .ge. MAXPTN .or. mul .eq. 0) then
print *, 'event',ievt,'has',mul,'number of gluon',
& 'adjusting counting is necessary'
stop 'adarr'
end if
return
end
subroutine posit1(x, y, r0)
implicit double precision (a-h, o-z)
external ran1
common /rndm3/ iseedp
cc SAVE /rndm3/
SAVE
iseed=iseedp
10 x = 2d0 * ran1(iseed) - 1d0
y = 2d0 * ran1(iseed) - 1d0
if (x ** 2 + y ** 2 .gt. 1d0) goto 10
x = x * r0
y = y * r0
return
end
subroutine posit2(x, y)
implicit double precision (a-h, o-z)
external ran1
common /ilist3/ size1, size2, size3, v1, v2, v3, size
cc SAVE /ilist3/
common /rndm3/ iseedp
cc SAVE /rndm3/
SAVE
iseed=iseedp
x = 2d0 * ran1(iseed) - 1d0
y = 2d0 * ran1(iseed) - 1d0
x = x * 5d0 * size1
y = y * 5d0 * size2
return
end
subroutine posit3(x, y, z)
implicit double precision (a-h, o-z)
external ran1
common /ilist3/ size1, size2, size3, v1, v2, v3, size
cc SAVE /ilist3/
common /rndm3/ iseedp
cc SAVE /rndm3/
SAVE
iseed=iseedp
x = 2d0 * ran1(iseed) - 1d0
y = 2d0 * ran1(iseed) - 1d0
z = 2d0 * ran1(iseed) - 1d0
x = x * 5d0 * size1
y = y * 5d0 * size2
z = z * 5d0 * size3
return
end
subroutine energy(e, temp)
c to generate the magnitude of the momentum e,
c knowing the temperature of the local thermal distribution temp
implicit double precision (a-h, o-z)
external ran1
common /para2/ xmp, xmu, alpha, rscut2, cutof2
cc SAVE /para2/
common /rndm3/ iseedp
cc SAVE /rndm3/
SAVE
iseed=iseedp
1000 continue
e = ran1(iseed)
e = e * ran1(iseed)
e = e * ran1(iseed)
if (e .le. 0d0) goto 1000
e = - temp * log(e)
if (ran1(iseed) .gt.
& exp((e - dsqrt(e ** 2 + xmp ** 2))/temp)) then
goto 1000
end if
return
end
subroutine momntm(px, py, pz, e)
c to generate the 3 components of the momentum px, py, pz,
c from the magnitude of the momentum e
implicit double precision (a-h,o-z)
external ran1
parameter (pi = 3.14159265358979d0)
common /rndm3/ iseedp
cc SAVE /rndm3/
SAVE
iseed=iseedp
cost = 2d0 * ran1(iseed) - 1d0
c 7/20/01:
c sint = sqrt(1d0 - cost ** 2)
sint = dsqrt(1d0 - cost ** 2)
phi = 2d0 * pi * ran1(iseed)
px = e * sint * cos(phi)
py = e * sint * sin(phi)
pz = e * cost
return
end
subroutine boosti
implicit double precision (a-h, o-z)
parameter (MAXPTN=400001)
common /para1/ mul
cc SAVE /para1/
common /para6/ centy
cc SAVE /para6/
COMMON /prec1/GX0(MAXPTN),GY0(MAXPTN),GZ0(MAXPTN),FT0(MAXPTN),
& PX0(MAXPTN), PY0(MAXPTN), PZ0(MAXPTN), E0(MAXPTN),
& XMASS0(MAXPTN), ITYP0(MAXPTN)
cc SAVE /prec1/
common /lor/ enenew, pxnew, pynew, pznew
cc SAVE /lor/
SAVE
external lorenz
bex = 0d0
bey = 0d0
bez = - tanh(centy)
c save data for many runs of the same initial condition
do 1001 i = 1, mul
px1 = gx0(i)
py1 = gy0(i)
pz1 = gz0(i)
e1 = ft0(i)
call lorenz(e1, px1, py1, pz1, bex, bey, bez)
gx0(i) = pxnew
gy0(i) = pynew
gz0(i) = pznew
ft0(i) = enenew
px1 = px0(i)
py1 = py0(i)
pz1 = pz0(i)
e1 = e0(i)
call lorenz(e1, px1, py1, pz1, bex, bey, bez)
px0(i) = pxnew
py0(i) = pynew
pz0(i) = pznew
e0(i) = enenew
1001 continue
return
end
******************************************************************************
subroutine inirun
SAVE
c sort prec2 according to increasing formation time
call ftime
call inirec
call iilist
call inian2
return
end
subroutine ftime
c this subroutine generates formation time for the particles
c indexing ft(i)
c input e(i)
c output ft(i), indx(i)
implicit double precision (a-h, o-z)
external ftime1
parameter (MAXPTN=400001)
common /para1/ mul
cc SAVE /para1/
common /para2/ xmp, xmu, alpha, rscut2, cutof2
cc SAVE /para2/
common /para4/ iftflg, ireflg, igeflg, ibstfg
cc SAVE /para4/
COMMON /prec1/GX0(MAXPTN),GY0(MAXPTN),GZ0(MAXPTN),FT0(MAXPTN),
& PX0(MAXPTN), PY0(MAXPTN), PZ0(MAXPTN), E0(MAXPTN),
& XMASS0(MAXPTN), ITYP0(MAXPTN)
cc SAVE /prec1/
common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
cc SAVE /prec4/
common /ilist4/ ifmpt, ichkpt, indx(MAXPTN)
cc SAVE /ilist4/
common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
cc SAVE /ilist5/
common /par1/ formt
cc SAVE /par1/
common/anim/nevent,isoft,isflag,izpc
cc SAVE /anim/
common /rndm3/ iseedp
cc SAVE /rndm3/
SAVE
iseed=iseedp
clin-6/07/02 initialize here to expedite compiling, instead in zpcbdt:
do 1001 i = 1, MAXPTN
ct(i)=0d0
ot(i)=0d0
1001 continue
tlarge=1000000.d0
clin-6/07/02-end
if (iftflg .eq. 0) then
c 5/01/01 different prescription for parton initial formation time:
if(isoft.eq.3.or.isoft.eq.4.or.isoft.eq.5) then
do 1002 i = 1, mul
if (ft0(i) .gt. tlarge) ft0(i) = tlarge
1002 continue
goto 150
else
c 5/01/01-end
do 1003 i = 1, MAXPTN
ft0(i) = tlarge
1003 continue
do 1004 i = 1, mul
xmt2 = px0(i) ** 2 + py0(i) ** 2 + xmp ** 2
formt = xmt2 / e0(i)
ft0(i) = ftime1(iseed)
if (ft0(i) .gt. tlarge) ft0(i) = tlarge
1004 continue
c 5/01/01:
endif
end if
c 5/01/01:
150 continue
c call index1(MAXPTN, mul, ft0, indx)
if (mul .gt. 1) then
call index1(MAXPTN, mul, ft0, indx)
else
clin-7/09/03: need to set value for mul=1:
indx(1)=1
end if
c
return
end
subroutine inirec
implicit double precision (a-h, o-z)
external ran1
parameter (MAXPTN=400001)
common /para1/ mul
cc SAVE /para1/
common /para4/ iftflg, ireflg, igeflg, ibstfg
cc SAVE /para4/
common /para5/ iconfg, iordsc
cc SAVE /para5/
COMMON /prec1/GX0(MAXPTN),GY0(MAXPTN),GZ0(MAXPTN),FT0(MAXPTN),
& PX0(MAXPTN), PY0(MAXPTN), PZ0(MAXPTN), E0(MAXPTN),
& XMASS0(MAXPTN), ITYP0(MAXPTN)
cc SAVE /prec1/
common /prec2/gx(MAXPTN),gy(MAXPTN),gz(MAXPTN),ft(MAXPTN),
& px(MAXPTN), py(MAXPTN), pz(MAXPTN), e(MAXPTN),
& xmass(MAXPTN), ityp(MAXPTN)
cc SAVE /prec2/
common /prec3/gxs(MAXPTN),gys(MAXPTN),gzs(MAXPTN),fts(MAXPTN),
& pxs(MAXPTN), pys(MAXPTN), pzs(MAXPTN), es(MAXPTN),
& xmasss(MAXPTN), ityps(MAXPTN)
cc SAVE /prec3/
common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
cc SAVE /prec4/
common /prec5/ eta(MAXPTN), rap(MAXPTN), tau(MAXPTN)
cc SAVE /prec5/
common /prec6/ etas(MAXPTN), raps(MAXPTN), taus(MAXPTN)
cc SAVE /prec6/
common /ilist4/ ifmpt, ichkpt, indx(MAXPTN)
cc SAVE /ilist4/
cbz1/25/99
COMMON /ilist7/ LSTRG0(MAXPTN), LPART0(MAXPTN)
cc SAVE /ilist7/
COMMON /ilist8/ LSTRG1(MAXPTN), LPART1(MAXPTN)
cc SAVE /ilist8/
cbz1/25/99end
COMMON /smearz/smearp,smearh
cc SAVE /smearz/
clin-8/2015:
c dimension vxp(MAXPTN), vyp(MAXPTN), vzp(MAXPTN)
common /precpb/vxp(MAXPTN),vyp(MAXPTN),vzp(MAXPTN)
clin-8/2015:
common /precpa/vxp0(MAXPTN),vyp0(MAXPTN),vzp0(MAXPTN),
1 xstrg0(MAXPTN),ystrg0(MAXPTN),
2 xstrg(MAXPTN),ystrg(MAXPTN),istrg0(MAXPTN),istrg(MAXPTN)
c common /precpa/ vxp0(MAXPTN), vyp0(MAXPTN), vzp0(MAXPTN)
cc SAVE /precpa/
common/anim/nevent,isoft,isflag,izpc
cc SAVE /anim/
clin-6/06/02 local parton freezeout:
common /frzprc/
& gxfrz(MAXPTN), gyfrz(MAXPTN), gzfrz(MAXPTN), ftfrz(MAXPTN),
& pxfrz(MAXPTN), pyfrz(MAXPTN), pzfrz(MAXPTN), efrz(MAXPTN),
& xmfrz(MAXPTN),
& tfrz(302), ifrz(MAXPTN), idfrz(MAXPTN), itlast
cc SAVE /frzprc/
common /rndm3/ iseedp
cc SAVE /rndm3/
common /para7/ ioscar,nsmbbbar,nsmmeson
COMMON /AREVT/ IAEVT, IARUN, MISS
SAVE
iseed=iseedp
clin-6/06/02 local freezeout initialization:
if(isoft.eq.5) then
itlast=0
call inifrz
endif
do 1001 i = 1, mul
clin-7/09/01 define indx(i) to save time:
c ityp(i) = ityp0(indx(i))
c gx(i) = gx0(indx(i))
c gy(i) = gy0(indx(i))
c gz(i) = gz0(indx(i))
c ft(i) = ft0(indx(i))
c px(i) = px0(indx(i))
c py(i) = py0(indx(i))
c pz(i) = pz0(indx(i))
c e(i) = e0(indx(i))
c xmass(i) = xmass0(indx(i))
ccbz1/25/99
c LSTRG1(I) = LSTRG0(INDX(I))
c LPART1(I) = LPART0(INDX(I))
ccbz1/25/99end
indxi=indx(i)
ityp(i) = ityp0(indxi)
gx(i) = gx0(indxi)
gy(i) = gy0(indxi)
gz(i) = gz0(indxi)
ft(i) = ft0(indxi)
px(i) = px0(indxi)
py(i) = py0(indxi)
pz(i) = pz0(indxi)
e(i) = e0(indxi)
xmass(i) = xmass0(indxi)
LSTRG1(I) = LSTRG0(INDXI)
LPART1(I) = LPART0(INDXI)
vxp(I) = vxp0(INDXI)
vyp(I) = vyp0(INDXI)
vzp(I) = vzp0(INDXI)
clin-8/2015:
xstrg0(I) = xstrg(INDXI)
ystrg0(I) = ystrg(INDXI)
istrg0(I) = istrg(INDXI)
clin-7/09/01-end
c
clin-6/06/02 local freezeout initialization:
if(isoft.eq.5) then
idfrz(i)=ityp(i)
gxfrz(i)=gx(i)
gyfrz(i)=gy(i)
gzfrz(i)=gz(i)
ftfrz(i)=ft(i)
pxfrz(i)=px(i)
pyfrz(i)=py(i)
pzfrz(i)=pz(i)
efrz(i)=e(i)
xmfrz(i)=xmass(i)
ifrz(i)=0
endif
clin-6/06/02-end
1001 continue
c save particle info for fixed time analysis
do 1002 i = 1, mul
ityps(i) = ityp(i)
gxs(i) = gx(i)
gys(i) = gy(i)
gzs(i) = gz(i)
fts(i) = ft(i)
pxs(i) = px(i)
pys(i) = py(i)
pzs(i) = pz(i)
es(i) = e(i)
xmasss(i) = xmass(i)
1002 continue
clin-6/2009
if(isoft.eq.1.and.(ioscar.eq.2.or.ioscar.eq.3))
1 write(92,*) iaevt,miss,mul
do 1003 i = 1, mul
energy = e(i)
vx(i) = px(i) / energy
vy(i) = py(i) / energy
vz(i) = pz(i) / energy
if (iftflg .eq. 0) then
formt = ft(i)
c 7/09/01 propagate partons with parent velocity till formation
c so that partons in same hadron have 0 distance:
c gx(i) = gx(i) + vx(i) * formt
c gy(i) = gy(i) + vy(i) * formt
c gz(i) = gz(i) + vz(i) * formt
if(isoft.eq.3.or.isoft.eq.4.or.isoft.eq.5) then
gx(i) = gx(i) + vxp(i) * formt
gy(i) = gy(i) + vyp(i) * formt
gz(i) = gz(i) + vzp(i) * formt
else
gx(i) = gx(i) + vx(i) * formt
gy(i) = gy(i) + vy(i) * formt
gz(i) = gz(i) + vz(i) * formt
endif
c 7/09/01-end
c
c 3/27/00-ctest off no smear z on partons to avoid eta overflow:
c gz(i) = gz(i)+smearp*(2d0 * ran1(iseed) - 1d0)
c to give eta=y +- smearp*random:
c smeary=smearp*(2d0 * ran1(iseed) - 1d0)
c smearf=dexp(2*smeary)*(1+vz(i))/(1-vz(i)+1.d-8)
c gz(i) = gz(i)+formt*(smearf-1)/(smearf+1)
c 3/27/00-end
end if
clin-6/2009 write out initial parton information after string melting
c and after propagating to its format time:
if(ioscar.eq.2.or.ioscar.eq.3) then
if(dmax1(abs(gx(i)),abs(gy(i)),
1 abs(gz(i)),abs(ft(i))).lt.9999) then
clin-8/2015:
write(92,200) ityp(i),px(i),py(i),pz(i),xmass(i),
1 gx(i),gy(i),gz(i),ft(i),istrg0(i),xstrg0(i),ystrg0(i)
else
clin-8/2015:
write(92,201) ityp(i),px(i),py(i),pz(i),xmass(i),
1 gx(i),gy(i),gz(i),ft(i),istrg0(i),xstrg0(i),ystrg0(i)
endif
endif
clin-8/2015:
c 200 format(I6,2(1x,f8.3),1x,f10.3,1x,f6.3,4(1x,f8.2))
c 201 format(I6,2(1x,f8.3),1x,f10.3,1x,f6.3,4(1x,e8.2))
c reduce file size:
c 200 format(I6,2(1x,f8.3),1x,f10.3,1x,f6.3,4(1x,f9.3),
c 1 1x,I6,2(1x,f8.3))
c 201 format(I6,2(1x,f8.3),1x,f10.3,1x,f6.3,4(1x,e9.3),
c 1 1x,I6,2(1x,f8.3))
200 format(I3,2(1x,f7.2),1x,f8.2,1x,f6.3,4(1x,f8.2),
1 1x,I5,2(1x,f7.2))
201 format(I3,2(1x,f7.2),1x,f8.2,1x,f6.3,4(1x,e8.2),
1 1x,I5,2(1x,f7.2))
c
1003 continue
if (iconfg .le. 3) then
do 1004 i = 1, mul
if (ft(i) .le. abs(gz(i))) then
eta(i) = 1000000.d0
else
eta(i) = 0.5d0 * log((ft(i) + gz(i)) / (ft(i) - gz(i)))
end if
if (e(i) .le. abs(pz(i))) then
rap(i) = 1000000.d0
else
rap(i) = 0.5d0 * log((e(i) + pz(i)) / (e(i) - pz(i)))
end if
clin-8/2015 to avoid IEEE_OVERFLOW_FLAG:
c tau(i) = ft(i) / cosh(eta(i))
if(eta(i).lt.1000000.d0) then
tau(i) = ft(i) / cosh(eta(i))
else
tau(i) = 1d-10
endif
c
1004 continue
do 1005 i = 1, mul
etas(i) = eta(i)
raps(i) = rap(i)
taus(i) = tau(i)
1005 continue
end if
return
end
subroutine iilist