c------------------------------------------------------------------------------ c split(m2,mmin,sigma,iseed,dwmax,dw,nprog,mprog) c c subroutine to do single binary split c c input: c ------ c m2: input mass c mmin: minimum mass to resolve c iseed: random number seed c dwmax: max timstep dw (w=deltc(a)) c sigma(m,dlsigdlm): FUNCTION to compute sigma(m) & dln(sigma)/dln(m) c output: c ------- c dw: actual time step in units of change in delta_c c nprog: (=0,1,2) number of progenitors with m>mmin after split c mprog(2): array containing masses of progenitors with m>mmin c c ---------------------------- c THEORY: c c Defining q=m/m2, qmin=mmin/m2 c (1) generate 0 or 1 progenitors with qmin0 and d(alpha)/dm>0, then the factor c v(q) = sigma(q*m2)^2/(sigma(q*m2)^2-sigma(m2)^2)^(3/2) c is monotonically increasing and ln(v) vs ln(q) is concave upwards c for 0mmin mprog(2) = q*m2 if(mprog(2).le.mmin) then nprog = 1 else nprog = 2 end if c mprog(1) = (1-q-f)*m2 !adjust for mass frac in progenitors m1/2 diff_hf = sigsq_hf - sigsq_m2 diff12_hf = sqrt(diff_hf) sfac = ROOT2*diff12_hf dw = min(eps1*sfac,dwmax) ! improve this? diff_qmin = sigsq_qmin - sigsq_m2 if (diff_qmin.lt.0.0) then c diff_qmin<0 which should be impossible but may have c occured as within rounding error m2=mmin diff_qmin=0.0 end if diff12_qmin = sqrt(diff_qmin) if(diff12_qmin.gt.RT2_PI*dw)then cd if (diff12_qmin.le.0) stop 'split() diff12_qmin.le.0 !' f = RT2_PI*dw/diff12_qmin else f = 1 end if mprog(1) = (1-f)*m2 !adjust for mass frac in progenitors m