9 REAL*8 tscls(20),lums(10),gb(10),tm,tn
10 REAL*8 m0,m1,age,lum,mc,rcc,q,rl1,rl2
12 REAL*8 aj,rhigh,thigh,t,tt,rr,rx,tlow,rlow,del,der,eps,tol
13 parameter(eps = 1.0d-06, tol = 1.0d-04)
27 semi = -0.5*body(i)/h(ipair)
39 IF (radius(j1)/rl1.LT.radius(j2)/rl2)
THEN
54 ELSEIF(kstar(i).GT.0.AND.mod(kstar(i),2).NE.0)
THEN
55 IF(tev(i).GT.9.9d+09) tev(i) = tev0(j1)
66 CALL
star(kw,m0,m1,tm,tn,tscls,lums,gb,zpars)
67 age = tev0(j1)*tstar - epoch(j1)
68 CALL
hrdiag(m0,age,m1,tm,tn,tscls,lums,gb,zpars,
69 & rsj,lum,kw,mc,rcc,menv,renv,k2)
80 IF(kstar(j1).GE.10)
THEN
89 IF(kw.LE.1.OR.kw.EQ.7)
THEN
91 CALL
hrdiag(m0,aj,m1,tm,tn,tscls,lums,gb,zpars,
92 & rhigh,lum,kw,mc,rcc,menv,renv,k2)
93 IF(rhigh.GT.rls.AND.aj.GT.age)
THEN
99 10 t = 0.5d0*(thigh + tlow)
100 CALL
hrdiag(m0,t,m1,tm,tn,tscls,lums,gb,zpars,
101 & rr,lum,kw,mc,rcc,menv,renv,k2)
109 IF(abs(rr-rls).GT.0.1)
THEN
110 WRITE(38,*)
' TRFLOW KW1: ',rr,rls,t,tm
113 IF(abs(rr - rls).LE.0.001*rr.OR.it.GT.25) goto 200
125 aj = min(tn,tscls(1))*(1.d0-eps)
126 CALL
hrdiag(m0,aj,m1,tm,tn,tscls,lums,gb,zpars,
127 & rhigh,lum,kw,mc,rcc,menv,renv,k2)
128 IF(rhigh.GT.rls.AND.aj.GT.age)
THEN
131 t = log(rls/rr)/log(rhigh/rr)
132 t = tm + t*(tscls(1) - tm)
135 IF(tn.LE.tscls(1)) goto 200
142 aj = min(tn,tscls(2))*(1.d0-eps)
143 CALL
hrdiag(m0,aj,m1,tm,tn,tscls,lums,gb,zpars,
144 & rhigh,lum,kw,mc,rcc,menv,renv,k2)
151 del =
rgbf(m1,lum) - rls
152 IF(it.EQ.25.AND.abs(del).GT.0.1)
THEN
153 WRITE(38,*)
' TRFLOW KW3: ',
rgbf(m1,lum),rls,lum,lums(3)
155 IF(abs(del/rls).LE.tol.OR.it.EQ.25) goto 40
160 IF(lum.LE.lums(6))
THEN
161 t = tscls(4) - (1.d0/((gb(5)-1.d0)*gb(1)*gb(4)))*
162 & ((gb(4)/lum)**((gb(5)-1.d0)/gb(5)))
164 t = tscls(5) - (1.d0/((gb(6)-1.d0)*gb(1)*gb(3)))*
165 & ((gb(3)/lum)**((gb(6)-1.d0)/gb(6)))
172 IF(m0.LT.zpars(2).OR.tn.LE.tscls(2)) goto 200
180 IF(tn.LT.(tscls(2)+tscls(3)))
THEN
181 t = max(tscls(2),age)
182 aj = t + 0.5d0*(tn - t)
183 CALL
hrdiag(m0,aj,m1,tm,tn,tscls,lums,gb,zpars,
184 & rhigh,lum,kw,mc,rcc,menv,renv,k2)
194 aj = (tscls(2)+tscls(3))*(1.d0-eps)
195 CALL
hrdiag(m0,aj,m1,tm,tn,tscls,lums,gb,zpars,
196 & rhigh,lum,kw,mc,rcc,menv,renv,k2)
197 IF(rhigh.LT.rls) goto 50
204 60 t = 0.5d0*(thigh + tlow)
205 CALL
hrdiag(m0,t,m1,tm,tn,tscls,lums,gb,zpars,
206 & rr,lum,kw,mc,rcc,menv,renv,k2)
214 IF(abs(rr-rls).GT.0.1)
THEN
215 WRITE(38,*)
' TRFLOW KW4: ',rr,rls,tscls(2),t,tscls(3)
218 IF(abs(rr - rls).LE.0.001*rr.OR.it.GT.25) goto 200
237 rr =
ragbf(m1,lum,zpars(2))
246 rr =
ragbf(m1,lum,zpars(2))
248 IF(it.EQ.25.AND.abs(del).GT.0.1)
THEN
249 WRITE(38,*)
' TRFLOW KW6: ',rr,rls,lum,lums(7)
251 IF(abs(del/rls).LE.tol.OR.it.EQ.25) goto 80
252 der =
ragbdf(m1,lum,zpars(2))
256 IF(lum.LE.lums(8))
THEN
257 IF(lum.LE.lums(6))
THEN
258 t = tscls(7) - (1.d0/((gb(5)-1.d0)*gb(8)*gb(4)))*
259 & ((gb(4)/lum)**((gb(5)-1.d0)/gb(5)))
261 t = tscls(8) - (1.d0/((gb(6)-1.d0)*gb(8)*gb(3)))*
262 & ((gb(3)/lum)**((gb(6)-1.d0)/gb(6)))
265 IF(lum.LE.lums(6))
THEN
266 t = tscls(10) - (1.d0/((gb(5)-1.d0)*gb(2)*gb(4)))*
267 & ((gb(4)/lum)**((gb(5)-1.d0)/gb(5)))
269 t = tscls(11) - (1.d0/((gb(6)-1.d0)*gb(2)*gb(3)))*
270 & ((gb(3)/lum)**((gb(6)-1.d0)/gb(6)))
280 lum = (rls/0.08d0)**(4.0/3.0)
281 cm = 2.0d-03*m1**2.5/(2.d0 + m1**5)
282 IF(cm*lum.GE.100.d0)
THEN
287 rr = rx*(lum/lums(2))**0.2 +
288 & 0.02d0*(exp(cm*lum) - exp(cm*lums(2)))
294 rr = rx*(lum/lums(2))**0.2 +
295 & 0.02d0*(exp(cm*lum) - exp(cm*lums(2)))
296 IF(rr.LE.rls) goto 89
300 90 lum = 0.5d0*(thigh + tlow)
301 rr = rx*(lum/lums(2))**0.2 +
302 & 0.02d0*(exp(cm*lum) - exp(cm*lums(2)))
310 IF(abs(rr-rls).GT.0.1)
THEN
311 WRITE(38,*)
' TRFLOW KW9: ',rr,rls,t,tm
314 IF(abs(rr - rls).LE.0.001*rr.OR.it.GT.25) goto 95
321 IF(lum.LE.lums(6))
THEN
322 t = tscls(4) - (1.d0/((gb(5)-1.d0)*gb(8)*gb(4)))*
323 & ((gb(4)/lum)**((gb(5)-1.d0)/gb(5)))
325 t = tscls(5) - (1.d0/((gb(6)-1.d0)*gb(8)*gb(3)))*
326 & ((gb(3)/lum)**((gb(6)-1.d0)/gb(6)))
334 tt = (t+epoch(j1))/tstar
336 IF(dtr.LT.0.d0.AND.itev)
THEN
337 tev(j1) = min(tev(j1),time)
341 IF(tev(j1).LT.tev0(j1))
THEN
342 WRITE (6,101)j1,kstar(j1),tev(j1)+toff,ttot
343 101
FORMAT(
' TRFLOW WARNING! TEV<TEV0 ',i6,i4,2f10.3)