2 SUBROUTINE comenv(M01,M1,MC1,AJ1,JSPIN1,KW1,
3 & m02,m2,mc2,aj2,jspin2,kw2,ecc,sep,coel)
12 REAL*8 m01,m1,mc1,aj1,jspin1,r1,l1
13 REAL*8 m02,m2,mc2,aj2,jspin2,r2,l2,mc22
14 REAL*8 tscls1(20),tscls2(20),lums(10),gb(10),tm1,tm2,tn
15 REAL*8 ebindi,ebindf,eorbi,eorbf,
ecirc
17 REAL*8 ecc,sep,sepf,sepl,mf,xx
18 REAL*8 const,dely,deri,delmf,mc3,fage1,fage2
19 REAL*8 tb,oorb,ospin1,ospin2
20 REAL*8 rc1,rc2,q1,q2,rl1,rl2
21 REAL*8 menv,renv,menvd,rzams
22 REAL*8 lamb1,lamb2,k21,k22
23 REAL*8 aursun,k3,lambda,alpha1,mch
24 parameter(aursun = 214.95d0,k3 = 0.21d0)
25 parameter(lambda = 0.d0,alpha1 = 3.d0)
26 parameter(mch = 1.44d0)
41 CALL
star(kw1,m01,m1,tm1,tn,tscls1,lums,gb,zpars)
42 IF(aj1.GT.tn) aj1 = tn
43 CALL
hrdiag(m01,aj1,m1,tm1,tn,tscls1,lums,gb,zpars,
44 & r1,l1,kw1,mc1,rc1,menv,renv,k21)
45 ospin1 = jspin1/(k21*r1*r1*(m1-mc1)+k3*rc1*rc1*mc1)
49 lamb1 =
celamf(kw,m01,l1,r1,rzams,menvd,lambda)
53 IF(kw.NE.kw1)
WRITE(38,*)
' COMENV TYPE CHANGE *1'
56 CALL
star(kw2,m02,m2,tm2,tn,tscls2,lums,gb,zpars)
57 IF(aj2.GT.tn) aj2 = tn
58 CALL
hrdiag(m02,aj2,m2,tm2,tn,tscls2,lums,gb,zpars,
59 & r2,l2,kw2,mc2,rc2,menv,renv,k22)
60 ospin2 = jspin2/(k22*r2*r2*(m2-mc2)+k3*rc2*rc2*mc2)
61 IF(kw.NE.kw2)
WRITE(38,*)
' COMENV TYPE CHANGE *2'
64 tb = (sep/aursun)*sqrt(sep/(aursun*(m1+m2)))
68 WRITE(38,66)kw1,m01,m1,mc1,aj1,sep
69 66
FORMAT(
' COMENV OLD *1:',i4,3f7.2,f9.2,f12.4)
70 WRITE(38,67)kw2,m02,m2,mc2,aj2
71 67
FORMAT(
' COMENV OLD *2:',i4,3f7.2,f9.2)
75 ebindi = m1*(m1-mc1)/(lamb1*r1)
79 eorbi = mc1*m2/(2.d0*sep)
85 IF(eccflg.AND.ecc.GT.0.01d0)
THEN
102 qp = sep*(1.d0 - ecc)/(r1 + r2)
103 yp = 0.5d0*(qp - 0.5d0)**3 - 0.375d0*(qp - 0.5d0) + 0.125d0
108 IF (m1-mc1.LT.0.05) de = ebindi
110 mf = 0.5d0*(mc1 + sqrt(mc1*mc1 + 4.d0*lamb1*r1*ebindf))
111 eorbi = mf*m2/(2.d0*sep)
112 ecirc = eorbi/(1.d0 - ecc*ecc)
113 eorbf = eorbi + de/alpha1
114 IF(eorbf.LT.
ecirc)
THEN
116 ecc = sqrt(1.d0 - eorbf/
ecirc)
119 efac = ecc*ecc/(1.d0 - ecc*ecc)
122 bb = (2.d0*m1-mc1)/(lamb1*r1) + alpha1*efac*m2/(2.d0*sep)
124 cc = alpha1*efac*m1*m2/(2.d0*sep)
125 dm = (bb - sqrt(bb*bb - 4.d0*aa*cc))/(2.d0*aa)
126 IF(dm.LE.0.0.OR.dm.GT.(m1-mc1))
THEN
127 WRITE(*,*)
' WARNING: CE DM ',dm,m1,mc1
130 ebindf = m1*(m1-mc1)/(lamb1*r1)
132 eorbf = eorbi + de/alpha1
135 sepf = m1*m2/(2.d0*eorbf)
136 IF((m1-mc1).LT.1.0d-07)
THEN
138 CALL
star(kw1,m01,m1,tm1,tn,tscls1,lums,gb,zpars)
139 CALL
hrdiag(m01,aj1,m1,tm1,tn,tscls1,lums,gb,zpars,
140 & r1,l1,kw1,mc1,rc1,menv,renv,k21)
142 aj1 = (aj1 - tscls1(2))/tscls1(3)
143 CALL
gntage(mc1,m1,kw1,zpars,m01,aj1)
150 IF(kw2.GE.2.AND.kw2.LE.9.AND.kw2.NE.7)
THEN
152 menvd = menv/(m2-mc2)
154 lamb2 =
celamf(kw,m02,l2,r2,rzams,menvd,lambda)
158 ebindi = ebindi + m2*(m2-mc2)/(lamb2*r2)
162 eorbi = mc1*mc2/(2.d0*sep)
168 eorbf = eorbi + ebindi/alpha1
172 IF(kw2.LE.1.OR.kw2.EQ.7)
THEN
173 sepf = mc1*m2/(2.d0*eorbf)
189 IF(rc1/rl1.GE.r2/rl2)
THEN
194 IF(rc1.GT.rl1*sepf)
THEN
199 IF(r2.GT.rl2*sepf)
THEN
206 kw = ktype(kw1,kw2) - 100
208 IF(kw2.EQ.7.AND.kw.EQ.4) mc3 = mc3 + m2
212 eorbf = max(mc1*m2/(2.d0*sepl),eorbi)
213 ebindf = ebindi - alpha1*(eorbf - eorbi)
220 CALL
star(kw1,m01,m1,tm1,tn,tscls1,lums,gb,zpars)
221 CALL
hrdiag(m01,aj1,m1,tm1,tn,tscls1,lums,gb,zpars,
222 & r1,l1,kw1,mc1,rc1,menv,renv,k21)
229 sepf = mc1*mc2/(2.d0*eorbf)
247 IF(rc1/rl1.GE.rc2/rl2)
THEN
248 IF(rc1.GT.rl1*sepf)
THEN
253 IF(rc2.GT.rl2*sepf)
THEN
279 kw = ktype(kw1,kw2) - 100
284 eorbf = max(mc1*mc2/(2.d0*sepl),eorbi)
285 ebindf = ebindi - alpha1*(eorbf - eorbi)
290 IF(kw1.EQ.6.AND.(kw2.EQ.6.OR.kw2.GE.11))
THEN
291 CALL
dgcore(kw1,kw2,kw,mc1,mc2,mc3,ebindf)
293 IF(kw1.LE.3.AND.m01.LE.zpars(2))
THEN
294 IF((kw2.GE.2.AND.kw2.LE.3.AND.m02.LE.zpars(2)).OR.
296 CALL
dgcore(kw1,kw2,kw,mc1,mc2,mc3,ebindf)
301 IF(kw.LT.15) m01 = mc3
317 CALL
star(kw1,m01,m1,tm1,tn,tscls1,lums,gb,zpars)
318 CALL
hrdiag(m01,aj1,m1,tm1,tn,tscls1,lums,gb,zpars,
319 & r1,l1,kw1,mc1,rc1,menv,renv,k21)
323 CALL
star(kw2,m02,m2,tm2,tn,tscls2,lums,gb,zpars)
324 CALL
hrdiag(m02,aj2,m2,tm2,tn,tscls2,lums,gb,zpars,
325 & r2,l2,kw2,mc2,rc2,menv,renv,k22)
331 IF(kw.EQ.4.OR.kw.EQ.7)
THEN
339 fage1 = (aj1 - tscls1(2))/(tscls1(13) - tscls1(2))
341 IF(kw2.LE.3.OR.kw2.EQ.10)
THEN
349 fage2 = (aj2 - tscls2(2))/(tscls2(13) - tscls2(2))
361 tb = (sepl/aursun)*sqrt(sepl/(aursun*(mc1+mc2)))
365 IF(ebindf.LE.0.d0)
THEN
369 const = ((m1+m2)**xx)*(m1-mc1+m2-mc22)*ebindf/ebindi
374 mf = max(mc1 + mc22,(m1 + m2)*(ebindf/ebindi)**(1.d0/xx))
375 10 dely = (mf**xx)*(mf - mc1 - mc22) -
const
377 IF(abs(dely/mf).LE.1.0d-03) goto 20
378 deri = mf**zpars(7)*((1.d0+xx)*mf - xx*(mc1 + mc22))
385 20
IF(mc22.EQ.0.d0) mf = max(mf,mc1+m2)
393 CALL
star(kw,m1,m1,tm2,tn,tscls2,lums,gb,zpars)
396 aj1 = tm2 + (tscls2(1) - tm2)*(aj1-tm1)/(tscls1(1) - tm1)
397 CALL
star(kw,m01,m1,tm1,tn,tscls1,lums,gb,zpars)
401 CALL
star(kw,m01,m1,tm1,tn,tscls1,lums,gb,zpars)
402 aj1 = tm1*(fage1*mc1 + fage2*mc22)/(mc1 + mc22)
403 ELSEIF(kw.EQ.4.OR.mc2.GT.0.d0.OR.kw.NE.kw1)
THEN
404 IF(kw.EQ.4) aj1 = (fage1*mc1 + fage2*mc22)/(mc1 + mc22)
410 CALL
gntage(mc1,m1,kw,zpars,m01,aj1)
411 CALL
star(kw,m01,m1,tm1,tn,tscls1,lums,gb,zpars)
413 CALL
hrdiag(m01,aj1,m1,tm1,tn,tscls1,lums,gb,zpars,
414 & r1,l1,kw,mc1,rc1,menv,renv,k21)
415 jspin1 = oorb*(k21*r1*r1*(m1-mc1)+k3*rc1*rc1*mc1)
431 tb = (sepf/aursun)*sqrt(sepf/(aursun*(m1+m2)))
439 jspin1 = ospin1*(k21*r1*r1*(m1-mc1)+k3*rc1*rc1*mc1)
440 jspin2 = ospin2*(k22*r2*r2*(m2-mc2)+k3*rc2*rc2*mc2)
443 aj1 = max(aj1,1.0d-10)
444 aj2 = max(aj2,1.0d-10)
448 WRITE(38,68)kw1,m01,m1,mc1,aj1
449 68
FORMAT(
' COMENV NEW *1:',i4,3f7.2,f9.2)
450 WRITE(38,69)kw2,m02,m2,mc2,aj2
451 69
FORMAT(
' COMENV NEW *2:',i4,3f7.2,f9.2)