1 c 10.04.2003 Main program and random number generator of epos
2 c (Do not compile it for CONEX or Corsika)
4 c-----------------------------------------------------------------------
6 c-----------------------------------------------------------------------
17 if(nopen.eq.-1) then !after second round aread
23 call utpri('aamain',ish,ishini,4)
24 if(model.ne.1)call IniModel(model)
29 ! if (nrebin.eq.1) call xini
32 write(ifmt,'(a,i10,a,f10.2,a)')'generate',nevent
33 & ,' events for engy =',engy,' ...'
34 if(icotabr.eq.1)nevent=1
35 if(icotabr.eq.1)nrevt=1
36 if(nfull.gt.0)nevent=nfreeze*nfull
37 if(mod(nevent,nfreeze).ne.0)
38 & stop'nevent must be a multiple of nfreeze!!!!!!!!! '
39 if(istore.ne.0) call bstora
42 if(istore.ge.1.and.istore.le.4) call bstore
43 if(istore.eq.5) call ustore
52 if(istore.eq.3) write(ifdt,*) ' 0 0 '
53 99 write(6,'(a)')'rewind copy-file'
58 call utprix('aamain',ish,ishini,4)
66 if(irewch.eq.1)rewind(ifch)
67 nfr=mod(n-1,nfreeze)*ispherio
69 do nin=1,iabs(ninicon)
70 if(icotabr.eq.0)call aepos(isign(1,-ninicon)*nin)
71 if(icocore.ne.0)call IniCon(nin)
73 77 if(ispherio.ne.0)then
74 if(nfr.eq.0)write(ifmt,'(a)')
75 & 'spherio evolution + hadronization ...'
76 if(mod(nfr+1,50).eq.0)
77 & write(ifmt,*)'hadronization ',nfr+1,' / ',nfreeze
78 c call spherio2(nrevt,nfr)
79 if(ish.ge.2)call alist('list after spherio&',1,nptl)
81 if(ish.ge.2)call alist('list after decay&',1,nptl)
84 if(iurqmd.eq.1)call urqmd
87 if(nfr+1.eq.nfreeze.or.ispherio.eq.0)call aseed(1)
91 subroutine setinp(ifname, nifname)
96 open(UNIT=ifop,FILE=ifname(1:nifname),STATUS='UNKNOWN')
97 write(*, '(a,a)')'Connecting input to file: ', ifname(1:nifname)
100 c-----------------------------------------------------------------------
102 c-----------------------------------------------------------------------
103 c generates a random number
104 c-----------------------------------------------------------------------
107 if(rangen.le.0.)goto1
108 if(rangen.ge.1.)goto1
109 if(irandm.eq.1)write(ifch,*)'rangen()= ',rangen
114 c-----------------------------------------------------------------------
115 double precision function drangen(dummy)
116 c-----------------------------------------------------------------------
117 c generates a random number
118 c-----------------------------------------------------------------------
120 double precision dummy,dranf
122 if(drangen.le.0.d0)goto1
123 if(drangen.ge.1.d0)goto1
124 if(irandm.eq.1)write(ifch,*)'rangen()= ',drangen
129 c-----------------------------------------------------------------------
130 function cxrangen(dummy)
131 c-----------------------------------------------------------------------
132 c generates a random number
133 c-----------------------------------------------------------------------
135 double precision dummy
137 if(cxrangen.le.0.)goto1
138 if(cxrangen.ge.1.)goto1
139 if(irandm.eq.1)write(ifch,*)'rangen()= ',cxrangen
144 c-----------------------------------------------------------------------
146 c-----------------------------------------------------------------------
147 c uniform random number generator from cern library
148 c-----------------------------------------------------------------------
149 double precision dranf, g900gt, g900st
150 double precision ds(2), dm(2), dseed
151 double precision dx24, dx48
152 double precision dl, dc, du, dr
154 data ds / 1665 1885.d0, 286 8876.d0 /
155 data dm / 1518 4245.d0, 265 1554.d0 /
156 data dx24 / 1677 7216.d0 /
157 data dx48 / 281 4749 7671 0656.d0 /
162 10 dl = ds(1) * dm(1)
165 du = ds(1)*dm(2) + ds(2)*dm(1) + dc
166 ds(2) = du - dint(du/dx24)*dx24
168 dr = (ds(2)*dx24 + ds(1)) / dx48
176 g900gt = ds(2)*dx24 + ds(1)
179 ds(2) = dint(dseed/dx24)
180 ds(1) = dseed - ds(2)*dx24
185 c-----------------------------------------------------------------------
186 subroutine ranfgt(seed)
187 c-----------------------------------------------------------------------
188 double precision seed, g900gt, g900st, dummy