1 SUBROUTINE gntage(mc,mt,kw,zpars,m0,aj)
19 real*8 mc,mt,m0,aj,tm,tn
20 real*8 tscls(20),lums(10),gb(10),zpars(20)
21 real*8 mmin,mmax,mmid,dm,f,fmid,dell,derl,lum
23 parameter(macc=0.00001d0,lacc=0.0001d0,tiny=1.0d-14)
35 mcy =
mcheif(zpars(2),zpars(2),zpars(10))
42 mcy =
mcheif(zpars(3),zpars(2),zpars(9))
54 mcy = 0.44d0*2.25d0 + 0.448d0
59 mcx = (mc + 0.35d0)/0.773d0
60 elseif(mc.ge.0.8d0)
then
61 mcx = (mc - 0.448d0)/0.44d0
74 CALL
star(kw,m0,mt,tm,tn,tscls,lums,gb,zpars)
88 CALL
star(kw,m0,mt,tm,tn,tscls,lums,gb,zpars)
89 aj = tscls(2) + tscls(3)
106 mmax =
mheif(mc,zpars(2),zpars(10))
110 elseif(aj.ge.1.d0)
then
115 fmid = (1.d0-aj)*
mcheif(mmax,zpars(2),zpars(10)) +
117 f = (1.d0-aj)*
mcheif(mmin,zpars(2),zpars(10)) +
119 if(f*fmid.ge.0.d0)
then
130 fmid = (1.d0-aj)*
mcheif(mmid,zpars(2),zpars(10)) +
132 if(fmid.lt.0.d0) m0 = mmid
133 if(abs(dm).lt.macc.or.abs(fmid).lt.tiny) goto 20
137 CALL
star(kw,m0,mt,tm,tn,tscls,lums,gb,zpars)
138 aj = tscls(2) + aj*tscls(3)
147 mcy =
mcheif(zpars(3),zpars(2),zpars(9))
149 mcx =
mcheif(zpars(2),zpars(2),zpars(9))
151 m0 =
mheif(mc,zpars(2),zpars(9))
155 CALL
star(kw,m0,mt,tm,tn,tscls,lums,gb,zpars)
159 dell =
lbgbf(m0) - lum
160 if(abs(dell/lum).le.lacc) goto 40
167 CALL
star(kw,m0,mt,tm,tn,tscls,lums,gb,zpars)
168 aj = tscls(1) + 1.0d-06*(tscls(2) - tscls(1))
172 if(kw.eq.8.or.kw.eq.9)
then
180 CALL
star(kw,mmin,mc,tm,tn,tscls,lums,gb,zpars)
181 mcx =
mcgbf(lums(2),gb,lums(6))
185 CALL
star(kw,mmax,mc,tm,tn,tscls,lums,gb,zpars)
186 mcy =
mcgbf(lums(2),gb,lums(6))
187 if(mcy.gt.mc) goto 60
198 CALL
star(kw,mmid,mc,tm,tn,tscls,lums,gb,zpars)
199 mcy =
mcgbf(lums(2),gb,lums(6))
201 if(fmid.lt.0.d0) m0 = mmid
202 if(abs(dm).lt.macc.or.abs(fmid).lt.tiny) goto 80
206 CALL
star(kw,m0,mt,tm,tn,tscls,lums,gb,zpars)
217 CALL
star(kw,m0,mt,tm,tn,tscls,lums,gb,zpars)
218 if(m0.le.zpars(2))
then
219 mcx =
mcgbf(lums(4),gb,lums(6))
221 mcx =
mcheif(m0,zpars(2),zpars(10))
223 mc = mcx + (mcy - mcx)*aj
224 aj = tscls(2) + aj*tscls(3)