8 REAL*8 FUNCTION imfbd(XX,LOM,UPM)
22 REAL*8 ml,mh,m0,m1,m2,mu
23 REAL*8 alpha0,alpha1,alpha2,alpha3,alpha4
24 REAL*8 k,xh,x0,x1,x2,xu,mup
25 REAL*8 mtot,massh,mass0,mass1,mass2,massu
26 REAL*8 xx,lom,upm,lm,um,zm
31 SAVE firstbd,xh,x0,x1,x2,xu,k,lm,um
47 DATA ml, mh, m0, m1, m2, mu/
48 & 0.01d0, 0.08d0, 0.5d0, 1.0d0, 8.0d0, 100.0d0/
49 DATA alpha0, alpha1, alpha2, alpha3, alpha4/
50 & 0.3d0, 1.3d0, 2.3d0, 2.3d0, 2.3d0/
77 IF (.NOT.firstbd.AND.um.EQ.lm)
THEN
89 WRITE(6,
'(a)')
' The 5-part power-law MF:'
90 WRITE(6,
'(a)')
' ML MH M0 M1 M2 MU'
91 WRITE(6,
'(6F8.3)')ml,mh,m0,m1,m2,mu
92 WRITE(6,
'(a)')
' ALPHA0 ALPHA1 ALPHA2 ALPHA3 ALPHA4'
93 WRITE(6,
'(3x,6F8.3)')alpha0,alpha1,alpha2,alpha3,alpha4
100 WRITE(6,*)
' FATAL: ML > MH'
107 WRITE(6,*)
' FATAL: MH > M0'
114 WRITE(6,*)
' FATAL: M0 > M1'
121 WRITE(6,*)
' FATAL: M1 > M2'
128 WRITE(6,*)
' FATAL: M2 > MU'
138 WRITE(6,*)
' WARNING: UM (= ',um,
' Msun) = LM= ',
148 WRITE(6,*)
' FATAL: UM (= ',um,
' Msun) < LM= ',
156 WRITE(6,*)
' FATAL: BODYN (LM= ',lm,
' Msun) > MU'
163 WRITE(6,*)
' WARNING: BODYN (LM= ',lm,
' Msun) < ML'
164 WRITE(6,*)
' BODYN = ',ml,
' Msun adopted.'
170 WRITE(6,*)
' WARNING: BODY1 (UM= ',um,
' Msun) > MU= ',
172 WRITE(6,*)
' BODY1 = ',mu,
' Msun adopted.'
186 IF (lm.GE.ml.AND.lm.LE.mh)
THEN
190 ELSE IF (um.GT.mh)
THEN
194 xh =
intgr(lm,mup,alpha0,beta)
199 ELSE IF (um.GT.m0)
THEN
203 x0 =
intgr(mh,mup,alpha1,beta)
209 ELSE IF (um.GT.m1)
THEN
212 beta = m0**alpha2 * (mh/m0)**alpha1
213 x1 =
intgr(m0,mup,alpha2,beta)
219 ELSE IF (um.GT.m2)
THEN
222 beta = m1**alpha3 * (mh/m0)**alpha1 * (m0/m1)**alpha2
223 x2 =
intgr(m1,mup,alpha3,beta)
228 beta = m2**alpha4 * (mh/m0)**alpha1 * (m0/m1)**alpha2 *
230 xu =
intgr(m2,mup,alpha4,beta)
233 ELSE IF (lm.GT.mh.AND.lm.LE.m0)
THEN
237 ELSE IF (um.GT.m0)
THEN
241 x0 =
intgr(lm,mup,alpha1,beta)
246 ELSE IF (um.GT.m1)
THEN
249 beta = m0**alpha2 * (mh/m0)**alpha1
250 x1 =
intgr(m0,mup,alpha2,beta)
256 ELSE IF (um.GT.m2)
THEN
259 beta = m1**alpha3 * (mh/m0)**alpha1 * (m0/m1)**alpha2
260 x2 =
intgr(m1,mup,alpha3,beta)
265 beta = m2**alpha4 * (mh/m0)**alpha1 * (m0/m1)**alpha2 *
267 xu =
intgr(m2,mup,alpha4,beta)
270 ELSE IF (lm.GT.m0.AND.lm.LE.m1)
THEN
274 ELSE IF (um.GT.m1)
THEN
277 beta = m0**alpha2 * (mh/m0)**alpha1
278 x1 =
intgr(lm,mup,alpha2,beta)
283 ELSE IF (um.GT.m2)
THEN
286 beta = m1**alpha3 * (mh/m0)**alpha1 * (m0/m1)**alpha2
287 x2 =
intgr(m1,mup,alpha3,beta)
292 beta = m2**alpha4 * (mh/m0)**alpha1 * (m0/m1)**alpha2 *
294 xu =
intgr(m2,mup,alpha4,beta)
297 ELSE IF (lm.GT.m1.AND.lm.LE.m2)
THEN
301 ELSE IF (um.GT.m2)
THEN
304 beta = m1**alpha3 * (mh/m0)**alpha1 * (m0/m1)**alpha2
305 x2 =
intgr(lm,mup,alpha3,beta)
309 beta = m2**alpha4 * (mh/m0)**alpha1 * (m0/m1)**alpha2 *
311 xu =
intgr(m2,mup,alpha4,beta)
314 ELSE IF (lm.GT.m2)
THEN
317 beta = m2**alpha4 * (mh/m0)**alpha1 * (m0/m1)**alpha2 *
319 xu =
intgr(lm,mup,alpha4,beta)
324 k = xh + x0 + x1 + x2 + xu
333 WRITE(6,
'(a,F7.3,a,F7.3,a)')
334 &
' Number fractions for LM=',lm,
', Msun, UM=',um,
' Msun:'
335 WRITE(6,
'(F7.3,a,F7.3,a,F7.4)') ml,
' -',mh,
' Msun:', xh
336 WRITE(6,
'(F7.3,a,F7.3,a,F7.4)') mh,
' -',m0,
' Msun:', x0
337 WRITE(6,
'(F7.3,a,F7.3,a,F7.4)') m0,
' -',m1,
' Msun:', x1
338 WRITE(6,
'(F7.3,a,F7.3,a,F7.4)') m1,
' -',m2,
' Msun:', x2
339 WRITE(6,
'(F7.3,a,F7.3,a,F7.4)') m2,
' -',mu,
' Msun:', xu
351 IF (lm.GE.ml.AND.lm.LE.mh)
THEN
355 ELSE IF (um.GT.mh)
THEN
359 massh =
mintgr(lm,mup,alpha0,beta)
364 ELSE IF (um.GT.m0)
THEN
368 mass0 =
mintgr(mh,mup,alpha1,beta)
374 ELSE IF (um.GT.m1)
THEN
377 beta = m0**alpha2 * (mh/m0)**alpha1
378 mass1 =
mintgr(m0,mup,alpha2,beta)
384 ELSE IF (um.GT.m2)
THEN
387 beta = m1**alpha3 * (mh/m0)**alpha1 * (m0/m1)**alpha2
388 mass2 =
mintgr(m1,mup,alpha3,beta)
393 beta = m2**alpha4 * (mh/m0)**alpha1 * (m0/m1)**alpha2 *
395 massu =
mintgr(m2,mup,alpha4,beta)
398 ELSE IF (lm.GT.mh.AND.lm.LE.m0)
THEN
402 ELSE IF (um.GT.m0)
THEN
406 mass0 =
mintgr(lm,mup,alpha1,beta)
411 ELSE IF (um.GT.m1)
THEN
414 beta = m0**alpha2 * (mh/m0)**alpha1
415 mass1 =
mintgr(m0,mup,alpha2,beta)
421 ELSE IF (um.GT.m2)
THEN
424 beta = m1**alpha3 * (mh/m0)**alpha1 * (m0/m1)**alpha2
425 mass2 =
mintgr(m1,mup,alpha3,beta)
430 beta = m2**alpha4 * (mh/m0)**alpha1 * (m0/m1)**alpha2 *
432 massu =
mintgr(m2,mup,alpha4,beta)
435 ELSE IF (lm.GT.m0.AND.lm.LE.m1)
THEN
439 ELSE IF (um.GT.m1)
THEN
442 beta = m0**alpha2 * (mh/m0)**alpha1
443 mass1 =
mintgr(lm,mup,alpha2,beta)
448 ELSE IF (um.GT.m2)
THEN
451 beta = m1**alpha3 * (mh/m0)**alpha1 * (m0/m1)**alpha2
452 mass2 =
mintgr(m1,mup,alpha3,beta)
457 beta = m2**alpha4 * (mh/m0)**alpha1 * (m0/m1)**alpha2 *
459 massu =
mintgr(m2,mup,alpha4,beta)
462 ELSE IF (lm.GT.m1.AND.lm.LE.m2)
THEN
466 ELSE IF (um.GT.m2)
THEN
469 beta = m1**alpha3 * (mh/m0)**alpha1 * (m0/m1)**alpha2
470 mass2 =
mintgr(lm,mup,alpha3,beta)
474 beta = m2**alpha4 * (mh/m0)**alpha1 * (m0/m1)**alpha2 *
476 massu =
mintgr(m2,mup,alpha4,beta)
479 ELSE IF (lm.GT.m2)
THEN
482 beta = m2**alpha4 * (mh/m0)**alpha1 * (m0/m1)**alpha2 *
484 massu =
mintgr(lm,mup,alpha4,beta)
489 mtot = massh + mass0 + mass1 + mass2 + massu
498 WRITE(6,
'(a,F7.3,a,F7.3,a)')
499 &
' Mass fractions for LM=',lm,
', Msun, UM=',um,
' Msun:'
500 WRITE(6,
'(F7.3,a,F7.3,a,F7.4)') ml,
' -',mh,
' Msun:', massh
501 WRITE(6,
'(F7.3,a,F7.3,a,F7.4)') mh,
' -',m0,
' Msun:', mass0
502 WRITE(6,
'(F7.3,a,F7.3,a,F7.4)') m0,
' -',m1,
' Msun:', mass1
503 WRITE(6,
'(F7.3,a,F7.3,a,F7.4)') m1,
' -',m2,
' Msun:', mass2
504 WRITE(6,
'(F7.3,a,F7.3,a,F7.4)') m2,
' -',mu,
' Msun:', massu
505 WRITE(6,
'(a,F7.3,a)')
' Expected average stellar mass: ',
514 IF (lm.GE.ml.AND.lm.LE.mh)
THEN
519 zm =
mgen(xin,lm,alpha0,beta)
520 ELSE IF (xx.GT.xh.AND.xx.LE.(xh+x0))
THEN
523 zm =
mgen(xin,mh,alpha1,beta)
524 ELSE IF (xx.GT.(xh+x0).AND.xx.LE.(xh+x0+x1))
THEN
526 beta = k/m0**alpha2 * (m0/mh)**alpha1
527 zm =
mgen(xin,m0,alpha2,beta)
528 ELSE IF (xx.GT.(xh+x0+x1).AND.xx.LE.(xh+x0+x1+x2))
THEN
530 beta = k/m1**alpha3 * (m1/m0)**alpha2 * (m0/mh)**alpha1
531 zm =
mgen(xin,m1,alpha3,beta)
532 ELSE IF (xx.GT.(xh+x0+x1+x2))
THEN
534 beta = k/m2**alpha4 * (m2/m1)**alpha3 *
535 + (m1/m0)**alpha2 * (m0/mh)**alpha1
536 zm =
mgen(xin,m2,alpha4,beta)
539 ELSE IF (lm.GT.mh.AND.lm.LE.m0)
THEN
541 IF (xx.GT.xh.AND.xx.LE.(xh+x0))
THEN
544 zm =
mgen(xin,lm,alpha1,beta)
545 ELSE IF (xx.GT.(xh+x0).AND.xx.LE.(xh+x0+x1))
THEN
547 beta = k/m0**alpha2 * (m0/mh)**alpha1
548 zm =
mgen(xin,m0,alpha2,beta)
549 ELSE IF (xx.GT.(xh+x0+x1).AND.xx.LE.(xh+x0+x1+x2))
THEN
551 beta = k/m1**alpha3 * (m1/m0)**alpha2 * (m0/mh)**alpha1
552 zm =
mgen(xin,m1,alpha3,beta)
553 ELSE IF (xx.GT.(xh+x0+x1+x2))
THEN
555 beta = k/m2**alpha4 * (m2/m1)**alpha3 *
556 + (m1/m0)**alpha2 * (m0/mh)**alpha1
557 zm =
mgen(xin,m2,alpha4,beta)
560 ELSE IF (lm.GT.m0.AND.lm.LE.m1)
THEN
562 IF (xx.GT.(xh+x0).AND.xx.LE.(xh+x0+x1))
THEN
564 beta = k/m0**alpha2 * (m0/mh)**alpha1
565 zm =
mgen(xin,lm,alpha2,beta)
566 ELSE IF (xx.GT.(xh+x0+x1).AND.xx.LE.(xh+x0+x1+x2))
THEN
568 beta = k/m1**alpha3 * (m1/m0)**alpha2 * (m0/mh)**alpha1
569 zm =
mgen(xin,m1,alpha3,beta)
570 ELSE IF (xx.GT.(xh+x0+x1+x2))
THEN
572 beta = k/m2**alpha4 * (m2/m1)**alpha3 *
573 + (m1/m0)**alpha2 * (m0/mh)**alpha1
574 zm =
mgen(xin,m2,alpha4,beta)
577 ELSE IF (lm.GT.m1.AND.lm.LE.m2)
THEN
579 IF (xx.GT.(xh+x0+x1).AND.xx.LE.(xh+x0+x1+x2))
THEN
581 beta = k/m1**alpha3 * (m1/m0)**alpha2 * (m0/mh)**alpha1
582 zm =
mgen(xin,lm,alpha3,beta)
583 ELSE IF (xx.GT.(xh+x0+x1+x2))
THEN
585 beta = k/m2**alpha4 * (m2/m1)**alpha3 *
586 + (m1/m0)**alpha2 * (m0/mh)**alpha1
587 zm =
mgen(xin,m2,alpha4,beta)
590 ELSE IF (lm.GT.m2)
THEN
592 IF (xx.GT.(xh+x0+x1+x2))
THEN
594 beta = k/m2**alpha4 * (m2/m1)**alpha3 *
595 + (m1/m0)**alpha2 * (m0/mh)**alpha1
596 zm =
mgen(xin,lm,alpha4,beta)
606 real*8 FUNCTION intgr(MA,MB,ALPHA,BETA)
612 REAL*8 alpha,beta,ma,mb
615 IF (alpha.NE.1.d0)
THEN
616 intgr = (mb**(1.d0-alpha)-ma**(1.d0-alpha)) * beta/(1.d0-alpha)
617 ELSE IF (alpha.EQ.1.d0)
THEN
618 intgr = log(mb/ma) * beta
630 REAL*8 alpha,beta,ma,mb
633 IF (alpha.NE.2.d0)
THEN
634 mintgr = (mb**(2.d0-alpha)-ma**(2.d0-alpha)) * beta/(2.d0-alpha)
635 ELSE IF (alpha.EQ.2.d0)
THEN
636 mintgr = log(mb/ma) * beta
642 real*8 FUNCTION mgen(XIN,MA,ALPHA,BETA)
648 REAL*8 alpha,beta,xin,ma
651 IF (alpha.NE.1.d0)
THEN
652 mgen = (1.d0-alpha) * xin * beta
653 mgen = (
mgen + ma**(1.d0-alpha))**(1.d0/(1.d0-alpha))
654 ELSE IF (alpha.EQ.1.d0)
THEN
655 mgen = ma * dexp(xin * beta)