1 SUBROUTINE imf2(BODY10,BODYN)
13 common/work1/ bcm(nmax)
14 REAL*8 copyx(3,nmax),copyv(3,nmax)
19 DATA g1,g2,g3,g4 /0.19,1.55,0.050,0.6/
35 IF (kz(20).EQ.2.OR.kz(20).EQ.4)
THEN
36 zm = 0.08 + (g1*xx**g2 + g3*xx**g4)/(1.0 - xx)**0.58
37 ELSE IF (kz(20).EQ.3.OR.kz(20).EQ.5)
THEN
38 zm = 0.3*xx/(1.0 - xx)**0.55
40 ELSE IF (kz(20).EQ.6.OR.kz(20).EQ.7)
THEN
49 IF (zm.GE.bodyn.AND.zm.LE.body10)
THEN
51 zmass = zmass + body(i)
57 IF (body(i).GT.bdymax)
THEN
65 zmass = zmass - body(imaxx)
67 zmass = zmass + body(imaxx)
71 IF (nbin0.EQ.0) go to 50
75 bcm(i) = body(2*i-1) + body(2*i)
77 kcm(2*i-1) = kstar(2*i-1)
83 CALL
sort1(nbin0,bcm,jlist)
89 body0(2*i-1) = max(body(2*jb-1),body(2*jb))/zmass
90 body0(2*i) = min(body(2*jb-1),body(2*jb))/zmass
100 zmb = body0(2*i-1) + body0(2*i)
101 ratio = body0(2*i-1)/body0(2*i)
102 body0(2*i) = zmb/(1.0 + ratio**0.4)
103 body0(2*i-1) = zmb - body0(2*i)
105 kstar(2*i-1) = kcm(2*jb-1)
106 kstar(2*i) = kcm(2*jb)
112 body(nbin0-i+1) = bcm(i)
116 WRITE (6,45) nbin0, body(1), body(nbin0), zmb/float(nbin0)
117 45
FORMAT (//,12x,
'BINARY STAR IMF: NB =',i6,
118 &
' RANGE =',1p,2e10.2,
' <MB> =',e9.2)
121 50
IF (n.LE.nbin0) go to 90
124 body(nbin0+l) = body(2*nbin0+l)
126 bcm(ns) = body(nbin0+l)
127 kcm(ns) = kstar(2*nbin0+l)
131 copyx(k,ns) = x(k,nbin0 + l)
132 copyv(k,ns) = xdot(k,nbin0 + l)
138 CALL
sort1(ns,bcm,jlist)
145 kstar(n-i+1+nbin0) = kcm(jlist(i))
150 x(k,n-i+1) = copyx(k,j)
151 xdot(k,n-i+1) = copyv(k,j)
155 WRITE (6,80) n-nbin0, body(nbin0+1), body(n), zms/float(n-nbin0)
156 80
FORMAT (/,12x,
'SINGLE STAR IMF: NS =',i6,
' RANGE =',1p,2e10.2,
160 90 zmbar = zmass/float(n)