From 0414a83404624e41c7897b079d48d9593d3d7186 Mon Sep 17 00:00:00 2001 From: Poojan <34255053+poojanagrawal@users.noreply.github.com> Date: Tue, 4 Jun 2024 12:21:28 -0400 Subject: [PATCH 01/46] Metisse integration meson (#628) * modified COSMIC to use the setup for METISSE * METISSE integration is complete * moved assign_commons_COSMIC.f90 to COSMIC src dir --- meson.build | 22 +- src/cosmic/evolve.py | 34 +- src/cosmic/src/SSE/SSE_deltat.f | 62 ++ src/cosmic/src/SSE/SSE_gntage.f | 300 +++++++++ src/cosmic/src/SSE/SSE_hrdiag.f | 615 +++++++++++++++++ src/cosmic/src/SSE/SSE_mlwind.f | 249 +++++++ src/cosmic/src/SSE/SSE_star.f | 365 ++++++++++ src/cosmic/src/SSE/SSE_zcnsts.f | 383 +++++++++++ src/cosmic/src/{zfuncs.f => SSE/SSE_zfuncs.f} | 4 +- src/cosmic/src/assign_commons_COSMIC.f90 | 35 + src/cosmic/src/comenv.f | 45 +- src/cosmic/src/const_bse.h | 5 + src/cosmic/src/deltat.f | 68 +- src/cosmic/src/evolv2.f | 88 ++- src/cosmic/src/{ => extra}/bse.f | 0 src/cosmic/src/{ => extra}/evolv1.f | 0 src/cosmic/src/{ => extra}/sse.f | 0 src/cosmic/src/gntage.f | 311 +-------- src/cosmic/src/hrdiag.f | 629 +----------------- src/cosmic/src/mix.f | 18 +- src/cosmic/src/mlwind.f | 259 +------- src/cosmic/src/star.f | 378 +---------- src/cosmic/src/zcnsts.f | 393 +---------- src/cosmic/utils.py | 25 +- 24 files changed, 2276 insertions(+), 2012 deletions(-) create mode 100644 src/cosmic/src/SSE/SSE_deltat.f create mode 100644 src/cosmic/src/SSE/SSE_gntage.f create mode 100644 src/cosmic/src/SSE/SSE_hrdiag.f create mode 100644 src/cosmic/src/SSE/SSE_mlwind.f create mode 100644 src/cosmic/src/SSE/SSE_star.f create mode 100644 src/cosmic/src/SSE/SSE_zcnsts.f rename src/cosmic/src/{zfuncs.f => SSE/SSE_zfuncs.f} (99%) create mode 100644 src/cosmic/src/assign_commons_COSMIC.f90 rename src/cosmic/src/{ => extra}/bse.f (100%) rename src/cosmic/src/{ => extra}/evolv1.f (100%) rename src/cosmic/src/{ => extra}/sse.f (100%) diff --git a/meson.build b/meson.build index 4e056ef2d..c6e2eee8b 100644 --- a/meson.build +++ b/meson.build @@ -53,7 +53,27 @@ lib_source = [ 'src/cosmic/src/hrdiag.f', 'src/cosmic/src/star.f', 'src/cosmic/src/zcnsts.f', - 'src/cosmic/src/zfuncs.f',] + 'src/cosmic/src/SSE/SSE_deltat.f', + 'src/cosmic/src/SSE/SSE_mlwind.f', + 'src/cosmic/src/SSE/SSE_hrdiag.f', + 'src/cosmic/src/SSE/SSE_star.f', + 'src/cosmic/src/SSE/SSE_zcnsts.f', + 'src/cosmic/src/SSE/SSE_zfuncs.f', + 'src/cosmic/src/SSE/SSE_gntage.f', + 'src/cosmic/src/METISSE/src/METISSE_gntage.f90', + 'src/cosmic/src/METISSE/src/METISSE_deltat.f90', + 'src/cosmic/src/METISSE/src/METISSE_mlwind.f90', + 'src/cosmic/src/METISSE/src/METISSE_hrdiag.f90', + 'src/cosmic/src/METISSE/src/METISSE_star.f90', + 'src/cosmic/src/METISSE/src/METISSE_zcnsts.f90', + 'src/cosmic/src/METISSE/src/track_support.f90', + 'src/cosmic/src/METISSE/src/z_support.f90', + 'src/cosmic/src/METISSE/src/sse_support.f90', + 'src/cosmic/src/METISSE/src/remnant_support.f90', + 'src/cosmic/src/METISSE/src/interp_support.f90', + 'src/cosmic/src/METISSE/src/comenv_lambda.f90', + 'src/cosmic/src/METISSE/src/METISSE_miscellaneous.f90', + 'src/cosmic/src/assign_commons_COSMIC.f90'] # Detect operating system and set appropriate linker flags host_system = host_machine.system() diff --git a/src/cosmic/evolve.py b/src/cosmic/evolve.py index 2c21d2c1e..29b478fc0 100644 --- a/src/cosmic/evolve.py +++ b/src/cosmic/evolve.py @@ -95,9 +95,12 @@ INITIAL_CONDITIONS_MISC_COLUMN = ['bin_num'] +INITIAL_CONDITIONS_SSE_COLUMN = ['stellar_engine','path_to_tracks','path_to_he_tracks'] + # Add the BSE COLUMSN and MISC COLUMN to the PASS_COLUMNS list INITIAL_CONDITIONS_PASS_COLUMNS.extend(INITIAL_CONDITIONS_BSE_COLUMNS) INITIAL_CONDITIONS_PASS_COLUMNS.extend(INITIAL_CONDITIONS_MISC_COLUMN) +INITIAL_CONDITIONS_PASS_COLUMNS.extend(INITIAL_CONDITIONS_SSE_COLUMN) if sys.version_info.major == 2 and sys.version_info.minor == 7: INITIAL_BINARY_TABLE_SAVE_COLUMNS = INITIAL_CONDITIONS_PASS_COLUMNS[:] @@ -210,6 +213,8 @@ def evolve(cls, initialbinarytable, pool=None, **kwargs): # NUMBER 1: PASS A DICTIONARY OF FLAGS BSEDict = kwargs.pop('BSEDict', {}) + SSEDict = kwargs.pop('SSEDict', {}) + # NUMBER 2: PASS A PANDAS DATA FRAME WITH PARAMS DEFINED AS COLUMNS @@ -229,14 +234,14 @@ def evolve(cls, initialbinarytable, pool=None, **kwargs): if not os.path.isfile(params): raise ValueError("File does not exist, probably supplied incorrect " "path to the inifile.") - BSEDict, _, _, _, _ = utils.parse_inifile(params) + BSEDict, SSEDict, _, _, _, _ = utils.parse_inifile(params) # error check the parameters you are trying to pass to BSE # if we sent in a table with the parameter names # then we will temporarily create a dictionary # in order to verify that the values in the table # are valid - utils.error_check(BSEDict) + utils.error_check(BSEDict, SSEDict) # check the initial conditions of the system and warn user if # anything is weird about them, such as the star starts @@ -252,7 +257,16 @@ def evolve(cls, initialbinarytable, pool=None, **kwargs): initialbinarytable = initialbinarytable.assign(randomseed=kwargs.pop('randomseed', seed)) if 'bin_num' not in initialbinarytable.keys(): initialbinarytable = initialbinarytable.assign(bin_num=np.arange(idx, idx + len(initialbinarytable))) - + + for k, v in SSEDict.items(): + if k in initialbinarytable.keys(): + warnings.warn("The value for {0} in initial binary table is being " + "overwritten by the value of {0} from either the params " + "file or the SSEDict.".format(k)) + # assigning values this way work for most of the parameters. + kwargs1 = {k: v} + initialbinarytable = initialbinarytable.assign(**kwargs1) + for k, v in BSEDict.items(): if k in initialbinarytable.keys(): warnings.warn("The value for {0} in initial binary table is being " @@ -462,6 +476,16 @@ def _evolve_single_system(f): _evolvebin.metvars.zsun = f["zsun"] _evolvebin.snvars.kickflag = f["kickflag"] _evolvebin.cmcpass.using_cmc = 0 + if f["stellar_engine"] == "sse": + _evolvebin.se_flags.using_sse = True + _evolvebin.se_flags.using_metisse = False + path_to_tracks = "" + path_to_he_tracks = "" + elif f["stellar_engine"] == "metisse": + _evolvebin.se_flags.using_metisse = True + _evolvebin.se_flags.using_sse = False + path_to_tracks = f["path_to_tracks"] + path_to_he_tracks = f["path_to_he_tracks"] [bpp_index, bcm_index, kick_info] = _evolvebin.evolv2([f["kstar_1"], f["kstar_2"]], [f["mass_1"], f["mass_2"]], @@ -483,7 +507,9 @@ def _evolve_single_system(f): f["tphys"], np.zeros(20), np.zeros(20), - f["kick_info"]) + f["kick_info"], + path_to_tracks, + path_to_he_tracks) bcm = _evolvebin.binary.bcm[:bcm_index].copy() bpp = _evolvebin.binary.bpp[:bpp_index].copy() _evolvebin.binary.bpp[:bpp_index] = np.zeros(bpp.shape) diff --git a/src/cosmic/src/SSE/SSE_deltat.f b/src/cosmic/src/SSE/SSE_deltat.f new file mode 100644 index 000000000..7b753c208 --- /dev/null +++ b/src/cosmic/src/SSE/SSE_deltat.f @@ -0,0 +1,62 @@ +*** + SUBROUTINE SSE_deltat(kw,age,tm,tn,tscls,dt,dtr) + IMPLICIT NONE + INCLUDE '../const_bse.h' +* + INTEGER kw + REAL*8 age,tm,tn,tscls(20) + REAL*8 dt,dtr +* +* Base new time scale for changes in radius & mass on stellar type. +* + if(kw.le.1)then + dt = pts1*tm + dtr = tm - age + elseif(kw.eq.2)then + dt = pts1*(tscls(1) - tm) + dtr = tscls(1) - age + elseif(kw.eq.3)then + if(age.lt.tscls(6))then + dt = pts2*(tscls(4) - age) + else + dt = pts2*(tscls(5) - age) + endif + dtr = MIN(tscls(2),tn) - age + elseif(kw.eq.4)then + dt = pts2*tscls(3) + dtr = MIN(tn,tscls(2) + tscls(3)) - age + elseif(kw.eq.5)then + if(age.lt.tscls(9))then + dt = pts3*(tscls(7) - age) + else + dt = pts3*(tscls(8) - age) + endif + dtr = MIN(tn,tscls(13)) - age + elseif(kw.eq.6)then + if(age.lt.tscls(12))then + dt = pts3*(tscls(10) - age) + else + dt = pts3*(tscls(11) - age) + endif + dt = MIN(dt,0.005d0) + dtr = tn - age + elseif(kw.eq.7)then + dt = pts1*tm + dtr = tm - age + elseif(kw.eq.8.or.kw.eq.9)then + if(age.lt.tscls(6))then + dt = pts2*(tscls(4) - age) + else + dt = pts2*(tscls(5) - age) + endif + dtr = tn - age + else +* dt = MAX(0.1d0,age*10.d0) + dt = MAX(0.1d0,dt*10.d0) + dt = MIN(dt,5.0d+02) + dtr = dt + endif +* + RETURN + END +*** diff --git a/src/cosmic/src/SSE/SSE_gntage.f b/src/cosmic/src/SSE/SSE_gntage.f new file mode 100644 index 000000000..e82f63ef0 --- /dev/null +++ b/src/cosmic/src/SSE/SSE_gntage.f @@ -0,0 +1,300 @@ +*** + SUBROUTINE SSE_gntage(mc,mt,kw,zpars,m0,aj,k) + IMPLICIT NONE + INCLUDE '../const_bse.h' +* +* A routine to determine the age of a giant from its core mass and type. +* +* Author : C. A. Tout +* Date : 24th September 1996 +* Revised: 21st February 1997 to include core-helium-burning stars +* +* Rewritten: 2nd January 1998 by J. R. Hurley to be compatible with +* the new evolution routines and to include new stellar +* types. +* +* + integer kw, k + integer j,jmax + parameter(jmax=30) +* + real*8 mc,mt,m0,aj,tm,tn,dtm + real*8 tscls(20),lums(10),GB(10),zpars(20) + real*8 mmin,mmax,mmid,dm,f,fmid,dell,derl,lum + real*8 macc,lacc,tiny + parameter(macc=0.00001d0,lacc=0.0001d0,tiny=1.0d-14) + real*8 mcx,mcy +* + real*8 mcheif,mcagbf,mheif,mbagbf,mcgbf,lmcgbf,lbgbf,lbgbdf + external mcheif,mcagbf,mheif,mbagbf,mcgbf,lmcgbf,lbgbf,lbgbdf +* +* This should only be entered with KW = 3, 4, 5, 6 or 9 +* +* First we check that we don't have a CheB star +* with too small a core mass. + if(kw.eq.4)then +* Set the minimum CHeB core mass using M = Mflash + mcy = mcheif(zpars(2),zpars(2),zpars(10)) + if(mc.le.mcy) kw = 3 +* if(mc.le.mcy) WRITE(66,*)' GNTAGE4: changed to 3' + endif +* +* Next we check that we don't have a GB star for M => Mfgb + if(kw.eq.3)then +* Set the maximum GB core mass using M = Mfgb + mcy = mcheif(zpars(3),zpars(2),zpars(9)) + if(mc.ge.mcy)then + kw = 4 + aj = 0.d0 +* WRITE(66,*)' GNTAGE3: changed to 4' + endif + endif +* + if(kw.eq.6)then +* +* We try to start the star from the start of the SAGB by +* setting Mc = Mc,TP. +* + mcy = 0.44d0*2.25d0 + 0.448d0 + if(mc.gt.mcy)then +* A type 6 with this sized core mass cannot exist as it should +* already have become a NS or BH as a type 5. +* We set it up so that it will. + mcx = (mc + 0.35d0)/0.773d0 + elseif(mc.ge.0.8d0)then + mcx = (mc - 0.448d0)/0.44d0 + else + mcx = mc + endif + m0 = mbagbf(mcx) + if(m0.lt.tiny)then +* Carbon core mass is less then the minimum for the start of SAGB. +* This must be the case of a low-mass C/O or O/Ne WD with only a +* very small envelope added or possibly the merger of a helium star +* with a main sequence star. We will set m0 = mt and then reset the +* core mass to allow for some helium to be added to the C/O core. + kw = 14 +* WRITE(66,*)' GNTAGE6: changed to 4' + else + CALL star(kw,m0,mt,tm,tn,tscls,lums,GB,zpars,dtm,k) + aj = tscls(13) + 2.d0*tiny + endif + endif +* + if(kw.eq.5)then +* +* We fit a Helium core mass at the base of the AGB. +* + m0 = mbagbf(mc) + if(m0.lt.tiny)then +* Helium core mass is less then the BAGB minimum. + kw = 14 +* WRITE(66,*)' GNTAGE5: changed to 4' + else + CALL star(kw,m0,mt,tm,tn,tscls,lums,GB,zpars,dtm,k) + aj = tscls(2) + tscls(3) + 2.d0*tiny + endif + endif +* +* + if(kw.eq.4)then +* +* The supplied age is actually the fractional age, fage, of CHeB lifetime +* that has been completed, ie. 0 <= aj <= 1. +* + if(aj.lt.0.d0.or.aj.gt.1.d0)then +* WRITE(99,*)' FATAL ERROR! GNTAGE4: fage out of bounds ' +* WRITE(99,*)' FAGE ',aj +* WRITE(*,*)' STOP: FATAL ERROR ' +* CALL exit(0) +* STOP + aj = 0.d0 + endif +* Get the minimum, fage=1, and maximum, fage=0, allowable masses + mcy = mcagbf(zpars(2)) + if(mc.ge.mcy)then + mmin = mbagbf(mc) + else + mmin = zpars(2) + endif + mmax = mheif(mc,zpars(2),zpars(10)) + if(aj.lt.tiny)then + m0 = mmax + goto 20 + elseif(aj.ge.1.d0)then + m0 = mmin + goto 20 + endif +* Use the bisection method to find m0 + fmid = (1.d0-aj)*mcheif(mmax,zpars(2),zpars(10)) + + & aj*mcagbf(mmax) - mc + f = (1.d0-aj)*mcheif(mmin,zpars(2),zpars(10)) + + & aj*mcagbf(mmin) - mc + if(f*fmid.ge.0.d0)then +* This will probably occur if mc is just greater than the minimum +* allowed mass for a CHeB star and fage > 0. + kw = 3 +* WRITE(66,*)' GNTAGE4: changed to 3' + goto 90 + endif + m0 = mmin + dm = mmax - mmin + do 10 , j = 1,jmax + dm = 0.5d0*dm + mmid = m0 + dm + fmid = (1.d0-aj)*mcheif(mmid,zpars(2),zpars(10)) + + & aj*mcagbf(mmid) - mc + if(fmid.lt.0.d0) m0 = mmid + if(ABS(dm).lt.macc.or.ABS(fmid).lt.tiny) goto 20 + if(j.eq.jmax)then +* WRITE(99,*)' FATAL ERROR! GNTAGE4: root not found ' +* WRITE(*,*)' STOP: FATAL ERROR ' +* CALL exit(0) +* STOP + m0 = mt + aj = 0.d0 + endif + 10 continue + 20 continue +* + CALL star(kw,m0,mt,tm,tn,tscls,lums,GB,zpars,dtm,k) + aj = tscls(2) + aj*tscls(3) +* + endif +* + 90 continue +* + if(kw.eq.3)then +* +* First we double check that we don't have a GB star for M => Mfgb + mcy = mcheif(zpars(3),zpars(2),zpars(9)) + if(mc.ge.mcy)then +* WRITE(99,*)' GNTAGE3: star too big for GB ' +* WRITE(*,*)' STOP: FATAL ERROR ' +* CALL exit(0) +* STOP + mc = 0.99d0*mcy + endif +* Next we find an m0 so as to place the star at the BGB + mcx = mcheif(zpars(2),zpars(2),zpars(9)) + if(mc.gt.mcx)then + m0 = mheif(mc,zpars(2),zpars(9)) + else +* Use Newton-Raphson to find m0 from Lbgb + m0 = zpars(2) + CALL star(kw,m0,mt,tm,tn,tscls,lums,GB,zpars,dtm,k) + lum = lmcgbf(mc,GB) + j = 0 + 30 continue + dell = lbgbf(m0) - lum + if(ABS(dell/lum).le.lacc) goto 40 + derl = lbgbdf(m0) + m0 = m0 - dell/derl + j = j + 1 + if(j.eq.jmax)then +* WRITE(99,*)' FATAL ERROR! GNTAGE3: root not found ' +* WRITE(*,*)' STOP: FATAL ERROR ' +* CALL exit(0) +* STOP + m0 = zpars(2) + m0 = MAX(m0,mt) + goto 40 + endif + goto 30 + 40 continue + endif + CALL star(kw,m0,mt,tm,tn,tscls,lums,GB,zpars,dtm,k) + aj = tscls(1) + 1.0d-06*(tscls(2) - tscls(1)) +* + endif +* + if(kw.eq.8.or.kw.eq.9)then +* +* We make a post-MS naked helium star. +* To make things easier we put the star at the TMS point +* so it actually begins as type 8. +* + kw = 8 + mmin = mc + CALL star(kw,mmin,mc,tm,tn,tscls,lums,GB,zpars,dtm,k) + mcx = mcgbf(lums(2),GB,lums(6)) + if(mcx.ge.mc)then +* WRITE(99,*)' FATAL ERROR! GNTAGE9: mmin too big ' +* WRITE(*,*)' STOP: FATAL ERROR ' +* CALL exit(0) +* STOP + m0 = mt + goto 80 + endif + f = mcx - mc + mmax = mt + do 50 , j = 1,jmax + CALL star(kw,mmax,mc,tm,tn,tscls,lums,GB,zpars,dtm,k) + mcy = mcgbf(lums(2),GB,lums(6)) + if(mcy.gt.mc) goto 60 + mmax = 2.d0*mmax + if(j.eq.jmax)then +* WRITE(99,*)' FATAL ERROR! GNTAGE9: mmax not found ' +* WRITE(*,*)' STOP: FATAL ERROR ' +* CALL exit(0) +* STOP + m0 = mt + goto 80 + endif + 50 continue + 60 continue + fmid = mcy - mc +* Use the bisection method to find m0 + if(f*fmid.ge.0.d0)then +* WRITE(99,*)' FATAL ERROR! GNTAGE9: root not bracketed ' +* WRITE(*,*)' STOP: FATAL ERROR ' +* CALL exit(0) +* STOP + m0 = mt + goto 80 + endif + m0 = mmin + dm = mmax - mmin + do 70 , j = 1,jmax + dm = 0.5d0*dm + mmid = m0 + dm + CALL star(kw,mmid,mc,tm,tn,tscls,lums,GB,zpars,dtm,k) + mcy = mcgbf(lums(2),GB,lums(6)) + fmid = mcy - mc + if(fmid.lt.0.d0) m0 = mmid + if(ABS(dm).lt.macc.or.ABS(fmid).lt.tiny) goto 80 + if(j.eq.jmax)then +* WRITE(99,*)' FATAL ERROR! GNTAGE9: root not found ' +* WRITE(*,*)' STOP: FATAL ERROR ' +* CALL exit(0) +* STOP + m0 = mt + goto 80 + endif + 70 continue + 80 continue +* + CALL star(kw,m0,mt,tm,tn,tscls,lums,GB,zpars,dtm,k) + aj = tm + 1.0d-10*tm +* + endif +* + if(kw.eq.14)then +* + kw = 4 + m0 = mt + mcy = mcagbf(m0) + aj = mc/mcy + CALL star(kw,m0,mt,tm,tn,tscls,lums,GB,zpars,dtm,k) + if(m0.le.zpars(2))then + mcx = mcgbf(lums(4),GB,lums(6)) + else + mcx = mcheif(m0,zpars(2),zpars(10)) + end if + mc = mcx + (mcy - mcx)*aj + aj = tscls(2) + aj*tscls(3) + endif +* + RETURN + END +*** diff --git a/src/cosmic/src/SSE/SSE_hrdiag.f b/src/cosmic/src/SSE/SSE_hrdiag.f new file mode 100644 index 000000000..384af5f16 --- /dev/null +++ b/src/cosmic/src/SSE/SSE_hrdiag.f @@ -0,0 +1,615 @@ +*** + SUBROUTINE SSE_hrdiag(mass,aj,mt,tm,tn,tscls,lums,GB,zpars, + & r,lum,kw,mc,rc,menv,renv,k2, + & bhspin,kidx) + IMPLICIT NONE + INCLUDE '../const_bse.h' +* +* +* H-R diagram for population I stars. +* ----------------------------------- +* +* Computes the new mass, luminosity, radius & stellar type. +* Input (MASS, AJ, TM, TN, LUMS & TSCLS) supplied by routine STAR. +* Ref: P.P. Eggleton, M.J. Fitchett & C.A. Tout (1989) Ap.J. 347, 998. +* +* Revised 27th March 1995 by C. A. Tout; +* 24th October 1995 to include metallicity; +* 14th November 1996 to include naked helium stars; +* 28th February 1997 to allow accretion induced supernovae. +* +* Revised 5th April 1997 by J. R. Hurley +* to include Z=0.001 as well as Z=0.02, convective overshooting, +* MS hook and more elaborate CHeB +* +* + integer kw,kwp,kidx +* + real*8 mass,aj,mt,tm,tn,tscls(20),lums(10),GB(10),zpars(20),met + real*8 bhspin + real*8 r,lum,mc,rc,menv,renv,k2 + real*8 mch,mlp,tiny +* parameter(mch=1.44d0,mlp=12.d0,tiny=1.0d-14) + parameter(mlp=12.d0,tiny=1.0d-14) + real*8 mass0,mt0,mtc + common /fall/fallback + REAL*8 fallback + REAL ran3 + EXTERNAL ran3 +* +* real*8 mchold +* +* real*8 avar,bvar + real*8 thook,thg,tbagb,tau,tloop,taul,tauh,tau1,tau2,dtau,texp + real*8 lx,ly,dell,alpha,betahrdiag,eta + real*8 rx,ry,delr,rzams,rtms,gammahrdiag,rmin,taumin,rg + parameter(taumin=5.0d-08) + real*8 mcmax,mcx,mcy,mcbagb,lambdahrdiag +* real*8 frac,kappa,sappa,alphap,polyfit + real*8 am,xx,fac,rdgen,mew,lum0,kap,zeta,ahe,aco + parameter(lum0=7.0d+04,kap=-0.5d0,ahe=4.d0,aco=16.d0) +* + real*8 thookf,tblf + real*8 lalphf,lbetaf,lnetaf,lhookf,lgbtf,lmcgbf,lzhef,lpertf + real*8 rzamsf,rtmsf,ralphf,rbetaf,rgammf,rhookf + real*8 rgbf,rminf,ragbf,rzahbf,rzhef,rhehgf,rhegbf,rpertf + real*8 mctmsf,mcgbtf,mcgbf,mcheif,mcagbf,lzahbf +* real*8 mrem + external thookf,tblf + external lalphf,lbetaf,lnetaf,lhookf,lgbtf,lmcgbf,lzhef,lpertf + external rzamsf,rtmsf,ralphf,rbetaf,rgammf,rhookf + external rgbf,rminf,ragbf,rzahbf,rzhef,rhehgf,rhegbf,rpertf + external mctmsf,mcgbtf,mcgbf,mcheif,mcagbf,lzahbf +* +* +* --------------------------------------------------------------------- +* MASS Stellar mass in solar units (input: old; output: new value). +* AJ Current age in Myr. +* MT Current mass in solar units (used for R). +* TM Main sequence time. +* TN Nuclear burning time. +* TSCLS Time scale for different stages. +* LUMS Characteristic luminosity. +* GB Giant Branch parameters +* ZPARS Parameters for distinguishing various mass intervals. +* R Stellar radius in solar units. +* TE Effective temperature (suppressed). +* KW Classification type (0 - 15). +* MC Core mass. +* --------------------------------------------------------------------- +* +* +* Make evolutionary changes to stars that have not reached KW > 5. +* + mch = 1.44d0 !set here owing to AIC ECSN model. +* + mass0 = mass +C if(mass0.gt.100.d0) mass = 100.d0 + mt0 = mt +C if(mt0.gt.100.d0) mt = 100.d0 +* + if(kw.gt.6) goto 90 +* + tbagb = tscls(2) + tscls(3) + thg = tscls(1) - tm +* + rzams = rzamsf(mass) +* calculate metallicity using the zpars(14) parameter. + met = 10**(LOG10(zpars(14))/0.4) + rtms = rtmsf(mass, met) +* + if(aj.lt.tscls(1))then +* +* Either on MS or HG +* + rg = rgbf(mt,lums(3)) +* + if(aj.lt.tm)then +* +* Main sequence star. +* + mc = 0.d0 + tau = aj/tm + thook = thookf(mass)*tscls(1) + zeta = 0.01d0 + tau1 = MIN(1.d0,aj/thook) + tau2 = MAX(0.d0, + & MIN(1.d0,(aj-(1.d0-zeta)*thook)/(zeta*thook))) +* + dell = lhookf(mass,zpars(1)) + dtau = tau1**2 - tau2**2 + alpha = lalphf(mass) + betahrdiag = lbetaf(mass) + eta = lnetaf(mass) + lx = LOG10(lums(2)/lums(1)) + if(tau.gt.taumin)then + xx = alpha*tau + betahrdiag*tau**eta + + & (lx - alpha - betahrdiag)*tau**2 - dell*dtau + else + xx = alpha*tau + (lx - alpha)*tau**2 - dell*dtau + endif + lum = lums(1)*10.d0**xx +* + delr = rhookf(mass,zpars(1)) + dtau = tau1**3 - tau2**3 + alpha = ralphf(mass) + betahrdiag = rbetaf(mass) + gammahrdiag = rgammf(mass) + rx = LOG10(rtms/rzams) +* Note that the use of taumin is a slightly pedantic attempt to +* avoid floating point underflow. It IS overkill! + if(tau.gt.taumin)then + xx = alpha*tau + betahrdiag*tau**10 + + & gammahrdiag*tau**40 + (rx - alpha - betahrdiag - + & gammahrdiag)*tau**3 - delr*dtau + else + xx = alpha*tau + (rx - alpha)*tau**3 - delr*dtau + endif + r = rzams*10.d0**xx +* + if(mass.lt.(zpars(1)-0.3d0))then + kw = 0 +* This following is given by Chris for low mass MS stars which will be +* substantially degenerate. We need the Hydrogen abundance, X, which we +* calculate from Z assuming that the helium abundance, Y, is calculated +* according to Y = 0.24 + 2*Z + rdgen = 0.0258d0*((1.d0+zpars(11))**(5.d0/3.d0))* + & (mass**(-1.d0/3.d0)) + r = MAX(rdgen,r) + else + kw = 1 + endif +* planets + if(mass.lt.0.005d0.and.mass.ge.tiny)then + r = 0.16d0 + endif +* + else +* +* Star is on the HG +* + mcx = mc + if(mass.le.zpars(2))then + mc = mcgbf(lums(3),GB,lums(6)) + elseif(mass.le.zpars(3))then + mc = mcheif(mass,zpars(2),zpars(9)) + else + mc = mcheif(mass,zpars(2),zpars(10)) + endif + eta = mctmsf(mass) + tau = (aj - tm)/thg + mc = ((1.d0 - tau)*eta + tau)*mc + mc = MAX(mc,mcx) +* +* Test whether core mass has reached total mass. +* + if(mc.ge.mt)then + aj = 0.d0 + if(mass.gt.zpars(2))then +* +* Zero-age helium star +* + mc = 0.d0 + mass = mt + kw = 7 + CALL SSE_star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars) + else +* +* Zero-age helium white dwarf. +* + mc = mt + mass = mt + kw = 10 + endif + else + lum = lums(2)*(lums(3)/lums(2))**tau + if(mass.le.zpars(3))then + rx = rg + else +* He-ignition and end of HG occur at Rmin + rmin = rminf(mass) + ry = ragbf(mt,lums(4),zpars(2)) + rx = MIN(rmin,ry) + if(mass.le.mlp)then + texp = log(mass/mlp)/log(zpars(3)/mlp) + rx = rg + rx = rmin*(rx/rmin)**texp + endif + tau2 = tblf(mass,zpars(2),zpars(3)) + if(tau2.lt.tiny) rx = ry + endif + r = rtms*(rx/rtms)**tau + kw = 2 + endif +* + endif +* +* Now the GB, CHeB and AGB evolution. +* + elseif(aj.lt.tscls(2))then +* +* Red Giant. +* + kw = 3 + lum = lgbtf(aj,GB(1),GB,tscls(4),tscls(5),tscls(6)) + if(mass.le.zpars(2))then +* Star has a degenerate He core which grows on the GB + mc = mcgbf(lum,GB,lums(6)) + else +* Star has a non-degenerate He core which may grow, but +* only slightly, on the GB + tau = (aj - tscls(1))/(tscls(2) - tscls(1)) + mcx = mcheif(mass,zpars(2),zpars(9)) + mcy = mcheif(mass,zpars(2),zpars(10)) + mc = mcx + (mcy - mcx)*tau + endif + r = rgbf(mt,lum) + rg = r + if(mc.ge.mt)then + aj = 0.d0 + if(mass.gt.zpars(2))then +* +* Zero-age helium star +* + mc = 0.d0 + mass = mt + kw = 7 + CALL SSE_star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars) + else +* +* Zero-age helium white dwarf. +* + mc = mt + mass = mt + kw = 10 + endif + endif +* + elseif(aj.lt.tbagb)then +* +* Core helium burning star. +* + if(kw.eq.3.and.mass.le.zpars(2))then + mass = mt + CALL SSE_star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars) + aj = tscls(2) + endif + if(mass.le.zpars(2))then + mcx = mcgbf(lums(4),GB,lums(6)) + else + mcx = mcheif(mass,zpars(2),zpars(10)) + endif + tau = (aj - tscls(2))/tscls(3) + mc = mcx + (mcagbf(mass) - mcx)*tau +* + if(mass.le.zpars(2))then + lx = lums(5) + ly = lums(7) + rx = rzahbf(mt,mc,zpars(2)) + rg = rgbf(mt,lx) + rmin = rg*zpars(13)**(mass/zpars(2)) + texp = MIN(MAX(0.4d0,rmin/rx),2.5d0) + ry = ragbf(mt,ly,zpars(2)) + if(rmin.lt.rx)then + taul = (log(rx/rmin))**(1.d0/3.d0) + else + rmin = rx + taul = 0.d0 + endif + tauh = (log(ry/rmin))**(1.d0/3.d0) + tau2 = taul*(tau - 1.d0) + tauh*tau + r = rmin*exp(abs(tau2)**3) + rg = rg + tau*(ry - rg) + lum = lx*(ly/lx)**(tau**texp) + elseif(mass.gt.zpars(3))then +* +* For HM stars He-ignition takes place at Rmin in the HG, and CHeB +* consists of a blue phase (before tloop) and a RG phase (after tloop). +* + tau2 = tblf(mass,zpars(2),zpars(3)) + tloop = tscls(2) + tau2*tscls(3) + rmin = rminf(mass) + rg = rgbf(mt,lums(4)) + rx = ragbf(mt,lums(4),zpars(2)) + rmin = MIN(rmin, rx) + if(mass.le.mlp) then + texp = log(mass/mlp)/log(zpars(3)/mlp) + rx = rg + rx = rmin*(rx/rmin)**texp + else + rx = rmin + endif + texp = MIN(MAX(0.4d0,rmin/rx),2.5d0) + lum = lums(4)*(lums(7)/lums(4))**(tau**texp) + if(aj.lt.tloop)then + ly = lums(4)*(lums(7)/lums(4))**(tau2**texp) + ry = ragbf(mt,ly,zpars(2)) + taul = 0.d0 + if(ABS(rmin-rx).gt.tiny)then + taul = (log(rx/rmin))**(1.d0/3.d0) + endif + tauh = 0.d0 + if(ry.gt.rmin) tauh = (log(ry/rmin))**(1.d0/3.d0) + tau = (aj - tscls(2))/(tau2*tscls(3)) + tau2 = taul*(tau - 1.d0) + tauh*tau + r = rmin*exp(abs(tau2)**3) + rg = rg + tau*(ry - rg) + else + r = ragbf(mt,lum,zpars(2)) + rg = r + endif + else +* +* For IM stars CHeB consists of a RG phase (before tloop) and a blue +* loop (after tloop). +* + tau2 = 1.d0 - tblf(mass,zpars(2),zpars(3)) + tloop = tscls(2) + tau2*tscls(3) + if(aj.lt.tloop)then + tau = (tloop - aj)/(tau2*tscls(3)) + lum = lums(5)*(lums(4)/lums(5))**(tau**3) + r = rgbf(mt,lum) + rg = r + else + lx = lums(5) + ly = lums(7) + rx = rgbf(mt,lx) + rmin = rminf(mt) + texp = MIN(MAX(0.4d0,rmin/rx),2.5d0) + ry = ragbf(mt,ly,zpars(2)) + if(rmin.lt.rx)then + taul = (log(rx/rmin))**(1.d0/3.d0) + else + rmin = rx + taul = 0.d0 + endif + tauh = (log(ry/rmin))**(1.d0/3.d0) + tau = (aj - tloop)/(tscls(3) - (tloop - tscls(2))) + tau2 = taul*(tau - 1.d0) + tauh*tau + r = rmin*exp(abs(tau2)**3) + rg = rx + tau*(ry - rx) + lum = lx*(ly/lx)**(tau**texp) + endif + endif +* +* Test whether core mass exceeds total mass. +* + if(mc.ge.mt)then +* +* Evolved MS naked helium star. +* + kw = 7 + xx = (aj - tscls(2))/tscls(3) + mass = mt + CALL SSE_star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars) + aj = xx*tm + else + kw = 4 + endif +* + else +* +* Asymptotic Red Giant. +* +* On the AGB the He core mass remains constant until at Ltp it +* is caught by the C core mass and they grow together. +* + mcbagb = mcagbf(mass) + mcx = mcgbtf(tbagb,GB(8),GB,tscls(7),tscls(8),tscls(9)) + mcmax = MAX(MAX(mch,0.773d0*mcbagb-0.35d0),1.05d0*mcx) +* + if(aj.lt.tscls(13))then + mcx = mcgbtf(aj,GB(8),GB,tscls(7),tscls(8),tscls(9)) + mc = mcbagb + lum = lmcgbf(mcx,GB) + if(mt.le.mc)then +* +* Evolved naked helium star as the envelope is lost but the +* star has not completed its interior burning. The star becomes +* a post-HeMS star. +* + kw = 9 + mt = mc + mass = mt + mc = mcx + CALL SSE_star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars) + if(mc.le.GB(7))then + aj = tscls(4) - (1.d0/((GB(5)-1.d0)*GB(8)*GB(4)))* + & (mc**(1.d0-GB(5))) + else + aj = tscls(5) - (1.d0/((GB(6)-1.d0)*GB(8)*GB(3)))* + & (mc**(1.d0-GB(6))) + endif + aj = MAX(aj,tm) + goto 90 + else + kw = 5 + endif + else + kw = 6 + mc = mcgbtf(aj,GB(2),GB,tscls(10),tscls(11),tscls(12)) + lum = lmcgbf(mc,GB) +* +* Approximate 3rd Dredge-up on AGB by limiting Mc. +* + lambdahrdiag = MIN(0.9d0,0.3d0+0.001d0*mass**5) + tau = tscls(13) + mcx = mcgbtf(tau,GB(2),GB,tscls(10),tscls(11),tscls(12)) + mcy = mc + mc = mc - lambdahrdiag*(mcy-mcx) + mcx = mc + mcmax = MIN(mt,mcmax) + endif + r = ragbf(mt,lum,zpars(2)) + rg = r +* +* Mc,x represents the C core mass and we now test whether it +* exceeds either the total mass or the maximum allowed core mass. +* + if(mcmax-mcx.lt.tiny)then + aj = 0.d0 + mc = mcmax + call assign_remnant(zpars,mc,mcbagb,mass,mt,kw,bhspin,kidx) + endif +* + endif +* + 90 continue +* + if(kw.ge.7.and.kw.le.9)then +* +* Naked Helium Star +* + rzams = rzhef(mt) + rx = rzams + if(aj.lt.tm)then +* +* Main Sequence +* + kw = 7 + tau = aj/tm + am = MAX(0.d0,0.85d0-0.08d0*mass) + lum = lums(1)*(1.d0+0.45d0*tau+am*tau**2) + am = MAX(0.d0,0.4d0-0.22d0*LOG10(mt)) + r = rx*(1.d0+am*(tau-tau**6)) + rg = rx +* Star has no core mass and hence no memory of its past +* which is why we subject mass and mt to mass loss for +* this phase. + mc = 0.d0 + if(mt.lt.zpars(10)) kw = 10 + else +* +* Helium Shell Burning +* + kw = 8 + lum = lgbtf(aj,GB(8),GB,tscls(4),tscls(5),tscls(6)) + r = rhehgf(mt,lum,rx,lums(2)) + rg = rhegbf(lum) + if(r.ge.rg)then + kw = 9 + r = rg + endif + mc = mcgbf(lum,GB,lums(6)) + mtc = MIN(mt,1.45d0*mt-0.31d0) + mcmax = MIN(mtc,MAX(mch,0.773d0*mass-0.35d0)) + if(mcmax-mc.lt.tiny)then + aj = 0.d0 + mc = mcmax + mcbagb = mass + call assign_remnant(zpars,mc,mcbagb,mass, + & mt,kw,bhspin,kidx) + + if(kw.eq.11) mt = MAX(mc,(mc+0.31d0)/1.45d0) + endif + endif + endif +* + call hrdiag_remnant(zpars,mt,mc,lum,r,aj,kw) +* +* Calculate the core radius and the luminosity and radius of the +* remnant that the star will become. +* + tau = 0.d0 + if(kw.le.1.or.kw.eq.7)then + rc = 0.d0 + elseif(kw.le.3)then + if(mass.gt.zpars(2))then + lx = lzhef(mc) + rx = rzhef(mc) + rc = rx + else + if(wdflag.eq.0)then + lx = 635.d0*mc*zpars(14)/((ahe*0.1d0)**1.4d0) + elseif(wdflag.ge.1)then + lx = 300.d0*mc*zpars(14)/((ahe*0.1d0)**1.18d0) + endif + rx = 0.0115d0*SQRT(MAX(1.48204d-06, + & (mch/mc)**(2.d0/3.d0)-(mc/mch)**(2.d0/3.d0))) + rc = 5.d0*rx + endif + elseif(kw.eq.4)then + tau = (aj - tscls(2))/tscls(3) + kwp = 7 + CALL SSE_star(kwp,mc,mc,tm,tn,tscls,lums,GB,zpars) + am = MAX(0.d0,0.85d0-0.08d0*mc) + lx = lums(1)*(1.d0+0.45d0*tau+am*tau**2) + rx = rzhef(mc) + am = MAX(0.d0,0.4d0-0.22d0*LOG10(mc)) + rx = rx*(1.d0+am*(tau-tau**6)) + CALL SSE_star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars) + rc = rx + elseif(kw.eq.5)then + kwp = 9 + if(tn.gt.tbagb) tau = 3.d0*(aj-tbagb)/(tn-tbagb) + CALL SSE_star(kwp,mc,mc,tm,tn,tscls,lums,GB,zpars) + lx = lmcgbf(mcx,GB) + if(tau.lt.1.d0) lx = lums(2)*(lx/lums(2))**tau + rx = rzhef(mc) + rx = MIN(rhehgf(mc,lx,rx,lums(2)),rhegbf(lx)) + CALL SSE_star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars) + rc = rx + elseif(kw.le.9)then + if(wdflag.eq.0)then + lx = 635.d0*mc*zpars(14)/((aco*0.1d0)**1.4d0) + elseif(wdflag.ge.1)then + lx = 300.d0*mc*zpars(14)/((aco*0.1d0)**1.18d0) + endif + rx = 0.0115d0*SQRT(MAX(1.48204d-06, + & (mch/mc)**(2.d0/3.d0) - (mc/mch)**(2.d0/3.d0))) + rc = 5.d0*rx + else + rc = r + menv = 1.0d-10 + renv = 1.0d-10 + k2 = 0.21d0 + endif +* +* Perturb the luminosity and radius due to small envelope mass. +* + if(kw.ge.2.and.kw.le.9.and.kw.ne.7)then + mew = ((mt-mc)/mt)*MIN(5.d0,MAX(1.2d0,(lum/lum0)**kap)) + if(kw.ge.8) mew = ((mtc-mc)/mtc)*5.d0 + if(mew.lt.1.d0)then + xx = lpertf(mt,mew) + lum = lx*(lum/lx)**xx + if(r.le.rx)then + xx = 0.d0 + else + xx = rpertf(mt,mew,r,rx) + endif + r = rx*(r/rx)**xx + endif + rc = MIN(rc,r) + endif +* +* Calculate mass and radius of convective envelope, and envelope +* gyration radius. +* + if(kw.lt.10)then + CALL mrenv(kw,mass,mt,mc,lum,r,rc,aj,tm,lums(2),lums(3), + & lums(4),rzams,rtms,rg,menv,renv,k2) + endif +* + if(ST_tide.gt.0)then + if(kw.le.2.or.kw.eq.7.or.kw.ge.10)then + if(mt.le.1.d0)then + k2 = 0.205d0 + else + k2 = 0.075d0 + endif + else + k2 = 0.1d0 + endif + endif +* +C if(mass.gt.99.99d0)then +C mass = mass0 +C endif +C if(mt.gt.99.99d0)then +C mt = mt0 +C endif +* + return + end +*** diff --git a/src/cosmic/src/SSE/SSE_mlwind.f b/src/cosmic/src/SSE/SSE_mlwind.f new file mode 100644 index 000000000..3be7c80d5 --- /dev/null +++ b/src/cosmic/src/SSE/SSE_mlwind.f @@ -0,0 +1,249 @@ +*** + real*8 FUNCTION SSE_mlwind(kw,lum,r,mt,mc,rl,z) + IMPLICIT NONE + INCLUDE '../const_bse.h' + integer kw,testflag + real*8 lum,r,mt,mc,rl,z,teff,alpha + real*8 dml,dms,dmt,p0,x,mew,lum0,kap + real*8 MLalpha + external MLalpha + parameter(lum0=7.0d+04,kap=-0.5d0) +* +* windflag = 0 !BSE=0, startrack08=1, vink=2, vink+LBV for all +* stars=3. +* Must be one of these values or mlwind will cause problem with code, +* i.e. mlwind not set (see last line of main if statement...). + + if(windflag.eq.0)then +* BSE +* +* Calculate stellar wind mass loss. +* +* Apply mass loss of Nieuwenhuijzen & de Jager, A&A, 1990, 231, 134, +* for massive stars over the entire HRD. + dms = 0.d0 + if(lum.gt.4000.d0)then + x = MIN(1.d0,(lum-4000.d0)/500.d0) + dms = 9.6d-15*x*(r**0.81d0)*(lum**1.24d0)*(mt**0.16d0) + alpha = 0.5d0 + dms = dms*(z/zsun)**(alpha) + endif + if(kw.ge.2.and.kw.le.9)then +* 'Reimers' mass loss + dml = neta*4.0d-13*r*lum/mt + if(rl.gt.0.d0) dml = + & dml*(1.d0 + bwind*(MIN(0.5d0,(r/rl)))**6) +* Apply mass loss of Vassiliadis & Wood, ApJ, 1993, 413, 641, +* for high pulsation periods on AGB. + if(kw.eq.5.or.kw.eq.6)then + p0 = -2.07d0 - 0.9d0*log10(mt) + 1.94d0*log10(r) + p0 = 10.d0**p0 + p0 = MIN(p0,2000.d0) + dmt = -11.4d0+0.0125d0*(p0-100.d0*MAX(mt-2.5d0,0.d0)) + dmt = 10.d0**dmt + dmt = 1.d0*MIN(dmt,1.36d-09*lum) + dml = MAX(dml,dmt) + endif + if(kw.gt.6)then + dms = MAX(dml,1.0d-13*hewind*lum**(3.d0/2.d0)) + else + dms = MAX(dml,dms) + mew = ((mt-mc)/mt)*MIN(5.d0,MAX(1.2d0,(lum/lum0)**kap)) +* reduced WR-like mass loss for small H-envelope mass + if(mew.lt.1.d0)then + dml = 1.0d-13*lum**(3.d0/2.d0)*(1.d0 - mew) + dms = MAX(dml,dms) + endif +* LBV-like mass loss beyond the Humphreys-Davidson limit. + x = 1.0d-5*r*sqrt(lum) + if(lum.gt.6.0d+05.and.x.gt.1.d0)then + dml = 0.1d0*(x-1.d0)**3*(lum/6.0d+05-1.d0) + dms = dms + dml + endif + endif + endif +* + SSE_mlwind = dms + elseif(windflag.eq.1)then +* StarTrack (Beclzynski+08) +* +* Calculate stellar wind mass loss. +* +* Apply mass loss of Nieuwenhuijzen & de Jager, A&A, 1990, 231, 134, +* for massive stars over the entire HRD, with no luminosity limit +* according to Belczynsk+08 pp. 174. +* +* This may not be what is actually assumed in StarTrack (see the windf1 function). +* +* + dms = 0.d0 + if(lum.gt.4000.d0.or.(kw.ge.0.and.kw.le.1))then + if(lum.gt.4000.d0)then + x = MIN(1.d0,(lum-4000.d0)/500.d0) + else + x = 0.1d0/500.d0 + endif !or is it simply x = Min(1, lum/500)? + dms = 9.6d-15*x*(r**0.81d0)*(lum**1.24d0)*(mt**0.16d0) + alpha = 0.5d0 + dms = dms*(z/zsun)**(alpha) + endif + if(kw.ge.2.and.kw.le.9)then +* 'Reimers' mass loss + dml = neta*4.0d-13*r*lum/mt + if(rl.gt.0.d0) dml = + & dml*(1.d0 + bwind*(MIN(0.5d0,(r/rl)))**6) +* Apply mass loss of Vassiliadis & Wood, ApJ, 1993, 413, 641, +* for high pulsation periods on AGB. + if(kw.eq.5.or.kw.eq.6)then + p0 = -2.07d0 - 0.9d0*log10(mt) + 1.94d0*log10(r) + p0 = 10.d0**p0 + p0 = MIN(p0,2000.d0) + dmt = -11.4d0+0.0125d0*(p0-100.d0*MAX(mt-2.5d0,0.d0)) + dmt = 10.d0**dmt + dmt = 1.d0*MIN(dmt,1.36d-09*lum) + dml = MAX(dml,dmt) + endif + if(kw.gt.6)then + dms = MAX(dml,1.0d-13*lum**(3.d0/2.d0)) !hewind here for KH06, not included for StarTrack... + else + dms = MAX(dml,dms) + mew = ((mt-mc)/mt)*MIN(5.d0,MAX(1.2d0,(lum/lum0)**kap)) +* reduced WR-like mass loss for small H-envelope mass + if(mew.lt.1.d0)then + dml = 1.0d-13*lum**(3.d0/2.d0)*(1.d0 - mew) + dms = MAX(dml,dms) + endif +* LBV-like mass loss beyond the Humphreys-Davidson limit. + x = 1.0d-5*r*sqrt(lum) + if(lum.gt.6.0d+05.and.x.gt.1.d0)then + dml = 0.1d0*(x-1.d0)**3*(lum/6.0d+05-1.d0) + dms = dms + dml + endif + endif + endif +* + SSE_mlwind = dms + elseif(windflag.eq.2.or.windflag.eq.3)then +* Vink winds etc according to as implemented following +* Belczynski, Bulik, Fryer, Ruiter, Valsecchi, Vink & Hurley 2010. +* +* Firstly implement BSE 'old' winds that cover all other stars not +* accounted for by Vink winds (see Belczynski+09). Then implement +* Vink et al. winds. +* +* We also include the option for a variable metallicity-dependent mass +* loss parameter which eddlimflag is set, which makes the metallicity +* dependence become weaker as the star approaches the electron-scattering +* Eddington limit (Grafener & Hamann 2008, Giacobbo et al. 2018) +* + teff = 1000.d0*((1130.d0*lum/(r**2.d0))**(1.d0/4.d0)) + dms = 0.d0 + if(lum.gt.4000.d0)then +* Apply mass loss of Nieuwenhuijzen & de Jager, A&A, 1990, 231, 134, +* for massive stars over the entire HRD after OB stars accounted for. + x = MIN(1.d0,(lum-4000.d0)/500.d0) + dms = 9.6d-15*x*(r**0.81d0)*(lum**1.24d0)*(mt**0.16d0) + alpha = 0.5d0 + dms = dms*(z/zsun)**(alpha) + testflag = 1 + endif + if(kw.ge.2.and.kw.le.6)then +* 'Reimers' mass loss + dml = neta*4.0d-13*r*lum/mt + if(rl.gt.0.d0) dml = + & dml*(1.d0 + bwind*(MIN(0.5d0,(r/rl)))**6) +* Apply mass loss of Vassiliadis & Wood, ApJ, 1993, 413, 641, +* for high pulsation periods on AGB. + if(kw.eq.5.or.kw.eq.6)then + p0 = -2.07d0 - 0.9d0*log10(mt) + 1.94d0*log10(r) + p0 = 10.d0**p0 + p0 = MIN(p0,2000.d0) + dmt = -11.4d0+0.0125d0*(p0-100.d0*MAX(mt-2.5d0,0.d0)) + dmt = 10.d0**dmt + dmt = 1.d0*MIN(dmt,1.36d-09*lum) + dml = MAX(dml,dmt) + endif + dms = MAX(dms,dml) + endif +* Apply Vink, de Koter & Lamers (2001) OB star winds. +* Next check if hot massive H-rich O/B star in appropriate temperature ranges. + if(teff.ge.12500.and.teff.le.25000)then + if(eddlimflag.eq.0) alpha = 0.85d0 + if(eddlimflag.eq.1) alpha = MLalpha(mt,lum,kw) + dms = -6.688d0 + 2.210d0*LOG10(lum/1.0d+05) - + & 1.339d0*LOG10(mt/30.d0) - 1.601d0*LOG10(1.3d0/2.d0) + + & alpha*LOG10(z/zsun) + 1.07d0*LOG10(teff/2.0d+04) + dms = 10.d0**dms + testflag = 2 + elseif(teff.gt.25000.)then +* Although Vink et al. formulae are only defined until Teff=50000K, +* we follow the Dutch prescription of MESA, and extend to higher Teff + dms = -6.697d0 + 2.194d0*LOG10(lum/1.0d+05) - + & 1.313d0*LOG10(mt/30.d0) - 1.226d0*LOG10(2.6d0/2.d0) + + & alpha*LOG10(z/zsun) +0.933d0*LOG10(teff/4.0d+04) - + & 10.92d0*(LOG10(teff/4.0d+04)**2) + dms = 10.d0**dms + testflag = 2 + endif + + if((windflag.eq.3.or.kw.ge.2).and.kw.le.6)then +* LBV-like mass loss beyond the Humphreys-Davidson limit. +* Optional flag (windflag=3) to use for every non-degenerate star +* past the limit, rather than just for giant, evolved stars + x = 1.0d-5*r*sqrt(lum) + if(lum.gt.6.0d+05.and.x.gt.1.d0)then + if(eddlimflag.eq.0) alpha = 0.d0 + if(eddlimflag.eq.1) alpha = MLalpha(mt,lum,kw) + dms = 1.5d0*1.0d-04*((z/zsun)**alpha) + testflag = 3 + endif + elseif(kw.ge.7.and.kw.le.9)then !WR (naked helium stars) +* If naked helium use Hamann & Koesterke (1998) WR winds reduced by factor of +* 10 (Yoon & Langer 2005), with Vink & de Koter (2005) metallicity dependence + if(eddlimflag.eq.0) alpha = 0.86d0 + if(eddlimflag.eq.1) alpha = MLalpha(mt,lum,kw) + dms = 1.0d-13*(lum**1.5d0)*((z/zsun)**alpha) + testflag = 4 + endif +* + SSE_mlwind = dms + elseif(windflag.eq.4)then +* +* Calculate stellar wind mass loss following MIST as closely as possible +* + dms = 0.d0 + if(kw.ge.0.and.kw.le.9)then +* 'Reimers' mass loss over the whole HRD + dml = 0.1*4.0d-13*r*lum/mt + if(rl.gt.0.d0) dml = + & dml*(1.d0 + bwind*(MIN(0.5d0,(r/rl)))**6) +* Apply mass loss of Blocker 1995 for AGB. + if(kw.eq.5.or.kw.eq.6)then + dml = 4.83d-9*0.2*dml/0.1*((lum)**2.7)/((mt)**2.1) + endif + if(kw.gt.6)then + dms = MAX(dml,1.0d-13*hewind*lum**(3.d0/2.d0)) + else + dms = MAX(dml,dms) + mew = ((mt-mc)/mt)*MIN(5.d0,MAX(1.2d0,(lum/lum0)**kap)) +* reduced WR-like mass loss for small H-envelope mass + if(mew.lt.1.d0)then + dml = 1.0d-13*lum**(3.d0/2.d0)*(1.d0 - mew) + dms = MAX(dml,dms) + endif +* LBV-like mass loss beyond the Humphreys-Davidson limit. + x = 1.0d-5*r*sqrt(lum) + if(lum.gt.6.0d+05.and.x.gt.1.d0)then + dml = 0.1d0*(x-1.d0)**3*(lum/6.0d+05-1.d0) + dms = dms + dml + endif + endif + endif +* + SSE_mlwind = dms + + endif + + return + end +*** diff --git a/src/cosmic/src/SSE/SSE_star.f b/src/cosmic/src/SSE/SSE_star.f new file mode 100644 index 000000000..074a566d2 --- /dev/null +++ b/src/cosmic/src/SSE/SSE_star.f @@ -0,0 +1,365 @@ +*** + SUBROUTINE SSE_star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars) + IMPLICIT NONE + INCLUDE '../const_bse.h' +* +* +* Stellar luminosity & evolution time. +* ------------------------------------ +* +* + integer kw +* + real*8 mass,mt,tm,tn,tscls(20),lums(10),GB(10),zpars(20) + real*8 tgb,tbagb,mch,mcmax,mc1,mc2,mcbagb,dx,am + real*8 lambdastar,tau,mtc,mass0 + parameter(mch=1.44d0) +* + real*8 lzamsf,lzahbf,lzhef + real*8 tbgbf,thookf,tHef,themsf,mcgbf,mcagbf,mcheif,mcgbtf + real*8 ltmsf,lbgbf,lHeIf,lHef,lbagbf,lmcgbf + external lzamsf,lzahbf,lzhef + external tbgbf,thookf,tHef,themsf,mcgbf,mcagbf,mcheif,mcgbtf + external ltmsf,lbgbf,lHeIf,lHef,lbagbf,lmcgbf +* +* Computes the characteristic luminosities at different stages (LUMS), +* and various timescales (TSCLS). +* Ref: P.P. Eggleton, M.J. Fitchett & C.A. Tout (1989) Ap.J. 347, 998. +* +* Revised 27th March 1995 by C. A. Tout +* and 24th October 1995 to include metallicity +* and 13th December 1996 to include naked helium stars +* +* Revised 5th April 1997 by J. R. Hurley +* to include Z=0.001 as well as Z=0.02, convective overshooting, +* MS hook and more elaborate CHeB. It now also sets the Giant +* Branch parameters relevant to the mass of the star. +* +* ------------------------------------------------------------ +* Times: 1; BGB 2; He ignition 3; He burning +* 4; Giant t(inf1) 5; Giant t(inf2) 6; Giant t(Mx) +* 7; FAGB t(inf1) 8; FAGB t(inf2) 9; FAGB t(Mx) +* 10; SAGB t(inf1) 11; SAGB t(inf2) 12; SAGB t(Mx) +* 13; TP 14; t(Mcmax) +* +* LUMS: 1; ZAMS 2; End MS 3; BGB +* 4; He ignition 5; He burning 6; L(Mx) +* 7; BAGB 8; TP +* +* GB: 1; effective A(H) 2; A(H,He) 3; B +* 4; D 5; p 6; q +* 7; Mx 8; A(He) 9; Mc,BGB +* +* ------------------------------------------------------------ +* +* + mass0 = mass +C if(mass0.gt.100.d0) mass = 100.d0 +* + if(kw.ge.7.and.kw.le.9) goto 90 + if(kw.ge.10) goto 95 +* +* MS and BGB times +* + tscls(1) = tbgbf(mass) + tm = MAX(zpars(8),thookf(mass))*tscls(1) +* +* Zero- and terminal age main sequence luminosity +* + lums(1) = lzamsf(mass) + lums(2) = ltmsf(mass) +* +* Set the GB parameters +* + GB(1) = MAX(-4.8d0,MIN(-5.7d0+0.8d0*mass,-4.1d0+0.14d0*mass)) + GB(1) = 10.d0**GB(1) + GB(2) = 1.27d-05 + GB(8) = 8.0d-05 + GB(3) = MAX(3.0d+04,500.d0 + 1.75d+04*mass**0.6d0) + if(mass.le.2.0)then + GB(4) = zpars(6) + GB(5) = 6.d0 + GB(6) = 3.d0 + elseif(mass.lt.2.5)then + dx = zpars(6) - (0.975d0*zpars(6) - 0.18d0*2.5d0) + GB(4) = zpars(6) - dx*(mass - 2.d0)/(0.5d0) + GB(5) = 6.d0 - (mass - 2.d0)/(0.5d0) + GB(6) = 3.d0 - (mass - 2.d0)/(0.5d0) + else + GB(4) = MAX(-1.d0,0.5d0*zpars(6) - 0.06d0*mass) + GB(4) = MAX(GB(4),0.975d0*zpars(6) - 0.18d0*mass) + GB(5) = 5.d0 + GB(6) = 2.d0 + endif + GB(4) = 10.d0**GB(4) + GB(7) = (GB(3)/GB(4))**(1.d0/(GB(5)-GB(6))) +* +* Change in slope of giant L-Mc relation. + lums(6) = GB(4)*GB(7)**GB(5) +* +* HeI ignition luminosity + lums(4) = lHeIf(mass,zpars(2)) + lums(7) = lbagbf(mass,zpars(2)) +* + if(mass.lt.0.1d0.and.kw.le.1)then + tscls(2) = 1.1d0*tscls(1) + tscls(3) = 0.1d0*tscls(1) + lums(3) = lbgbf(mass) + goto 96 + endif +* + if(mass.le.zpars(3))then +* Base of the giant branch luminosity + lums(3) = lbgbf(mass) +* Set GB timescales + tscls(4) = tscls(1) + (1.d0/((GB(5)-1.d0)*GB(1)*GB(4)))* + & ((GB(4)/lums(3))**((GB(5)-1.d0)/GB(5))) + tscls(6) = tscls(4) - (tscls(4) - tscls(1))*((lums(3)/lums(6)) + & **((GB(5)-1.d0)/GB(5))) + tscls(5) = tscls(6) + (1.d0/((GB(6)-1.d0)*GB(1)*GB(3)))* + & ((GB(3)/lums(6))**((GB(6)-1.d0)/GB(6))) +* Set Helium ignition time + if(lums(4).le.lums(6))then + tscls(2) = tscls(4) - (1.d0/((GB(5)-1.d0)*GB(1)*GB(4)))* + & ((GB(4)/lums(4))**((GB(5)-1.d0)/GB(5))) + else + tscls(2) = tscls(5) - (1.d0/((GB(6)-1.d0)*GB(1)*GB(3)))* + & ((GB(3)/lums(4))**((GB(6)-1.d0)/GB(6))) + endif + tgb = tscls(2) - tscls(1) + if(mass.le.zpars(2))then + mc1 = mcgbf(lums(4),GB,lums(6)) + mc2 = mcagbf(mass) + lums(5) = lzahbf(mass,mc1,zpars(2)) + tscls(3) = tHef(mass,mc1,zpars(2)) + else + lums(5) = lHef(mass)*lums(4) + tscls(3) = tHef(mass,1.d0,zpars(2))*tscls(1) + endif + else +* Note that for M>zpars(3) there is no GB as the star goes from +* HG -> CHeB -> AGB. So in effect tscls(1) refers to the time of +* Helium ignition and not the BGB. + tscls(2) = tscls(1) + tscls(3) = tHef(mass,1.d0,zpars(2))*tscls(1) +* This now represents the luminosity at the end of CHeB, ie. BAGB + lums(5) = lums(7) +* We set lums(3) to be the luminosity at the end of the HG + lums(3) = lums(4) + endif +* +* Set the core mass at the BGB. +* + if(mass.le.zpars(2))then + GB(9) = mcgbf(lums(3),GB,lums(6)) + elseif(mass.le.zpars(3))then + GB(9) = mcheif(mass,zpars(2),zpars(9)) + else + GB(9) = mcheif(mass,zpars(2),zpars(10)) + endif +* +* FAGB time parameters +* + tbagb = tscls(2) + tscls(3) + tscls(7) = tbagb + (1.d0/((GB(5)-1.d0)*GB(8)*GB(4)))* + & ((GB(4)/lums(7))**((GB(5)-1.d0)/GB(5))) + tscls(9) = tscls(7) - (tscls(7) - tbagb)*((lums(7)/lums(6)) + & **((GB(5)-1.d0)/GB(5))) + tscls(8) = tscls(9) + (1.d0/((GB(6)-1.d0)*GB(8)*GB(3)))* + & ((GB(3)/lums(6))**((GB(6)-1.d0)/GB(6))) +* +* Now to find Ltp and ttp using Mc,He,tp +* + mcbagb = mcagbf(mass) + mc1 = mcbagb + if(mc1.ge.0.8d0.and.mc1.lt.2.25d0)then +* The star undergoes dredge-up at Ltp causing a decrease in Mc,He + mc1 = 0.44d0*mc1 + 0.448d0 + endif + lums(8) = lmcgbf(mc1,GB) + if(mc1.le.GB(7))then + tscls(13) = tscls(7) - (1.d0/((GB(5)-1.d0)*GB(8)*GB(4)))* + & (mc1**(1.d0-GB(5))) + else + tscls(13) = tscls(8) - (1.d0/((GB(6)-1.d0)*GB(8)*GB(3)))* + & (mc1**(1.d0-GB(6))) + endif +* +* SAGB time parameters +* + if(mc1.le.GB(7))then + tscls(10) = tscls(13) + (1.d0/((GB(5)-1.d0)*GB(2)*GB(4)))* + & ((GB(4)/lums(8))**((GB(5)-1.d0)/GB(5))) + tscls(12) = tscls(10) - (tscls(10) - tscls(13))* + & ((lums(8)/lums(6))**((GB(5)-1.d0)/GB(5))) + tscls(11) = tscls(12) + (1.d0/((GB(6)-1.d0)*GB(2)*GB(3)))* + & ((GB(3)/lums(6))**((GB(6)-1.d0)/GB(6))) + else + tscls(10) = tscls(7) + tscls(12) = tscls(9) + tscls(11) = tscls(13) + (1.d0/((GB(6)-1.d0)*GB(2)*GB(3)))* + & ((GB(3)/lums(8))**((GB(6)-1.d0)/GB(6))) + endif +* +* Get an idea of when Mc,C = Mc,C,max on the AGB + tau = tscls(2) + tscls(3) + mc2 = mcgbtf(tau,GB(8),GB,tscls(7),tscls(8),tscls(9)) + mcmax = MAX(MAX(mch,0.773d0*mcbagb - 0.35d0),1.05d0*mc2) +* + if(mcmax.le.mc1)then + if(mcmax.le.GB(7))then + tscls(14) = tscls(7) - (1.d0/((GB(5)-1.d0)*GB(8)*GB(4)))* + & (mcmax**(1.d0-GB(5))) + else + tscls(14) = tscls(8) - (1.d0/((GB(6)-1.d0)*GB(8)*GB(3)))* + & (mcmax**(1.d0-GB(6))) + endif + else +* Star is on SAGB and we need to increase mcmax if any 3rd +* dredge-up has occurred. + lambdastar = MIN(0.9d0,0.3d0+0.001d0*mass**5) + mcmax = (mcmax - lambdastar*mc1)/(1.d0 - lambdastar) + if(mcmax.le.GB(7))then + tscls(14) = tscls(10) - (1.d0/((GB(5)-1.d0)*GB(2)*GB(4)))* + & (mcmax**(1.d0-GB(5))) + else + tscls(14) = tscls(11) - (1.d0/((GB(6)-1.d0)*GB(2)*GB(3)))* + & (mcmax**(1.d0-GB(6))) + endif + endif + tscls(14) = MAX(tbagb,tscls(14)) +C if(mass.ge.100.d0)then +C tn = tscls(2) +C goto 100 +C endif +* +* Calculate the nuclear timescale - the time of exhausting +* nuclear fuel without further mass loss. +* This means we want to find when Mc = Mt which defines Tn and will +* be used in determining the timestep required. Note that after some +* stars reach Mc = Mt there will be a Naked Helium Star lifetime +* which is also a nuclear burning period but is not included in Tn. +* + if(ABS(mt-mcbagb).lt.1.0d-14.and.kw.lt.5)then + tn = tbagb + else +* Note that the only occurence of Mc being double-valued is for stars +* that have a dredge-up. If Mt = Mc where Mc could be the value taken +* from CHeB or from the AGB we need to check the current stellar type. + if(mt.gt.mcbagb.or.(mt.ge.mc1.and.kw.gt.4))then + if(kw.eq.6)then + lambdastar = MIN(0.9d0,0.3d0+0.001d0*mass**5) + mc1 = (mt - lambdastar*mc1)/(1.d0 - lambdastar) + else + mc1 = mt + endif + if(mc1.le.GB(7))then + tn = tscls(10) - (1.d0/((GB(5)-1.d0)*GB(2)*GB(4)))* + & (mc1**(1.d0-GB(5))) + else + tn = tscls(11) - (1.d0/((GB(6)-1.d0)*GB(2)*GB(3)))* + & (mc1**(1.d0-GB(6))) + endif + else + if(mass.gt.zpars(3))then + mc1 = mcheif(mass,zpars(2),zpars(10)) + if(mt.le.mc1)then + tn = tscls(2) + else + tn = tscls(2) + tscls(3)*((mt - mc1)/(mcbagb - mc1)) + endif + elseif(mass.le.zpars(2))then + mc1 = mcgbf(lums(3),GB,lums(6)) + mc2 = mcgbf(lums(4),GB,lums(6)) + if(mt.le.mc1)then + tn = tscls(1) + elseif(mt.le.mc2)then + if(mt.le.GB(7))then + tn = tscls(4) - (1.d0/((GB(5)-1.d0)*GB(1)*GB(4)))* + & (mt**(1.d0-GB(5))) + else + tn = tscls(5) - (1.d0/((GB(6)-1.d0)*GB(1)*GB(3)))* + & (mt**(1.d0-GB(6))) + endif + else + tn = tscls(2) + tscls(3)*((mt - mc2)/(mcbagb - mc2)) + endif + else + mc1 = mcheif(mass,zpars(2),zpars(9)) + mc2 = mcheif(mass,zpars(2),zpars(10)) + if(mt.le.mc1)then + tn = tscls(1) + elseif(mt.le.mc2)then + tn = tscls(1) + tgb*((mt - mc1)/(mc2 - mc1)) + else + tn = tscls(2) + tscls(3)*((mt - mc2)/(mcbagb - mc2)) + endif + endif + endif + endif + tn = MIN(tn,tscls(14)) +* + goto 100 +* + 90 continue +* +* Calculate Helium star Main Sequence lifetime. +* + tm = themsf(mass) + tscls(1) = tm +* +* Zero- and terminal age Helium star main sequence luminosity +* + lums(1) = lzhef(mass) + am = MAX(0.d0,0.85d0-0.08d0*mass) + lums(2) = lums(1)*(1.d0+0.45d0+am) +* +* Set the Helium star GB parameters +* + GB(8) = 8.0d-05 + GB(3) = 4.1d+04 + GB(4) = 5.5d+04/(1.d0+0.4d0*mass**4) + GB(5) = 5.d0 + GB(6) = 3.d0 + GB(7) = (GB(3)/GB(4))**(1.d0/(GB(5)-GB(6))) +* Change in slope of giant L-Mc relation. + lums(6) = GB(4)*GB(7)**GB(5) +* +*** Set Helium star GB timescales +* + mc1 = mcgbf(lums(2),GB,lums(6)) + tscls(4) = tm + (1.d0/((GB(5)-1.d0)*GB(8)*GB(4)))* + & mc1**(1.d0-GB(5)) + tscls(6) = tscls(4) - (tscls(4) - tm)*((GB(7)/mc1) + & **(1.d0-GB(5))) + tscls(5) = tscls(6) + (1.d0/((GB(6)-1.d0)*GB(8)*GB(3)))* + & GB(7)**(1.d0-GB(6)) +* +* Get an idea of when Mc = MIN(Mt,Mc,C,max) on the GB + mtc = MIN(mt,1.45d0*mt-0.31d0) + if(mtc.le.0.d0) mtc = mt + mcmax = MIN(mtc,MAX(mch,0.773d0*mass-0.35d0)) + if(mcmax.le.GB(7))then + tscls(14) = tscls(4) - (1.d0/((GB(5)-1.d0)*GB(8)*GB(4)))* + & (mcmax**(1.d0-GB(5))) + else + tscls(14) = tscls(5) - (1.d0/((GB(6)-1.d0)*GB(8)*GB(3)))* + & (mcmax**(1.d0-GB(6))) + endif + tscls(14) = MAX(tscls(14),tm) + tn = tscls(14) +* + goto 100 +* + 95 continue + tm = 1.0d+10 + tscls(1) = tm + 96 continue + tn = 1.0d+10 +* + 100 continue + mass = mass0 +* + return + end +*** diff --git a/src/cosmic/src/SSE/SSE_zcnsts.f b/src/cosmic/src/SSE/SSE_zcnsts.f new file mode 100644 index 000000000..990410a0c --- /dev/null +++ b/src/cosmic/src/SSE/SSE_zcnsts.f @@ -0,0 +1,383 @@ +*** + SUBROUTINE SSE_zcnsts(z,zpars) + IMPLICIT NONE + INCLUDE '../const_bse.h' +* + integer kw +* + real*8 z,zpars(20) + real*8 tm,tn,tscls(20),lums(10),GB(10) + real*8 lzs,dlzs,lz,lzd,dum1,m1,m2,rr,rb,mhefl,lhefl,thefl,lx + real*8 tbgbf,thef,lbagbf,lheif,lhef,lzahbf + real*8 rgbf,ragbf,rminf,mcgbf + external tbgbf,thef,lbagbf,lheif,lhef,lzahbf + external rgbf,ragbf,rminf,mcgbf +* + include '../zdata.h' + real*8 msp(200),gbp(200),c(5) + common /MSCFF/ msp + common /GBCFF/ gbp + data c /3.040581d-01, 8.049509d-02, 8.967485d-02, + & 8.780198d-02, 2.219170d-02/ +* +* ------------------------------------------------------------ +* +* zpars: 1; M below which hook doesn't appear on MS, Mhook. +* 2; M above which He ignition occurs non-degenerately, Mhef. +* 3; M above which He ignition occurs on the HG, Mfgb. +* 4; M below which C/O ignition doesn't occur, Mup. +* 5; M above which C ignites in the centre, Mec. +* 6; value of log D for M<= zpars(3) +* 7; value of x for Rgb propto M^(-x) +* 8; value of x for tMS = MAX(tHOOK,x*tBGB) +* 9; constant for McHeIf when computing Mc,BGB, mchefl. +* 10; constant for McHeIf when computing Mc,HeI, mchefl. +* 11; hydrogen abundance. +* 12; helium abundance. +* 13; constant x in rmin = rgb*x**y used by LM CHeB. +* 14; z**0.4 to be used for WD L formula. +* +* ------------------------------------------------------------ +* + lzs = log10(z/zsun) + dlzs = 1.d0/(z*log(10.d0)) + lz = log10(z) + lzd = lzs + 1.d0 +* + zpars(1) = 1.0185d0 + lzs*(0.16015d0 + lzs*0.0892d0) + zpars(2) = 1.995d0 + lzs*(0.25d0 + lzs*0.087d0) + zpars(3) = 16.5d0*z**0.06d0/(1.d0 + (1.0d-04/z)**1.27d0) + zpars(4) = MAX(6.11044d0 + 1.02167d0*lzs, 5.d0) + zpars(5) = zpars(4) + 1.8d0 + zpars(6) = 5.37d0 + lzs*0.135d0 + zpars(7) = c(1) + lzs*(c(2) + lzs*(c(3) + lzs*(c(4) + lzs*c(5)))) + zpars(8) = MAX(0.95d0,MAX(0.95d0-(10.d0/3.d0)*(z-0.01d0), + & MIN(0.99d0,0.98d0-(100.d0/7.d0)*(z-0.001d0)))) +*** +* Lzams + msp(1) = xz(1)+lzs*(xz(2)+lzs*(xz(3)+lzs*(xz(4)+lzs*xz(5)))) + msp(2) = xz(6)+lzs*(xz(7)+lzs*(xz(8)+lzs*(xz(9)+lzs*xz(10)))) + msp(3) = xz(11)+lzs*(xz(12)+lzs*(xz(13)+lzs*(xz(14)+lzs*xz(15)))) + msp(4) = xz(16)+lzs*(xz(17)+lzs*(xz(18)+lzs*(xz(19)+lzs*xz(20)))) + msp(5) = xz(21)+lzs*(xz(22)+lzs*(xz(23)+lzs*(xz(24)+lzs*xz(25)))) + msp(6) = xz(26)+lzs*(xz(27)+lzs*(xz(28)+lzs*(xz(29)+lzs*xz(30)))) + msp(7) = xz(31)+lzs*(xz(32)+lzs*(xz(33)+lzs*(xz(34)+lzs*xz(35)))) +* Rzams + msp(8) = xz(36)+lzs*(xz(37)+lzs*(xz(38)+lzs*(xz(39)+lzs*xz(40)))) + msp(9) = xz(41)+lzs*(xz(42)+lzs*(xz(43)+lzs*(xz(44)+lzs*xz(45)))) + msp(10) = xz(46)+lzs*(xz(47)+lzs*(xz(48)+lzs*(xz(49)+lzs*xz(50)))) + msp(11) = xz(51)+lzs*(xz(52)+lzs*(xz(53)+lzs*(xz(54)+lzs*xz(55)))) + msp(12) = xz(56)+lzs*(xz(57)+lzs*(xz(58)+lzs*(xz(59)+lzs*xz(60)))) + msp(13) = xz(61) + msp(14) = xz(62)+lzs*(xz(63)+lzs*(xz(64)+lzs*(xz(65)+lzs*xz(66)))) + msp(15) = xz(67)+lzs*(xz(68)+lzs*(xz(69)+lzs*(xz(70)+lzs*xz(71)))) + msp(16) = xz(72)+lzs*(xz(73)+lzs*(xz(74)+lzs*(xz(75)+lzs*xz(76)))) +* Tbgb + msp(17) = xt(1)+lzs*(xt(2)+lzs*(xt(3)+lzs*xt(4))) + msp(18) = xt(5)+lzs*(xt(6)+lzs*(xt(7)+lzs*xt(8))) + msp(19) = xt(9)+lzs*(xt(10)+lzs*(xt(11)+lzs*xt(12))) + msp(20) = xt(13)+lzs*(xt(14)+lzs*(xt(15)+lzs*xt(16))) + msp(21) = xt(17) +* dTbgb/dz + msp(117) = dlzs*(xt(2)+lzs*(2.d0*xt(3)+3.d0*lzs*xt(4))) + msp(118) = dlzs*(xt(6)+lzs*(2.d0*xt(7)+3.d0*lzs*xt(8))) + msp(119) = dlzs*(xt(10)+lzs*(2.d0*xt(11)+3.d0*lzs*xt(12))) + msp(120) = dlzs*(xt(14)+lzs*(2.d0*xt(15)+3.d0*lzs*xt(16))) +* Thook + msp(22) = xt(18)+lzs*(xt(19)+lzs*(xt(20)+lzs*xt(21))) + msp(23) = xt(22) + msp(24) = xt(23)+lzs*(xt(24)+lzs*(xt(25)+lzs*xt(26))) + msp(25) = xt(27)+lzs*(xt(28)+lzs*(xt(29)+lzs*xt(30))) + msp(26) = xt(31) +* Ltms + msp(27) = xl(1)+lzs*(xl(2)+lzs*(xl(3)+lzs*(xl(4)+lzs*xl(5)))) + msp(28) = xl(6)+lzs*(xl(7)+lzs*(xl(8)+lzs*(xl(9)+lzs*xl(10)))) + msp(29) = xl(11)+lzs*(xl(12)+lzs*(xl(13)+lzs*xl(14))) + msp(30) = xl(15)+lzs*(xl(16)+lzs*(xl(17)+lzs*(xl(18)+lzs*xl(19)))) + msp(27) = msp(27)*msp(30) + msp(28) = msp(28)*msp(30) + msp(31) = xl(20)+lzs*(xl(21)+lzs*(xl(22)+lzs*xl(23))) + msp(32) = xl(24)+lzs*(xl(25)+lzs*(xl(26)+lzs*xl(27))) +* Lalpha + m2 = 2.d0 + msp(33) = xl(28)+lzs*(xl(29)+lzs*(xl(30)+lzs*xl(31))) + msp(34) = xl(32)+lzs*(xl(33)+lzs*(xl(34)+lzs*xl(35))) + msp(35) = xl(36)+lzs*(xl(37)+lzs*(xl(38)+lzs*xl(39))) + msp(36) = xl(40)+lzs*(xl(41)+lzs*(xl(42)+lzs*xl(43))) + msp(37) = MAX(0.9d0,1.1064d0+lzs*(0.415d0+0.18d0*lzs)) + msp(38) = MAX(1.d0,1.19d0+lzs*(0.377d0+0.176d0*lzs)) + if(z.gt.0.01d0)then + msp(37) = MIN(msp(37),1.d0) + msp(38) = MIN(msp(38),1.1d0) + endif + msp(39) = MAX(0.145d0,0.0977d0-lzs*(0.231d0+0.0753d0*lzs)) + msp(40) = MIN(0.24d0+lzs*(0.18d0+0.595d0*lzs),0.306d0+0.053d0*lzs) + msp(41) = MIN(0.33d0+lzs*(0.132d0+0.218d0*lzs), + & 0.3625d0+0.062d0*lzs) + msp(42) = (msp(33)+msp(34)*m2**msp(36))/ + & (m2**0.4d0+msp(35)*m2**1.9d0) +* Lbeta + msp(43) = xl(44)+lzs*(xl(45)+lzs*(xl(46)+lzs*(xl(47)+lzs*xl(48)))) + msp(44) = xl(49)+lzs*(xl(50)+lzs*(xl(51)+lzs*(xl(52)+lzs*xl(53)))) + msp(45) = xl(54)+lzs*(xl(55)+lzs*xl(56)) + msp(46) = MIN(1.4d0,1.5135d0+0.3769d0*lzs) + msp(46) = MAX(0.6355d0-0.4192d0*lzs,MAX(1.25d0,msp(46))) +* Lhook + msp(47) = xl(57)+lzs*(xl(58)+lzs*(xl(59)+lzs*xl(60))) + msp(48) = xl(61)+lzs*(xl(62)+lzs*(xl(63)+lzs*xl(64))) + msp(49) = xl(65)+lzs*(xl(66)+lzs*(xl(67)+lzs*xl(68))) + msp(50) = xl(69)+lzs*(xl(70)+lzs*(xl(71)+lzs*xl(72))) + msp(51) = MIN(1.4d0,1.5135d0+0.3769d0*lzs) + msp(51) = MAX(0.6355d0-0.4192d0*lzs,MAX(1.25d0,msp(51))) +* Rtms + msp(52) = xr(1)+lzs*(xr(2)+lzs*(xr(3)+lzs*(xr(4)+lzs*xr(5)))) + msp(53) = xr(6)+lzs*(xr(7)+lzs*(xr(8)+lzs*(xr(9)+lzs*xr(10)))) + msp(54) = xr(11)+lzs*(xr(12)+lzs*(xr(13)+lzs*(xr(14)+lzs*xr(15)))) + msp(55) = xr(16)+lzs*(xr(17)+lzs*(xr(18)+lzs*xr(19))) + msp(56) = xr(20)+lzs*(xr(21)+lzs*(xr(22)+lzs*xr(23))) + msp(52) = msp(52)*msp(54) + msp(53) = msp(53)*msp(54) + msp(57) = xr(24) + msp(58) = xr(25)+lzs*(xr(26)+lzs*(xr(27)+lzs*xr(28))) + msp(59) = xr(29)+lzs*(xr(30)+lzs*(xr(31)+lzs*xr(32))) + msp(60) = xr(33)+lzs*(xr(34)+lzs*(xr(35)+lzs*xr(36))) + msp(61) = xr(37)+lzs*(xr(38)+lzs*(xr(39)+lzs*xr(40))) +* + msp(62) = MAX(0.097d0-0.1072d0*(lz+3.d0),MAX(0.097d0,MIN(0.1461d0, + & 0.1461d0+0.1237d0*(lz+2.d0)))) + msp(62) = 10.d0**msp(62) + m2 = msp(62) + 0.1d0 + msp(63) = (msp(52)+msp(53)*msp(62)**msp(55))/ + & (msp(54)+msp(62)**msp(56)) + msp(64) = (msp(57)*m2**3+msp(58)*m2**msp(61)+ + & msp(59)*m2**(msp(61)+1.5d0))/(msp(60)+m2**5) +* Ralpha + msp(65) = xr(41)+lzs*(xr(42)+lzs*(xr(43)+lzs*xr(44))) + msp(66) = xr(45)+lzs*(xr(46)+lzs*(xr(47)+lzs*xr(48))) + msp(67) = xr(49)+lzs*(xr(50)+lzs*(xr(51)+lzs*xr(52))) + msp(68) = xr(53)+lzs*(xr(54)+lzs*(xr(55)+lzs*xr(56))) + msp(69) = xr(57)+lzs*(xr(58)+lzs*(xr(59)+lzs*(xr(60)+lzs*xr(61)))) + msp(70) = MAX(0.9d0,MIN(1.d0,1.116d0+0.166d0*lzs)) + msp(71) = MAX(1.477d0+0.296d0*lzs,MIN(1.6d0,-0.308d0-1.046d0*lzs)) + msp(71) = MAX(0.8d0,MIN(0.8d0-2.d0*lzs,msp(71))) + msp(72) = xr(62)+lzs*(xr(63)+lzs*xr(64)) + msp(73) = MAX(0.065d0,0.0843d0-lzs*(0.0475d0+0.0352d0*lzs)) + msp(74) = 0.0736d0+lzs*(0.0749d0+0.04426d0*lzs) + if(z.lt.0.004d0) msp(74) = MIN(0.055d0,msp(74)) + msp(75) = MAX(0.091d0,MIN(0.121d0,0.136d0+0.0352d0*lzs)) + msp(76) = (msp(65)*msp(71)**msp(67))/(msp(66) + msp(71)**msp(68)) + if(msp(70).gt.msp(71))then + msp(70) = msp(71) + msp(75) = msp(76) + endif +* Rbeta + msp(77) = xr(65)+lzs*(xr(66)+lzs*(xr(67)+lzs*xr(68))) + msp(78) = xr(69)+lzs*(xr(70)+lzs*(xr(71)+lzs*xr(72))) + msp(79) = xr(73)+lzs*(xr(74)+lzs*(xr(75)+lzs*xr(76))) + msp(80) = xr(77)+lzs*(xr(78)+lzs*(xr(79)+lzs*xr(80))) + msp(81) = xr(81)+lzs*(xr(82)+lzs*lzs*xr(83)) + if(z.gt.0.01d0) msp(81) = MAX(msp(81),0.95d0) + msp(82) = MAX(1.4d0,MIN(1.6d0,1.6d0+lzs*(0.764d0+0.3322d0*lzs))) +* Rgamma + msp(83) = MAX(xr(84)+lzs*(xr(85)+lzs*(xr(86)+lzs*xr(87))), + & xr(96)+lzs*(xr(97)+lzs*xr(98))) + msp(84) = MIN(0.d0,xr(88)+lzs*(xr(89)+lzs*(xr(90)+lzs*xr(91)))) + msp(84) = MAX(msp(84),xr(99)+lzs*(xr(100)+lzs*xr(101))) + msp(85) = xr(92)+lzs*(xr(93)+lzs*(xr(94)+lzs*xr(95))) + msp(85) = MAX(0.d0,MIN(msp(85),7.454d0+9.046d0*lzs)) + msp(86) = MIN(xr(102)+lzs*xr(103),MAX(2.d0,-13.3d0-18.6d0*lzs)) + msp(87) = MIN(1.5d0,MAX(0.4d0,2.493d0+1.1475d0*lzs)) + msp(88) = MAX(1.d0,MIN(1.27d0,0.8109d0-0.6282d0*lzs)) + msp(88) = MAX(msp(88),0.6355d0-0.4192d0*lzs) + msp(89) = MAX(5.855420d-02,-0.2711d0-lzs*(0.5756d0+0.0838d0*lzs)) +* Rhook + msp(90) = xr(104)+lzs*(xr(105)+lzs*(xr(106)+lzs*xr(107))) + msp(91) = xr(108)+lzs*(xr(109)+lzs*(xr(110)+lzs*xr(111))) + msp(92) = xr(112)+lzs*(xr(113)+lzs*(xr(114)+lzs*xr(115))) + msp(93) = xr(116)+lzs*(xr(117)+lzs*(xr(118)+lzs*xr(119))) + msp(94) = MIN(1.25d0, + & MAX(1.1d0,1.9848d0+lzs*(1.1386d0+0.3564d0*lzs))) + msp(95) = 0.063d0 + lzs*(0.0481d0 + 0.00984d0*lzs) + msp(96) = MIN(1.3d0,MAX(0.45d0,1.2d0+2.45d0*lzs)) +* Lneta + if(z.gt.0.0009d0)then + msp(97) = 10.d0 + else + msp(97) = 20.d0 + endif +* Lbgb + gbp(1) = xg(1)+lzs*(xg(2)+lzs*(xg(3)+lzs*xg(4))) + gbp(2) = xg(5)+lzs*(xg(6)+lzs*(xg(7)+lzs*xg(8))) + gbp(3) = xg(9)+lzs*(xg(10)+lzs*(xg(11)+lzs*xg(12))) + gbp(4) = xg(13)+lzs*(xg(14)+lzs*(xg(15)+lzs*xg(16))) + gbp(5) = xg(17)+lzs*(xg(18)+lzs*xg(19)) + gbp(6) = xg(20)+lzs*(xg(21)+lzs*xg(22)) + gbp(3) = gbp(3)**gbp(6) + gbp(7) = xg(23) + gbp(8) = xg(24) +* Lbagb +* set gbp(16) = 1.d0 until it is reset later with an initial +* call to Lbagbf using mass = zpars(2) and mhefl = 0.0 + gbp(9) = xg(25) + lzs*(xg(26) + lzs*xg(27)) + gbp(10) = xg(28) + lzs*(xg(29) + lzs*xg(30)) + gbp(11) = 15.d0 + gbp(12) = xg(31)+lzs*(xg(32)+lzs*(xg(33)+lzs*xg(34))) + gbp(13) = xg(35)+lzs*(xg(36)+lzs*(xg(37)+lzs*xg(38))) + gbp(14) = xg(39)+lzs*(xg(40)+lzs*(xg(41)+lzs*xg(42))) + gbp(15) = xg(43)+lzs*xg(44) + gbp(12) = gbp(12)**gbp(15) + gbp(14) = gbp(14)**gbp(15) + gbp(16) = 1.d0 +* Rgb + gbp(17) = -4.6739d0-0.9394d0*lz + gbp(17) = 10.d0**gbp(17) + gbp(17) = MAX(gbp(17),-0.04167d0+55.67d0*z) + gbp(17) = MIN(gbp(17),0.4771d0-9329.21d0*z**2.94d0) + gbp(18) = MIN(0.54d0,0.397d0+lzs*(0.28826d0+0.5293d0*lzs)) + gbp(19) = MAX(-0.1451d0,-2.2794d0-lz*(1.5175d0+0.254d0*lz)) + gbp(19) = 10.d0**gbp(19) + if(z.gt.0.004d0)then + gbp(19) = MAX(gbp(19),0.7307d0+14265.1d0*z**3.395d0) + endif + gbp(20) = xg(45)+lzs*(xg(46)+lzs*(xg(47)+lzs*(xg(48)+ + & lzs*(xg(49)+lzs*xg(50))))) + gbp(21) = xg(51)+lzs*(xg(52)+lzs*(xg(53)+lzs*(xg(54)+lzs*xg(55)))) + gbp(22) = xg(56)+lzs*(xg(57)+lzs*(xg(58)+lzs*(xg(59)+ + & lzs*(xg(60)+lzs*xg(61))))) + gbp(23) = xg(62)+lzs*(xg(63)+lzs*(xg(64)+lzs*(xg(65)+lzs*xg(66)))) +* Ragb + gbp(24) = MIN(0.99164d0-743.123d0*z**2.83d0, + & 1.0422d0+lzs*(0.13156d0+0.045d0*lzs)) + gbp(25) = xg(67)+lzs*(xg(68)+lzs*(xg(69)+lzs*(xg(70)+ + & lzs*(xg(71)+lzs*xg(72))))) + gbp(26) = xg(73)+lzs*(xg(74)+lzs*(xg(75)+lzs*(xg(76)+lzs*xg(77)))) + gbp(27) = xg(78)+lzs*(xg(79)+lzs*(xg(80)+lzs*(xg(81)+ + & lzs*(xg(82)+lzs*xg(83))))) + gbp(28) = xg(84)+lzs*(xg(85)+lzs*(xg(86)+lzs*(xg(87)+lzs*xg(88)))) + gbp(29) = xg(89)+lzs*(xg(90)+lzs*(xg(91)+lzs*(xg(92)+ + & lzs*(xg(93)+lzs*xg(94))))) + gbp(30) = xg(95)+lzs*(xg(96)+lzs*(xg(97)+lzs*(xg(98)+ + & lzs*(xg(99)+lzs*xg(100))))) + m1 = zpars(2) - 0.2d0 + gbp(31) = gbp(29) + gbp(30)*m1 + gbp(32) = MIN(gbp(25)/zpars(2)**gbp(26),gbp(27)/zpars(2)**gbp(28)) +* Mchei + gbp(33) = xg(101)**4 + gbp(34) = xg(102)*4.d0 +* Mcagb + gbp(35) = xg(103)+lzs*(xg(104)+lzs*(xg(105)+lzs*xg(106))) + gbp(36) = xg(107)+lzs*(xg(108)+lzs*(xg(109)+lzs*xg(110))) + gbp(37) = xg(111)+lzs*xg(112) + gbp(35) = gbp(35)**4 + gbp(36) = gbp(36)*4.d0 + gbp(37) = gbp(37)**4 +* Lhei +* set gbp(41) = -1.d0 until it is reset later with an initial +* call to Lheif using mass = zpars(2) and mhefl = 0.0 + gbp(38) = xh(1)+lzs*xh(2) + gbp(39) = xh(3)+lzs*xh(4) + gbp(40) = xh(5) + gbp(41) = -1.d0 + gbp(42) = xh(6)+lzs*(xh(7)+lzs*xh(8)) + gbp(43) = xh(9)+lzs*(xh(10)+lzs*xh(11)) + gbp(44) = xh(12)+lzs*(xh(13)+lzs*xh(14)) + gbp(42) = gbp(42)**2 + gbp(44) = gbp(44)**2 +* Lhe + gbp(45) = xh(15)+lzs*(xh(16)+lzs*xh(17)) + if(lzs.gt.-1.d0)then + gbp(46) = 1.d0 - xh(19)*(lzs+1.d0)**xh(18) + else + gbp(46) = 1.d0 + endif + gbp(47) = xh(20)+lzs*(xh(21)+lzs*xh(22)) + gbp(48) = xh(23)+lzs*(xh(24)+lzs*xh(25)) + gbp(45) = gbp(45)**gbp(48) + gbp(47) = gbp(47)**gbp(48) + gbp(46) = gbp(46)/zpars(3)**0.1d0+(gbp(46)*gbp(47)-gbp(45))/ + & zpars(3)**(gbp(48)+0.1d0) +* Rmin + gbp(49) = xh(26)+lzs*(xh(27)+lzs*(xh(28)+lzs*xh(29))) + gbp(50) = xh(30)+lzs*(xh(31)+lzs*(xh(32)+lzs*xh(33))) + gbp(51) = xh(34)+lzs*(xh(35)+lzs*(xh(36)+lzs*xh(37))) + gbp(52) = 5.d0+xh(38)*z**xh(39) + gbp(53) = xh(40)+lzs*(xh(41)+lzs*(xh(42)+lzs*xh(43))) + gbp(49) = gbp(49)**gbp(53) + gbp(51) = gbp(51)**(2.d0*gbp(53)) +* The +* set gbp(57) = -1.d0 until it is reset later with an initial +* call to Thef using mass = zpars(2), mc = 0.0 and mhefl = 0.0 + gbp(54) = xh(44)+lzs*(xh(45)+lzs*(xh(46)+lzs*xh(47))) + gbp(55) = xh(48)+lzs*(xh(49)+lzs*xh(50)) + gbp(55) = MAX(gbp(55),1.d0) + gbp(56) = xh(51) + gbp(57) = -1.d0 + gbp(58) = xh(52)+lzs*(xh(53)+lzs*(xh(54)+lzs*xh(55))) + gbp(59) = xh(56)+lzs*(xh(57)+lzs*(xh(58)+lzs*xh(59))) + gbp(60) = xh(60)+lzs*(xh(61)+lzs*(xh(62)+lzs*xh(63))) + gbp(61) = xh(64)+lzs*xh(65) + gbp(58) = gbp(58)**gbp(61) + gbp(60) = gbp(60)**5 +* Tbl + dum1 = zpars(2)/zpars(3) + gbp(62) = xh(66)+lzs*xh(67) + gbp(62) = -gbp(62)*log10(dum1) + gbp(63) = xh(68) + if(lzd.gt.0.d0) then + gbp(64) = 1.d0-lzd*(xh(69)+lzd*(xh(70)+lzd*xh(71))) + else + gbp(64) = 1.d0 + end if + gbp(65) = 1.d0-gbp(64)*dum1**gbp(63) + gbp(66) = 1.d0 - lzd*(xh(77) + lzd*(xh(78) + lzd*xh(79))) + gbp(67) = xh(72) + lzs*(xh(73) + lzs*(xh(74) + lzs*xh(75))) + gbp(68) = xh(76) +* Lzahb + gbp(69) = xh(80) + lzs*(xh(81) + lzs*xh(82)) + gbp(70) = xh(83) + lzs*(xh(84) + lzs*xh(85)) + gbp(71) = 15.d0 + gbp(72) = xh(86) + gbp(73) = xh(87) +* Rzahb + gbp(75) = xh(88) + lzs*(xh(89) + lzs*(xh(90) + lzs*xh(91))) + gbp(76) = xh(92) + lzs*(xh(93) + lzs*(xh(94) + lzs*xh(95))) + gbp(77) = xh(96) + lzs*(xh(97) + lzs*(xh(98) + lzs*xh(99))) +*** +* finish Lbagb + mhefl = 0.d0 + lx = lbagbf(zpars(2),mhefl) + gbp(16) = lx +* finish LHeI + dum1 = 0.d0 + lhefl = lheif(zpars(2),mhefl) + gbp(41) = (gbp(38)*zpars(2)**gbp(39)-lhefl)/ + & (EXP(zpars(2)*gbp(40))*lhefl) +* finish THe + thefl = thef(zpars(2),dum1,mhefl)*tbgbf(zpars(2)) + gbp(57) = (thefl-gbp(54))/(gbp(54)*EXP(gbp(56)*zpars(2))) +* finish Tblf + rb = ragbf(zpars(3),lheif(zpars(3),zpars(2)),mhefl) + rr = 1.d0 - rminf(zpars(3))/rb + rr = MAX(rr,1.0d-12) + gbp(66) = gbp(66)/(zpars(3)**gbp(67)*rr**gbp(68)) +* finish Lzahb + gbp(74) = lhefl*lHef(zpars(2)) +*** + kw = 0 + tm = 0.d0 + tn = 0.d0 + CALL SSE_star(kw,zpars(2),zpars(2),tm,tn,tscls,lums,GB,zpars) + zpars(9) = mcgbf(lums(3),GB,lums(6)) + zpars(10) = mcgbf(lums(4),GB,lums(6)) +* set the hydrogen and helium abundances + zpars(11) = 0.76d0 - 3.d0*z + zpars(12) = 0.24d0 + 2.d0*z +* set constant for low-mass CHeB stars + zpars(13) = rminf(zpars(2))/ + & rgbf(zpars(2),lzahbf(zpars(2),zpars(9),zpars(2))) +* + zpars(14) = z**0.4d0 +* + return + end +*** diff --git a/src/cosmic/src/zfuncs.f b/src/cosmic/src/SSE/SSE_zfuncs.f similarity index 99% rename from src/cosmic/src/zfuncs.f rename to src/cosmic/src/SSE/SSE_zfuncs.f index 704fee7a3..25b78578a 100644 --- a/src/cosmic/src/zfuncs.f +++ b/src/cosmic/src/SSE/SSE_zfuncs.f @@ -24,7 +24,7 @@ *** real*8 FUNCTION lzamsf(m) IMPLICIT NONE - INCLUDE 'const_bse.h' + INCLUDE '../const_bse.h' real*8 m,mx,a(200) common /MSCFF/ a * @@ -260,7 +260,7 @@ real*8 FUNCTION rtmssse(m) real*8 FUNCTION rtmsf(m, met) implicit none - INCLUDE 'const_bse.h' + INCLUDE '../const_bse.h' real*8 m,met,Rtms200,Rtms199,slope real*8 rtmssse, rtmsBoost, rtmsBpass external rtmssse diff --git a/src/cosmic/src/assign_commons_COSMIC.f90 b/src/cosmic/src/assign_commons_COSMIC.f90 new file mode 100644 index 000000000..5d00046fa --- /dev/null +++ b/src/cosmic/src/assign_commons_COSMIC.f90 @@ -0,0 +1,35 @@ + subroutine assign_commons() + use track_support + implicit none + + !to assign common variables when METISSE is used with COSMIC + + REAL(dp) :: ecsn,ecsn_mlow + COMMON /SNVARS1/ ecsn,ecsn_mlow + + real(dp) :: d + + + if(front_end == COSMIC) then + ! use inputs from COSMIC + + if (Mec_core > 0.d0) ecsn = Mec_core + d = (Mec_core-Mup_core) + if (Mup_core > 0.d0 .and. d>tiny ) ecsn_mlow = Mup_core + + else + print*,'Error: Front end mismtach in assign commons' + print*,'expected 2 (COSMIC); got ', front_end + endif + + end subroutine + + subroutine get_bhspin(bhspin,id) + use track_support + implicit none + integer, intent(in) :: id + real(dp), intent(out) :: bhspin + + bhspin = tarr(id)% pars% bhspin + end subroutine + diff --git a/src/cosmic/src/comenv.f b/src/cosmic/src/comenv.f index 2a7051acf..35e965428 100644 --- a/src/cosmic/src/comenv.f +++ b/src/cosmic/src/comenv.f @@ -6,7 +6,7 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, & bhspin1,bhspin2,binstate,mergertype, & jp,tphys,switchedCE,rad,tms,evolve_type,disrupt, & lumin,B_0,bacc,tacc,epoch,menv_bpp,renv_bpp, - & bkick) + & bkick,dtm) IMPLICIT NONE INCLUDE 'const_bse.h' * @@ -38,7 +38,7 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, REAL*8 Porbi,Porbf,Mcf,Menvf,qi,qf,G REAL*8 kick_info(2,17),fallback,M1i,M2i REAL*8 bkick(20) - REAL*8 bhspin1,bhspin2 + REAL*8 bhspin1,bhspin2,dtm common /fall/fallback INTEGER formation1,formation2 REAL*8 sigmahold @@ -88,20 +88,24 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, * Obtain the core masses and radii. * KW = KW1 - CALL star(KW1,M01,M1,TM1,TN,TSCLS1,LUMS,GB,ZPARS) + CALL star(KW1,M01,M1,TM1,TN,TSCLS1,LUMS,GB,ZPARS,dtm,star1) CALL hrdiag(M01,AJ1,M1,TM1,TN,TSCLS1,LUMS,GB,ZPARS, & R1,L1,KW1,MC1,RC1,MENV,RENV,K21, & bhspin1,star1) OSPIN1 = JSPIN1/(K21*R1*R1*(M1-MC1)+K3*RC1*RC1*MC1) MENVD = MENV/(M1-MC1) - RZAMS = RZAMSF(M01) * * Decide which CE prescription to use based on LAMBDA flag * MJZ: NOTE - Nanjing lambda prescription DOES NOT WORK! * - LAMB1 = CELAMF(KW,M01,L1,R1,RZAMS,MENVD,LAMBDAF) + IF (using_METISSE) THEN + CALL comenv_lambda(KW,M01,L1,R1,MENVD,LAMBDAF,STAR1,LAMB1) + ELSEIF (using_SSE) THEN + RZAMS = RZAMSF(M01) + LAMB1 = CELAMF(KW,M01,L1,R1,RZAMS,MENVD,LAMBDAF) + ENDIF KW = KW2 - CALL star(KW2,M02,M2,TM2,TN,TSCLS2,LUMS,GB,ZPARS) + CALL star(KW2,M02,M2,TM2,TN,TSCLS2,LUMS,GB,ZPARS,dtm,star2) CALL hrdiag(M02,AJ2,M2,TM2,TN,TSCLS2,LUMS,GB,ZPARS, & R2,L2,KW2,MC2,RC2,MENV,RENV,K22, & bhspin2,star2) @@ -116,8 +120,12 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, * IF(KW2.GE.2.AND.KW2.LE.9.AND.KW2.NE.7)THEN MENVD = MENV/(M2-MC2) - RZAMS = RZAMSF(M02) - LAMB2 = CELAMF(KW,M02,L2,R2,RZAMS,MENVD,LAMBDAF) + IF (using_METISSE) THEN + CALL comenv_lambda(KW,M02,L2,R2,MENVD,LAMBDAF,STAR2,LAMB2) + ELSEIF (using_SSE) THEN + RZAMS = RZAMSF(M02) + LAMB2 = CELAMF(KW,M02,L2,R2,RZAMS,MENVD,LAMBDAF) + ENDIF EBINDI = EBINDI + M2*(M2-MC2)/(LAMB2*R2) * * Calculate the initial orbital energy @@ -213,7 +221,7 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, M_postCE=MC1 ENDIF - CALL star(KW1,M01,M1,TM1,TN,TSCLS1,LUMS,GB,ZPARS) + CALL star(KW1,M01,M1,TM1,TN,TSCLS1,LUMS,GB,ZPARS,dtm,star1) CALL hrdiag(M01,AJ1,M1,TM1,TN,TSCLS1,LUMS,GB,ZPARS, & R1,L1,KW1,MC1,RC1,MENV,RENV,K21, & bhspin1,star1) @@ -515,7 +523,7 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, endif ENDIF - CALL star(KW1,M01,M1,TM1,TN,TSCLS1,LUMS,GB,ZPARS) + CALL star(KW1,M01,M1,TM1,TN,TSCLS1,LUMS,GB,ZPARS,dtm,star1) CALL hrdiag(M01,AJ1,M1,TM1,TN,TSCLS1,LUMS,GB,ZPARS, & R1,L1,KW1,MC1,RC1,MENV,RENV,K21, & bhspin1,star1) @@ -678,7 +686,7 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, M_postCE=MC2 ENDIF - CALL star(KW2,M02,M2,TM2,TN,TSCLS2,LUMS,GB,ZPARS) + CALL star(KW2,M02,M2,TM2,TN,TSCLS2,LUMS,GB,ZPARS,dtm,star2) CALL hrdiag(M02,AJ2,M2,TM2,TN,TSCLS2,LUMS,GB,ZPARS, & R2,L2,KW2,MC2,RC2,MENV,RENV,K22, & bhspin2,star2) @@ -884,17 +892,20 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, if(output) write(*,*)'coel 2 1:',KW,KW1,KW2,M1,M2,MF,MC22, & TB,OORB IF(KW.EQ.2)THEN - CALL star(KW,M1,M1,TM2,TN,TSCLS2,LUMS,GB,ZPARS) + if (using_METISSE) call set_star_type(star1) + CALL star(KW,M1,M1,TM2,TN,TSCLS2,LUMS,GB,ZPARS,dtm,star1) IF(GB(9).GE.MC1)THEN M01 = M1 AJ1 = TM2 + (TSCLS2(1) - TM2)*(AJ1-TM1)/(TSCLS1(1) - TM1) - CALL star(KW,M01,M1,TM1,TN,TSCLS1,LUMS,GB,ZPARS) + CALL star(KW,M01,M1,TM1,TN,TSCLS1,LUMS,GB,ZPARS, + & dtm,star1) ENDIF if(output) write(*,*)'coel 2 2:',KW,KW1,KW2,M1,M01,MC22, & TB,OORB ELSEIF(KW.EQ.7)THEN M01 = M1 - CALL star(KW,M01,M1,TM1,TN,TSCLS1,LUMS,GB,ZPARS) + if (using_METISSE) call set_star_type(star1) + CALL star(KW,M01,M1,TM1,TN,TSCLS1,LUMS,GB,ZPARS,dtm,star1) AJ1 = TM1*(FAGE1*MC1 + FAGE2*MC22)/(MC1 + MC22) if(output) write(*,*)'coel 2 3:',KW,KW1,KW2,M1,M01,MC22, & TB,OORB @@ -905,8 +916,8 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, * * Obtain a new age for the giant. * - CALL gntage(MC1,M1,KW,ZPARS,M01,AJ1) - CALL star(KW,M01,M1,TM1,TN,TSCLS1,LUMS,GB,ZPARS) + CALL gntage(MC1,M1,KW,ZPARS,M01,AJ1,star1) + CALL star(KW,M01,M1,TM1,TN,TSCLS1,LUMS,GB,ZPARS,dtm,star1) if(output) write(*,*)'coel 2 4:',KW,KW1,KW2,M1,M01,MC22, & TB,OORB ENDIF @@ -920,7 +931,7 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, if(output) write(*,*)'coel 2 5:',KW,M1,M01,R1,MENV,RENV IF(KW1i.LE.12.and.KW.GE.13)THEN formation1 = 1 - if(KW.eq.13.and.ecsn.gt.0.d0)then + if(KW1.eq.13.and.ecsn.gt.0.d0)then if(KW1i.le.6)then if(M1i.le.zpars(5))then if(sigma.gt.0.d0.and.sigmadiv.gt.0.d0)then diff --git a/src/cosmic/src/const_bse.h b/src/cosmic/src/const_bse.h index e404b8dee..3d16c6c9c 100644 --- a/src/cosmic/src/const_bse.h +++ b/src/cosmic/src/const_bse.h @@ -57,4 +57,9 @@ COMMON /SINGLE/ scm,spp REAL*8 bcm(50000,38),bpp(1000,43) COMMON /BINARY/ bcm,bpp +* + LOGICAL using_metisse, using_sse + COMMON /SE_FLAGS/ using_metisse, using_sse + LOGICAL bcm_err + COMMON/ ER_FLAGS/ bcm_err * diff --git a/src/cosmic/src/deltat.f b/src/cosmic/src/deltat.f index d7afeecee..4a8b649df 100644 --- a/src/cosmic/src/deltat.f +++ b/src/cosmic/src/deltat.f @@ -1,62 +1,18 @@ -*** - SUBROUTINE deltat(kw,age,tm,tn,tscls,dt,dtr) + SUBROUTINE deltat(kw,age,tm,tn,tscls,dt,dtr,id) IMPLICIT NONE INCLUDE 'const_bse.h' -* - INTEGER kw + + INTEGER kw,id REAL*8 age,tm,tn,tscls(20) REAL*8 dt,dtr -* -* Base new time scale for changes in radius & mass on stellar type. -* - if(kw.le.1)then - dt = pts1*tm - dtr = tm - age - elseif(kw.eq.2)then - dt = pts1*(tscls(1) - tm) - dtr = tscls(1) - age - elseif(kw.eq.3)then - if(age.lt.tscls(6))then - dt = pts2*(tscls(4) - age) - else - dt = pts2*(tscls(5) - age) - endif - dtr = MIN(tscls(2),tn) - age - elseif(kw.eq.4)then - dt = pts2*tscls(3) - dtr = MIN(tn,tscls(2) + tscls(3)) - age - elseif(kw.eq.5)then - if(age.lt.tscls(9))then - dt = pts3*(tscls(7) - age) - else - dt = pts3*(tscls(8) - age) - endif - dtr = MIN(tn,tscls(13)) - age - elseif(kw.eq.6)then - if(age.lt.tscls(12))then - dt = pts3*(tscls(10) - age) - else - dt = pts3*(tscls(11) - age) - endif - dt = MIN(dt,0.005d0) - dtr = tn - age - elseif(kw.eq.7)then - dt = pts1*tm - dtr = tm - age - elseif(kw.eq.8.or.kw.eq.9)then - if(age.lt.tscls(6))then - dt = pts2*(tscls(4) - age) - else - dt = pts2*(tscls(5) - age) - endif - dtr = tn - age - else -* dt = MAX(0.1d0,age*10.d0) - dt = MAX(0.1d0,dt*10.d0) - dt = MIN(dt,5.0d+02) - dtr = dt + + if (using_METISSE) then + !WRITE(*,*) 'Calling METISSE_deltat' + CALL METISSE_deltat(id,age,dt,dtr) + + elseif (using_SSE) then + !WRITE(*,*) 'Calling SSE_deltat' + CALL SSE_deltat(kw,age,tm,tn,tscls,dt,dtr) endif -* - RETURN + END -*** diff --git a/src/cosmic/src/evolv2.f b/src/cosmic/src/evolv2.f index b57eb9705..5578dee36 100644 --- a/src/cosmic/src/evolv2.f +++ b/src/cosmic/src/evolv2.f @@ -3,6 +3,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, \ dtp,mass0,rad,lumin,massc,radc, \ menv,renv,ospin,B_0,bacc,tacc,epoch,tms, \ bhspin,tphys,zpars,bkick,kick_info, + \ path_to_tracks,path_to_he_tracks, \ bpp_index_out,bcm_index_out,kick_info_out) IMPLICIT NONE INCLUDE 'const_bse.h' @@ -197,6 +198,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, COMMON /fall/fallback REAL ran3 EXTERNAL ran3 + CHARACTER*256 path_to_tracks,path_to_he_tracks * * @@ -242,6 +244,8 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, Cf2py intent(in) zpars Cf2py intent(in) bkick Cf2py intent(in) kick_info +Cf2py intent(in) path_to_tracks +Cf2py intent(in) path_to_he_tracks Cf2py intent(out) bpp_index_out Cf2py intent(out) bcm_index_out Cf2py intent(out) kick_info_out @@ -249,6 +253,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, if(using_cmc.eq.0)then CALL instar endif + + if(using_METISSE) CALL initialize_front_end('cosmic') + if(using_METISSE) call allocate_track(2,mass0) * * Save the initial state. @@ -334,7 +341,8 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * Set the collision matrix. * if(using_cmc.eq.0)then - CALL zcnsts(z,zpars) +* for SSE path_to_tracks and path_to_he_tracks are empty ('') + CALL zcnsts(z,zpars,path_to_tracks,path_to_he_tracks) endif kmin = 1 @@ -409,7 +417,8 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, age = tphys - epoch(k) mc = massc(k) rc = radc(k) - CALL star(kstar(k),mass0(k),mass(k),tm,tn,tscls,lums,GB,zpars) + CALL star(kstar(k),mass0(k),mass(k),tm,tn,tscls,lums,GB,zpars, + & dtm,k) CALL hrdiag(mass0(k),age,mass(k),tm,tn,tscls,lums,GB,zpars, & rm,lum,kstar(k),mc,rc,me,re,k2,bhspin(k),k) aj(k) = age @@ -550,7 +559,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, if(neta.gt.tiny .and. kstar(k)<15)then rlperi = rol(k)*(1.d0-ecc) dmr(k) = mlwind(kstar(k),lumin(k),rad(k),mass(k), - & massc(k),rlperi,z) + & massc(k),rlperi,z,k) * * Calculate how much of wind mass loss from companion will be * accreted (Boffin & Jorissen, A&A 1988, 205, 155). @@ -916,7 +925,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, if(neta.gt.tiny .and. kstar(k)<15)then rlperi = 0.d0 dmr(k) = mlwind(kstar(k),lumin(k),rad(k),mass(k), - & massc(k),rlperi,z) + & massc(k),rlperi,z,k) else dmr(k) = 0.d0 endif @@ -1133,8 +1142,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, m0 = mass0(k) mass0(k) = mass(k) CALL star(kstar(k),mass0(k),mass(k),tm,tn,tscls, - & lums,GB,zpars) + & lums,GB,zpars,dtm,k) if(kstar(k).eq.2)then + if (using_SSE) then if(GB(9).lt.massc(k).or.m0.gt.zpars(3))then mass0(k) = m0 else @@ -1142,6 +1152,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & (tbgb(k) - tms(k)) epoch(k) = tphys - epoch(k) endif + endif else epoch(k) = tphys - aj(k)*tm/tms(k) endif @@ -1213,7 +1224,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * goto 140 endif * - CALL star(kw,m0,mt,tm,tn,tscls,lums,GB,zpars) + CALL star(kw,m0,mt,tm,tn,tscls,lums,GB,zpars,dtm,k) CALL hrdiag(m0,age,mt,tm,tn,tscls,lums,GB,zpars, & rm,lum,kw,mc,rc,me,re,k2,bhspin(k),k) * @@ -1507,7 +1518,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * Base new time scale for changes in radius & mass on stellar type. * dt = dtmi(k) - CALL deltat(kw,age,tm,tn,tscls,dt,dtr) + CALL deltat(kw,age,tm,tn,tscls,dt,dtr,k) if(output) write(*,*)'post deltat:',tphys,dt,dtr,kw, & age,intpol,iter,k,kmin,kmax * @@ -1650,6 +1661,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & radc(2),menv(2),renv(2),epoch(2),ospin(2), & deltam2_bcm,rrl2,tb,sep,ecc,b01_bcm,b02_bcm, & formation(1),formation(2),binstate,mergertype) + if (bcm_err) goto 150 if(isave) tsave = tsave + dtp if(output) write(*,*)'bcm1',kstar(1),kstar(2),mass(1), & mass(2),rad(1),rad(2),ospin(1),ospin(2),jspin(1) @@ -1685,6 +1697,10 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * Test whether Roche lobe overflow has begun. * if(rad(j1).gt.rol(j1))then + if (using_METISSE .and. (rad(j1).lt.1.05d0*rol(j1))) then + if(tphys.ge.tphysf) goto 140 + goto 7 + endif * * Interpolate back until the primary is just filling its Roche lobe. * @@ -1749,6 +1765,8 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, prec = .true. endif tphys0 = tphys + if(using_METISSE .and. (dtm.le.1.0d-10)) + & dtm = max(ABS(dtm),dtmi(j1)) endif endif * @@ -1932,6 +1950,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & radc(2),menv(2),renv(2),epoch(2),ospin(2), & deltam2_bcm,rrl2,tb,sep,ecc,b01_bcm,b02_bcm, & formation(1),formation(2),binstate,mergertype) + if (bcm_err) goto 150 if(output) write(*,*)'bcm2:',kstar(1),kstar(2),mass(1), & mass(2),rad(1),rad(2),ospin(1),ospin(2),jspin(1) * & mass(2),rad(1),rad(2),ospin(1),ospin(2),b01_bcm,b02_bcm,jspin(1) @@ -2253,7 +2272,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * mass0(j2) = mass(j2) CALL star(kstar(j2),mass0(j2),mass(j2),tmsnew,tn, - & tscls,lums,GB,zpars) + & tscls,lums,GB,zpars,dtm,j2) * If the star has no convective core then the effective age decreases, * otherwise it will become younger still. if(mass(j2).lt.0.35d0.or.mass(j2).gt.1.25d0)then @@ -2270,8 +2289,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, mass(j2) = mass(j2) + dm2 if(kstar(j2).eq.2)then mass0(j2) = mass(j2) + if (using_METISSE) call set_star_type(j2) CALL star(kstar(j2),mass0(j2),mass(j2),tmsnew,tn,tscls, - & lums,GB,zpars) + & lums,GB,zpars,dtm,j2) aj(j2) = tmsnew + tscls(1)*(aj(j2)-tms(j2))/tbgb(j2) epoch(j2) = tphys - aj(j2) endif @@ -2297,7 +2317,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, else mass(j2) = mass(j2) + dm2 CALL gntage(massc(j2),mass(j2),kst,zpars, - & mass0(j2),aj(j2)) + & mass0(j2),aj(j2),j2) epoch(j2) = tphys - aj(j2) endif kstar(j2) = kst @@ -2378,7 +2398,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & vk,kick_info,formation(j1),formation(j2),sigmahold, & bhspin(j1),bhspin(j2),binstate,mergertype, & jp,tphys,switchedCE,rad,tms,evolve_type,disrupt, - & lumin,B_0,bacc,tacc,epoch,menv,renv,bkick) + & lumin,B_0,bacc,tacc,epoch,menv,renv,bkick,dtm) if(binstate.eq.1.d0)then sep = 0.d0 tb = 0.d0 @@ -2502,7 +2522,8 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * kst = 9 if(kstar(j2).eq.10) massc(j2) = dm2 - CALL gntage(massc(j2),mass(j2),kst,zpars,mass0(j2),aj(j2)) + CALL gntage(massc(j2),mass(j2),kst,zpars, + & mass0(j2),aj(j2),j2) kstar(j2) = kst epoch(j2) = tphys - aj(j2) elseif(kstar(j2).le.12)then @@ -2636,7 +2657,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, formation(1) = 11 formation(2) = 11 endif - CALL mix(mass0,mass,aj,kstar,zpars,bhspin) + CALL mix(mass0,mass,aj,kstar,zpars,bhspin,dtm) dm1 = m1ce - mass(j1) dm2 = mass(j2) - m2ce * @@ -2701,7 +2722,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, endif rlperi = rol(k)*(1.d0-ecc) dmr(k) = mlwind(kstar(k),lumin(k),radx(k), - & mass(k),massc(k),rlperi,z) + & mass(k),massc(k),rlperi,z,k) vwind2 = 2.d0*beta*acc1*mass(k)/radx(k) omv2 = (1.d0 + vorb2/vwind2)**(3.d0/2.d0) dmt(3-k) = ivsqm*acc2*dmr(k)*((acc1*mass(3-k)/vwind2)**2) @@ -2806,7 +2827,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, mcx = massc(j2) endif mt2 = mass(j2) + km*(dm2 - dms(j2)) - CALL gntage(mcx,mt2,kst,zpars,mass0(j2),aj(j2)) + CALL gntage(mcx,mt2,kst,zpars,mass0(j2),aj(j2),j2) epoch(j2) = tphys + dtm - aj(j2) endif endif @@ -2857,7 +2878,8 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, else kst = MIN(6,3*kstar(j2)-27) mt2 = mass(j2) + km*(dm2 - dms(j2)) - CALL gntage(massc(j2),mt2,kst,zpars,mass0(j2),aj(j2)) + CALL gntage(massc(j2),mt2,kst,zpars, + & mass0(j2),aj(j2),j2) epoch(j2) = tphys + dtm - aj(j2) * endif @@ -3372,7 +3394,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, m0 = mass0(j1) mass0(j1) = mass(j1) CALL star(kstar(j1),mass0(j1),mass(j1),tmsnew,tn,tscls, - & lums,GB,zpars) + & lums,GB,zpars,dtm,j1) if(GB(9).lt.massc(j1))then mass0(j1) = m0 endif @@ -3381,7 +3403,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, m0 = mass0(j2) mass0(j2) = mass(j2) CALL star(kstar(j2),mass0(j2),mass(j2),tmsnew,tn,tscls, - & lums,GB,zpars) + & lums,GB,zpars,dtm,j2) if(GB(9).lt.massc(j2))then mass0(j2) = m0 endif @@ -3415,10 +3437,10 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * if(kstar(j1).le.2.or.kstar(j1).eq.7)then CALL star(kstar(j1),mass0(j1),mass(j1),tmsnew,tn,tscls, - & lums,GB,zpars) + & lums,GB,zpars,dtm,j1) if(kstar(j1).eq.2)then - aj(j1) = tmsnew + (tscls(1) - tmsnew)*(aj(j1)-tms(j1))/ - & (tbgb(j1) - tms(j1)) + if (using_SSE) aj(j1) = tmsnew + (tscls(1) - tmsnew)* + & (aj(j1)-tms(j1))/(tbgb(j1) - tms(j1)) else aj(j1) = tmsnew/tms(j1)*aj(j1) endif @@ -3427,10 +3449,10 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * if(kstar(j2).le.2.or.kstar(j2).eq.7)then CALL star(kstar(j2),mass0(j2),mass(j2),tmsnew,tn,tscls, - & lums,GB,zpars) + & lums,GB,zpars,dtm,j2) if(kstar(j2).eq.2)then - aj(j2) = tmsnew + (tscls(1) - tmsnew)*(aj(j2)-tms(j2))/ - & (tbgb(j2) - tms(j2)) + if (using_SSE) aj(j2) = tmsnew + (tscls(1) - tmsnew)* + & (aj(j2)-tms(j2))/(tbgb(j2) - tms(j2)) elseif((mass(j2).lt.0.35d0.or.mass(j2).gt.1.25d0). & and.kstar(j2).ne.7)then aj(j2) = tmsnew/tms(j2)*aj(j2)*(mass(j2) - dm22)/mass(j2) @@ -3458,7 +3480,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * goto 140 endif kw = kstar(k) - CALL star(kw,m0,mt,tm,tn,tscls,lums,GB,zpars) + CALL star(kw,m0,mt,tm,tn,tscls,lums,GB,zpars,dtm,k) CALL hrdiag(m0,age,mt,tm,tn,tscls,lums,GB,zpars, & rm,lum,kw,mc,rc,me,re,k2,bhspin(k),k) * @@ -3578,7 +3600,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * Determine stellar evolution timescale for nuclear burning types. * if(kw.le.9)then - CALL deltat(kw,age,tm,tn,tscls,dt,dtr) + CALL deltat(kw,age,tm,tn,tscls,dt,dtr,k) dtmi(k) = MIN(dt,dtr) * dtmi(k) = dtr dtmi(k) = MAX(1.0d-07,dtmi(k)) @@ -3672,6 +3694,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & radc(2),menv(2),renv(2),epoch(2),ospin(2), & deltam2_bcm,rrl2,tb,sep,ecc,b01_bcm,b02_bcm, & formation(1),formation(2),binstate,mergertype) + if (bcm_err) goto 150 if(isave) tsave = tsave + dtp if(output) write(*,*)'bcm3:',kstar(1),kstar(2),mass(1), & mass(2),rad(1),rad(2),ospin(1),ospin(2),jspin(1) @@ -3861,7 +3884,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & vk,kick_info,formation(j1),formation(j2),sigmahold, & bhspin(j1),bhspin(j2),binstate,mergertype, & jp,tphys,switchedCE,rad,tms,evolve_type,disrupt, - & lumin,B_0,bacc,tacc,epoch,menv,renv,bkick) + & lumin,B_0,bacc,tacc,epoch,menv,renv,bkick,dtm) if(output) write(*,*)'coal1:',tphys,kstar(j1),kstar(j2),coel, & mass(j1),mass(j2) if(j1.eq.2.and.kcomp2.eq.13.and.kstar(j2).eq.15.and. @@ -3942,7 +3965,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & vk,kick_info,formation(j2),formation(j1),sigmahold, & bhspin(j2),bhspin(j1),binstate,mergertype, & jp,tphys,switchedCE,rad,tms,evolve_type,disrupt, - & lumin,B_0,bacc,tacc,epoch,menv,renv,bkick) + & lumin,B_0,bacc,tacc,epoch,menv,renv,bkick,dtm) if(output) write(*,*)'coal2:',tphys,kstar(j1),kstar(j2),coel, & mass(j1),mass(j2) if(j2.eq.2.and.kcomp1.eq.13.and.kstar(j1).eq.15.and. @@ -3980,7 +4003,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, tb = -1.d0 endif else - CALL mix(mass0,mass,aj,kstar,zpars,bhspin) + CALL mix(mass0,mass,aj,kstar,zpars,bhspin,dtm) endif if(com)then @@ -4470,6 +4493,8 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & radc(2),menv(2),renv(2),epoch(2),ospin(2), & deltam2_bcm,rrl2,tb,sep,ecc,b01_bcm,b02_bcm, & formation(1),formation(2),binstate,mergertype) + + if (bcm_err) goto 150 if(output) write(*,*)'bcm4:',kstar(1),kstar(2),mass(1), & mass(2),rad(1),rad(2),ospin(1),ospin(2),jspin(1), & tphys,tphysf @@ -4487,6 +4512,8 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, evolve_type = 10.0 goto 135 endif + 150 continue + tphysfhold = tphysf tphysf = tphys if(sgl)then @@ -4501,6 +4528,8 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * STOP elseif(jp.ge.40)then WRITE(99,*)' EVOLV2 ARRAY WARNING ',mass1i,mass2i,tbi,ecci,jp + elseif (IP+1>SIZE(BCM,1)) then + WRITE(99,*)'IP>SIZE(BCM)',IP, size(bcm,1) endif if(iter.ge.loop)then WRITE(99,*)'ITER>=LOOP:',jp,tphys,tphysfhold,dtp,kstar,age,kst, @@ -4516,6 +4545,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, bpp_index_out = jp kick_info_out = kick_info endif + if (using_METISSE) call dealloc_track() * END SUBROUTINE evolv2 diff --git a/src/cosmic/src/bse.f b/src/cosmic/src/extra/bse.f similarity index 100% rename from src/cosmic/src/bse.f rename to src/cosmic/src/extra/bse.f diff --git a/src/cosmic/src/evolv1.f b/src/cosmic/src/extra/evolv1.f similarity index 100% rename from src/cosmic/src/evolv1.f rename to src/cosmic/src/extra/evolv1.f diff --git a/src/cosmic/src/sse.f b/src/cosmic/src/extra/sse.f similarity index 100% rename from src/cosmic/src/sse.f rename to src/cosmic/src/extra/sse.f diff --git a/src/cosmic/src/gntage.f b/src/cosmic/src/gntage.f index f5c6609e4..edfb945ad 100644 --- a/src/cosmic/src/gntage.f +++ b/src/cosmic/src/gntage.f @@ -1,300 +1,17 @@ -*** - SUBROUTINE gntage(mc,mt,kw,zpars,m0,aj) + SUBROUTINE gntage(mc,mt,kw,zpars,m0,aj,id) IMPLICIT NONE INCLUDE 'const_bse.h' -* -* A routine to determine the age of a giant from its core mass and type. -* -* Author : C. A. Tout -* Date : 24th September 1996 -* Revised: 21st February 1997 to include core-helium-burning stars -* -* Rewritten: 2nd January 1998 by J. R. Hurley to be compatible with -* the new evolution routines and to include new stellar -* types. -* -* - integer kw - integer j,jmax - parameter(jmax=30) -* - real*8 mc,mt,m0,aj,tm,tn - real*8 tscls(20),lums(10),GB(10),zpars(20) - real*8 mmin,mmax,mmid,dm,f,fmid,dell,derl,lum - real*8 macc,lacc,tiny - parameter(macc=0.00001d0,lacc=0.0001d0,tiny=1.0d-14) - real*8 mcx,mcy -* - real*8 mcheif,mcagbf,mheif,mbagbf,mcgbf,lmcgbf,lbgbf,lbgbdf - external mcheif,mcagbf,mheif,mbagbf,mcgbf,lmcgbf,lbgbf,lbgbdf -* -* This should only be entered with KW = 3, 4, 5, 6 or 9 -* -* First we check that we don't have a CheB star -* with too small a core mass. - if(kw.eq.4)then -* Set the minimum CHeB core mass using M = Mflash - mcy = mcheif(zpars(2),zpars(2),zpars(10)) - if(mc.le.mcy) kw = 3 -* if(mc.le.mcy) WRITE(66,*)' GNTAGE4: changed to 3' - endif -* -* Next we check that we don't have a GB star for M => Mfgb - if(kw.eq.3)then -* Set the maximum GB core mass using M = Mfgb - mcy = mcheif(zpars(3),zpars(2),zpars(9)) - if(mc.ge.mcy)then - kw = 4 - aj = 0.d0 -* WRITE(66,*)' GNTAGE3: changed to 4' - endif - endif -* - if(kw.eq.6)then -* -* We try to start the star from the start of the SAGB by -* setting Mc = Mc,TP. -* - mcy = 0.44d0*2.25d0 + 0.448d0 - if(mc.gt.mcy)then -* A type 6 with this sized core mass cannot exist as it should -* already have become a NS or BH as a type 5. -* We set it up so that it will. - mcx = (mc + 0.35d0)/0.773d0 - elseif(mc.ge.0.8d0)then - mcx = (mc - 0.448d0)/0.44d0 - else - mcx = mc - endif - m0 = mbagbf(mcx) - if(m0.lt.tiny)then -* Carbon core mass is less then the minimum for the start of SAGB. -* This must be the case of a low-mass C/O or O/Ne WD with only a -* very small envelope added or possibly the merger of a helium star -* with a main sequence star. We will set m0 = mt and then reset the -* core mass to allow for some helium to be added to the C/O core. - kw = 14 -* WRITE(66,*)' GNTAGE6: changed to 4' - else - CALL star(kw,m0,mt,tm,tn,tscls,lums,GB,zpars) - aj = tscls(13) + 2.d0*tiny - endif - endif -* - if(kw.eq.5)then -* -* We fit a Helium core mass at the base of the AGB. -* - m0 = mbagbf(mc) - if(m0.lt.tiny)then -* Helium core mass is less then the BAGB minimum. - kw = 14 -* WRITE(66,*)' GNTAGE5: changed to 4' - else - CALL star(kw,m0,mt,tm,tn,tscls,lums,GB,zpars) - aj = tscls(2) + tscls(3) + 2.d0*tiny - endif - endif -* -* - if(kw.eq.4)then -* -* The supplied age is actually the fractional age, fage, of CHeB lifetime -* that has been completed, ie. 0 <= aj <= 1. -* - if(aj.lt.0.d0.or.aj.gt.1.d0)then -* WRITE(99,*)' FATAL ERROR! GNTAGE4: fage out of bounds ' -* WRITE(99,*)' FAGE ',aj -* WRITE(*,*)' STOP: FATAL ERROR ' -* CALL exit(0) -* STOP - aj = 0.d0 - endif -* Get the minimum, fage=1, and maximum, fage=0, allowable masses - mcy = mcagbf(zpars(2)) - if(mc.ge.mcy)then - mmin = mbagbf(mc) - else - mmin = zpars(2) - endif - mmax = mheif(mc,zpars(2),zpars(10)) - if(aj.lt.tiny)then - m0 = mmax - goto 20 - elseif(aj.ge.1.d0)then - m0 = mmin - goto 20 - endif -* Use the bisection method to find m0 - fmid = (1.d0-aj)*mcheif(mmax,zpars(2),zpars(10)) + - & aj*mcagbf(mmax) - mc - f = (1.d0-aj)*mcheif(mmin,zpars(2),zpars(10)) + - & aj*mcagbf(mmin) - mc - if(f*fmid.ge.0.d0)then -* This will probably occur if mc is just greater than the minimum -* allowed mass for a CHeB star and fage > 0. - kw = 3 -* WRITE(66,*)' GNTAGE4: changed to 3' - goto 90 - endif - m0 = mmin - dm = mmax - mmin - do 10 , j = 1,jmax - dm = 0.5d0*dm - mmid = m0 + dm - fmid = (1.d0-aj)*mcheif(mmid,zpars(2),zpars(10)) + - & aj*mcagbf(mmid) - mc - if(fmid.lt.0.d0) m0 = mmid - if(ABS(dm).lt.macc.or.ABS(fmid).lt.tiny) goto 20 - if(j.eq.jmax)then -* WRITE(99,*)' FATAL ERROR! GNTAGE4: root not found ' -* WRITE(*,*)' STOP: FATAL ERROR ' -* CALL exit(0) -* STOP - m0 = mt - aj = 0.d0 - endif - 10 continue - 20 continue -* - CALL star(kw,m0,mt,tm,tn,tscls,lums,GB,zpars) - aj = tscls(2) + aj*tscls(3) -* - endif -* - 90 continue -* - if(kw.eq.3)then -* -* First we double check that we don't have a GB star for M => Mfgb - mcy = mcheif(zpars(3),zpars(2),zpars(9)) - if(mc.ge.mcy)then -* WRITE(99,*)' GNTAGE3: star too big for GB ' -* WRITE(*,*)' STOP: FATAL ERROR ' -* CALL exit(0) -* STOP - mc = 0.99d0*mcy - endif -* Next we find an m0 so as to place the star at the BGB - mcx = mcheif(zpars(2),zpars(2),zpars(9)) - if(mc.gt.mcx)then - m0 = mheif(mc,zpars(2),zpars(9)) - else -* Use Newton-Raphson to find m0 from Lbgb - m0 = zpars(2) - CALL star(kw,m0,mt,tm,tn,tscls,lums,GB,zpars) - lum = lmcgbf(mc,GB) - j = 0 - 30 continue - dell = lbgbf(m0) - lum - if(ABS(dell/lum).le.lacc) goto 40 - derl = lbgbdf(m0) - m0 = m0 - dell/derl - j = j + 1 - if(j.eq.jmax)then -* WRITE(99,*)' FATAL ERROR! GNTAGE3: root not found ' -* WRITE(*,*)' STOP: FATAL ERROR ' -* CALL exit(0) -* STOP - m0 = zpars(2) - m0 = MAX(m0,mt) - goto 40 - endif - goto 30 - 40 continue - endif - CALL star(kw,m0,mt,tm,tn,tscls,lums,GB,zpars) - aj = tscls(1) + 1.0d-06*(tscls(2) - tscls(1)) -* - endif -* - if(kw.eq.8.or.kw.eq.9)then -* -* We make a post-MS naked helium star. -* To make things easier we put the star at the TMS point -* so it actually begins as type 8. -* - kw = 8 - mmin = mc - CALL star(kw,mmin,mc,tm,tn,tscls,lums,GB,zpars) - mcx = mcgbf(lums(2),GB,lums(6)) - if(mcx.ge.mc)then -* WRITE(99,*)' FATAL ERROR! GNTAGE9: mmin too big ' -* WRITE(*,*)' STOP: FATAL ERROR ' -* CALL exit(0) -* STOP - m0 = mt - goto 80 - endif - f = mcx - mc - mmax = mt - do 50 , j = 1,jmax - CALL star(kw,mmax,mc,tm,tn,tscls,lums,GB,zpars) - mcy = mcgbf(lums(2),GB,lums(6)) - if(mcy.gt.mc) goto 60 - mmax = 2.d0*mmax - if(j.eq.jmax)then -* WRITE(99,*)' FATAL ERROR! GNTAGE9: mmax not found ' -* WRITE(*,*)' STOP: FATAL ERROR ' -* CALL exit(0) -* STOP - m0 = mt - goto 80 - endif - 50 continue - 60 continue - fmid = mcy - mc -* Use the bisection method to find m0 - if(f*fmid.ge.0.d0)then -* WRITE(99,*)' FATAL ERROR! GNTAGE9: root not bracketed ' -* WRITE(*,*)' STOP: FATAL ERROR ' -* CALL exit(0) -* STOP - m0 = mt - goto 80 - endif - m0 = mmin - dm = mmax - mmin - do 70 , j = 1,jmax - dm = 0.5d0*dm - mmid = m0 + dm - CALL star(kw,mmid,mc,tm,tn,tscls,lums,GB,zpars) - mcy = mcgbf(lums(2),GB,lums(6)) - fmid = mcy - mc - if(fmid.lt.0.d0) m0 = mmid - if(ABS(dm).lt.macc.or.ABS(fmid).lt.tiny) goto 80 - if(j.eq.jmax)then -* WRITE(99,*)' FATAL ERROR! GNTAGE9: root not found ' -* WRITE(*,*)' STOP: FATAL ERROR ' -* CALL exit(0) -* STOP - m0 = mt - goto 80 - endif - 70 continue - 80 continue -* - CALL star(kw,m0,mt,tm,tn,tscls,lums,GB,zpars) - aj = tm + 1.0d-10*tm -* - endif -* - if(kw.eq.14)then -* - kw = 4 - m0 = mt - mcy = mcagbf(m0) - aj = mc/mcy - CALL star(kw,m0,mt,tm,tn,tscls,lums,GB,zpars) - if(m0.le.zpars(2))then - mcx = mcgbf(lums(4),GB,lums(6)) - else - mcx = mcheif(m0,zpars(2),zpars(10)) - end if - mc = mcx + (mcy - mcx)*aj - aj = tscls(2) + aj*tscls(3) - endif -* - RETURN + + real*8 mc,mt,zpars,m0,aj + integer kw ,id + + if (using_METISSE) then + !WRITE(*,*) 'Calling METISSE_gntage' + CALL METISSE_gntage(mc,mt,kw,zpars,m0,aj,id) + + elseif (using_SSE) then + !WRITE(*,*) 'Calling SSE_gntage' + CALL SSE_gntage(mc,mt,kw,zpars,m0,aj,id) + endif + END -*** diff --git a/src/cosmic/src/hrdiag.f b/src/cosmic/src/hrdiag.f index e554ef695..7df5b238c 100644 --- a/src/cosmic/src/hrdiag.f +++ b/src/cosmic/src/hrdiag.f @@ -1,615 +1,28 @@ -*** SUBROUTINE hrdiag(mass,aj,mt,tm,tn,tscls,lums,GB,zpars, & r,lum,kw,mc,rc,menv,renv,k2, - & bhspin,kidx) + & bhspin,id) IMPLICIT NONE INCLUDE 'const_bse.h' + + integer kw,id * -* -* H-R diagram for population I stars. -* ----------------------------------- -* -* Computes the new mass, luminosity, radius & stellar type. -* Input (MASS, AJ, TM, TN, LUMS & TSCLS) supplied by routine STAR. -* Ref: P.P. Eggleton, M.J. Fitchett & C.A. Tout (1989) Ap.J. 347, 998. -* -* Revised 27th March 1995 by C. A. Tout; -* 24th October 1995 to include metallicity; -* 14th November 1996 to include naked helium stars; -* 28th February 1997 to allow accretion induced supernovae. -* -* Revised 5th April 1997 by J. R. Hurley -* to include Z=0.001 as well as Z=0.02, convective overshooting, -* MS hook and more elaborate CHeB -* -* - integer kw,kwp,kidx -* - real*8 mass,aj,mt,tm,tn,tscls(20),lums(10),GB(10),zpars(20),met + real*8 mass,aj,mt,tm,tn,tscls(20),lums(10),GB(10),zpars(20) real*8 bhspin - real*8 r,lum,mc,rc,menv,renv,k2 - real*8 mch,mlp,tiny -* parameter(mch=1.44d0,mlp=12.d0,tiny=1.0d-14) - parameter(mlp=12.d0,tiny=1.0d-14) - real*8 mass0,mt0,mtc - common /fall/fallback - REAL*8 fallback - REAL ran3 - EXTERNAL ran3 -* -* real*8 mchold -* -* real*8 avar,bvar - real*8 thook,thg,tbagb,tau,tloop,taul,tauh,tau1,tau2,dtau,texp - real*8 lx,ly,dell,alpha,betahrdiag,eta - real*8 rx,ry,delr,rzams,rtms,gammahrdiag,rmin,taumin,rg - parameter(taumin=5.0d-08) - real*8 mcmax,mcx,mcy,mcbagb,lambdahrdiag -* real*8 frac,kappa,sappa,alphap,polyfit - real*8 am,xx,fac,rdgen,mew,lum0,kap,zeta,ahe,aco - parameter(lum0=7.0d+04,kap=-0.5d0,ahe=4.d0,aco=16.d0) -* - real*8 thookf,tblf - real*8 lalphf,lbetaf,lnetaf,lhookf,lgbtf,lmcgbf,lzhef,lpertf - real*8 rzamsf,rtmsf,ralphf,rbetaf,rgammf,rhookf - real*8 rgbf,rminf,ragbf,rzahbf,rzhef,rhehgf,rhegbf,rpertf - real*8 mctmsf,mcgbtf,mcgbf,mcheif,mcagbf,lzahbf -* real*8 mrem - external thookf,tblf - external lalphf,lbetaf,lnetaf,lhookf,lgbtf,lmcgbf,lzhef,lpertf - external rzamsf,rtmsf,ralphf,rbetaf,rgammf,rhookf - external rgbf,rminf,ragbf,rzahbf,rzhef,rhehgf,rhegbf,rpertf - external mctmsf,mcgbtf,mcgbf,mcheif,mcagbf,lzahbf -* -* -* --------------------------------------------------------------------- -* MASS Stellar mass in solar units (input: old; output: new value). -* AJ Current age in Myr. -* MT Current mass in solar units (used for R). -* TM Main sequence time. -* TN Nuclear burning time. -* TSCLS Time scale for different stages. -* LUMS Characteristic luminosity. -* GB Giant Branch parameters -* ZPARS Parameters for distinguishing various mass intervals. -* R Stellar radius in solar units. -* TE Effective temperature (suppressed). -* KW Classification type (0 - 15). -* MC Core mass. -* --------------------------------------------------------------------- -* -* -* Make evolutionary changes to stars that have not reached KW > 5. -* - mch = 1.44d0 !set here owing to AIC ECSN model. -* - mass0 = mass -C if(mass0.gt.100.d0) mass = 100.d0 - mt0 = mt -C if(mt0.gt.100.d0) mt = 100.d0 -* - if(kw.gt.6) goto 90 -* - tbagb = tscls(2) + tscls(3) - thg = tscls(1) - tm -* - rzams = rzamsf(mass) -* calculate metallicity using the zpars(14) parameter. - met = 10**(LOG10(zpars(14))/0.4) - rtms = rtmsf(mass, met) -* - if(aj.lt.tscls(1))then -* -* Either on MS or HG -* - rg = rgbf(mt,lums(3)) -* - if(aj.lt.tm)then -* -* Main sequence star. -* - mc = 0.d0 - tau = aj/tm - thook = thookf(mass)*tscls(1) - zeta = 0.01d0 - tau1 = MIN(1.d0,aj/thook) - tau2 = MAX(0.d0, - & MIN(1.d0,(aj-(1.d0-zeta)*thook)/(zeta*thook))) -* - dell = lhookf(mass,zpars(1)) - dtau = tau1**2 - tau2**2 - alpha = lalphf(mass) - betahrdiag = lbetaf(mass) - eta = lnetaf(mass) - lx = LOG10(lums(2)/lums(1)) - if(tau.gt.taumin)then - xx = alpha*tau + betahrdiag*tau**eta + - & (lx - alpha - betahrdiag)*tau**2 - dell*dtau - else - xx = alpha*tau + (lx - alpha)*tau**2 - dell*dtau - endif - lum = lums(1)*10.d0**xx -* - delr = rhookf(mass,zpars(1)) - dtau = tau1**3 - tau2**3 - alpha = ralphf(mass) - betahrdiag = rbetaf(mass) - gammahrdiag = rgammf(mass) - rx = LOG10(rtms/rzams) -* Note that the use of taumin is a slightly pedantic attempt to -* avoid floating point underflow. It IS overkill! - if(tau.gt.taumin)then - xx = alpha*tau + betahrdiag*tau**10 + - & gammahrdiag*tau**40 + (rx - alpha - betahrdiag - - & gammahrdiag)*tau**3 - delr*dtau - else - xx = alpha*tau + (rx - alpha)*tau**3 - delr*dtau - endif - r = rzams*10.d0**xx -* - if(mass.lt.(zpars(1)-0.3d0))then - kw = 0 -* This following is given by Chris for low mass MS stars which will be -* substantially degenerate. We need the Hydrogen abundance, X, which we -* calculate from Z assuming that the helium abundance, Y, is calculated -* according to Y = 0.24 + 2*Z - rdgen = 0.0258d0*((1.d0+zpars(11))**(5.d0/3.d0))* - & (mass**(-1.d0/3.d0)) - r = MAX(rdgen,r) - else - kw = 1 - endif -* planets - if(mass.lt.0.005d0.and.mass.ge.tiny)then - r = 0.16d0 - endif -* - else -* -* Star is on the HG -* - mcx = mc - if(mass.le.zpars(2))then - mc = mcgbf(lums(3),GB,lums(6)) - elseif(mass.le.zpars(3))then - mc = mcheif(mass,zpars(2),zpars(9)) - else - mc = mcheif(mass,zpars(2),zpars(10)) - endif - eta = mctmsf(mass) - tau = (aj - tm)/thg - mc = ((1.d0 - tau)*eta + tau)*mc - mc = MAX(mc,mcx) -* -* Test whether core mass has reached total mass. -* - if(mc.ge.mt)then - aj = 0.d0 - if(mass.gt.zpars(2))then -* -* Zero-age helium star -* - mc = 0.d0 - mass = mt - kw = 7 - CALL star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars) - else -* -* Zero-age helium white dwarf. -* - mc = mt - mass = mt - kw = 10 - endif - else - lum = lums(2)*(lums(3)/lums(2))**tau - if(mass.le.zpars(3))then - rx = rg - else -* He-ignition and end of HG occur at Rmin - rmin = rminf(mass) - ry = ragbf(mt,lums(4),zpars(2)) - rx = MIN(rmin,ry) - if(mass.le.mlp)then - texp = log(mass/mlp)/log(zpars(3)/mlp) - rx = rg - rx = rmin*(rx/rmin)**texp - endif - tau2 = tblf(mass,zpars(2),zpars(3)) - if(tau2.lt.tiny) rx = ry - endif - r = rtms*(rx/rtms)**tau - kw = 2 - endif -* - endif -* -* Now the GB, CHeB and AGB evolution. -* - elseif(aj.lt.tscls(2))then -* -* Red Giant. -* - kw = 3 - lum = lgbtf(aj,GB(1),GB,tscls(4),tscls(5),tscls(6)) - if(mass.le.zpars(2))then -* Star has a degenerate He core which grows on the GB - mc = mcgbf(lum,GB,lums(6)) - else -* Star has a non-degenerate He core which may grow, but -* only slightly, on the GB - tau = (aj - tscls(1))/(tscls(2) - tscls(1)) - mcx = mcheif(mass,zpars(2),zpars(9)) - mcy = mcheif(mass,zpars(2),zpars(10)) - mc = mcx + (mcy - mcx)*tau - endif - r = rgbf(mt,lum) - rg = r - if(mc.ge.mt)then - aj = 0.d0 - if(mass.gt.zpars(2))then -* -* Zero-age helium star -* - mc = 0.d0 - mass = mt - kw = 7 - CALL star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars) - else -* -* Zero-age helium white dwarf. -* - mc = mt - mass = mt - kw = 10 - endif - endif -* - elseif(aj.lt.tbagb)then -* -* Core helium burning star. -* - if(kw.eq.3.and.mass.le.zpars(2))then - mass = mt - CALL star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars) - aj = tscls(2) - endif - if(mass.le.zpars(2))then - mcx = mcgbf(lums(4),GB,lums(6)) - else - mcx = mcheif(mass,zpars(2),zpars(10)) - endif - tau = (aj - tscls(2))/tscls(3) - mc = mcx + (mcagbf(mass) - mcx)*tau -* - if(mass.le.zpars(2))then - lx = lums(5) - ly = lums(7) - rx = rzahbf(mt,mc,zpars(2)) - rg = rgbf(mt,lx) - rmin = rg*zpars(13)**(mass/zpars(2)) - texp = MIN(MAX(0.4d0,rmin/rx),2.5d0) - ry = ragbf(mt,ly,zpars(2)) - if(rmin.lt.rx)then - taul = (log(rx/rmin))**(1.d0/3.d0) - else - rmin = rx - taul = 0.d0 - endif - tauh = (log(ry/rmin))**(1.d0/3.d0) - tau2 = taul*(tau - 1.d0) + tauh*tau - r = rmin*exp(abs(tau2)**3) - rg = rg + tau*(ry - rg) - lum = lx*(ly/lx)**(tau**texp) - elseif(mass.gt.zpars(3))then -* -* For HM stars He-ignition takes place at Rmin in the HG, and CHeB -* consists of a blue phase (before tloop) and a RG phase (after tloop). -* - tau2 = tblf(mass,zpars(2),zpars(3)) - tloop = tscls(2) + tau2*tscls(3) - rmin = rminf(mass) - rg = rgbf(mt,lums(4)) - rx = ragbf(mt,lums(4),zpars(2)) - rmin = MIN(rmin, rx) - if(mass.le.mlp) then - texp = log(mass/mlp)/log(zpars(3)/mlp) - rx = rg - rx = rmin*(rx/rmin)**texp - else - rx = rmin - endif - texp = MIN(MAX(0.4d0,rmin/rx),2.5d0) - lum = lums(4)*(lums(7)/lums(4))**(tau**texp) - if(aj.lt.tloop)then - ly = lums(4)*(lums(7)/lums(4))**(tau2**texp) - ry = ragbf(mt,ly,zpars(2)) - taul = 0.d0 - if(ABS(rmin-rx).gt.tiny)then - taul = (log(rx/rmin))**(1.d0/3.d0) - endif - tauh = 0.d0 - if(ry.gt.rmin) tauh = (log(ry/rmin))**(1.d0/3.d0) - tau = (aj - tscls(2))/(tau2*tscls(3)) - tau2 = taul*(tau - 1.d0) + tauh*tau - r = rmin*exp(abs(tau2)**3) - rg = rg + tau*(ry - rg) - else - r = ragbf(mt,lum,zpars(2)) - rg = r - endif - else -* -* For IM stars CHeB consists of a RG phase (before tloop) and a blue -* loop (after tloop). -* - tau2 = 1.d0 - tblf(mass,zpars(2),zpars(3)) - tloop = tscls(2) + tau2*tscls(3) - if(aj.lt.tloop)then - tau = (tloop - aj)/(tau2*tscls(3)) - lum = lums(5)*(lums(4)/lums(5))**(tau**3) - r = rgbf(mt,lum) - rg = r - else - lx = lums(5) - ly = lums(7) - rx = rgbf(mt,lx) - rmin = rminf(mt) - texp = MIN(MAX(0.4d0,rmin/rx),2.5d0) - ry = ragbf(mt,ly,zpars(2)) - if(rmin.lt.rx)then - taul = (log(rx/rmin))**(1.d0/3.d0) - else - rmin = rx - taul = 0.d0 - endif - tauh = (log(ry/rmin))**(1.d0/3.d0) - tau = (aj - tloop)/(tscls(3) - (tloop - tscls(2))) - tau2 = taul*(tau - 1.d0) + tauh*tau - r = rmin*exp(abs(tau2)**3) - rg = rx + tau*(ry - rx) - lum = lx*(ly/lx)**(tau**texp) - endif - endif -* -* Test whether core mass exceeds total mass. -* - if(mc.ge.mt)then -* -* Evolved MS naked helium star. -* - kw = 7 - xx = (aj - tscls(2))/tscls(3) - mass = mt - CALL star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars) - aj = xx*tm - else - kw = 4 - endif -* - else -* -* Asymptotic Red Giant. -* -* On the AGB the He core mass remains constant until at Ltp it -* is caught by the C core mass and they grow together. -* - mcbagb = mcagbf(mass) - mcx = mcgbtf(tbagb,GB(8),GB,tscls(7),tscls(8),tscls(9)) - mcmax = MAX(MAX(mch,0.773d0*mcbagb-0.35d0),1.05d0*mcx) -* - if(aj.lt.tscls(13))then - mcx = mcgbtf(aj,GB(8),GB,tscls(7),tscls(8),tscls(9)) - mc = mcbagb - lum = lmcgbf(mcx,GB) - if(mt.le.mc)then -* -* Evolved naked helium star as the envelope is lost but the -* star has not completed its interior burning. The star becomes -* a post-HeMS star. -* - kw = 9 - mt = mc - mass = mt - mc = mcx - CALL star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars) - if(mc.le.GB(7))then - aj = tscls(4) - (1.d0/((GB(5)-1.d0)*GB(8)*GB(4)))* - & (mc**(1.d0-GB(5))) - else - aj = tscls(5) - (1.d0/((GB(6)-1.d0)*GB(8)*GB(3)))* - & (mc**(1.d0-GB(6))) - endif - aj = MAX(aj,tm) - goto 90 - else - kw = 5 - endif - else - kw = 6 - mc = mcgbtf(aj,GB(2),GB,tscls(10),tscls(11),tscls(12)) - lum = lmcgbf(mc,GB) -* -* Approximate 3rd Dredge-up on AGB by limiting Mc. -* - lambdahrdiag = MIN(0.9d0,0.3d0+0.001d0*mass**5) - tau = tscls(13) - mcx = mcgbtf(tau,GB(2),GB,tscls(10),tscls(11),tscls(12)) - mcy = mc - mc = mc - lambdahrdiag*(mcy-mcx) - mcx = mc - mcmax = MIN(mt,mcmax) - endif - r = ragbf(mt,lum,zpars(2)) - rg = r -* -* Mc,x represents the C core mass and we now test whether it -* exceeds either the total mass or the maximum allowed core mass. -* - if(mcmax-mcx.lt.tiny)then - aj = 0.d0 - mc = mcmax - call assign_remnant(zpars,mc,mcbagb,mass,mt,kw,bhspin,kidx) - endif -* - endif -* - 90 continue -* - if(kw.ge.7.and.kw.le.9)then -* -* Naked Helium Star -* - rzams = rzhef(mt) - rx = rzams - if(aj.lt.tm)then -* -* Main Sequence -* - kw = 7 - tau = aj/tm - am = MAX(0.d0,0.85d0-0.08d0*mass) - lum = lums(1)*(1.d0+0.45d0*tau+am*tau**2) - am = MAX(0.d0,0.4d0-0.22d0*LOG10(mt)) - r = rx*(1.d0+am*(tau-tau**6)) - rg = rx -* Star has no core mass and hence no memory of its past -* which is why we subject mass and mt to mass loss for -* this phase. - mc = 0.d0 - if(mt.lt.zpars(10)) kw = 10 - else -* -* Helium Shell Burning -* - kw = 8 - lum = lgbtf(aj,GB(8),GB,tscls(4),tscls(5),tscls(6)) - r = rhehgf(mt,lum,rx,lums(2)) - rg = rhegbf(lum) - if(r.ge.rg)then - kw = 9 - r = rg - endif - mc = mcgbf(lum,GB,lums(6)) - mtc = MIN(mt,1.45d0*mt-0.31d0) - mcmax = MIN(mtc,MAX(mch,0.773d0*mass-0.35d0)) - if(mcmax-mc.lt.tiny)then - aj = 0.d0 - mc = mcmax - mcbagb = mass - call assign_remnant(zpars,mc,mcbagb,mass, - & mt,kw,bhspin,kidx) - - if(kw.eq.11) mt = MAX(mc,(mc+0.31d0)/1.45d0) - endif - endif - endif -* - call hrdiag_remnant(zpars,mt,mc,lum,r,aj,kw) -* -* Calculate the core radius and the luminosity and radius of the -* remnant that the star will become. -* - tau = 0.d0 - if(kw.le.1.or.kw.eq.7)then - rc = 0.d0 - elseif(kw.le.3)then - if(mass.gt.zpars(2))then - lx = lzhef(mc) - rx = rzhef(mc) - rc = rx - else - if(wdflag.eq.0)then - lx = 635.d0*mc*zpars(14)/((ahe*0.1d0)**1.4d0) - elseif(wdflag.ge.1)then - lx = 300.d0*mc*zpars(14)/((ahe*0.1d0)**1.18d0) - endif - rx = 0.0115d0*SQRT(MAX(1.48204d-06, - & (mch/mc)**(2.d0/3.d0)-(mc/mch)**(2.d0/3.d0))) - rc = 5.d0*rx - endif - elseif(kw.eq.4)then - tau = (aj - tscls(2))/tscls(3) - kwp = 7 - CALL star(kwp,mc,mc,tm,tn,tscls,lums,GB,zpars) - am = MAX(0.d0,0.85d0-0.08d0*mc) - lx = lums(1)*(1.d0+0.45d0*tau+am*tau**2) - rx = rzhef(mc) - am = MAX(0.d0,0.4d0-0.22d0*LOG10(mc)) - rx = rx*(1.d0+am*(tau-tau**6)) - CALL star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars) - rc = rx - elseif(kw.eq.5)then - kwp = 9 - if(tn.gt.tbagb) tau = 3.d0*(aj-tbagb)/(tn-tbagb) - CALL star(kwp,mc,mc,tm,tn,tscls,lums,GB,zpars) - lx = lmcgbf(mcx,GB) - if(tau.lt.1.d0) lx = lums(2)*(lx/lums(2))**tau - rx = rzhef(mc) - rx = MIN(rhehgf(mc,lx,rx,lums(2)),rhegbf(lx)) - CALL star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars) - rc = rx - elseif(kw.le.9)then - if(wdflag.eq.0)then - lx = 635.d0*mc*zpars(14)/((aco*0.1d0)**1.4d0) - elseif(wdflag.ge.1)then - lx = 300.d0*mc*zpars(14)/((aco*0.1d0)**1.18d0) - endif - rx = 0.0115d0*SQRT(MAX(1.48204d-06, - & (mch/mc)**(2.d0/3.d0) - (mc/mch)**(2.d0/3.d0))) - rc = 5.d0*rx - else - rc = r - menv = 1.0d-10 - renv = 1.0d-10 - k2 = 0.21d0 - endif -* -* Perturb the luminosity and radius due to small envelope mass. -* - if(kw.ge.2.and.kw.le.9.and.kw.ne.7)then - mew = ((mt-mc)/mt)*MIN(5.d0,MAX(1.2d0,(lum/lum0)**kap)) - if(kw.ge.8) mew = ((mtc-mc)/mtc)*5.d0 - if(mew.lt.1.d0)then - xx = lpertf(mt,mew) - lum = lx*(lum/lx)**xx - if(r.le.rx)then - xx = 0.d0 - else - xx = rpertf(mt,mew,r,rx) - endif - r = rx*(r/rx)**xx - endif - rc = MIN(rc,r) - endif -* -* Calculate mass and radius of convective envelope, and envelope -* gyration radius. -* - if(kw.lt.10)then - CALL mrenv(kw,mass,mt,mc,lum,r,rc,aj,tm,lums(2),lums(3), - & lums(4),rzams,rtms,rg,menv,renv,k2) - endif -* - if(ST_tide.gt.0)then - if(kw.le.2.or.kw.eq.7.or.kw.ge.10)then - if(mt.le.1.d0)then - k2 = 0.205d0 - else - k2 = 0.075d0 - endif - else - k2 = 0.1d0 - endif + real*8 r,lum,mc,rc,menv,renv,k2,mcx + + if (using_METISSE) then + !WRITE(*,*) 'Calling METISSE_hrdiag' + CALL METISSE_hrdiag(mass,aj,mt,tm,tn,tscls,lums,GB,zpars, + & r,lum,kw,mc,rc,menv,renv,k2, + & mcx,id) + ! get_bhspin is defined in assign_commons_cosmic.f90 + if (kw==14) CALL get_bhspin(bhspin,id) + + elseif (using_SSE) then + !WRITE(*,*) 'Calling SSE_hrdiag' + CALL SSE_hrdiag(mass,aj,mt,tm,tn,tscls,lums,GB,zpars, + & r,lum,kw,mc,rc,menv,renv,k2, + & bhspin,id) endif -* -C if(mass.gt.99.99d0)then -C mass = mass0 -C endif -C if(mt.gt.99.99d0)then -C mt = mt0 -C endif -* - return - end -*** + + END diff --git a/src/cosmic/src/mix.f b/src/cosmic/src/mix.f index 77e44a32d..ed1e06b39 100644 --- a/src/cosmic/src/mix.f +++ b/src/cosmic/src/mix.f @@ -1,5 +1,5 @@ *** - SUBROUTINE MIX(M0,M,AJ,KS,ZPARS,bhspin) + SUBROUTINE MIX(M0,M,AJ,KS,ZPARS,bhspin,dtm) IMPLICIT NONE INCLUDE 'const_bse.h' * @@ -11,7 +11,7 @@ SUBROUTINE MIX(M0,M,AJ,KS,ZPARS,bhspin) * * INTEGER KS(2),I1,I2,K1,K2,KW,ICASE - REAL*8 M0(2),M(2),AJ(2),ZPARS(20),bhspin(2) + REAL*8 M0(2),M(2),AJ(2),ZPARS(20),bhspin(2),dtm REAL*8 TSCLS(20),LUMS(10),GB(10),TMS1,TMS2,TMS3,TN REAL*8 M01,M02,M03,M1,M2,M3,AGE1,AGE2,AGE3,MC3,MCH REAL*8 M_CORE_BGB_1,M_CORE_BGB_2,M_CORE_BGB_3,HE_3_current @@ -37,7 +37,7 @@ SUBROUTINE MIX(M0,M,AJ,KS,ZPARS,bhspin) M01 = M0(I1) M1 = M(I1) AGE1 = AJ(I1) - CALL star(K1,M01,M1,TMS1,TN,TSCLS,LUMS,GB,ZPARS) + CALL star(K1,M01,M1,TMS1,TN,TSCLS,LUMS,GB,ZPARS,dtm,I1) IF(REJUVFLAG.EQ.1.AND.KS(1).LE.2.0.AND.KS(2).LE.2.0)THEN M_CORE_BGB_1 = GB(9) ENDIF @@ -46,7 +46,7 @@ SUBROUTINE MIX(M0,M,AJ,KS,ZPARS,bhspin) M02 = M0(I2) M2 = M(I2) AGE2 = AJ(I2) - CALL star(K2,M02,M2,TMS2,TN,TSCLS,LUMS,GB,ZPARS) + CALL star(K2,M02,M2,TMS2,TN,TSCLS,LUMS,GB,ZPARS,dtm,I2) IF(REJUVFLAG.EQ.1.AND.KS(1).LE.2.0.AND.KS(2).LE.2.0)THEN M_CORE_BGB_2 = GB(9) ENDIF @@ -90,7 +90,8 @@ SUBROUTINE MIX(M0,M,AJ,KS,ZPARS,bhspin) * mixing. We will now make it a parameter so that it can * be partial mixing. IF(K1.EQ.7) KW = 7 - CALL star(KW,M03,M3,TMS3,TN,TSCLS,LUMS,GB,ZPARS) + if (using_METISSE) call set_star_type(1) + CALL star(KW,M03,M3,TMS3,TN,TSCLS,LUMS,GB,ZPARS,dtm,1) IF(REJUVFLAG.EQ.1.AND.KS(1).LE.2.0.AND.KS(2).LE.2.0)THEN M_CORE_BGB_3 = GB(9) HE_3_current =AGE1*M_CORE_BGB_1/TMS1+AGE2*M_CORE_BGB_2/TMS2 @@ -100,13 +101,14 @@ SUBROUTINE MIX(M0,M,AJ,KS,ZPARS,bhspin) ENDIF ELSEIF(ICASE.EQ.3.OR.ICASE.EQ.6.OR.ICASE.EQ.9)THEN MC3 = M1 - CALL gntage(MC3,M3,KW,ZPARS,M03,AGE3) + CALL gntage(MC3,M3,KW,ZPARS,M03,AGE3,1) ELSEIF(ICASE.EQ.4)THEN MC3 = M1 AGE3 = AGE1/TMS1 - CALL gntage(MC3,M3,KW,ZPARS,M03,AGE3) + CALL gntage(MC3,M3,KW,ZPARS,M03,AGE3,1) ELSEIF(ICASE.EQ.7)THEN - CALL star(KW,M03,M3,TMS3,TN,TSCLS,LUMS,GB,ZPARS) + if (using_METISSE) call set_star_type(1) + CALL star(KW,M03,M3,TMS3,TN,TSCLS,LUMS,GB,ZPARS,dtm,1) AGE3 = TMS3*(AGE2*M2/TMS2)/M3 ELSEIF(ICASE.LE.12)THEN * Ensure that a new WD has the initial mass set correctly. diff --git a/src/cosmic/src/mlwind.f b/src/cosmic/src/mlwind.f index 2f514747e..3c7080f41 100644 --- a/src/cosmic/src/mlwind.f +++ b/src/cosmic/src/mlwind.f @@ -1,249 +1,20 @@ -*** - real*8 FUNCTION mlwind(kw,lum,r,mt,mc,rl,z) + real*8 FUNCTION mlwind(kw,lum,r,mt,mc,rl,z,id) IMPLICIT NONE INCLUDE 'const_bse.h' - integer kw,testflag - real*8 lum,r,mt,mc,rl,z,teff,alpha - real*8 dml,dms,dmt,p0,x,mew,lum0,kap - real*8 MLalpha - external MLalpha - parameter(lum0=7.0d+04,kap=-0.5d0) -* -* windflag = 0 !BSE=0, startrack08=1, vink=2, vink+LBV for all -* stars=3. -* Must be one of these values or mlwind will cause problem with code, -* i.e. mlwind not set (see last line of main if statement...). - - if(windflag.eq.0)then -* BSE -* -* Calculate stellar wind mass loss. -* -* Apply mass loss of Nieuwenhuijzen & de Jager, A&A, 1990, 231, 134, -* for massive stars over the entire HRD. - dms = 0.d0 - if(lum.gt.4000.d0)then - x = MIN(1.d0,(lum-4000.d0)/500.d0) - dms = 9.6d-15*x*(r**0.81d0)*(lum**1.24d0)*(mt**0.16d0) - alpha = 0.5d0 - dms = dms*(z/zsun)**(alpha) - endif - if(kw.ge.2.and.kw.le.9)then -* 'Reimers' mass loss - dml = neta*4.0d-13*r*lum/mt - if(rl.gt.0.d0) dml = - & dml*(1.d0 + bwind*(MIN(0.5d0,(r/rl)))**6) -* Apply mass loss of Vassiliadis & Wood, ApJ, 1993, 413, 641, -* for high pulsation periods on AGB. - if(kw.eq.5.or.kw.eq.6)then - p0 = -2.07d0 - 0.9d0*log10(mt) + 1.94d0*log10(r) - p0 = 10.d0**p0 - p0 = MIN(p0,2000.d0) - dmt = -11.4d0+0.0125d0*(p0-100.d0*MAX(mt-2.5d0,0.d0)) - dmt = 10.d0**dmt - dmt = 1.d0*MIN(dmt,1.36d-09*lum) - dml = MAX(dml,dmt) - endif - if(kw.gt.6)then - dms = MAX(dml,1.0d-13*hewind*lum**(3.d0/2.d0)) - else - dms = MAX(dml,dms) - mew = ((mt-mc)/mt)*MIN(5.d0,MAX(1.2d0,(lum/lum0)**kap)) -* reduced WR-like mass loss for small H-envelope mass - if(mew.lt.1.d0)then - dml = 1.0d-13*lum**(3.d0/2.d0)*(1.d0 - mew) - dms = MAX(dml,dms) - endif -* LBV-like mass loss beyond the Humphreys-Davidson limit. - x = 1.0d-5*r*sqrt(lum) - if(lum.gt.6.0d+05.and.x.gt.1.d0)then - dml = 0.1d0*(x-1.d0)**3*(lum/6.0d+05-1.d0) - dms = dms + dml - endif - endif - endif -* - mlwind = dms - elseif(windflag.eq.1)then -* StarTrack (Beclzynski+08) -* -* Calculate stellar wind mass loss. -* -* Apply mass loss of Nieuwenhuijzen & de Jager, A&A, 1990, 231, 134, -* for massive stars over the entire HRD, with no luminosity limit -* according to Belczynsk+08 pp. 174. -* -* This may not be what is actually assumed in StarTrack (see the windf1 function). -* -* - dms = 0.d0 - if(lum.gt.4000.d0.or.(kw.ge.0.and.kw.le.1))then - if(lum.gt.4000.d0)then - x = MIN(1.d0,(lum-4000.d0)/500.d0) - else - x = 0.1d0/500.d0 - endif !or is it simply x = Min(1, lum/500)? - dms = 9.6d-15*x*(r**0.81d0)*(lum**1.24d0)*(mt**0.16d0) - alpha = 0.5d0 - dms = dms*(z/zsun)**(alpha) - endif - if(kw.ge.2.and.kw.le.9)then -* 'Reimers' mass loss - dml = neta*4.0d-13*r*lum/mt - if(rl.gt.0.d0) dml = - & dml*(1.d0 + bwind*(MIN(0.5d0,(r/rl)))**6) -* Apply mass loss of Vassiliadis & Wood, ApJ, 1993, 413, 641, -* for high pulsation periods on AGB. - if(kw.eq.5.or.kw.eq.6)then - p0 = -2.07d0 - 0.9d0*log10(mt) + 1.94d0*log10(r) - p0 = 10.d0**p0 - p0 = MIN(p0,2000.d0) - dmt = -11.4d0+0.0125d0*(p0-100.d0*MAX(mt-2.5d0,0.d0)) - dmt = 10.d0**dmt - dmt = 1.d0*MIN(dmt,1.36d-09*lum) - dml = MAX(dml,dmt) - endif - if(kw.gt.6)then - dms = MAX(dml,1.0d-13*lum**(3.d0/2.d0)) !hewind here for KH06, not included for StarTrack... - else - dms = MAX(dml,dms) - mew = ((mt-mc)/mt)*MIN(5.d0,MAX(1.2d0,(lum/lum0)**kap)) -* reduced WR-like mass loss for small H-envelope mass - if(mew.lt.1.d0)then - dml = 1.0d-13*lum**(3.d0/2.d0)*(1.d0 - mew) - dms = MAX(dml,dms) - endif -* LBV-like mass loss beyond the Humphreys-Davidson limit. - x = 1.0d-5*r*sqrt(lum) - if(lum.gt.6.0d+05.and.x.gt.1.d0)then - dml = 0.1d0*(x-1.d0)**3*(lum/6.0d+05-1.d0) - dms = dms + dml - endif - endif - endif -* - mlwind = dms - elseif(windflag.eq.2.or.windflag.eq.3)then -* Vink winds etc according to as implemented following -* Belczynski, Bulik, Fryer, Ruiter, Valsecchi, Vink & Hurley 2010. -* -* Firstly implement BSE 'old' winds that cover all other stars not -* accounted for by Vink winds (see Belczynski+09). Then implement -* Vink et al. winds. -* -* We also include the option for a variable metallicity-dependent mass -* loss parameter which eddlimflag is set, which makes the metallicity -* dependence become weaker as the star approaches the electron-scattering -* Eddington limit (Grafener & Hamann 2008, Giacobbo et al. 2018) -* - teff = 1000.d0*((1130.d0*lum/(r**2.d0))**(1.d0/4.d0)) - dms = 0.d0 - if(lum.gt.4000.d0)then -* Apply mass loss of Nieuwenhuijzen & de Jager, A&A, 1990, 231, 134, -* for massive stars over the entire HRD after OB stars accounted for. - x = MIN(1.d0,(lum-4000.d0)/500.d0) - dms = 9.6d-15*x*(r**0.81d0)*(lum**1.24d0)*(mt**0.16d0) - alpha = 0.5d0 - dms = dms*(z/zsun)**(alpha) - testflag = 1 - endif - if(kw.ge.2.and.kw.le.6)then -* 'Reimers' mass loss - dml = neta*4.0d-13*r*lum/mt - if(rl.gt.0.d0) dml = - & dml*(1.d0 + bwind*(MIN(0.5d0,(r/rl)))**6) -* Apply mass loss of Vassiliadis & Wood, ApJ, 1993, 413, 641, -* for high pulsation periods on AGB. - if(kw.eq.5.or.kw.eq.6)then - p0 = -2.07d0 - 0.9d0*log10(mt) + 1.94d0*log10(r) - p0 = 10.d0**p0 - p0 = MIN(p0,2000.d0) - dmt = -11.4d0+0.0125d0*(p0-100.d0*MAX(mt-2.5d0,0.d0)) - dmt = 10.d0**dmt - dmt = 1.d0*MIN(dmt,1.36d-09*lum) - dml = MAX(dml,dmt) - endif - dms = MAX(dms,dml) - endif -* Apply Vink, de Koter & Lamers (2001) OB star winds. -* Next check if hot massive H-rich O/B star in appropriate temperature ranges. - if(teff.ge.12500.and.teff.le.25000)then - if(eddlimflag.eq.0) alpha = 0.85d0 - if(eddlimflag.eq.1) alpha = MLalpha(mt,lum,kw) - dms = -6.688d0 + 2.210d0*LOG10(lum/1.0d+05) - - & 1.339d0*LOG10(mt/30.d0) - 1.601d0*LOG10(1.3d0/2.d0) + - & alpha*LOG10(z/zsun) + 1.07d0*LOG10(teff/2.0d+04) - dms = 10.d0**dms - testflag = 2 - elseif(teff.gt.25000.)then -* Although Vink et al. formulae are only defined until Teff=50000K, -* we follow the Dutch prescription of MESA, and extend to higher Teff - dms = -6.697d0 + 2.194d0*LOG10(lum/1.0d+05) - - & 1.313d0*LOG10(mt/30.d0) - 1.226d0*LOG10(2.6d0/2.d0) + - & alpha*LOG10(z/zsun) +0.933d0*LOG10(teff/4.0d+04) - - & 10.92d0*(LOG10(teff/4.0d+04)**2) - dms = 10.d0**dms - testflag = 2 - endif - - if((windflag.eq.3.or.kw.ge.2).and.kw.le.6)then -* LBV-like mass loss beyond the Humphreys-Davidson limit. -* Optional flag (windflag=3) to use for every non-degenerate star -* past the limit, rather than just for giant, evolved stars - x = 1.0d-5*r*sqrt(lum) - if(lum.gt.6.0d+05.and.x.gt.1.d0)then - if(eddlimflag.eq.0) alpha = 0.d0 - if(eddlimflag.eq.1) alpha = MLalpha(mt,lum,kw) - dms = 1.5d0*1.0d-04*((z/zsun)**alpha) - testflag = 3 - endif - elseif(kw.ge.7.and.kw.le.9)then !WR (naked helium stars) -* If naked helium use Hamann & Koesterke (1998) WR winds reduced by factor of -* 10 (Yoon & Langer 2005), with Vink & de Koter (2005) metallicity dependence - if(eddlimflag.eq.0) alpha = 0.86d0 - if(eddlimflag.eq.1) alpha = MLalpha(mt,lum,kw) - dms = 1.0d-13*(lum**1.5d0)*((z/zsun)**alpha) - testflag = 4 - endif -* - mlwind = dms - elseif(windflag.eq.4)then -* -* Calculate stellar wind mass loss following MIST as closely as possible -* - dms = 0.d0 - if(kw.ge.0.and.kw.le.9)then -* 'Reimers' mass loss over the whole HRD - dml = 0.1*4.0d-13*r*lum/mt - if(rl.gt.0.d0) dml = - & dml*(1.d0 + bwind*(MIN(0.5d0,(r/rl)))**6) -* Apply mass loss of Blocker 1995 for AGB. - if(kw.eq.5.or.kw.eq.6)then - dml = 4.83d-9*0.2*dml/0.1*((lum)**2.7)/((mt)**2.1) - endif - if(kw.gt.6)then - dms = MAX(dml,1.0d-13*hewind*lum**(3.d0/2.d0)) - else - dms = MAX(dml,dms) - mew = ((mt-mc)/mt)*MIN(5.d0,MAX(1.2d0,(lum/lum0)**kap)) -* reduced WR-like mass loss for small H-envelope mass - if(mew.lt.1.d0)then - dml = 1.0d-13*lum**(3.d0/2.d0)*(1.d0 - mew) - dms = MAX(dml,dms) - endif -* LBV-like mass loss beyond the Humphreys-Davidson limit. - x = 1.0d-5*r*sqrt(lum) - if(lum.gt.6.0d+05.and.x.gt.1.d0)then - dml = 0.1d0*(x-1.d0)**3*(lum/6.0d+05-1.d0) - dms = dms + dml - endif - endif - endif -* - mlwind = dms + integer kw,id + real*8 lum,r,mt,mc,rl,z + + real*8 SSE_mlwind, METISSE_mlwind + external SSE_mlwind, METISSE_mlwind + + if (using_METISSE) then + !WRITE(*,*) 'Calling METISSE_mlwind' + mlwind = METISSE_mlwind(kw,lum,r,mt,mc,rl,z,id) + + elseif (using_SSE) then + !WRITE(*,*) 'Calling SSE_mlwind' + mlwind = SSE_mlwind(kw,lum,r,mt,mc,rl,z) endif - return - end -*** + END diff --git a/src/cosmic/src/star.f b/src/cosmic/src/star.f index 0913d049b..8ad901730 100644 --- a/src/cosmic/src/star.f +++ b/src/cosmic/src/star.f @@ -1,365 +1,17 @@ -*** - SUBROUTINE star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars) + SUBROUTINE star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars,dtm,id) IMPLICIT NONE INCLUDE 'const_bse.h' -* -* -* Stellar luminosity & evolution time. -* ------------------------------------ -* -* - integer kw -* - real*8 mass,mt,tm,tn,tscls(20),lums(10),GB(10),zpars(20) - real*8 tgb,tbagb,mch,mcmax,mc1,mc2,mcbagb,dx,am - real*8 lambdastar,tau,mtc,mass0 - parameter(mch=1.44d0) -* - real*8 lzamsf,lzahbf,lzhef - real*8 tbgbf,thookf,tHef,themsf,mcgbf,mcagbf,mcheif,mcgbtf - real*8 ltmsf,lbgbf,lHeIf,lHef,lbagbf,lmcgbf - external lzamsf,lzahbf,lzhef - external tbgbf,thookf,tHef,themsf,mcgbf,mcagbf,mcheif,mcgbtf - external ltmsf,lbgbf,lHeIf,lHef,lbagbf,lmcgbf -* -* Computes the characteristic luminosities at different stages (LUMS), -* and various timescales (TSCLS). -* Ref: P.P. Eggleton, M.J. Fitchett & C.A. Tout (1989) Ap.J. 347, 998. -* -* Revised 27th March 1995 by C. A. Tout -* and 24th October 1995 to include metallicity -* and 13th December 1996 to include naked helium stars -* -* Revised 5th April 1997 by J. R. Hurley -* to include Z=0.001 as well as Z=0.02, convective overshooting, -* MS hook and more elaborate CHeB. It now also sets the Giant -* Branch parameters relevant to the mass of the star. -* -* ------------------------------------------------------------ -* Times: 1; BGB 2; He ignition 3; He burning -* 4; Giant t(inf1) 5; Giant t(inf2) 6; Giant t(Mx) -* 7; FAGB t(inf1) 8; FAGB t(inf2) 9; FAGB t(Mx) -* 10; SAGB t(inf1) 11; SAGB t(inf2) 12; SAGB t(Mx) -* 13; TP 14; t(Mcmax) -* -* LUMS: 1; ZAMS 2; End MS 3; BGB -* 4; He ignition 5; He burning 6; L(Mx) -* 7; BAGB 8; TP -* -* GB: 1; effective A(H) 2; A(H,He) 3; B -* 4; D 5; p 6; q -* 7; Mx 8; A(He) 9; Mc,BGB -* -* ------------------------------------------------------------ -* -* - mass0 = mass -C if(mass0.gt.100.d0) mass = 100.d0 -* - if(kw.ge.7.and.kw.le.9) goto 90 - if(kw.ge.10) goto 95 -* -* MS and BGB times -* - tscls(1) = tbgbf(mass) - tm = MAX(zpars(8),thookf(mass))*tscls(1) -* -* Zero- and terminal age main sequence luminosity -* - lums(1) = lzamsf(mass) - lums(2) = ltmsf(mass) -* -* Set the GB parameters -* - GB(1) = MAX(-4.8d0,MIN(-5.7d0+0.8d0*mass,-4.1d0+0.14d0*mass)) - GB(1) = 10.d0**GB(1) - GB(2) = 1.27d-05 - GB(8) = 8.0d-05 - GB(3) = MAX(3.0d+04,500.d0 + 1.75d+04*mass**0.6d0) - if(mass.le.2.0)then - GB(4) = zpars(6) - GB(5) = 6.d0 - GB(6) = 3.d0 - elseif(mass.lt.2.5)then - dx = zpars(6) - (0.975d0*zpars(6) - 0.18d0*2.5d0) - GB(4) = zpars(6) - dx*(mass - 2.d0)/(0.5d0) - GB(5) = 6.d0 - (mass - 2.d0)/(0.5d0) - GB(6) = 3.d0 - (mass - 2.d0)/(0.5d0) - else - GB(4) = MAX(-1.d0,0.5d0*zpars(6) - 0.06d0*mass) - GB(4) = MAX(GB(4),0.975d0*zpars(6) - 0.18d0*mass) - GB(5) = 5.d0 - GB(6) = 2.d0 - endif - GB(4) = 10.d0**GB(4) - GB(7) = (GB(3)/GB(4))**(1.d0/(GB(5)-GB(6))) -* -* Change in slope of giant L-Mc relation. - lums(6) = GB(4)*GB(7)**GB(5) -* -* HeI ignition luminosity - lums(4) = lHeIf(mass,zpars(2)) - lums(7) = lbagbf(mass,zpars(2)) -* - if(mass.lt.0.1d0.and.kw.le.1)then - tscls(2) = 1.1d0*tscls(1) - tscls(3) = 0.1d0*tscls(1) - lums(3) = lbgbf(mass) - goto 96 - endif -* - if(mass.le.zpars(3))then -* Base of the giant branch luminosity - lums(3) = lbgbf(mass) -* Set GB timescales - tscls(4) = tscls(1) + (1.d0/((GB(5)-1.d0)*GB(1)*GB(4)))* - & ((GB(4)/lums(3))**((GB(5)-1.d0)/GB(5))) - tscls(6) = tscls(4) - (tscls(4) - tscls(1))*((lums(3)/lums(6)) - & **((GB(5)-1.d0)/GB(5))) - tscls(5) = tscls(6) + (1.d0/((GB(6)-1.d0)*GB(1)*GB(3)))* - & ((GB(3)/lums(6))**((GB(6)-1.d0)/GB(6))) -* Set Helium ignition time - if(lums(4).le.lums(6))then - tscls(2) = tscls(4) - (1.d0/((GB(5)-1.d0)*GB(1)*GB(4)))* - & ((GB(4)/lums(4))**((GB(5)-1.d0)/GB(5))) - else - tscls(2) = tscls(5) - (1.d0/((GB(6)-1.d0)*GB(1)*GB(3)))* - & ((GB(3)/lums(4))**((GB(6)-1.d0)/GB(6))) - endif - tgb = tscls(2) - tscls(1) - if(mass.le.zpars(2))then - mc1 = mcgbf(lums(4),GB,lums(6)) - mc2 = mcagbf(mass) - lums(5) = lzahbf(mass,mc1,zpars(2)) - tscls(3) = tHef(mass,mc1,zpars(2)) - else - lums(5) = lHef(mass)*lums(4) - tscls(3) = tHef(mass,1.d0,zpars(2))*tscls(1) - endif - else -* Note that for M>zpars(3) there is no GB as the star goes from -* HG -> CHeB -> AGB. So in effect tscls(1) refers to the time of -* Helium ignition and not the BGB. - tscls(2) = tscls(1) - tscls(3) = tHef(mass,1.d0,zpars(2))*tscls(1) -* This now represents the luminosity at the end of CHeB, ie. BAGB - lums(5) = lums(7) -* We set lums(3) to be the luminosity at the end of the HG - lums(3) = lums(4) - endif -* -* Set the core mass at the BGB. -* - if(mass.le.zpars(2))then - GB(9) = mcgbf(lums(3),GB,lums(6)) - elseif(mass.le.zpars(3))then - GB(9) = mcheif(mass,zpars(2),zpars(9)) - else - GB(9) = mcheif(mass,zpars(2),zpars(10)) - endif -* -* FAGB time parameters -* - tbagb = tscls(2) + tscls(3) - tscls(7) = tbagb + (1.d0/((GB(5)-1.d0)*GB(8)*GB(4)))* - & ((GB(4)/lums(7))**((GB(5)-1.d0)/GB(5))) - tscls(9) = tscls(7) - (tscls(7) - tbagb)*((lums(7)/lums(6)) - & **((GB(5)-1.d0)/GB(5))) - tscls(8) = tscls(9) + (1.d0/((GB(6)-1.d0)*GB(8)*GB(3)))* - & ((GB(3)/lums(6))**((GB(6)-1.d0)/GB(6))) -* -* Now to find Ltp and ttp using Mc,He,tp -* - mcbagb = mcagbf(mass) - mc1 = mcbagb - if(mc1.ge.0.8d0.and.mc1.lt.2.25d0)then -* The star undergoes dredge-up at Ltp causing a decrease in Mc,He - mc1 = 0.44d0*mc1 + 0.448d0 - endif - lums(8) = lmcgbf(mc1,GB) - if(mc1.le.GB(7))then - tscls(13) = tscls(7) - (1.d0/((GB(5)-1.d0)*GB(8)*GB(4)))* - & (mc1**(1.d0-GB(5))) - else - tscls(13) = tscls(8) - (1.d0/((GB(6)-1.d0)*GB(8)*GB(3)))* - & (mc1**(1.d0-GB(6))) - endif -* -* SAGB time parameters -* - if(mc1.le.GB(7))then - tscls(10) = tscls(13) + (1.d0/((GB(5)-1.d0)*GB(2)*GB(4)))* - & ((GB(4)/lums(8))**((GB(5)-1.d0)/GB(5))) - tscls(12) = tscls(10) - (tscls(10) - tscls(13))* - & ((lums(8)/lums(6))**((GB(5)-1.d0)/GB(5))) - tscls(11) = tscls(12) + (1.d0/((GB(6)-1.d0)*GB(2)*GB(3)))* - & ((GB(3)/lums(6))**((GB(6)-1.d0)/GB(6))) - else - tscls(10) = tscls(7) - tscls(12) = tscls(9) - tscls(11) = tscls(13) + (1.d0/((GB(6)-1.d0)*GB(2)*GB(3)))* - & ((GB(3)/lums(8))**((GB(6)-1.d0)/GB(6))) - endif -* -* Get an idea of when Mc,C = Mc,C,max on the AGB - tau = tscls(2) + tscls(3) - mc2 = mcgbtf(tau,GB(8),GB,tscls(7),tscls(8),tscls(9)) - mcmax = MAX(MAX(mch,0.773d0*mcbagb - 0.35d0),1.05d0*mc2) -* - if(mcmax.le.mc1)then - if(mcmax.le.GB(7))then - tscls(14) = tscls(7) - (1.d0/((GB(5)-1.d0)*GB(8)*GB(4)))* - & (mcmax**(1.d0-GB(5))) - else - tscls(14) = tscls(8) - (1.d0/((GB(6)-1.d0)*GB(8)*GB(3)))* - & (mcmax**(1.d0-GB(6))) - endif - else -* Star is on SAGB and we need to increase mcmax if any 3rd -* dredge-up has occurred. - lambdastar = MIN(0.9d0,0.3d0+0.001d0*mass**5) - mcmax = (mcmax - lambdastar*mc1)/(1.d0 - lambdastar) - if(mcmax.le.GB(7))then - tscls(14) = tscls(10) - (1.d0/((GB(5)-1.d0)*GB(2)*GB(4)))* - & (mcmax**(1.d0-GB(5))) - else - tscls(14) = tscls(11) - (1.d0/((GB(6)-1.d0)*GB(2)*GB(3)))* - & (mcmax**(1.d0-GB(6))) - endif - endif - tscls(14) = MAX(tbagb,tscls(14)) -C if(mass.ge.100.d0)then -C tn = tscls(2) -C goto 100 -C endif -* -* Calculate the nuclear timescale - the time of exhausting -* nuclear fuel without further mass loss. -* This means we want to find when Mc = Mt which defines Tn and will -* be used in determining the timestep required. Note that after some -* stars reach Mc = Mt there will be a Naked Helium Star lifetime -* which is also a nuclear burning period but is not included in Tn. -* - if(ABS(mt-mcbagb).lt.1.0d-14.and.kw.lt.5)then - tn = tbagb - else -* Note that the only occurence of Mc being double-valued is for stars -* that have a dredge-up. If Mt = Mc where Mc could be the value taken -* from CHeB or from the AGB we need to check the current stellar type. - if(mt.gt.mcbagb.or.(mt.ge.mc1.and.kw.gt.4))then - if(kw.eq.6)then - lambdastar = MIN(0.9d0,0.3d0+0.001d0*mass**5) - mc1 = (mt - lambdastar*mc1)/(1.d0 - lambdastar) - else - mc1 = mt - endif - if(mc1.le.GB(7))then - tn = tscls(10) - (1.d0/((GB(5)-1.d0)*GB(2)*GB(4)))* - & (mc1**(1.d0-GB(5))) - else - tn = tscls(11) - (1.d0/((GB(6)-1.d0)*GB(2)*GB(3)))* - & (mc1**(1.d0-GB(6))) - endif - else - if(mass.gt.zpars(3))then - mc1 = mcheif(mass,zpars(2),zpars(10)) - if(mt.le.mc1)then - tn = tscls(2) - else - tn = tscls(2) + tscls(3)*((mt - mc1)/(mcbagb - mc1)) - endif - elseif(mass.le.zpars(2))then - mc1 = mcgbf(lums(3),GB,lums(6)) - mc2 = mcgbf(lums(4),GB,lums(6)) - if(mt.le.mc1)then - tn = tscls(1) - elseif(mt.le.mc2)then - if(mt.le.GB(7))then - tn = tscls(4) - (1.d0/((GB(5)-1.d0)*GB(1)*GB(4)))* - & (mt**(1.d0-GB(5))) - else - tn = tscls(5) - (1.d0/((GB(6)-1.d0)*GB(1)*GB(3)))* - & (mt**(1.d0-GB(6))) - endif - else - tn = tscls(2) + tscls(3)*((mt - mc2)/(mcbagb - mc2)) - endif - else - mc1 = mcheif(mass,zpars(2),zpars(9)) - mc2 = mcheif(mass,zpars(2),zpars(10)) - if(mt.le.mc1)then - tn = tscls(1) - elseif(mt.le.mc2)then - tn = tscls(1) + tgb*((mt - mc1)/(mc2 - mc1)) - else - tn = tscls(2) + tscls(3)*((mt - mc2)/(mcbagb - mc2)) - endif - endif - endif - endif - tn = MIN(tn,tscls(14)) -* - goto 100 -* - 90 continue -* -* Calculate Helium star Main Sequence lifetime. -* - tm = themsf(mass) - tscls(1) = tm -* -* Zero- and terminal age Helium star main sequence luminosity -* - lums(1) = lzhef(mass) - am = MAX(0.d0,0.85d0-0.08d0*mass) - lums(2) = lums(1)*(1.d0+0.45d0+am) -* -* Set the Helium star GB parameters -* - GB(8) = 8.0d-05 - GB(3) = 4.1d+04 - GB(4) = 5.5d+04/(1.d0+0.4d0*mass**4) - GB(5) = 5.d0 - GB(6) = 3.d0 - GB(7) = (GB(3)/GB(4))**(1.d0/(GB(5)-GB(6))) -* Change in slope of giant L-Mc relation. - lums(6) = GB(4)*GB(7)**GB(5) -* -*** Set Helium star GB timescales -* - mc1 = mcgbf(lums(2),GB,lums(6)) - tscls(4) = tm + (1.d0/((GB(5)-1.d0)*GB(8)*GB(4)))* - & mc1**(1.d0-GB(5)) - tscls(6) = tscls(4) - (tscls(4) - tm)*((GB(7)/mc1) - & **(1.d0-GB(5))) - tscls(5) = tscls(6) + (1.d0/((GB(6)-1.d0)*GB(8)*GB(3)))* - & GB(7)**(1.d0-GB(6)) -* -* Get an idea of when Mc = MIN(Mt,Mc,C,max) on the GB - mtc = MIN(mt,1.45d0*mt-0.31d0) - if(mtc.le.0.d0) mtc = mt - mcmax = MIN(mtc,MAX(mch,0.773d0*mass-0.35d0)) - if(mcmax.le.GB(7))then - tscls(14) = tscls(4) - (1.d0/((GB(5)-1.d0)*GB(8)*GB(4)))* - & (mcmax**(1.d0-GB(5))) - else - tscls(14) = tscls(5) - (1.d0/((GB(6)-1.d0)*GB(8)*GB(3)))* - & (mcmax**(1.d0-GB(6))) - endif - tscls(14) = MAX(tscls(14),tm) - tn = tscls(14) -* - goto 100 -* - 95 continue - tm = 1.0d+10 - tscls(1) = tm - 96 continue - tn = 1.0d+10 -* - 100 continue - mass = mass0 -* - return - end -*** + + real*8 mass,mt,tm,tn,tscls(20),lums(10),GB(10),zpars(20),dtm + integer kw ,id + + if (using_METISSE) then + !WRITE(*,*) 'Calling METISSE_star' + CALL METISSE_star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars,dtm,id) + + elseif (using_SSE) then + !WRITE(*,*) 'Calling SSE_star' + CALL SSE_star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars) + endif + + END diff --git a/src/cosmic/src/zcnsts.f b/src/cosmic/src/zcnsts.f index 6605dc14a..40bd3af6b 100644 --- a/src/cosmic/src/zcnsts.f +++ b/src/cosmic/src/zcnsts.f @@ -1,383 +1,18 @@ -*** - SUBROUTINE zcnsts(z,zpars) + SUBROUTINE zcnsts(z,zpars,path_to_tracks,path_to_he_tracks) IMPLICIT NONE INCLUDE 'const_bse.h' -* - integer kw -* + real*8 z,zpars(20) - real*8 tm,tn,tscls(20),lums(10),GB(10) - real*8 lzs,dlzs,lz,lzd,dum1,m1,m2,rr,rb,mhefl,lhefl,thefl,lx - real*8 tbgbf,thef,lbagbf,lheif,lhef,lzahbf - real*8 rgbf,ragbf,rminf,mcgbf - external tbgbf,thef,lbagbf,lheif,lhef,lzahbf - external rgbf,ragbf,rminf,mcgbf -* - include 'zdata.h' - real*8 msp(200),gbp(200),c(5) - common /MSCFF/ msp - common /GBCFF/ gbp - data c /3.040581d-01, 8.049509d-02, 8.967485d-02, - & 8.780198d-02, 2.219170d-02/ -* -* ------------------------------------------------------------ -* -* zpars: 1; M below which hook doesn't appear on MS, Mhook. -* 2; M above which He ignition occurs non-degenerately, Mhef. -* 3; M above which He ignition occurs on the HG, Mfgb. -* 4; M below which C/O ignition doesn't occur, Mup. -* 5; M above which C ignites in the centre, Mec. -* 6; value of log D for M<= zpars(3) -* 7; value of x for Rgb propto M^(-x) -* 8; value of x for tMS = MAX(tHOOK,x*tBGB) -* 9; constant for McHeIf when computing Mc,BGB, mchefl. -* 10; constant for McHeIf when computing Mc,HeI, mchefl. -* 11; hydrogen abundance. -* 12; helium abundance. -* 13; constant x in rmin = rgb*x**y used by LM CHeB. -* 14; z**0.4 to be used for WD L formula. -* -* ------------------------------------------------------------ -* - lzs = log10(z/zsun) - dlzs = 1.d0/(z*log(10.d0)) - lz = log10(z) - lzd = lzs + 1.d0 -* - zpars(1) = 1.0185d0 + lzs*(0.16015d0 + lzs*0.0892d0) - zpars(2) = 1.995d0 + lzs*(0.25d0 + lzs*0.087d0) - zpars(3) = 16.5d0*z**0.06d0/(1.d0 + (1.0d-04/z)**1.27d0) - zpars(4) = MAX(6.11044d0 + 1.02167d0*lzs, 5.d0) - zpars(5) = zpars(4) + 1.8d0 - zpars(6) = 5.37d0 + lzs*0.135d0 - zpars(7) = c(1) + lzs*(c(2) + lzs*(c(3) + lzs*(c(4) + lzs*c(5)))) - zpars(8) = MAX(0.95d0,MAX(0.95d0-(10.d0/3.d0)*(z-0.01d0), - & MIN(0.99d0,0.98d0-(100.d0/7.d0)*(z-0.001d0)))) -*** -* Lzams - msp(1) = xz(1)+lzs*(xz(2)+lzs*(xz(3)+lzs*(xz(4)+lzs*xz(5)))) - msp(2) = xz(6)+lzs*(xz(7)+lzs*(xz(8)+lzs*(xz(9)+lzs*xz(10)))) - msp(3) = xz(11)+lzs*(xz(12)+lzs*(xz(13)+lzs*(xz(14)+lzs*xz(15)))) - msp(4) = xz(16)+lzs*(xz(17)+lzs*(xz(18)+lzs*(xz(19)+lzs*xz(20)))) - msp(5) = xz(21)+lzs*(xz(22)+lzs*(xz(23)+lzs*(xz(24)+lzs*xz(25)))) - msp(6) = xz(26)+lzs*(xz(27)+lzs*(xz(28)+lzs*(xz(29)+lzs*xz(30)))) - msp(7) = xz(31)+lzs*(xz(32)+lzs*(xz(33)+lzs*(xz(34)+lzs*xz(35)))) -* Rzams - msp(8) = xz(36)+lzs*(xz(37)+lzs*(xz(38)+lzs*(xz(39)+lzs*xz(40)))) - msp(9) = xz(41)+lzs*(xz(42)+lzs*(xz(43)+lzs*(xz(44)+lzs*xz(45)))) - msp(10) = xz(46)+lzs*(xz(47)+lzs*(xz(48)+lzs*(xz(49)+lzs*xz(50)))) - msp(11) = xz(51)+lzs*(xz(52)+lzs*(xz(53)+lzs*(xz(54)+lzs*xz(55)))) - msp(12) = xz(56)+lzs*(xz(57)+lzs*(xz(58)+lzs*(xz(59)+lzs*xz(60)))) - msp(13) = xz(61) - msp(14) = xz(62)+lzs*(xz(63)+lzs*(xz(64)+lzs*(xz(65)+lzs*xz(66)))) - msp(15) = xz(67)+lzs*(xz(68)+lzs*(xz(69)+lzs*(xz(70)+lzs*xz(71)))) - msp(16) = xz(72)+lzs*(xz(73)+lzs*(xz(74)+lzs*(xz(75)+lzs*xz(76)))) -* Tbgb - msp(17) = xt(1)+lzs*(xt(2)+lzs*(xt(3)+lzs*xt(4))) - msp(18) = xt(5)+lzs*(xt(6)+lzs*(xt(7)+lzs*xt(8))) - msp(19) = xt(9)+lzs*(xt(10)+lzs*(xt(11)+lzs*xt(12))) - msp(20) = xt(13)+lzs*(xt(14)+lzs*(xt(15)+lzs*xt(16))) - msp(21) = xt(17) -* dTbgb/dz - msp(117) = dlzs*(xt(2)+lzs*(2.d0*xt(3)+3.d0*lzs*xt(4))) - msp(118) = dlzs*(xt(6)+lzs*(2.d0*xt(7)+3.d0*lzs*xt(8))) - msp(119) = dlzs*(xt(10)+lzs*(2.d0*xt(11)+3.d0*lzs*xt(12))) - msp(120) = dlzs*(xt(14)+lzs*(2.d0*xt(15)+3.d0*lzs*xt(16))) -* Thook - msp(22) = xt(18)+lzs*(xt(19)+lzs*(xt(20)+lzs*xt(21))) - msp(23) = xt(22) - msp(24) = xt(23)+lzs*(xt(24)+lzs*(xt(25)+lzs*xt(26))) - msp(25) = xt(27)+lzs*(xt(28)+lzs*(xt(29)+lzs*xt(30))) - msp(26) = xt(31) -* Ltms - msp(27) = xl(1)+lzs*(xl(2)+lzs*(xl(3)+lzs*(xl(4)+lzs*xl(5)))) - msp(28) = xl(6)+lzs*(xl(7)+lzs*(xl(8)+lzs*(xl(9)+lzs*xl(10)))) - msp(29) = xl(11)+lzs*(xl(12)+lzs*(xl(13)+lzs*xl(14))) - msp(30) = xl(15)+lzs*(xl(16)+lzs*(xl(17)+lzs*(xl(18)+lzs*xl(19)))) - msp(27) = msp(27)*msp(30) - msp(28) = msp(28)*msp(30) - msp(31) = xl(20)+lzs*(xl(21)+lzs*(xl(22)+lzs*xl(23))) - msp(32) = xl(24)+lzs*(xl(25)+lzs*(xl(26)+lzs*xl(27))) -* Lalpha - m2 = 2.d0 - msp(33) = xl(28)+lzs*(xl(29)+lzs*(xl(30)+lzs*xl(31))) - msp(34) = xl(32)+lzs*(xl(33)+lzs*(xl(34)+lzs*xl(35))) - msp(35) = xl(36)+lzs*(xl(37)+lzs*(xl(38)+lzs*xl(39))) - msp(36) = xl(40)+lzs*(xl(41)+lzs*(xl(42)+lzs*xl(43))) - msp(37) = MAX(0.9d0,1.1064d0+lzs*(0.415d0+0.18d0*lzs)) - msp(38) = MAX(1.d0,1.19d0+lzs*(0.377d0+0.176d0*lzs)) - if(z.gt.0.01d0)then - msp(37) = MIN(msp(37),1.d0) - msp(38) = MIN(msp(38),1.1d0) + CHARACTER*256 path_to_tracks,path_to_he_tracks + + + if (using_METISSE) then + !WRITE(*,*) 'Calling METISSE_zcnsts',using_METISSE + CALL METISSE_zcnsts(z,zpars,path_to_tracks,path_to_he_tracks) + + elseif (using_SSE) then + !WRITE(*,*) 'Calling SSE_zcnsts' + CALL SSE_zcnsts(z,zpars) endif - msp(39) = MAX(0.145d0,0.0977d0-lzs*(0.231d0+0.0753d0*lzs)) - msp(40) = MIN(0.24d0+lzs*(0.18d0+0.595d0*lzs),0.306d0+0.053d0*lzs) - msp(41) = MIN(0.33d0+lzs*(0.132d0+0.218d0*lzs), - & 0.3625d0+0.062d0*lzs) - msp(42) = (msp(33)+msp(34)*m2**msp(36))/ - & (m2**0.4d0+msp(35)*m2**1.9d0) -* Lbeta - msp(43) = xl(44)+lzs*(xl(45)+lzs*(xl(46)+lzs*(xl(47)+lzs*xl(48)))) - msp(44) = xl(49)+lzs*(xl(50)+lzs*(xl(51)+lzs*(xl(52)+lzs*xl(53)))) - msp(45) = xl(54)+lzs*(xl(55)+lzs*xl(56)) - msp(46) = MIN(1.4d0,1.5135d0+0.3769d0*lzs) - msp(46) = MAX(0.6355d0-0.4192d0*lzs,MAX(1.25d0,msp(46))) -* Lhook - msp(47) = xl(57)+lzs*(xl(58)+lzs*(xl(59)+lzs*xl(60))) - msp(48) = xl(61)+lzs*(xl(62)+lzs*(xl(63)+lzs*xl(64))) - msp(49) = xl(65)+lzs*(xl(66)+lzs*(xl(67)+lzs*xl(68))) - msp(50) = xl(69)+lzs*(xl(70)+lzs*(xl(71)+lzs*xl(72))) - msp(51) = MIN(1.4d0,1.5135d0+0.3769d0*lzs) - msp(51) = MAX(0.6355d0-0.4192d0*lzs,MAX(1.25d0,msp(51))) -* Rtms - msp(52) = xr(1)+lzs*(xr(2)+lzs*(xr(3)+lzs*(xr(4)+lzs*xr(5)))) - msp(53) = xr(6)+lzs*(xr(7)+lzs*(xr(8)+lzs*(xr(9)+lzs*xr(10)))) - msp(54) = xr(11)+lzs*(xr(12)+lzs*(xr(13)+lzs*(xr(14)+lzs*xr(15)))) - msp(55) = xr(16)+lzs*(xr(17)+lzs*(xr(18)+lzs*xr(19))) - msp(56) = xr(20)+lzs*(xr(21)+lzs*(xr(22)+lzs*xr(23))) - msp(52) = msp(52)*msp(54) - msp(53) = msp(53)*msp(54) - msp(57) = xr(24) - msp(58) = xr(25)+lzs*(xr(26)+lzs*(xr(27)+lzs*xr(28))) - msp(59) = xr(29)+lzs*(xr(30)+lzs*(xr(31)+lzs*xr(32))) - msp(60) = xr(33)+lzs*(xr(34)+lzs*(xr(35)+lzs*xr(36))) - msp(61) = xr(37)+lzs*(xr(38)+lzs*(xr(39)+lzs*xr(40))) -* - msp(62) = MAX(0.097d0-0.1072d0*(lz+3.d0),MAX(0.097d0,MIN(0.1461d0, - & 0.1461d0+0.1237d0*(lz+2.d0)))) - msp(62) = 10.d0**msp(62) - m2 = msp(62) + 0.1d0 - msp(63) = (msp(52)+msp(53)*msp(62)**msp(55))/ - & (msp(54)+msp(62)**msp(56)) - msp(64) = (msp(57)*m2**3+msp(58)*m2**msp(61)+ - & msp(59)*m2**(msp(61)+1.5d0))/(msp(60)+m2**5) -* Ralpha - msp(65) = xr(41)+lzs*(xr(42)+lzs*(xr(43)+lzs*xr(44))) - msp(66) = xr(45)+lzs*(xr(46)+lzs*(xr(47)+lzs*xr(48))) - msp(67) = xr(49)+lzs*(xr(50)+lzs*(xr(51)+lzs*xr(52))) - msp(68) = xr(53)+lzs*(xr(54)+lzs*(xr(55)+lzs*xr(56))) - msp(69) = xr(57)+lzs*(xr(58)+lzs*(xr(59)+lzs*(xr(60)+lzs*xr(61)))) - msp(70) = MAX(0.9d0,MIN(1.d0,1.116d0+0.166d0*lzs)) - msp(71) = MAX(1.477d0+0.296d0*lzs,MIN(1.6d0,-0.308d0-1.046d0*lzs)) - msp(71) = MAX(0.8d0,MIN(0.8d0-2.d0*lzs,msp(71))) - msp(72) = xr(62)+lzs*(xr(63)+lzs*xr(64)) - msp(73) = MAX(0.065d0,0.0843d0-lzs*(0.0475d0+0.0352d0*lzs)) - msp(74) = 0.0736d0+lzs*(0.0749d0+0.04426d0*lzs) - if(z.lt.0.004d0) msp(74) = MIN(0.055d0,msp(74)) - msp(75) = MAX(0.091d0,MIN(0.121d0,0.136d0+0.0352d0*lzs)) - msp(76) = (msp(65)*msp(71)**msp(67))/(msp(66) + msp(71)**msp(68)) - if(msp(70).gt.msp(71))then - msp(70) = msp(71) - msp(75) = msp(76) - endif -* Rbeta - msp(77) = xr(65)+lzs*(xr(66)+lzs*(xr(67)+lzs*xr(68))) - msp(78) = xr(69)+lzs*(xr(70)+lzs*(xr(71)+lzs*xr(72))) - msp(79) = xr(73)+lzs*(xr(74)+lzs*(xr(75)+lzs*xr(76))) - msp(80) = xr(77)+lzs*(xr(78)+lzs*(xr(79)+lzs*xr(80))) - msp(81) = xr(81)+lzs*(xr(82)+lzs*lzs*xr(83)) - if(z.gt.0.01d0) msp(81) = MAX(msp(81),0.95d0) - msp(82) = MAX(1.4d0,MIN(1.6d0,1.6d0+lzs*(0.764d0+0.3322d0*lzs))) -* Rgamma - msp(83) = MAX(xr(84)+lzs*(xr(85)+lzs*(xr(86)+lzs*xr(87))), - & xr(96)+lzs*(xr(97)+lzs*xr(98))) - msp(84) = MIN(0.d0,xr(88)+lzs*(xr(89)+lzs*(xr(90)+lzs*xr(91)))) - msp(84) = MAX(msp(84),xr(99)+lzs*(xr(100)+lzs*xr(101))) - msp(85) = xr(92)+lzs*(xr(93)+lzs*(xr(94)+lzs*xr(95))) - msp(85) = MAX(0.d0,MIN(msp(85),7.454d0+9.046d0*lzs)) - msp(86) = MIN(xr(102)+lzs*xr(103),MAX(2.d0,-13.3d0-18.6d0*lzs)) - msp(87) = MIN(1.5d0,MAX(0.4d0,2.493d0+1.1475d0*lzs)) - msp(88) = MAX(1.d0,MIN(1.27d0,0.8109d0-0.6282d0*lzs)) - msp(88) = MAX(msp(88),0.6355d0-0.4192d0*lzs) - msp(89) = MAX(5.855420d-02,-0.2711d0-lzs*(0.5756d0+0.0838d0*lzs)) -* Rhook - msp(90) = xr(104)+lzs*(xr(105)+lzs*(xr(106)+lzs*xr(107))) - msp(91) = xr(108)+lzs*(xr(109)+lzs*(xr(110)+lzs*xr(111))) - msp(92) = xr(112)+lzs*(xr(113)+lzs*(xr(114)+lzs*xr(115))) - msp(93) = xr(116)+lzs*(xr(117)+lzs*(xr(118)+lzs*xr(119))) - msp(94) = MIN(1.25d0, - & MAX(1.1d0,1.9848d0+lzs*(1.1386d0+0.3564d0*lzs))) - msp(95) = 0.063d0 + lzs*(0.0481d0 + 0.00984d0*lzs) - msp(96) = MIN(1.3d0,MAX(0.45d0,1.2d0+2.45d0*lzs)) -* Lneta - if(z.gt.0.0009d0)then - msp(97) = 10.d0 - else - msp(97) = 20.d0 - endif -* Lbgb - gbp(1) = xg(1)+lzs*(xg(2)+lzs*(xg(3)+lzs*xg(4))) - gbp(2) = xg(5)+lzs*(xg(6)+lzs*(xg(7)+lzs*xg(8))) - gbp(3) = xg(9)+lzs*(xg(10)+lzs*(xg(11)+lzs*xg(12))) - gbp(4) = xg(13)+lzs*(xg(14)+lzs*(xg(15)+lzs*xg(16))) - gbp(5) = xg(17)+lzs*(xg(18)+lzs*xg(19)) - gbp(6) = xg(20)+lzs*(xg(21)+lzs*xg(22)) - gbp(3) = gbp(3)**gbp(6) - gbp(7) = xg(23) - gbp(8) = xg(24) -* Lbagb -* set gbp(16) = 1.d0 until it is reset later with an initial -* call to Lbagbf using mass = zpars(2) and mhefl = 0.0 - gbp(9) = xg(25) + lzs*(xg(26) + lzs*xg(27)) - gbp(10) = xg(28) + lzs*(xg(29) + lzs*xg(30)) - gbp(11) = 15.d0 - gbp(12) = xg(31)+lzs*(xg(32)+lzs*(xg(33)+lzs*xg(34))) - gbp(13) = xg(35)+lzs*(xg(36)+lzs*(xg(37)+lzs*xg(38))) - gbp(14) = xg(39)+lzs*(xg(40)+lzs*(xg(41)+lzs*xg(42))) - gbp(15) = xg(43)+lzs*xg(44) - gbp(12) = gbp(12)**gbp(15) - gbp(14) = gbp(14)**gbp(15) - gbp(16) = 1.d0 -* Rgb - gbp(17) = -4.6739d0-0.9394d0*lz - gbp(17) = 10.d0**gbp(17) - gbp(17) = MAX(gbp(17),-0.04167d0+55.67d0*z) - gbp(17) = MIN(gbp(17),0.4771d0-9329.21d0*z**2.94d0) - gbp(18) = MIN(0.54d0,0.397d0+lzs*(0.28826d0+0.5293d0*lzs)) - gbp(19) = MAX(-0.1451d0,-2.2794d0-lz*(1.5175d0+0.254d0*lz)) - gbp(19) = 10.d0**gbp(19) - if(z.gt.0.004d0)then - gbp(19) = MAX(gbp(19),0.7307d0+14265.1d0*z**3.395d0) - endif - gbp(20) = xg(45)+lzs*(xg(46)+lzs*(xg(47)+lzs*(xg(48)+ - & lzs*(xg(49)+lzs*xg(50))))) - gbp(21) = xg(51)+lzs*(xg(52)+lzs*(xg(53)+lzs*(xg(54)+lzs*xg(55)))) - gbp(22) = xg(56)+lzs*(xg(57)+lzs*(xg(58)+lzs*(xg(59)+ - & lzs*(xg(60)+lzs*xg(61))))) - gbp(23) = xg(62)+lzs*(xg(63)+lzs*(xg(64)+lzs*(xg(65)+lzs*xg(66)))) -* Ragb - gbp(24) = MIN(0.99164d0-743.123d0*z**2.83d0, - & 1.0422d0+lzs*(0.13156d0+0.045d0*lzs)) - gbp(25) = xg(67)+lzs*(xg(68)+lzs*(xg(69)+lzs*(xg(70)+ - & lzs*(xg(71)+lzs*xg(72))))) - gbp(26) = xg(73)+lzs*(xg(74)+lzs*(xg(75)+lzs*(xg(76)+lzs*xg(77)))) - gbp(27) = xg(78)+lzs*(xg(79)+lzs*(xg(80)+lzs*(xg(81)+ - & lzs*(xg(82)+lzs*xg(83))))) - gbp(28) = xg(84)+lzs*(xg(85)+lzs*(xg(86)+lzs*(xg(87)+lzs*xg(88)))) - gbp(29) = xg(89)+lzs*(xg(90)+lzs*(xg(91)+lzs*(xg(92)+ - & lzs*(xg(93)+lzs*xg(94))))) - gbp(30) = xg(95)+lzs*(xg(96)+lzs*(xg(97)+lzs*(xg(98)+ - & lzs*(xg(99)+lzs*xg(100))))) - m1 = zpars(2) - 0.2d0 - gbp(31) = gbp(29) + gbp(30)*m1 - gbp(32) = MIN(gbp(25)/zpars(2)**gbp(26),gbp(27)/zpars(2)**gbp(28)) -* Mchei - gbp(33) = xg(101)**4 - gbp(34) = xg(102)*4.d0 -* Mcagb - gbp(35) = xg(103)+lzs*(xg(104)+lzs*(xg(105)+lzs*xg(106))) - gbp(36) = xg(107)+lzs*(xg(108)+lzs*(xg(109)+lzs*xg(110))) - gbp(37) = xg(111)+lzs*xg(112) - gbp(35) = gbp(35)**4 - gbp(36) = gbp(36)*4.d0 - gbp(37) = gbp(37)**4 -* Lhei -* set gbp(41) = -1.d0 until it is reset later with an initial -* call to Lheif using mass = zpars(2) and mhefl = 0.0 - gbp(38) = xh(1)+lzs*xh(2) - gbp(39) = xh(3)+lzs*xh(4) - gbp(40) = xh(5) - gbp(41) = -1.d0 - gbp(42) = xh(6)+lzs*(xh(7)+lzs*xh(8)) - gbp(43) = xh(9)+lzs*(xh(10)+lzs*xh(11)) - gbp(44) = xh(12)+lzs*(xh(13)+lzs*xh(14)) - gbp(42) = gbp(42)**2 - gbp(44) = gbp(44)**2 -* Lhe - gbp(45) = xh(15)+lzs*(xh(16)+lzs*xh(17)) - if(lzs.gt.-1.d0)then - gbp(46) = 1.d0 - xh(19)*(lzs+1.d0)**xh(18) - else - gbp(46) = 1.d0 - endif - gbp(47) = xh(20)+lzs*(xh(21)+lzs*xh(22)) - gbp(48) = xh(23)+lzs*(xh(24)+lzs*xh(25)) - gbp(45) = gbp(45)**gbp(48) - gbp(47) = gbp(47)**gbp(48) - gbp(46) = gbp(46)/zpars(3)**0.1d0+(gbp(46)*gbp(47)-gbp(45))/ - & zpars(3)**(gbp(48)+0.1d0) -* Rmin - gbp(49) = xh(26)+lzs*(xh(27)+lzs*(xh(28)+lzs*xh(29))) - gbp(50) = xh(30)+lzs*(xh(31)+lzs*(xh(32)+lzs*xh(33))) - gbp(51) = xh(34)+lzs*(xh(35)+lzs*(xh(36)+lzs*xh(37))) - gbp(52) = 5.d0+xh(38)*z**xh(39) - gbp(53) = xh(40)+lzs*(xh(41)+lzs*(xh(42)+lzs*xh(43))) - gbp(49) = gbp(49)**gbp(53) - gbp(51) = gbp(51)**(2.d0*gbp(53)) -* The -* set gbp(57) = -1.d0 until it is reset later with an initial -* call to Thef using mass = zpars(2), mc = 0.0 and mhefl = 0.0 - gbp(54) = xh(44)+lzs*(xh(45)+lzs*(xh(46)+lzs*xh(47))) - gbp(55) = xh(48)+lzs*(xh(49)+lzs*xh(50)) - gbp(55) = MAX(gbp(55),1.d0) - gbp(56) = xh(51) - gbp(57) = -1.d0 - gbp(58) = xh(52)+lzs*(xh(53)+lzs*(xh(54)+lzs*xh(55))) - gbp(59) = xh(56)+lzs*(xh(57)+lzs*(xh(58)+lzs*xh(59))) - gbp(60) = xh(60)+lzs*(xh(61)+lzs*(xh(62)+lzs*xh(63))) - gbp(61) = xh(64)+lzs*xh(65) - gbp(58) = gbp(58)**gbp(61) - gbp(60) = gbp(60)**5 -* Tbl - dum1 = zpars(2)/zpars(3) - gbp(62) = xh(66)+lzs*xh(67) - gbp(62) = -gbp(62)*log10(dum1) - gbp(63) = xh(68) - if(lzd.gt.0.d0) then - gbp(64) = 1.d0-lzd*(xh(69)+lzd*(xh(70)+lzd*xh(71))) - else - gbp(64) = 1.d0 - end if - gbp(65) = 1.d0-gbp(64)*dum1**gbp(63) - gbp(66) = 1.d0 - lzd*(xh(77) + lzd*(xh(78) + lzd*xh(79))) - gbp(67) = xh(72) + lzs*(xh(73) + lzs*(xh(74) + lzs*xh(75))) - gbp(68) = xh(76) -* Lzahb - gbp(69) = xh(80) + lzs*(xh(81) + lzs*xh(82)) - gbp(70) = xh(83) + lzs*(xh(84) + lzs*xh(85)) - gbp(71) = 15.d0 - gbp(72) = xh(86) - gbp(73) = xh(87) -* Rzahb - gbp(75) = xh(88) + lzs*(xh(89) + lzs*(xh(90) + lzs*xh(91))) - gbp(76) = xh(92) + lzs*(xh(93) + lzs*(xh(94) + lzs*xh(95))) - gbp(77) = xh(96) + lzs*(xh(97) + lzs*(xh(98) + lzs*xh(99))) -*** -* finish Lbagb - mhefl = 0.d0 - lx = lbagbf(zpars(2),mhefl) - gbp(16) = lx -* finish LHeI - dum1 = 0.d0 - lhefl = lheif(zpars(2),mhefl) - gbp(41) = (gbp(38)*zpars(2)**gbp(39)-lhefl)/ - & (EXP(zpars(2)*gbp(40))*lhefl) -* finish THe - thefl = thef(zpars(2),dum1,mhefl)*tbgbf(zpars(2)) - gbp(57) = (thefl-gbp(54))/(gbp(54)*EXP(gbp(56)*zpars(2))) -* finish Tblf - rb = ragbf(zpars(3),lheif(zpars(3),zpars(2)),mhefl) - rr = 1.d0 - rminf(zpars(3))/rb - rr = MAX(rr,1.0d-12) - gbp(66) = gbp(66)/(zpars(3)**gbp(67)*rr**gbp(68)) -* finish Lzahb - gbp(74) = lhefl*lHef(zpars(2)) -*** - kw = 0 - tm = 0.d0 - tn = 0.d0 - CALL star(kw,zpars(2),zpars(2),tm,tn,tscls,lums,GB,zpars) - zpars(9) = mcgbf(lums(3),GB,lums(6)) - zpars(10) = mcgbf(lums(4),GB,lums(6)) -* set the hydrogen and helium abundances - zpars(11) = 0.76d0 - 3.d0*z - zpars(12) = 0.24d0 + 2.d0*z -* set constant for low-mass CHeB stars - zpars(13) = rminf(zpars(2))/ - & rgbf(zpars(2),lzahbf(zpars(2),zpars(9),zpars(2))) -* - zpars(14) = z**0.4d0 -* - return - end -*** + + END diff --git a/src/cosmic/utils.py b/src/cosmic/utils.py index eae256cae..283404d6e 100644 --- a/src/cosmic/utils.py +++ b/src/cosmic/utils.py @@ -923,11 +923,14 @@ def get_met_dep_binfrac(met): return float(np.round(binfrac, 2)) -def error_check(BSEDict, filters=None, convergence=None, sampling=None): - """Checks that values in BSEDict, filters, and convergence are viable""" +def error_check(BSEDict, SSEDict, filters=None, convergence=None, sampling=None): + """Checks that values in BSEDict, SSEDict,filters, and convergence are viable""" if not isinstance(BSEDict, dict): raise ValueError("BSE flags must be supplied via a dictionary") + if not isinstance(SSEDict, dict): + raise ValueError("SSE flags must be supplied via a dictionary") + if filters is not None: if not isinstance(filters, dict): raise ValueError("Filters criteria must be supplied via a dictionary") @@ -1087,6 +1090,17 @@ def error_check(BSEDict, filters=None, convergence=None, sampling=None): ) ) + # SSEDict + flag = "stellar_engine" + acceptable_stellar_engines = ["sse", "metisse"] + if flag in SSEDict.keys(): + if SSEDict[flag] not in acceptable_stellar_engines: + raise ValueError( + "{0} needs to be one of 'sse', 'metisse' (you set it to {1})".format( + flag, SSEDict[flag] + ) + ) + # BSEDict flag = "dtp" if flag in BSEDict.keys(): @@ -1814,6 +1828,8 @@ def _eval(node): dictionary["convergence"] = 0 if "sampling" not in dictionary.keys(): dictionary["sampling"] = 0 + if "sse" not in dictionary.keys(): + dictionary["sse"] = 0 continue dictionary[section] = {} for option in cp.options(section): @@ -1829,14 +1845,15 @@ def _eval(node): finally: if option not in dictionary[section].keys(): raise ValueError("We have detected an error in your inifile. The folloiwng parameter failed to be read correctly: {0}".format(option)) - + + SSEDict = dictionary["sse"] BSEDict = dictionary["bse"] seed_int = int(dictionary["rand_seed"]["seed"]) filters = dictionary["filters"] convergence = dictionary["convergence"] sampling = dictionary["sampling"] - return BSEDict, seed_int, filters, convergence, sampling + return BSEDict, SSEDict, seed_int, filters, convergence, sampling class VariableKey(object): From 766f2e521500b4a4a04b4278734f8f44818a80be Mon Sep 17 00:00:00 2001 From: Poojan <34255053+poojanagrawal@users.noreply.github.com> Date: Tue, 4 Jun 2024 14:57:45 -0400 Subject: [PATCH 02/46] added METISSE as submodule (#629) * added METISSE as submodule * try ssedict for one test --- .gitmodules | 3 +++ src/cosmic/src/METISSE | 1 + src/cosmic/tests/test_evolve.py | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .gitmodules create mode 160000 src/cosmic/src/METISSE diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..bb92d3d5b --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src/cosmic/src/METISSE"] + path = src/cosmic/src/METISSE + url = git@github.com:TeamMETISSE/METISSE.git diff --git a/src/cosmic/src/METISSE b/src/cosmic/src/METISSE new file mode 160000 index 000000000..e6798b953 --- /dev/null +++ b/src/cosmic/src/METISSE @@ -0,0 +1 @@ +Subproject commit e6798b953a8beda86e2ea640b94aeb051f55ffbc diff --git a/src/cosmic/tests/test_evolve.py b/src/cosmic/tests/test_evolve.py index 4d040d7fb..200f5130d 100644 --- a/src/cosmic/tests/test_evolve.py +++ b/src/cosmic/tests/test_evolve.py @@ -36,6 +36,8 @@ BSEDict['don_lim'] = -1 BSEDict['acc_lim'] = -1 BSEDict['wd_mass_lim'] = 0 +SSEDict = {'stellar_engine': 'sse'} + class TestEvolve(unittest.TestCase): """`TestCase` for the cosmic @@ -44,7 +46,7 @@ def test_single_evolve_with_table(self): # Check that the sample_primary function samples mass correctly EvolvedBinaryBPP, EvolvedBinaryBCM, initCond, kick_info = Evolve.evolve( - initialbinarytable=INIT_CONDITIONS, randomseed=523574) + initialbinarytable=INIT_CONDITIONS, randomseed=523574, SSEDict=SSEDict) pd.testing.assert_frame_equal(EvolvedBinaryBPP, BPP_DF, check_dtype=False, check_exact=False) pd.testing.assert_frame_equal(EvolvedBinaryBCM, BCM_DF, check_dtype=False, check_exact=False) From b3b95184371bdfed3a83a07b2b670513f170c6e1 Mon Sep 17 00:00:00 2001 From: Poojan <34255053+poojanagrawal@users.noreply.github.com> Date: Thu, 6 Jun 2024 10:49:26 -0400 Subject: [PATCH 03/46] updated comprad for METISSE (#631) --- .gitignore | 104 --------------------- meson.build | 109 ----------------------- src/cosmic/evolve.py | 4 +- src/cosmic/sample/sampler/independent.py | 26 ++++-- src/cosmic/src/comprad.f | 22 +++-- src/cosmic/utils.py | 19 +++- 6 files changed, 55 insertions(+), 229 deletions(-) delete mode 100644 .gitignore delete mode 100644 meson.build diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 2a54457eb..000000000 --- a/.gitignore +++ /dev/null @@ -1,104 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so* - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -.hypothesis/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ -docs/api/ -docs/input.hdf5 -docs/input.fits - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# pyenv -.python-version - -# celery beat schedule file -celerybeat-schedule - -# SageMath parsed files -*.sage.py - -# dotenv -.env - -# virtualenv -.venv -venv/ -ENV/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ diff --git a/meson.build b/meson.build deleted file mode 100644 index c6e2eee8b..000000000 --- a/meson.build +++ /dev/null @@ -1,109 +0,0 @@ -project('cosmic', - 'c', - 'fortran', - version : '3.4.10', - default_options: ['warning_level=0', 'optimization=3'], -) - -# Enable fortran and check arguments -# add_languages('fortran', native: false) -ff = meson.get_compiler('fortran') -f_args = ff.get_supported_arguments('-fPIC') -add_project_arguments(f_args, language: 'fortran') - -py3 = import('python').find_installation() - -numpy_include_dir = run_command(py3, ['-c', 'import numpy; print(numpy.get_include())'], check: true).stdout().strip() -f2py_include_dir = run_command(py3, ['-c', 'import numpy.f2py; print(numpy.f2py.get_include())'], check: true).stdout().strip() -inc_np = include_directories(numpy_include_dir, f2py_include_dir) - -f2py_source = custom_target( - 'evolvebin-target', - input : ['src/cosmic/src/evolv2.f', 'src/cosmic/src/comprad.f'], - output : ['_evolvebinmodule.c', '_evolvebin-f2pywrappers.f'], - command : [py3, '-m', 'numpy.f2py', '@INPUT@', '-m', '_evolvebin', '--lower', '@OUTDIR'] -) - -lib_source = [ - 'src/cosmic/src/hrdiag_remnant.f', - 'src/cosmic/src/assign_remnant.f', - 'src/cosmic/src/benchmarkevolv2.f', - 'src/cosmic/src/corerd.f', - 'src/cosmic/src/comenv.f', - 'src/cosmic/src/dgcore.f', - 'src/cosmic/src/evolv2.f', - 'src/cosmic/src/gntage.f', - 'src/cosmic/src/instar.f', - 'src/cosmic/src/kick.f', - 'src/cosmic/src/mix.f', - 'src/cosmic/src/mrenv.f', - 'src/cosmic/src/ran3.f', - 'src/cosmic/src/rl.f', - 'src/cosmic/src/concatkstars.f', - 'src/cosmic/src/comprad.f', - 'src/cosmic/src/bpp_array.f', - 'src/cosmic/src/checkstate.f', - 'src/cosmic/src/deltat.f', - 'src/cosmic/src/mlwind.f', - 'src/cosmic/src/hrdiag.f', - 'src/cosmic/src/star.f', - 'src/cosmic/src/zcnsts.f', - 'src/cosmic/src/deltat.f', - 'src/cosmic/src/mlwind.f', - 'src/cosmic/src/hrdiag.f', - 'src/cosmic/src/star.f', - 'src/cosmic/src/zcnsts.f', - 'src/cosmic/src/SSE/SSE_deltat.f', - 'src/cosmic/src/SSE/SSE_mlwind.f', - 'src/cosmic/src/SSE/SSE_hrdiag.f', - 'src/cosmic/src/SSE/SSE_star.f', - 'src/cosmic/src/SSE/SSE_zcnsts.f', - 'src/cosmic/src/SSE/SSE_zfuncs.f', - 'src/cosmic/src/SSE/SSE_gntage.f', - 'src/cosmic/src/METISSE/src/METISSE_gntage.f90', - 'src/cosmic/src/METISSE/src/METISSE_deltat.f90', - 'src/cosmic/src/METISSE/src/METISSE_mlwind.f90', - 'src/cosmic/src/METISSE/src/METISSE_hrdiag.f90', - 'src/cosmic/src/METISSE/src/METISSE_star.f90', - 'src/cosmic/src/METISSE/src/METISSE_zcnsts.f90', - 'src/cosmic/src/METISSE/src/track_support.f90', - 'src/cosmic/src/METISSE/src/z_support.f90', - 'src/cosmic/src/METISSE/src/sse_support.f90', - 'src/cosmic/src/METISSE/src/remnant_support.f90', - 'src/cosmic/src/METISSE/src/interp_support.f90', - 'src/cosmic/src/METISSE/src/comenv_lambda.f90', - 'src/cosmic/src/METISSE/src/METISSE_miscellaneous.f90', - 'src/cosmic/src/assign_commons_COSMIC.f90'] - -# Detect operating system and set appropriate linker flags -host_system = host_machine.system() - -if host_system == 'darwin' - ldflags = ['-Wl,-no_compact_unwind'] -else - ldflags = [] # No special flags for other systems -endif - -evolvebin_module = py3.extension_module('_evolvebin', - f2py_source, - lib_source, - f2py_include_dir / 'fortranobject.c', - include_directories: inc_np, - link_args: ldflags, - install : true, - install_dir : py3.get_install_dir() / 'cosmic' -) - - -module_dirs = ['src/cosmic', 'src/cosmic/bse_utils', - 'src/cosmic/sample', 'src/cosmic/tests'] - -# Install modules -foreach mod_dir: module_dirs - install_subdir(mod_dir, - install_dir: py3.get_install_dir()) -endforeach - - -python_script = 'bin/cosmic-pop' -install_data(python_script, install_dir: get_option('bindir')) diff --git a/src/cosmic/evolve.py b/src/cosmic/evolve.py index 29b478fc0..1ab8680fa 100644 --- a/src/cosmic/evolve.py +++ b/src/cosmic/evolve.py @@ -246,7 +246,7 @@ def evolve(cls, initialbinarytable, pool=None, **kwargs): # check the initial conditions of the system and warn user if # anything is weird about them, such as the star starts # in Roche Lobe overflow - utils.check_initial_conditions(initialbinarytable) + utils.check_initial_conditions(initialbinarytable,SSEDict) # assign some columns based on keyword arguments but that # can be overwritten by the params or BSEDict @@ -486,6 +486,8 @@ def _evolve_single_system(f): _evolvebin.se_flags.using_sse = False path_to_tracks = f["path_to_tracks"] path_to_he_tracks = f["path_to_he_tracks"] + else: + raise ValueError("Use either 'sse' or 'metisse' as stellar engine") [bpp_index, bcm_index, kick_info] = _evolvebin.evolv2([f["kstar_1"], f["kstar_2"]], [f["mass_1"], f["mass_2"]], diff --git a/src/cosmic/sample/sampler/independent.py b/src/cosmic/sample/sampler/independent.py index 974dd6347..d497690d5 100644 --- a/src/cosmic/sample/sampler/independent.py +++ b/src/cosmic/sample/sampler/independent.py @@ -45,6 +45,7 @@ def get_independent_sampler( SF_duration, binfrac_model, met, + SSEDict=None, size=None, total_mass=np.inf, sampling_target="size", @@ -159,6 +160,8 @@ def get_independent_sampler( n_binaries : `int` Number of binaries needed to generate a population """ + + if sampling_target == "total_mass" and (total_mass is None or total_mass == np.inf): raise ValueError("If `sampling_target == 'total mass'` then `total_mass` must be supplied") if size is None and (total_mass is None or total_mass == np.inf): @@ -284,8 +287,8 @@ def get_independent_sampler( zsun = kwargs.pop("zsun", 0.02) - rad1 = initconditions.set_reff(mass1_binary, metallicity=met, zsun=zsun) - rad2 = initconditions.set_reff(mass2_binary, metallicity=met, zsun=zsun) + rad1 = initconditions.set_reff(SSEDict, mass1_binary, metallicity=met, zsun=zsun) + rad2 = initconditions.set_reff(SSEDict, mass2_binary, metallicity=met, zsun=zsun) # sample periods and eccentricities # if the porb_model is moe19, the metallicity needs to be supplied @@ -1072,7 +1075,7 @@ def set_kstar(self, mass): return kstar - def set_reff(self, mass, metallicity, zsun=0.02): + def set_reff(self, SSEDict ,mass, metallicity, zsun=0.02): """ Better way to set the radii from BSE, by calling it directly @@ -1092,12 +1095,25 @@ def set_reff(self, mass, metallicity, zsun=0.02): _evolvebin.metvars.zsun = zsun + if (SSEDict == None) or (SSEDict["stellar_engine"] == "sse"): + _evolvebin.se_flags.using_sse = True + _evolvebin.se_flags.using_metisse = False + path_to_tracks = "" + path_to_he_tracks = "" + elif SSEDict["stellar_engine"] == "metisse": + _evolvebin.se_flags.using_metisse = True + _evolvebin.se_flags.using_sse = False + path_to_tracks = SSEDict["path_to_tracks"] + path_to_he_tracks = SSEDict["path_to_he_tracks"] + else: + raise ValueError("Use either 'sse' or 'metisse' as stellar engine") + idx = 0 while total_length > max_array_size: ## cycle through the masses max_array_size number at a time temp_mass = mass[idx*max_array_size:(idx+1)*max_array_size] - temp_radii = _evolvebin.compute_r(temp_mass,metallicity,max_array_size) + temp_radii = _evolvebin.compute_r(temp_mass,metallicity,max_array_size,path_to_tracks,path_to_he_tracks) ## put these in the radii array radii[idx*max_array_size:(idx+1)*max_array_size] = temp_radii @@ -1111,7 +1127,7 @@ def set_reff(self, mass, metallicity, zsun=0.02): temp_mass = np.zeros(max_array_size) temp_mass[:length_remaining] = mass[-length_remaining:] - temp_radii = _evolvebin.compute_r(temp_mass,metallicity,length_remaining) + temp_radii = _evolvebin.compute_r(temp_mass,metallicity,length_remaining,path_to_tracks,path_to_he_tracks) #finish up the array radii[-length_remaining:] = temp_radii[:length_remaining] diff --git a/src/cosmic/src/comprad.f b/src/cosmic/src/comprad.f index bfbf3dc5c..6a3f5eb4f 100644 --- a/src/cosmic/src/comprad.f +++ b/src/cosmic/src/comprad.f @@ -1,5 +1,6 @@ *** - SUBROUTINE compute_r(mass,z,num,rad) + SUBROUTINE compute_r(mass,z,num,rad, + & path_to_tracks,path_to_he_tracks) IMPLICIT NONE INCLUDE 'const_bse.h' @@ -17,8 +18,9 @@ SUBROUTINE compute_r(mass,z,num,rad) PARAMETER(loop=100000) real*8 mass(loop),rad(loop),z integer k,kstar,num - real*8 mt,tm,tn,mass0,age,lum,mc,rc,me,re + real*8 mt,tm,tn,mass0,age,lum,mc,rc,me,re,dtm REAL*8 tscls(20),lums(10),GB(10),zpars(20),k2,bhspin + CHARACTER*256 path_to_tracks,path_to_he_tracks *** * f2py directives go here; we'll return the radii as a 10^5 array @@ -29,7 +31,11 @@ SUBROUTINE compute_r(mass,z,num,rad) Cf2py intent(in) num Cf2py intent(out) rad - CALL zcnsts(z,zpars) + if(using_METISSE) CALL initialize_front_end('cosmic') + CALL zcnsts(z,zpars,path_to_tracks,path_to_he_tracks) + + if(using_METISSE) call allocate_track(num,mass) + *** * Then just loop through everything @@ -46,11 +52,15 @@ SUBROUTINE compute_r(mass,z,num,rad) kstar = 0 if(mt.ge.0.7) kstar = 1 bhspin = 0.d0 - rc = 0.d0 - CALL star(kstar,mass0,mt,tm,tn,tscls,lums,GB,zpars) + rc = 0.d0 + dtm = 0.d0 + CALL star(kstar,mass0,mt,tm,tn,tscls,lums,GB,zpars,dtm,k) CALL hrdiag(mass0,age,mt,tm,tn,tscls,lums,GB,zpars, & rad(k),lum,kstar,mc,rc,me,re,k2,bhspin,k) - + 10 continue + + + if (using_METISSE) call dealloc_track() END SUBROUTINE compute_r diff --git a/src/cosmic/utils.py b/src/cosmic/utils.py index 283404d6e..97fe6335c 100644 --- a/src/cosmic/utils.py +++ b/src/cosmic/utils.py @@ -1602,13 +1602,14 @@ def error_check(BSEDict, SSEDict, filters=None, convergence=None, sampling=None) return -def check_initial_conditions(full_initial_binary_table): +def check_initial_conditions(full_initial_binary_table, SSEDict): """Checks initial conditions and reports warnings Only warning provided right now is if star begins in Roche lobe overflow """ - + from cosmic import _evolvebin + def rzamsf(m): """A function to evaluate Rzams ( from Tout et al., 1996, MNRAS, 281, 257 ). @@ -1635,10 +1636,20 @@ def rzamsf(m): if np.all(mass2 == 0.0): return - else: + elif (SSEDict["stellar_engine"] == "sse"): rzams1 = rzamsf(mass1) rzams2 = rzamsf(mass2) - + +# TODO: the following section with METISSE is incomplete +# elif (SSEDict["stellar_engine"] == "metisse"): +# _evolvebin.se_flags.using_sse = False +# _evolvebin.se_flags.using_metisse = True +# path_to_tracks = SSEDict["path_to_tracks"] +# path_to_he_tracks = SSEDict["path_to_he_tracks"] + +# rzams1 = _evolvebin.compute_r(mass1,z,len(mass1),path_to_tracks,path_to_he_tracks) +# rzams1 = _evolvebin.compute_r(mass2,z,len(mass2),path_to_tracks,path_to_he_tracks) + # assume some time step in order to calculate sep yeardy = 365.24 aursun = 214.95 From d54bd83137163ff1389b186a4eb53d0261326b29 Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Thu, 6 Jun 2024 16:47:52 -0400 Subject: [PATCH 04/46] Kb metisse add ce facc split (#630) * trying to add git submodules to actions * splitting alphas and accretion limits for primary and secondary * forgot to add cosnt * fixing SSEDict columns in initial binary table * add in correct gfortran compilation * fixing benchmark to work with SSE, removing repeated compilation arguments * fixing tests with SSEDict * add ignore back in * fix tests and remove SSEDict from setreff for now --- .github/workflows/python-package.yml | 2 + .gitignore | 104 ++++++++ ci/compile_benchmark.sh | 4 +- meson.build | 104 ++++++++ src/cosmic/evolve.py | 67 ++++- src/cosmic/sample/sampler/independent.py | 9 +- src/cosmic/src/benchmarkevolv2.f | 250 +++++++++++++++++- src/cosmic/src/comenv.f | 22 +- src/cosmic/src/const_bse.h | 4 +- src/cosmic/src/evolv2.f | 60 ++--- src/cosmic/tests/data/Params.ini | 32 ++- .../data/initial_conditions_for_testing.hdf5 | Bin 23601 -> 1091848 bytes src/cosmic/tests/test_evolve.py | 13 +- src/cosmic/tests/test_sample.py | 1 + src/cosmic/tests/test_utils.py | 15 +- src/cosmic/utils.py | 44 ++- 16 files changed, 635 insertions(+), 96 deletions(-) create mode 100644 .gitignore create mode 100644 meson.build diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 457bd8757..aea4e83a1 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,6 +16,8 @@ jobs: steps: - uses: actions/checkout@v2 + with: + submodules: true - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..2a54457eb --- /dev/null +++ b/.gitignore @@ -0,0 +1,104 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so* + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ +docs/api/ +docs/input.hdf5 +docs/input.fits + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# dotenv +.env + +# virtualenv +.venv +venv/ +ENV/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ diff --git a/ci/compile_benchmark.sh b/ci/compile_benchmark.sh index 495c44fb8..34aa9d3a5 100755 --- a/ci/compile_benchmark.sh +++ b/ci/compile_benchmark.sh @@ -1,2 +1,2 @@ -gfortran -coverage -fprofile-arcs -ftest-coverage -O0 src/cosmic/src/assign_remnant.f src/cosmic/src/benchmarkevolv2.f src/cosmic/src/comenv.f src/cosmic/src/corerd.f src/cosmic/src/deltat.f src/cosmic/src/dgcore.f src/cosmic/src/evolv2.f src/cosmic/src/gntage.f src/cosmic/src/hrdiag.f src/cosmic/src/hrdiag_remnant.f src/cosmic/src/instar.f src/cosmic/src/kick.f src/cosmic/src/mix.f src/cosmic/src/mlwind.f src/cosmic/src/mrenv.f src/cosmic/src/ran3.f src/cosmic/src/rl.f src/cosmic/src/star.f src/cosmic/src/zcnsts.f src/cosmic/src/zfuncs.f src/cosmic/src/concatkstars.f src/cosmic/src/bpp_array.f src/cosmic/src/checkstate.f -o benchmarkevolv2.exe -I src/cosmic/src -Wl,-rpath,${CONDA_PREFIX}/lib -./benchmarkevolv2.exe +gfortran -coverage -fprofile-arcs -ftest-coverage -O0 src/cosmic/src/hrdiag_remnant.f src/cosmic/src/assign_remnant.f src/cosmic/src/benchmarkevolv2.f src/cosmic/src/corerd.f src/cosmic/src/comenv.f src/cosmic/src/dgcore.f src/cosmic/src/evolv2.f src/cosmic/src/gntage.f src/cosmic/src/instar.f src/cosmic/src/kick.f src/cosmic/src/mix.f src/cosmic/src/mrenv.f src/cosmic/src/ran3.f src/cosmic/src/rl.f src/cosmic/src/concatkstars.f src/cosmic/src/comprad.f src/cosmic/src/bpp_array.f src/cosmic/src/checkstate.f src/cosmic/src/deltat.f src/cosmic/src/mlwind.f src/cosmic/src/hrdiag.f src/cosmic/src/star.f src/cosmic/src/zcnsts.f src/cosmic/src/SSE/SSE_deltat.f src/cosmic/src/SSE/SSE_mlwind.f src/cosmic/src/SSE/SSE_hrdiag.f src/cosmic/src/SSE/SSE_star.f src/cosmic/src/SSE/SSE_zcnsts.f src/cosmic/src/SSE/SSE_zfuncs.f src/cosmic/src/SSE/SSE_gntage.f src/cosmic/src/METISSE/src/track_support.f90 src/cosmic/src/METISSE/src/z_support.f90 src/cosmic/src/METISSE/src/sse_support.f90 src/cosmic/src/METISSE/src/remnant_support.f90 src/cosmic/src/METISSE/src/interp_support.f90 src/cosmic/src/METISSE/src/METISSE_gntage.f90 src/cosmic/src/METISSE/src/METISSE_deltat.f90 src/cosmic/src/METISSE/src/METISSE_mlwind.f90 src/cosmic/src/METISSE/src/METISSE_hrdiag.f90 src/cosmic/src/METISSE/src/METISSE_star.f90 src/cosmic/src/METISSE/src/METISSE_zcnsts.f90 src/cosmic/src/METISSE/src/comenv_lambda.f90 src/cosmic/src/METISSE/src/METISSE_miscellaneous.f90 src/cosmic/src/assign_commons_COSMIC.f90 -o benchmarkevolv2.exe -I src/cosmic/src -Wl,-rpath,${CONDA_PREFIX}/lib +./benchmarkevolv2.exe \ No newline at end of file diff --git a/meson.build b/meson.build new file mode 100644 index 000000000..639eb2c78 --- /dev/null +++ b/meson.build @@ -0,0 +1,104 @@ +project('cosmic', + 'c', + 'fortran', + version : '3.4.10', + default_options: ['warning_level=0', 'optimization=3'], +) + +# Enable fortran and check arguments +# add_languages('fortran', native: false) +ff = meson.get_compiler('fortran') +f_args = ff.get_supported_arguments('-fPIC') +add_project_arguments(f_args, language: 'fortran') + +py3 = import('python').find_installation() + +numpy_include_dir = run_command(py3, ['-c', 'import numpy; print(numpy.get_include())'], check: true).stdout().strip() +f2py_include_dir = run_command(py3, ['-c', 'import numpy.f2py; print(numpy.f2py.get_include())'], check: true).stdout().strip() +inc_np = include_directories(numpy_include_dir, f2py_include_dir) + +f2py_source = custom_target( + 'evolvebin-target', + input : ['src/cosmic/src/evolv2.f', 'src/cosmic/src/comprad.f'], + output : ['_evolvebinmodule.c', '_evolvebin-f2pywrappers.f'], + command : [py3, '-m', 'numpy.f2py', '@INPUT@', '-m', '_evolvebin', '--lower', '@OUTDIR'] +) + +lib_source = [ + 'src/cosmic/src/hrdiag_remnant.f', + 'src/cosmic/src/assign_remnant.f', + 'src/cosmic/src/benchmarkevolv2.f', + 'src/cosmic/src/corerd.f', + 'src/cosmic/src/comenv.f', + 'src/cosmic/src/dgcore.f', + 'src/cosmic/src/evolv2.f', + 'src/cosmic/src/gntage.f', + 'src/cosmic/src/instar.f', + 'src/cosmic/src/kick.f', + 'src/cosmic/src/mix.f', + 'src/cosmic/src/mrenv.f', + 'src/cosmic/src/ran3.f', + 'src/cosmic/src/rl.f', + 'src/cosmic/src/concatkstars.f', + 'src/cosmic/src/comprad.f', + 'src/cosmic/src/bpp_array.f', + 'src/cosmic/src/checkstate.f', + 'src/cosmic/src/deltat.f', + 'src/cosmic/src/mlwind.f', + 'src/cosmic/src/hrdiag.f', + 'src/cosmic/src/star.f', + 'src/cosmic/src/zcnsts.f', + 'src/cosmic/src/SSE/SSE_deltat.f', + 'src/cosmic/src/SSE/SSE_mlwind.f', + 'src/cosmic/src/SSE/SSE_hrdiag.f', + 'src/cosmic/src/SSE/SSE_star.f', + 'src/cosmic/src/SSE/SSE_zcnsts.f', + 'src/cosmic/src/SSE/SSE_zfuncs.f', + 'src/cosmic/src/SSE/SSE_gntage.f', + 'src/cosmic/src/METISSE/src/METISSE_gntage.f90', + 'src/cosmic/src/METISSE/src/METISSE_deltat.f90', + 'src/cosmic/src/METISSE/src/METISSE_mlwind.f90', + 'src/cosmic/src/METISSE/src/METISSE_hrdiag.f90', + 'src/cosmic/src/METISSE/src/METISSE_star.f90', + 'src/cosmic/src/METISSE/src/METISSE_zcnsts.f90', + 'src/cosmic/src/METISSE/src/track_support.f90', + 'src/cosmic/src/METISSE/src/z_support.f90', + 'src/cosmic/src/METISSE/src/sse_support.f90', + 'src/cosmic/src/METISSE/src/remnant_support.f90', + 'src/cosmic/src/METISSE/src/interp_support.f90', + 'src/cosmic/src/METISSE/src/comenv_lambda.f90', + 'src/cosmic/src/METISSE/src/METISSE_miscellaneous.f90', + 'src/cosmic/src/assign_commons_COSMIC.f90'] + +# Detect operating system and set appropriate linker flags +host_system = host_machine.system() + +if host_system == 'darwin' + ldflags = ['-Wl,-no_compact_unwind'] +else + ldflags = [] # No special flags for other systems +endif + +evolvebin_module = py3.extension_module('_evolvebin', + f2py_source, + lib_source, + f2py_include_dir / 'fortranobject.c', + include_directories: inc_np, + link_args: ldflags, + install : true, + install_dir : py3.get_install_dir() / 'cosmic' +) + + +module_dirs = ['src/cosmic', 'src/cosmic/bse_utils', + 'src/cosmic/sample', 'src/cosmic/tests'] + +# Install modules +foreach mod_dir: module_dirs + install_subdir(mod_dir, + install_dir: py3.get_install_dir()) +endforeach + + +python_script = 'bin/cosmic-pop' +install_data(python_script, install_dir: get_option('bindir')) diff --git a/src/cosmic/evolve.py b/src/cosmic/evolve.py index 1ab8680fa..14fce405f 100644 --- a/src/cosmic/evolve.py +++ b/src/cosmic/evolve.py @@ -107,7 +107,7 @@ else: INITIAL_BINARY_TABLE_SAVE_COLUMNS = INITIAL_CONDITIONS_PASS_COLUMNS.copy() -for col in ['natal_kick_array', 'qcrit_array', 'fprimc_array']: +for col in ['natal_kick_array', 'qcrit_array', 'fprimc_array', 'alpha1', 'acc_lim']: INITIAL_BINARY_TABLE_SAVE_COLUMNS.remove(col) NATAL_KICK_COLUMNS = ['natal_kick', @@ -123,10 +123,14 @@ QCRIT_COLUMNS = ['qcrit_{0}'.format(kstar) for kstar in range(0, 16)] FPRIMC_COLUMNS = ['fprimc_{0}'.format(kstar) for kstar in range(0, 16)] +ALPHA_COLUMNS = ['alpha1_{0}'.format(star) for star in range(0, 2)] +ACCLIM_COLUMNS = ['acc_lim_{0}'.format(star) for star in range(0, 2)] INITIAL_BINARY_TABLE_SAVE_COLUMNS.extend(FLATTENED_NATAL_KICK_COLUMNS) INITIAL_BINARY_TABLE_SAVE_COLUMNS.extend(QCRIT_COLUMNS) INITIAL_BINARY_TABLE_SAVE_COLUMNS.extend(FPRIMC_COLUMNS) +INITIAL_BINARY_TABLE_SAVE_COLUMNS.extend(ALPHA_COLUMNS) +INITIAL_BINARY_TABLE_SAVE_COLUMNS.extend(ACCLIM_COLUMNS) # BSE doesn't need the binary fraction, so just add to columns for saving INITIAL_BINARY_TABLE_SAVE_COLUMNS.insert(7, 'binfrac') @@ -242,11 +246,11 @@ def evolve(cls, initialbinarytable, pool=None, **kwargs): # in order to verify that the values in the table # are valid utils.error_check(BSEDict, SSEDict) - + # check the initial conditions of the system and warn user if # anything is weird about them, such as the star starts # in Roche Lobe overflow - utils.check_initial_conditions(initialbinarytable,SSEDict) + utils.check_initial_conditions(initialbinarytable) # assign some columns based on keyword arguments but that # can be overwritten by the params or BSEDict @@ -257,15 +261,24 @@ def evolve(cls, initialbinarytable, pool=None, **kwargs): initialbinarytable = initialbinarytable.assign(randomseed=kwargs.pop('randomseed', seed)) if 'bin_num' not in initialbinarytable.keys(): initialbinarytable = initialbinarytable.assign(bin_num=np.arange(idx, idx + len(initialbinarytable))) - - for k, v in SSEDict.items(): - if k in initialbinarytable.keys(): - warnings.warn("The value for {0} in initial binary table is being " - "overwritten by the value of {0} from either the params " - "file or the SSEDict.".format(k)) - # assigning values this way work for most of the parameters. - kwargs1 = {k: v} - initialbinarytable = initialbinarytable.assign(**kwargs1) + + if SSEDict: + if SSEDict['stellar_engine'] == 'metisse': + for k, v in SSEDict.items(): + if k in initialbinarytable.keys(): + warnings.warn("The value for {0} in initial binary table is being " + "overwritten by the value of {0} from either the params " + "file or the SSEDict.".format(k)) + # assigning values this way work for most of the parameters.: + + kwargs1 = {k: v} + initialbinarytable = initialbinarytable.assign(**kwargs1) + elif SSEDict['stellar_engine'] == 'sse': + kwargs1 = {'stellar_engine': 'sse'} + initialbinarytable = initialbinarytable.assign(**kwargs1) + for col in ['path_to_tracks', 'path_to_he_tracks']: + kwargs1 = {col: ''} + initialbinarytable = initialbinarytable.assign(**kwargs1) for k, v in BSEDict.items(): if k in initialbinarytable.keys(): @@ -299,6 +312,22 @@ def evolve(cls, initialbinarytable, pool=None, **kwargs): index=initialbinarytable.index, name='fprimc_{0}'.format(kstar)) initialbinarytable.loc[:, 'fprimc_{0}'.format(kstar)] = columns_values + elif k == 'alpha1': + columns_values = [BSEDict['alpha1']] * len(initialbinarytable) + initialbinarytable = initialbinarytable.assign(alpha1=columns_values) + for kstar in range(0, 2): + columns_values = pd.Series([BSEDict['alpha1'][kstar]] * len(initialbinarytable), + index=initialbinarytable.index, + name='alpha1_{0}'.format(kstar)) + initialbinarytable.loc[:, 'alpha1_{0}'.format(kstar)] = columns_values + elif k == 'acc_lim': + columns_values = [BSEDict['acc_lim']] * len(initialbinarytable) + initialbinarytable = initialbinarytable.assign(acc_lim=columns_values) + for kstar in range(0,2): + columns_values = pd.Series([BSEDict['acc_lim'][kstar]] * len(initialbinarytable), + index=initialbinarytable.index, + name='acc_lim_{0}'.format(kstar)) + initialbinarytable.loc[:, 'acc_lim_{0}'.format(kstar)] = columns_values else: # assigning values this way work for most of the parameters. kwargs1 = {k: v} @@ -309,7 +338,7 @@ def evolve(cls, initialbinarytable, pool=None, **kwargs): # and either a dictionary or an inifile was not provided # then we need to raise an ValueError and tell the user to provide # either a dictionary or an inifile or add more columns - if not BSEDict: + if BSEDict and SSEDict is None: if ((not set(INITIAL_BINARY_TABLE_SAVE_COLUMNS).issubset(initialbinarytable.columns)) and (not set(INITIAL_CONDITIONS_PASS_COLUMNS).issubset(initialbinarytable.columns))): raise ValueError("You are passing BSE parameters as columns in the " @@ -317,6 +346,11 @@ def evolve(cls, initialbinarytable, pool=None, **kwargs): "Please pass a BSEDict or a params file or make sure " "you have all BSE parameters as columns {0} or {1}.".format( INITIAL_BINARY_TABLE_SAVE_COLUMNS, INITIAL_CONDITIONS_PASS_COLUMNS)) + + if (BSEDict and not SSEDict) or (SSEDict and not BSEDict): + raise ValueError("If you are passing BSE parameters as columns in the " + "initial binary table you must also pass SSE parameters " + "in the initial binary table.") # If you did not supply the natal kick or qcrit_array or fprimc_array in the BSEdict then we construct # it from the initial conditions table @@ -333,6 +367,13 @@ def evolve(cls, initialbinarytable, pool=None, **kwargs): if (pd.Series(FPRIMC_COLUMNS).isin(initialbinarytable.keys()).all()) and ('fprimc_array' not in BSEDict): initialbinarytable = initialbinarytable.assign(fprimc_array=initialbinarytable[FPRIMC_COLUMNS].values.tolist()) + if (pd.Series(ALPHA_COLUMNS).isin(initialbinarytable.keys()).all()) and ('alpha1' not in BSEDict): + initialbinarytable = initialbinarytable.assign(alpha1=initialbinarytable[ALPHA_COLUMNS].values.tolist()) + + if (pd.Series(ACCLIM_COLUMNS).isin(initialbinarytable.keys()).all()) and ('acc_lim' not in BSEDict): + initialbinarytable = initialbinarytable.assign(acc_lim=initialbinarytable[ACCLIM_COLUMNS].values.tolist()) + + # need to ensure that the order of parameters that we pass to BSE # is correct initial_conditions = initialbinarytable[INITIAL_CONDITIONS_PASS_COLUMNS].to_dict('records') diff --git a/src/cosmic/sample/sampler/independent.py b/src/cosmic/sample/sampler/independent.py index d497690d5..08f19fb31 100644 --- a/src/cosmic/sample/sampler/independent.py +++ b/src/cosmic/sample/sampler/independent.py @@ -123,6 +123,9 @@ def get_independent_sampler( met : `float` Sets the metallicity of the binary population where solar metallicity is zsun + SSEDict: `Dict` + Sets the engine to use for individual stellar evolution + size : `int` Size of the population to sample @@ -287,8 +290,8 @@ def get_independent_sampler( zsun = kwargs.pop("zsun", 0.02) - rad1 = initconditions.set_reff(SSEDict, mass1_binary, metallicity=met, zsun=zsun) - rad2 = initconditions.set_reff(SSEDict, mass2_binary, metallicity=met, zsun=zsun) + rad1 = initconditions.set_reff(mass1_binary, metallicity=met, zsun=zsun, SSEDict=SSEDict) + rad2 = initconditions.set_reff(mass2_binary, metallicity=met, zsun=zsun, SSEDict=SSEDict) # sample periods and eccentricities # if the porb_model is moe19, the metallicity needs to be supplied @@ -1075,7 +1078,7 @@ def set_kstar(self, mass): return kstar - def set_reff(self, SSEDict ,mass, metallicity, zsun=0.02): + def set_reff(self ,mass, metallicity, zsun=0.02, SSEDict=None): """ Better way to set the radii from BSE, by calling it directly diff --git a/src/cosmic/src/benchmarkevolv2.f b/src/cosmic/src/benchmarkevolv2.f index 8bc11ab38..f2a56d4d8 100644 --- a/src/cosmic/src/benchmarkevolv2.f +++ b/src/cosmic/src/benchmarkevolv2.f @@ -15,8 +15,12 @@ PROGRAM benchmarkevolv2 REAL*8 tphys REAL*8 kick_info_out(2,17) INTEGER bpp_index_out,bcm_index_out + CHARACTER*256 path_to_tracks,path_to_he_tracks - + using_METISSE = .false. + using_SSE = .true. + path_to_tracks = '' + path_to_he_tracks = '' kstar(1) = 0.0; kstar(2) = 0.0 mass(1) = 0.5 mass(2) = 0.5 @@ -97,6 +101,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -180,6 +185,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -263,6 +269,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -346,6 +353,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -429,6 +437,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -512,6 +521,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -595,6 +605,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -678,6 +689,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -761,6 +773,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -844,6 +857,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -927,6 +941,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1010,6 +1025,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1093,6 +1109,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1176,6 +1193,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1259,6 +1277,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1342,6 +1361,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1425,6 +1445,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1508,6 +1529,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1591,6 +1613,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1674,6 +1697,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1757,6 +1781,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1840,6 +1865,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1923,6 +1949,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2006,6 +2033,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2089,6 +2117,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2172,6 +2201,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2255,6 +2285,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2338,6 +2369,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2421,6 +2453,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2504,6 +2537,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2587,6 +2621,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2670,6 +2705,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2753,6 +2789,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2836,6 +2873,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2919,6 +2957,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3002,6 +3041,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3085,6 +3125,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3168,6 +3209,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3251,6 +3293,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3334,6 +3377,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3417,6 +3461,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3500,6 +3545,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3583,6 +3629,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3666,6 +3713,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3749,6 +3797,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3832,6 +3881,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3915,6 +3965,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3998,6 +4049,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4081,6 +4133,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4164,6 +4217,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4247,6 +4301,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4330,6 +4385,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4413,6 +4469,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4496,6 +4553,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4579,6 +4637,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4662,6 +4721,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4745,6 +4805,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4828,6 +4889,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4911,6 +4973,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4994,6 +5057,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5077,6 +5141,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5160,6 +5225,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5243,6 +5309,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5326,6 +5393,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5409,6 +5477,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5492,6 +5561,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5575,6 +5645,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5658,6 +5729,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5741,6 +5813,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5824,6 +5897,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5907,6 +5981,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5990,6 +6065,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6073,6 +6149,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6156,6 +6233,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6239,6 +6317,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6322,6 +6401,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6405,6 +6485,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6488,6 +6569,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6571,6 +6653,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6654,6 +6737,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6737,6 +6821,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6820,6 +6905,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6903,6 +6989,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6986,6 +7073,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7069,6 +7157,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7152,6 +7241,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7235,6 +7325,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7318,6 +7409,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7401,6 +7493,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7484,6 +7577,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7567,6 +7661,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7650,6 +7745,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7733,6 +7829,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7816,6 +7913,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7899,6 +7997,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7982,6 +8081,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8065,6 +8165,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8148,6 +8249,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8231,6 +8333,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8314,6 +8417,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8397,6 +8501,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8480,6 +8585,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8563,6 +8669,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8646,6 +8753,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8729,6 +8837,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8812,6 +8921,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8895,6 +9005,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8978,6 +9089,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9061,6 +9173,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9144,6 +9257,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9227,6 +9341,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9310,6 +9425,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9393,6 +9509,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9476,6 +9593,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9559,6 +9677,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9642,6 +9761,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9725,6 +9845,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9808,6 +9929,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9891,6 +10013,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9974,6 +10097,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10057,6 +10181,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10140,6 +10265,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10223,6 +10349,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10306,6 +10433,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10389,6 +10517,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10472,6 +10601,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10555,6 +10685,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10638,6 +10769,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10721,6 +10853,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10804,6 +10937,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10887,6 +11021,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10970,6 +11105,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11053,6 +11189,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11136,6 +11273,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11219,6 +11357,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11302,6 +11441,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11385,6 +11525,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11468,6 +11609,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11551,6 +11693,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11634,6 +11777,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11717,6 +11861,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11800,6 +11945,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11883,6 +12029,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11966,6 +12113,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12049,6 +12197,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12132,6 +12281,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12215,6 +12365,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12298,6 +12449,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12381,6 +12533,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12464,6 +12617,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12547,6 +12701,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12630,6 +12785,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12713,6 +12869,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12796,6 +12953,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12879,6 +13037,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12962,6 +13121,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13045,6 +13205,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13128,6 +13289,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13211,6 +13373,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13294,6 +13457,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13377,6 +13541,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13460,6 +13625,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13543,6 +13709,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13626,6 +13793,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13709,6 +13877,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13792,6 +13961,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13875,6 +14045,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13958,6 +14129,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14041,6 +14213,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14124,6 +14297,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14207,6 +14381,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14290,6 +14465,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14373,6 +14549,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14456,6 +14633,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14539,6 +14717,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14622,6 +14801,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14705,6 +14885,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14788,6 +14969,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14871,6 +15053,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14954,6 +15137,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15037,6 +15221,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15120,6 +15305,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15203,6 +15389,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15286,6 +15473,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15369,6 +15557,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15452,6 +15641,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15535,6 +15725,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15618,6 +15809,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15701,6 +15893,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15784,6 +15977,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15867,6 +16061,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15950,6 +16145,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16033,6 +16229,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16116,6 +16313,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16199,6 +16397,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16282,6 +16481,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16365,6 +16565,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16448,6 +16649,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16531,6 +16733,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16614,6 +16817,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16697,6 +16901,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16780,6 +16985,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16863,6 +17069,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16946,6 +17153,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17029,6 +17237,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17112,6 +17321,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17195,6 +17405,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17278,6 +17489,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17361,6 +17573,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17444,6 +17657,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17527,6 +17741,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17610,6 +17825,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17693,6 +17909,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17776,6 +17993,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17859,6 +18077,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17942,6 +18161,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18025,6 +18245,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18108,6 +18329,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18191,6 +18413,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18274,6 +18497,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18357,6 +18581,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18440,6 +18665,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18523,6 +18749,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18606,6 +18833,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18689,6 +18917,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18772,6 +19001,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18855,6 +19085,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18938,6 +19169,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19021,6 +19253,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19104,6 +19337,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19187,6 +19421,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19270,6 +19505,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19353,6 +19589,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19436,6 +19673,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19519,6 +19757,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19602,6 +19841,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19685,6 +19925,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19768,6 +20009,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19851,6 +20093,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19934,6 +20177,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -20017,6 +20261,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -20100,6 +20345,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -20183,6 +20429,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -20266,6 +20513,7 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, + & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) END PROGRAM benchmarkevolv2 diff --git a/src/cosmic/src/comenv.f b/src/cosmic/src/comenv.f index 35e965428..b179f40c3 100644 --- a/src/cosmic/src/comenv.f +++ b/src/cosmic/src/comenv.f @@ -59,6 +59,7 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, REAL*8 KW1_TEMP, KW2_TEMP REAL*8 rad(2),tms(2),lumin(2),B_0(2),bacc(2),tacc(2),epoch(2) REAL*8 menv_bpp(2),renv_bpp(2) + REAL*8 ALPHA_CE * * Initialize * @@ -144,7 +145,12 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, * * Calculate the final orbital energy without coalescence. * - EORBF = EORBI + EBINDI/ALPHA1 + IF(switchedCE)THEN + ALPHA_CE = ALPHA1(2) + ELSE + ALPHA_CE = ALPHA1(1) + ENDIF + EORBF = EORBI + EBINDI/ALPHA_CE * * If the secondary is on the main sequence see if it fills its Roche lobe. * @@ -195,7 +201,12 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, * Coalescence - calculate final binding energy. * EORBF = MAX(MC1*M2/(2.D0*SEPL),EORBI) - EBINDF = EBINDI - ALPHA1*(EORBF - EORBI) + IF(switchedCE)THEN + ALPHA_CE = ALPHA1(2) + ELSE + ALPHA_CE = ALPHA1(1) + ENDIF + EBINDF = EBINDI - ALPHA_CE*(EORBF - EORBI) KW1_TEMP = KW KW2_TEMP = 15 ELSE @@ -423,7 +434,12 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, * Calculate the final envelope binding energy. * EORBF = MAX(MC1*MC2/(2.D0*SEPL),EORBI) - EBINDF = EBINDI - ALPHA1*(EORBF - EORBI) + IF(switchedCE)THEN + ALPHA_CE = ALPHA1(2) + ELSE + ALPHA_CE = ALPHA1(1) + ENDIF + EBINDF = EBINDI - ALPHA_CE*(EORBF - EORBI) if(output) write(*,*)'In dg or giant 1:',M01,M1,R1,M02,M2, & R2,MC1,MC2,MC3,KW1,KW2,KW,EORBF,EBINDF * diff --git a/src/cosmic/src/const_bse.h b/src/cosmic/src/const_bse.h index 3d16c6c9c..f1f1a221c 100644 --- a/src/cosmic/src/const_bse.h +++ b/src/cosmic/src/const_bse.h @@ -15,7 +15,7 @@ & qcflag,eddlimflag,bhspinflag,aic,rejuvflag, & htpmb,ST_cr,ST_tide,bdecayfac,grflag, & bhms_coll_flag,wd_mass_lim,rtmsflag - REAL*8 don_lim,acc_lim,Mbh_initial + REAL*8 don_lim,acc_lim(2),Mbh_initial COMMON /MTVARS/ don_lim,acc_lim,Mbh_initial INTEGER ceflag,cekickflag,cemergeflag,cehestarflag,ussn COMMON /CEFLAGS/ ceflag,cekickflag,cemergeflag,cehestarflag,ussn @@ -28,7 +28,7 @@ REAL*8 eddfac,gamma COMMON /WINDVARS/ neta,bwind,hewind,beta,xi,acc2,epsnov, & eddfac,gamma - REAL*8 alpha1,lambdaf + REAL*8 alpha1(2),lambdaf REAL*8 qcrit_array(16) COMMON /CEVARS/ qcrit_array,alpha1,lambdaf REAL*8 bconst,CK diff --git a/src/cosmic/src/evolv2.f b/src/cosmic/src/evolv2.f index 5578dee36..4fcf647ec 100644 --- a/src/cosmic/src/evolv2.f +++ b/src/cosmic/src/evolv2.f @@ -2791,12 +2791,12 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, if(kstar(j2).le.2.or.kstar(j2).eq.4)then - if(acc_lim.eq.-1.or.acc_lim.eq.-3)then + if(acc_lim(j2).eq.-1.or.acc_lim(j2).eq.-3)then dm2 = MIN(1.d0,10.d0*taum/tkh(j2))*dm1 - elseif(acc_lim.eq.-2.or.acc_lim.eq.-4)then + elseif(acc_lim(j2).eq.-2.or.acc_lim(j2).eq.-4)then dm2 = MIN(1.d0,taum/tkh(j2))*dm1 - elseif(acc_lim.ge.0.d0)then - dm2 = acc_lim*dm1 + elseif(acc_lim(j2).ge.0.d0)then + dm2 = acc_lim(j2)*dm1 endif elseif(kstar(j2).ge.7.and.kstar(j2).le.9)then * @@ -2804,18 +2804,18 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * or SAGB star unless the primary is also a helium star. * if(kstar(j1).ge.7)then - if(acc_lim.eq.-1.or.acc_lim.eq.-3)then + if(acc_lim(j2).eq.-1.or.acc_lim(j2).eq.-3)then dm2 = MIN(1.d0,10.d0*taum/tkh(j2))*dm1 - elseif(acc_lim.eq.-2.or.acc_lim.eq.-4)then + elseif(acc_lim(j2).eq.-2.or.acc_lim(j2).eq.-4)then dm2 = MIN(1.d0,taum/tkh(j2))*dm1 - elseif(acc_lim.ge.0.d0)then - dm2 = acc_lim*dm1 + elseif(acc_lim(j2).ge.0.d0)then + dm2 = acc_lim(j2)*dm1 endif else - if(acc_lim.lt.0.d0)then + if(acc_lim(j2).lt.0.d0)then dm2 = dm1 - elseif(acc_lim.ge.0.d0)then - dm2 = acc_lim*dm1 + elseif(acc_lim(j2).ge.0.d0)then + dm2 = acc_lim(j2)*dm1 endif dmchk = dm2 - 1.05d0*dms(j2) if(dmchk.gt.0.d0.and.dm2/mass(j2).gt.1.0d-04)then @@ -2842,32 +2842,32 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * Accrete until a nova explosion blows away most of the accreted material. * novae = .true. - if(acc_lim.lt.0.d0)then + if(acc_lim(j2).lt.0.d0)then dm2 = MIN(dm1,dme) if(dm2.lt.dm1) supedd = .true. - elseif(acc_lim.ge.0.d0)then - dm2 = MIN(dm2,acc_lim*dm1) - if(dm2.lt.acc_lim*dm1) supedd = .true. + elseif(acc_lim(j2).ge.0.d0)then + dm2 = MIN(dm2,acc_lim(j2)*dm1) + if(dm2.lt.acc_lim(j2)*dm1) supedd = .true. endif dm22 = epsnov*dm2 else * * Steady burning at the surface * - if(acc_lim.lt.0.d0)then + if(acc_lim(j2).lt.0.d0)then dm2 = dm1 - elseif(acc_lim.ge.0.d0)then - dm2 = acc_lim*dm1 + elseif(acc_lim(j2).ge.0.d0)then + dm2 = acc_lim(j2)*dm1 endif endif else * * Make a new giant envelope. * - if(acc_lim.lt.0.d0)then + if(acc_lim(j2).lt.0.d0)then dm2 = dm1 - elseif(acc_lim.ge.0.d0)then - dm2 = MIN(dm2,acc_lim*dm1) + elseif(acc_lim(j2).ge.0.d0)then + dm2 = MIN(dm2,acc_lim(j2)*dm1) endif * * Check for planets or low-mass WDs. @@ -2888,14 +2888,14 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, elseif(kstar(j2).eq.3.or.kstar(j2).eq.5.or.kstar(j2).eq.6)then * We have a giant w/ kstar(j2) = 3,5,6 * - if(acc_lim.eq.-1.or.acc_lim.eq.-2)then + if(acc_lim(j2).eq.-1.or.acc_lim(j2).eq.-2)then dm2 = dm1 - elseif(acc_lim.eq.-3)then + elseif(acc_lim(j2).eq.-3)then dm2 = MIN(1.d0,10*taum/tkh(j2))*dm1 - elseif(acc_lim.eq.-4)then + elseif(acc_lim(j2).eq.-4)then dm2 = MIN(1.d0,taum/tkh(j2))*dm1 - elseif(acc_lim.ge.0.d0)then - dm2 = MIN(dm2,acc_lim*dm1) + elseif(acc_lim(j2).ge.0.d0)then + dm2 = MIN(dm2,acc_lim(j2)*dm1) endif endif @@ -2904,7 +2904,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * Impose the Eddington limit. * if(kstar(j2).ge.10)then - if(acc_lim.lt.0.d0)then + if(acc_lim(j2).lt.0.d0)then * * If there is wind accretion the total amount of mass change is * dms(j2) = dmr(j2) - dmt(j2), where dmt(j2) is the accretion @@ -2918,20 +2918,20 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * if(supedd.eqv..true.) dm2 = 0.d0 if(dm2.lt.dm1) supedd = .true. - elseif(acc_lim.ge.0.d0)then + elseif(acc_lim(j2).ge.0.d0)then * * If there is wind accretion the total amount of mass change is * dms(j2) = dmr(j2) - dmt(j2), where dmt(j2) is the accretion * from the companion. We should limit to the Eddington limit minus * the amount of accretion that is already coming in from Winds * - dm2 = MIN(acc_lim*dm1,dme + dms(j2)) + dm2 = MIN(acc_lim(j2)*dm1,dme + dms(j2)) * * If we already hit supereddington wind accretion, don't add * any more mass through RLO * if(supedd.eqv..true.) dm2 = 0.d0 - if(dm2.lt.acc_lim*dm1) supedd = .true. + if(dm2.lt.acc_lim(j2)*dm1) supedd = .true. endif * diff --git a/src/cosmic/tests/data/Params.ini b/src/cosmic/tests/data/Params.ini index 712dfb8eb..09429f907 100644 --- a/src/cosmic/tests/data/Params.ini +++ b/src/cosmic/tests/data/Params.ini @@ -74,6 +74,29 @@ bcm_bpp_initCond_filter = False seed = 42 +[sse] + +; stellar_engine specifies which engine to use for individual single star +; evolution. There are two choices: metisse and sse where sse uses the +; 'Hurley' tracks fits to the Pols+1998 grid. All results run with COSMIC +; prior to version 3.5 are equivalent to using sse as the enine + +stellar_engine = 'sse' + +; path_to_tracks specifies the path to hydrogen rich stellar evolution tracks +; specified as EEPs (equivalent evolutionary points). If stellar_engine is not +; metisse, leave the path as an empty string + +path_to_tracks = '' + +; path_to_tracks specifies the path to helium-star stellar evolution tracks +; specified as EEPs (equivalent evolutionary points). If stellar_engine is not +; metisse, leave the path as an empty string + +path_to_he_tracks = '' + + + [bse] ;;;;;;;;;;;;;;;;;;;;;; @@ -154,8 +177,10 @@ acc2=1.5 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; alpha1 is the common-envelope efficiency parameter -; default=1.0 -alpha1 = 1.0 +; It is a list so we can specify a different ejection efficiencies +; for the primary and secondary +; default=[1.0, 1.0] +alpha1 = [1.0, 1.0] ; lambdaf is the binding energy factor for common envelope evolution ; lambdaf>0.0 uses variable lambda prescription written by Onno Pols @@ -366,7 +391,8 @@ don_lim = -1 ; acc_lim = -2: assumes the accretion is limited to tkh_acc for MS/CHeB ; acc_lim = -3: assumes the accretion is limited by 10*tkh_acc for all fusing stars ; acc_lim = -4: assumes the accretion is limited by tkh_for all fusing stars -acc_lim = -1 +; it is a list so we can specify different accretion limits for the primary and secondary +acc_lim = [-1, -1] ;;;;;;;;;;;;;;;;;;; ;;; TIDES FLAGS ;;; diff --git a/src/cosmic/tests/data/initial_conditions_for_testing.hdf5 b/src/cosmic/tests/data/initial_conditions_for_testing.hdf5 index dee882902e150fb725ed469f08fa07241184c832..50191f363f147320165f8f44253b7811fd60c895 100644 GIT binary patch delta 6782 zcmeHIO>7%g5Z)iJv+G*LQS8``o5U@maj25U$$?NrYqvzTk~WS^8^s}!y>T{ii0!!c zh9(lo&H+fos*N>E6_o=5BxrMKS3VG_Lb5nj;*xSg0;zC9f(y5DLFMhfeMxCV4~PRo z`>cKQX5P%anQz`3YdiG%w`Vs)EPvZoJMj+FctP79XMyKJ%?gDFZBhlITvYgK7_({k zfb-k#eJ{>|E3gA;djx*B2L)oJz|p3#qdkt5XC0t$zJ2XJ{(f`NbW7X^K@eVM){=14 z>4q)Nxvx!p6N@1HfI}6?YfyjJYwpg9uEqbFl6C9PV;K?tCJC zc?>Rw1}Ze=G5nkOqVsUoCs(m)1QRMY6dlu-cTIl9q@^jmpv`*IG>(Nt^w=Cus?SiQ zsY9qjJT>L_|+0QDs@m<-}4-D$FkwB*VHW%Gs2>l#)wgX0iMi zQC31yn=Xc_;raSE!@sg9Xnp*4hEQm{`k;O@o)-eoh@hsmK+(xV+PP!UKD2(AL=O*k zlbw|VK^+K*2#kRC!lVe+g#H6Zi*vd98%0d<6WS3O71 zsPC%@H8eu&zxUKEt8laOYEjaSnE0T&v5xoI0fl~B9UUDV)^j(eku$P7voWnIY`H9{ zB4T>YxG;%4NARfXpj2&I;|sdB9u!=ySYblb9??c;V#G&v^t^H39U}}U+jdn#t(l2 D4_Ygd delta 767 zcmYL{PiPZC7{zBcYxYl*y21R}Y)aA|Y+@BmM2Zz#nj#pAZ7PCPjk2LM3MwWdh>A3N zD&&&%fk%lq2?$*mWRD46daQc%p!KBS!DDWkWM;Pu%j|w{zW09fG2363EQdBTzFdj4 zPQDNdVXJe^hh0g>&&nb+X#!`B%R<|aSH=RmVR=W)gc^iBl&=lUiFx(*GW%T@F<#Nd zm9M`y(H8q5jc6mmRJo3xacM`HR9u?|dPj2V$5kd@QN4D%uH2w_Bu$4>Oe1b$3O#*J zk*>3HAHho83yg($;IHFMmNTOjQX-Germk2wS-p;_NCFp>r23B=eV|_U5Z%rObb03L zYVjf+B+IOebh)j|au{P-NqWpZ?m2_)Un2z1)9+!19ib415h)070*5j6$m@XL^Zpxc zSxGELWntSGe5s6_kiLIdZ$@P*qZUo612RroTI{>xh@1kw zZ~~9@X(>1wVis@pw8u*LE@!~{P0zcdbnLxEUzwsLJnGT8vwOlir)#%frUjzoPifZb z?oqrGv@v%$nGC^$(k<^2G$YK!#J#7dVfsva@k z%vavnfUrDk7bfZgsz+seer2DcJO7z?*ayXD3Yq~8X23x;AR{|?m!9bMnXM+psnSfG Q62?s_V{)%j3N`i4e^BPBeE=0 (you set it to '{1:0.2f}')".format( - flag, BSEDict[flag] + for f in BSEDict[flag]: + if f not in [-1, -2, -3, -4]: + if BSEDict[flag] < 0.0: + raise ValueError( + "'{0:s}' needs to be set to -1, -2, -3, -4 or be >=0 (you set it to '{1:0.2f}')".format( + flag, BSEDict[flag] + ) ) - ) flag = "wd_mass_lim" if flag in BSEDict.keys(): @@ -1602,13 +1604,13 @@ def error_check(BSEDict, SSEDict, filters=None, convergence=None, sampling=None) return -def check_initial_conditions(full_initial_binary_table, SSEDict): +def check_initial_conditions(full_initial_binary_table): """Checks initial conditions and reports warnings Only warning provided right now is if star begins in Roche lobe overflow """ - from cosmic import _evolvebin + #from cosmic import _evolvebin def rzamsf(m): """A function to evaluate Rzams @@ -1636,20 +1638,10 @@ def rzamsf(m): if np.all(mass2 == 0.0): return - elif (SSEDict["stellar_engine"] == "sse"): + else: rzams1 = rzamsf(mass1) rzams2 = rzamsf(mass2) -# TODO: the following section with METISSE is incomplete -# elif (SSEDict["stellar_engine"] == "metisse"): -# _evolvebin.se_flags.using_sse = False -# _evolvebin.se_flags.using_metisse = True -# path_to_tracks = SSEDict["path_to_tracks"] -# path_to_he_tracks = SSEDict["path_to_he_tracks"] - -# rzams1 = _evolvebin.compute_r(mass1,z,len(mass1),path_to_tracks,path_to_he_tracks) -# rzams1 = _evolvebin.compute_r(mass2,z,len(mass2),path_to_tracks,path_to_he_tracks) - # assume some time step in order to calculate sep yeardy = 365.24 aursun = 214.95 @@ -1864,7 +1856,7 @@ def _eval(node): convergence = dictionary["convergence"] sampling = dictionary["sampling"] - return BSEDict, SSEDict, seed_int, filters, convergence, sampling + return BSEDict, SSEDict, seed_int, filters, convergence, sampling class VariableKey(object): From 2ea2def4e16479091aae5e8c19cf91afe7c85b79 Mon Sep 17 00:00:00 2001 From: Poojan <34255053+poojanagrawal@users.noreply.github.com> Date: Thu, 6 Jun 2024 17:18:37 -0400 Subject: [PATCH 05/46] Stop statements (#632) * METISSE now returns error instead of stopping the code * added back meson.build and .gitignore * updated metisse * removed print statement --- src/cosmic/evolve.py | 20 ++++++++++++-------- src/cosmic/src/METISSE | 2 +- src/cosmic/src/assign_commons_COSMIC.f90 | 17 +++++++++++++++-- src/cosmic/src/evolv2.f | 19 +++++++++++++++++-- src/cosmic/src/zcnsts.f | 6 ++++-- src/cosmic/utils.py | 3 ++- 6 files changed, 51 insertions(+), 16 deletions(-) diff --git a/src/cosmic/evolve.py b/src/cosmic/evolve.py index 14fce405f..6fade993b 100644 --- a/src/cosmic/evolve.py +++ b/src/cosmic/evolve.py @@ -553,14 +553,18 @@ def _evolve_single_system(f): f["kick_info"], path_to_tracks, path_to_he_tracks) - bcm = _evolvebin.binary.bcm[:bcm_index].copy() - bpp = _evolvebin.binary.bpp[:bpp_index].copy() - _evolvebin.binary.bpp[:bpp_index] = np.zeros(bpp.shape) - _evolvebin.binary.bcm[:bcm_index] = np.zeros(bcm.shape) - - bpp = np.hstack((bpp, np.ones((bpp.shape[0], 1))*f["bin_num"])) - bcm = np.hstack((bcm, np.ones((bcm.shape[0], 1))*f["bin_num"])) - kick_info = np.hstack((kick_info, np.ones((kick_info.shape[0], 1))*f["bin_num"])) + + if bpp_index<0: + raise ValueError("Failed in METISSE_zcnsts") + else: + bcm = _evolvebin.binary.bcm[:bcm_index].copy() + bpp = _evolvebin.binary.bpp[:bpp_index].copy() + _evolvebin.binary.bpp[:bpp_index] = np.zeros(bpp.shape) + _evolvebin.binary.bcm[:bcm_index] = np.zeros(bcm.shape) + + bpp = np.hstack((bpp, np.ones((bpp.shape[0], 1))*f["bin_num"])) + bcm = np.hstack((bcm, np.ones((bcm.shape[0], 1))*f["bin_num"])) + kick_info = np.hstack((kick_info, np.ones((kick_info.shape[0], 1))*f["bin_num"])) return f, bpp, bcm, kick_info, _evolvebin.snvars.natal_kick_array.copy() diff --git a/src/cosmic/src/METISSE b/src/cosmic/src/METISSE index e6798b953..d08997883 160000 --- a/src/cosmic/src/METISSE +++ b/src/cosmic/src/METISSE @@ -1 +1 @@ -Subproject commit e6798b953a8beda86e2ea640b94aeb051f55ffbc +Subproject commit d08997883d42e3b3f89f139f97c497cf2b9c1447 diff --git a/src/cosmic/src/assign_commons_COSMIC.f90 b/src/cosmic/src/assign_commons_COSMIC.f90 index 5d00046fa..cb3c33093 100644 --- a/src/cosmic/src/assign_commons_COSMIC.f90 +++ b/src/cosmic/src/assign_commons_COSMIC.f90 @@ -9,7 +9,6 @@ subroutine assign_commons() real(dp) :: d - if(front_end == COSMIC) then ! use inputs from COSMIC @@ -25,11 +24,25 @@ subroutine assign_commons() end subroutine subroutine get_bhspin(bhspin,id) - use track_support + use track_support, only: tarr,dp implicit none integer, intent(in) :: id real(dp), intent(out) :: bhspin bhspin = tarr(id)% pars% bhspin end subroutine + + subroutine check_error(err) + use track_support, only: code_error + integer, intent(out) :: err + err = 0 + if(code_error) err = 1 + end subroutine + + + subroutine assign_error() + use track_support, only: code_error + code_error = .true. + end subroutine + diff --git a/src/cosmic/src/evolv2.f b/src/cosmic/src/evolv2.f index 4fcf647ec..e6ef134a4 100644 --- a/src/cosmic/src/evolv2.f +++ b/src/cosmic/src/evolv2.f @@ -218,6 +218,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * REAL*8 qc_fixed LOGICAL switchedCE,disrupt + integer err Cf2py intent(in) kstar Cf2py intent(in) mass @@ -255,8 +256,6 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, endif if(using_METISSE) CALL initialize_front_end('cosmic') - if(using_METISSE) call allocate_track(2,mass0) - * * Save the initial state. * @@ -340,10 +339,20 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * * Set the collision matrix. * + err = 0 if(using_cmc.eq.0)then * for SSE path_to_tracks and path_to_he_tracks are empty ('') CALL zcnsts(z,zpars,path_to_tracks,path_to_he_tracks) + if(using_METISSE) then + call check_error(err) + if (err>0) then + bpp_index_out = -1 + return + endif + endif endif + + if(using_METISSE) call allocate_track(2,mass0) kmin = 1 kmax = 2 @@ -4405,6 +4414,10 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, evolve_type = 10.0 !added by PA for systems that stop evolving halfway if(iter.ge.loop) evolve_type = 100.0 + if (using_METISSE) then + call check_error(err) + if (err>0) evolve_type = 101.0 + end if rrl1 = rad(1)/rol(1) rrl2 = rad(2)/rol(2) teff1 = 1000.d0*((1130.d0*lumin(1)/ @@ -4537,6 +4550,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * CALL exit(0) * STOP endif + bcm(ip+1,1) = -1.0 bpp(jp+1,1) = -1.0 @@ -4546,6 +4560,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, kick_info_out = kick_info endif if (using_METISSE) call dealloc_track() + * END SUBROUTINE evolv2 diff --git a/src/cosmic/src/zcnsts.f b/src/cosmic/src/zcnsts.f index 40bd3af6b..aab51271a 100644 --- a/src/cosmic/src/zcnsts.f +++ b/src/cosmic/src/zcnsts.f @@ -4,11 +4,13 @@ SUBROUTINE zcnsts(z,zpars,path_to_tracks,path_to_he_tracks) real*8 z,zpars(20) CHARACTER*256 path_to_tracks,path_to_he_tracks - + integer :: ierr if (using_METISSE) then !WRITE(*,*) 'Calling METISSE_zcnsts',using_METISSE - CALL METISSE_zcnsts(z,zpars,path_to_tracks,path_to_he_tracks) + CALL METISSE_zcnsts(z,zpars,path_to_tracks, + & path_to_he_tracks,ierr) + if (ierr/=0) call assign_error() elseif (using_SSE) then !WRITE(*,*) 'Calling SSE_zcnsts' diff --git a/src/cosmic/utils.py b/src/cosmic/utils.py index 6db35a5b1..f44eaad86 100644 --- a/src/cosmic/utils.py +++ b/src/cosmic/utils.py @@ -1716,7 +1716,8 @@ def convert_kstar_evol_type(bpp): 14: "blue straggler", 15: "supernova of primary", 16: "supernova of secondary", - 100: "RLOF interpolation timeout error" + 100: "RLOF interpolation timeout error", + 101: "METISSE error" } evolve_type_string_to_int_dict = { From 6ebf8d8f0cf4eef8c964f57ed45d218685369736 Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Fri, 7 Jun 2024 09:57:31 -0400 Subject: [PATCH 06/46] fix pickle protocol (#633) --- .../data/initial_conditions_for_testing.hdf5 | Bin 1091848 -> 1104136 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/cosmic/tests/data/initial_conditions_for_testing.hdf5 b/src/cosmic/tests/data/initial_conditions_for_testing.hdf5 index 50191f363f147320165f8f44253b7811fd60c895..bf865ac2085c5b6e91cf728d18c1286b5de42277 100644 GIT binary patch delta 760 zcmZ9KJ#5oZ5P(k9F z*)WCrT zA4Qy$IbxaZg~J?97OmsPIAXL8?JpK!A}~8%FApt*lMP>l$J~oh^-RHoz?o42pESoy zYnd@vDR;*vF^QFs;>$h+9*IUYPTLA3qu1=}SEC(Th_uXU&=ryH#c=0$&)`bDrEj8M zPU21~xD~`(uhOuG>KUJStKy@X>ZLO+s%yYa5wiFD#Bp&SqE z$+HIkY}i58P3e9rc1&}cD8rjKW9|XAfbW?cR3mL<297VPP|$L!VqZ>o{6;Mm-#dx{ z2e%r>px)5fzP54#4pnB!F0?Ky>}F*kKp|C~2)k3rEjuA%2Nr7Q5>NjdlK9y%7vW$u z1>b7AJJl=+|Jz~PiA^r$Wm<}|^76|pbhS9;0xaT!{ZDQF#U6VZg<0mk`bcwCE-h`kisO)3owwLKyo%*a_M(l3{w;l$! g2tpAL!XsY9hX{y>NQfT^AY;fl5_}un3jO;12Y@@UC;$Ke delta 614 zcmZ9JJxC)#6vt;LSu>gFx<#_tB#`XcnAnL;uv$)#R7Vhms1a0L&Qfet6jT)Sx{I%| zxWZ@?u(-3)H<=_JH^Xl}{`=mW_uj4@^sHTf{h3mB${jZz z(4)URr}v|<7yS!4?|kEYslGPOCi_<(Gc}?RLYP=^=s3kVPXgz0nu$RN@1$+RFw7Ix z5DR?NJr680usCbUm{ntv6&v)oZ+}rpYc-x+KI7%W(((o7oEWSG?OHxRAR96%2^Gq5 zE?*{O!^9ixhZx;ZgN_!iWVuDWP;W-=!yJ)*ss;_H3un$xDPGtuQ1BQE&fAWFlVZ3`< z`jnCobiPF<{`(oMC_gV^^M>mAyKUdoI@Jv~Km9v}W$IvFS@57{-HX{t)wNSPZ4!R0 lu&h;9wTgmJ#DjPd6=_0z2t)h`M*>JQ(t>D*TBY^v{R0jhtBwEw From 18da43d65dab0d2894a852c2fbdee11728efcc52 Mon Sep 17 00:00:00 2001 From: Poojan <34255053+poojanagrawal@users.noreply.github.com> Date: Fri, 7 Jun 2024 10:11:11 -0400 Subject: [PATCH 07/46] added path validity checks for METISSE as stellar engine (#634) --- src/cosmic/utils.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/cosmic/utils.py b/src/cosmic/utils.py index f44eaad86..669c4a0c3 100644 --- a/src/cosmic/utils.py +++ b/src/cosmic/utils.py @@ -29,6 +29,7 @@ import json import itertools import os.path +import glob from configparser import ConfigParser from .bse_utils.zcnsts import zcnsts @@ -1101,6 +1102,40 @@ def error_check(BSEDict, SSEDict, filters=None, convergence=None, sampling=None) ) ) + flag = "path_to_tracks" + if SSEDict["stellar_engine"] == "metisse": + if SSEDict[flag] == '': + raise ValueError( + "If you want to use METISSE as the stellar engine, {0} needs to be a non-empty string".format ( + flag + ) + ) + else: + metallicity_file = glob.glob(SSEDict[flag]+'*_metallicity.in') + if metallicity_file == []: + raise ValueError( + "No metallicity file found in {0}. Make sure that {1} is valid".format ( + SSEDict[flag], flag + ) + ) + + flag = "path_to_he_tracks" + if SSEDict["stellar_engine"] == "metisse": + if SSEDict[flag] == '': + raise Warning( + "If you want to use METISSE as the stellar engine,{0} needs to be a non-empty string, otheriwse SSE formulae will be used for helium stars".format ( + flag + ) + ) + else: + metallicity_file = glob.glob(SSEDict[flag]+'*_metallicity.in') + if metallicity_file == []: + raise Warning( + "No metallicity file for helium star tracks found in {0}. Make sure that {1} is valid or SSE formulae will be used for helium stars".format ( + SSEDict[flag], flag + ) + ) + # BSEDict flag = "dtp" if flag in BSEDict.keys(): From f071e82904d14b99e42d122177b17285a375715b Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Fri, 7 Jun 2024 12:04:35 -0400 Subject: [PATCH 08/46] update utils call for when initC is passed directly and added SSEDict to docs (#635) --- docs/examples/index.rst | 75 ++++++++++++++++++++++++++--------------- docs/runpop/index.rst | 6 ++-- src/cosmic/plotting.py | 14 +++++--- src/cosmic/utils.py | 50 ++++++++++++++------------- 4 files changed, 87 insertions(+), 58 deletions(-) diff --git a/docs/examples/index.rst b/docs/examples/index.rst index d34ce949e..e4077d776 100644 --- a/docs/examples/index.rst +++ b/docs/examples/index.rst @@ -52,6 +52,13 @@ InitialBinaryTable class. Each initialized binary requires the following paramet In [4]: print(single_binary) +A stellar_engine or a method to evolve individual stars in the binary should be provided through another dictionary called SSEDict. Currently, either 'sse' or 'metisse' can be used as a stellar engine. Let's consider that we are using 'sse'. + +.. ipython:: + + In [5]: SSEDict = {'stellar_engine': 'sse'} + + The flags for the various binary evolution prescriptions used in BSE also need to be set. Each flag is saved in the BSEDict dictionary. Note that the BSEDict only needs to be specified the first time a binary is evolved with COSMIC or @@ -63,16 +70,15 @@ with `Breivik+2020 =1', 'dtp=0.0'], ['RRLO_2>=1', 'dtp=0.0']]) + In [16]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=single_binary, BSEDict=BSEDict, SSEDict=SSEDict, timestep_conditions =[['RRLO_1>=1', 'dtp=0.0'], ['RRLO_2>=1', 'dtp=0.0']]) In [16]: print(bcm[['tphys', 'kstar_1', 'kstar_2', 'mass_1', 'mass_2', 'RRLO_1', 'RRLO_2']]) @@ -264,7 +279,7 @@ Second, pick a certain resolution for the bcm array until the system mergers or .. ipython:: :okwarning: - In [16]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=single_binary, BSEDict=BSEDict, timestep_conditions =[['binstate=0', 'dtp=1.0']]) + In [16]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=single_binary, BSEDict=BSEDict, SSEDict=SSEDict, timestep_conditions =[['binstate=0', 'dtp=1.0']]) In [16]: print(bcm[['tphys', 'kstar_1', 'kstar_2', 'mass_1', 'mass_2', 'bin_state']]) @@ -275,9 +290,11 @@ Finally, we show how to print a fine resolution only during the HMXB stage of th In [3]: single_binary = InitialBinaryTable.InitialBinaries(m1=85.543645, m2=84.99784, porb=446.795757, ecc=0.448872, tphysf=13700.0, kstar1=1, kstar2=1, metallicity=0.002) - In [5]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': 1.0, 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 0, 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : -1, 'rtmsflag' : 0, 'wd_mass_lim': 1} + In [5]: SSEDict = {'stellar_engine': 'sse'} - In [6]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=single_binary, BSEDict=BSEDict, timestep_conditions =[['kstar_1=14', 'kstar_2<10','dtp=0.1'], ['kstar_2=14', 'kstar_1<10','dtp=0.1']]) + In [5]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': [1.0, 1.0], 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 0, 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : [-1, -1], 'rtmsflag' : 0, 'wd_mass_lim': 1} + + In [6]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=single_binary, BSEDict=BSEDict, SSEDict=SSEDict, timestep_conditions =[['kstar_1=14', 'kstar_2<10','dtp=0.1'], ['kstar_2=14', 'kstar_1<10','dtp=0.1']]) In [16]: print(bcm[['tphys', 'kstar_1', 'kstar_2', 'mass_1', 'mass_2', 'bin_state']]) @@ -294,14 +311,16 @@ started from the beginning and three different points in the evolution, once som :okwarning: In [16]: single_binary = InitialBinaryTable.InitialBinaries(m1=25.543645, m2=20.99784, porb=446.795757, ecc=0.448872, tphysf=13700.0, kstar1=1, kstar2=1, metallicity=0.002) + + In [16]: SSEDict = {'stellar_engine': 'sse'} - In [17]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': 1.0, 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'remnantflag': 3, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.5, 'ecsn_mlow' : 1.4, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 0, 'bdecayfac' : 1, 'randomseed' : -1235453, 'grflag' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 0, 'zsun' : 0.014, 'grflag' : 1, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : -1, 'rtmsflag' : 0, 'wd_mass_lim': 1} + In [17]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': [1.0,1.0], 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'remnantflag': 3, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.5, 'ecsn_mlow' : 1.4, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 0, 'bdecayfac' : 1, 'randomseed' : -1235453, 'grflag' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 0, 'zsun' : 0.014, 'grflag' : 1, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : [-1, -1], 'rtmsflag' : 0, 'wd_mass_lim': 1} In [18]: for i in [3, 7, 11]: - ....: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=single_binary, BSEDict=BSEDict) + ....: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=single_binary, BSEDict=BSEDict, SSEDict=SSEDict) ....: for column in bpp.columns: ....: initC = initC.assign(**{column:bpp.iloc[i][column]}) - ....: bpp_mid, bcm_mid, initC_mid, kick_info = Evolve.evolve(initialbinarytable=initC, BSEDict={}) + ....: bpp_mid, bcm_mid, initC_mid, kick_info = Evolve.evolve(initialbinarytable=initC, BSEDict={}, SSEDict={}) ....: if i == 3: ....: print("From beginning") ....: print(bpp) @@ -326,7 +345,7 @@ restart the evolution after the mass transfer would occur. We can do this by usi In [16]: single_binary = InitialBinaryTable.InitialBinaries(m1=65.0, m2=0.93, porb=4500, ecc=0.448872, ....: tphysf=13700.0, kstar1=1, kstar2=1, metallicity=0.014*0.6) - In [17]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=single_binary, BSEDict=BSEDict) + In [17]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=single_binary, BSEDict=BSEDict, SSEDict=SSEDict) In [18]: for column in bpp.columns: ....: initC = initC.assign(**{column:bpp.iloc[6][column]}) @@ -340,7 +359,7 @@ restart the evolution after the mass transfer would occur. We can do this by usi ....: initC['sep'] = utils.a_from_p(p=initC.porb.values, m1=initC.mass_1.values, m2=initC.mass_2.values) ....: initC['bin_num'] = np.linspace(0, 1000, 1000) - In [23]: bpp_restart, bcm_restart, initC_restart, kick_info_restart = Evolve.evolve(initialbinarytable=initC, BSEDict={}) + In [23]: bpp_restart, bcm_restart, initC_restart, kick_info_restart = Evolve.evolve(initialbinarytable=initC, BSEDict={}, SSEDict={}) In [23]: bpp_BH = bpp_restart.loc[(bpp_restart.kstar_1 == 14) & (bpp_restart.kstar_2 == 1) & (bpp_restart.porb > 0)].groupby('bin_num', as_index=False).first() diff --git a/docs/runpop/index.rst b/docs/runpop/index.rst index cdeffb99d..360502e0e 100644 --- a/docs/runpop/index.rst +++ b/docs/runpop/index.rst @@ -318,9 +318,11 @@ The syntax for the Evolve class is as follows: In [1]: from cosmic.evolve import Evolve - In [2]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': 1.0, 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 0, 'zsun' : 0.019, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : -1, 'rtmsflag' : 0, 'wd_mass_lim' : 1} + In [2]: SSEDict = {'stellar_engine' : 'sse'} - In [3]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=InitialBinaries, BSEDict=BSEDict) + In [2]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': [1.0, 1.0], 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 0, 'zsun' : 0.019, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : [-1, -1], 'rtmsflag' : 0, 'wd_mass_lim' : 1} + + In [3]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=InitialBinaries, BSEDict=BSEDict, SSEDict=SSEDict) In [4]: print(bcm.iloc[:10]) diff --git a/src/cosmic/plotting.py b/src/cosmic/plotting.py index 58ef4c712..c54eb0db0 100644 --- a/src/cosmic/plotting.py +++ b/src/cosmic/plotting.py @@ -52,7 +52,7 @@ secondary_color = "C1" -def evolve_binary(initC, t_min=None, t_max=None, BSEDict={}): +def evolve_binary(initC, t_min=None, t_max=None, BSEDict={}, SSEDict={}): """ Evolves a single binary with all timesteps written to the bcm array for plotting @@ -71,6 +71,9 @@ def evolve_binary(initC, t_min=None, t_max=None, BSEDict={}): BSEDict : `Dict` Dictionary containing all BSE flags needed + SSEDict : `Dict` + Dictionary containing all SSE flags needed + Returns ------- bcm : `pandas.DataFrame` @@ -100,7 +103,7 @@ def evolve_binary(initC, t_min=None, t_max=None, BSEDict={}): # Call evolution scripts bpp, bcm, initC, kick_info = Evolve.evolve( - initialbinarytable=initC, BSEDict=BSEDict + initialbinarytable=initC, BSEDict=BSEDict, SSEDict=SSEDict ) # In case minimum and maximum times are not supplied by user @@ -620,7 +623,7 @@ def plot_binary_evol(bcm, sys_obs={}, ktype_kwargs={}, t_min=None, t_max=None): return fig -def evolve_and_plot(initC, t_min=None, t_max=None, BSEDict=None, sys_obs={}): +def evolve_and_plot(initC, t_min=None, t_max=None, BSEDict=None, SSEDict=None, sys_obs={}): """ Evolve and plot binaries as a function of time @@ -638,6 +641,9 @@ def evolve_and_plot(initC, t_min=None, t_max=None, BSEDict=None, sys_obs={}): BSEDict : `Dict` Dictionary containing all BSE flags needed + SSEDict : `Dict` + Dictionary containing all SSE flags needed + sys_obs : `Dict` Dictionary containing keys for binary parameters with values to plot as vertical lines for each stellar component @@ -670,7 +676,7 @@ def evolve_and_plot(initC, t_min=None, t_max=None, BSEDict=None, sys_obs={}): # Evolve binary bcm = evolve_binary( - initC.iloc[i: i + 1], t_min=t_min_tmp, t_max=t_max_tmp, BSEDict=BSEDict + initC.iloc[i: i + 1], t_min=t_min_tmp, t_max=t_max_tmp, BSEDict=BSEDict, SSEDict=SSEDict ) # Plot binary diff --git a/src/cosmic/utils.py b/src/cosmic/utils.py index 669c4a0c3..6b9d1668e 100644 --- a/src/cosmic/utils.py +++ b/src/cosmic/utils.py @@ -1103,38 +1103,40 @@ def error_check(BSEDict, SSEDict, filters=None, convergence=None, sampling=None) ) flag = "path_to_tracks" - if SSEDict["stellar_engine"] == "metisse": - if SSEDict[flag] == '': - raise ValueError( - "If you want to use METISSE as the stellar engine, {0} needs to be a non-empty string".format ( - flag - ) - ) - else: - metallicity_file = glob.glob(SSEDict[flag]+'*_metallicity.in') - if metallicity_file == []: + if "stellar_engine" in SSEDict.keys(): + if SSEDict["stellar_engine"] == "metisse": + if SSEDict[flag] == '': raise ValueError( - "No metallicity file found in {0}. Make sure that {1} is valid".format ( - SSEDict[flag], flag + "If you want to use METISSE as the stellar engine, {0} needs to be a non-empty string".format ( + flag ) ) + else: + metallicity_file = glob.glob(SSEDict[flag]+'*_metallicity.in') + if metallicity_file == []: + raise ValueError( + "No metallicity file found in {0}. Make sure that {1} is valid".format ( + SSEDict[flag], flag + ) + ) flag = "path_to_he_tracks" - if SSEDict["stellar_engine"] == "metisse": - if SSEDict[flag] == '': - raise Warning( - "If you want to use METISSE as the stellar engine,{0} needs to be a non-empty string, otheriwse SSE formulae will be used for helium stars".format ( - flag - ) - ) - else: - metallicity_file = glob.glob(SSEDict[flag]+'*_metallicity.in') - if metallicity_file == []: + if "stellar_engine" in SSEDict.keys(): + if SSEDict["stellar_engine"] == "metisse": + if SSEDict[flag] == '': raise Warning( - "No metallicity file for helium star tracks found in {0}. Make sure that {1} is valid or SSE formulae will be used for helium stars".format ( - SSEDict[flag], flag + "If you want to use METISSE as the stellar engine,{0} needs to be a non-empty string, otheriwse SSE formulae will be used for helium stars".format ( + flag ) ) + else: + metallicity_file = glob.glob(SSEDict[flag]+'*_metallicity.in') + if metallicity_file == []: + raise Warning( + "No metallicity file for helium star tracks found in {0}. Make sure that {1} is valid or SSE formulae will be used for helium stars".format ( + SSEDict[flag], flag + ) + ) # BSEDict flag = "dtp" From c5ec59f739e02ff64b98cab109cd425d26dd50f6 Mon Sep 17 00:00:00 2001 From: Poojan <34255053+poojanagrawal@users.noreply.github.com> Date: Thu, 13 Jun 2024 15:06:43 -0400 Subject: [PATCH 09/46] warnings_fix (#636) * replaced warning command when path_he_tracks is not provided * fix tests for he tracks --------- Co-authored-by: Katie Breivik Co-authored-by: katiebreivik --- src/cosmic/utils.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/cosmic/utils.py b/src/cosmic/utils.py index 6b9d1668e..b1d9379a9 100644 --- a/src/cosmic/utils.py +++ b/src/cosmic/utils.py @@ -1124,17 +1124,25 @@ def error_check(BSEDict, SSEDict, filters=None, convergence=None, sampling=None) if "stellar_engine" in SSEDict.keys(): if SSEDict["stellar_engine"] == "metisse": if SSEDict[flag] == '': - raise Warning( + warnings.warn( "If you want to use METISSE as the stellar engine,{0} needs to be a non-empty string, otheriwse SSE formulae will be used for helium stars".format ( flag - ) ) + ) else: metallicity_file = glob.glob(SSEDict[flag]+'*_metallicity.in') if metallicity_file == []: - raise Warning( + warnings.warn( "No metallicity file for helium star tracks found in {0}. Make sure that {1} is valid or SSE formulae will be used for helium stars".format ( SSEDict[flag], flag + ) + ) + else: + metallicity_file = glob.glob(SSEDict[flag]+'*_metallicity.in') + if metallicity_file == []: + raise Warning( + "No metallicity file for helium star tracks found in {0}. Make sure that {1} is valid or SSE formulae will be used for helium stars".format ( + SSEDict[flag], flag ) ) From da86873d267e32e90953cc110bc9c2112c3504f6 Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Thu, 13 Jun 2024 14:13:15 -0500 Subject: [PATCH 10/46] submodule update (#637) --- src/cosmic/src/METISSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cosmic/src/METISSE b/src/cosmic/src/METISSE index d08997883..47bed3404 160000 --- a/src/cosmic/src/METISSE +++ b/src/cosmic/src/METISSE @@ -1 +1 @@ -Subproject commit d08997883d42e3b3f89f139f97c497cf2b9c1447 +Subproject commit 47bed3404952adf19b1d048b558b83489792b820 From a20d7b82bf019a5b7249458e0e15d03fda567507 Mon Sep 17 00:00:00 2001 From: Poojan <34255053+poojanagrawal@users.noreply.github.com> Date: Thu, 13 Jun 2024 22:55:25 -0400 Subject: [PATCH 11/46] fixed lum, r etc. of kw=15 stars for binary_type 9 (#638) --- src/cosmic/src/evolv2.f | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cosmic/src/evolv2.f b/src/cosmic/src/evolv2.f index e6ef134a4..2bccad47d 100644 --- a/src/cosmic/src/evolv2.f +++ b/src/cosmic/src/evolv2.f @@ -4258,10 +4258,18 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, kmax = 1 rol(2) = -1.d0*rad(2) dtmi(2) = tphysf + CALL hrdiag(mass0(2),aj(2),mass(2),tms(2),tn,tscls,lums,GB, + & zpars,rad(2),lumin(2),kstar(2),massc(2),radc(2), + & menv(2),renv(2),k2str(2),bhspin(2),2) + + elseif(kstar(1).eq.15)then kmin = 2 rol(1) = -1.d0*rad(1) dtmi(1) = tphysf + CALL hrdiag(mass0(1),aj(1),mass(1),tms(1),tn,tscls,lums,GB, + & zpars,rad(1),lumin(1),kstar(1),massc(1),radc(1), + & menv(1),renv(1),k2str(1),bhspin(1),1) endif * Makes sure coalesced NSs are reset. PK. if(kstar(1).eq.13.and.ecc.le.1.d0.and.pulsar.gt.0.and. From da3b92800d3e18bde99489a3e1b0bc719e4ec706 Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Fri, 14 Jun 2024 09:17:15 -0500 Subject: [PATCH 12/46] submodule update (#640) --- src/cosmic/src/METISSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cosmic/src/METISSE b/src/cosmic/src/METISSE index 47bed3404..a813af0e8 160000 --- a/src/cosmic/src/METISSE +++ b/src/cosmic/src/METISSE @@ -1 +1 @@ -Subproject commit 47bed3404952adf19b1d048b558b83489792b820 +Subproject commit a813af0e86fc32542b8e8ad7db3c12eb37b08c73 From e41c21fce28b3e95b6d932d4323f254df9a5a47d Mon Sep 17 00:00:00 2001 From: Poojan <34255053+poojanagrawal@users.noreply.github.com> Date: Mon, 24 Jun 2024 14:46:45 -0400 Subject: [PATCH 13/46] added rejuventaion flag for very low mass stars (#646) --- src/cosmic/src/evolv2.f | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cosmic/src/evolv2.f b/src/cosmic/src/evolv2.f index 2bccad47d..44d094dbf 100644 --- a/src/cosmic/src/evolv2.f +++ b/src/cosmic/src/evolv2.f @@ -2323,6 +2323,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, kst = kstar(j1) mass(j1) = mass(j2) + dm2 mass(j2) = 0.d0 + if (using_METISSE) call set_star_type(j1) else mass(j2) = mass(j2) + dm2 CALL gntage(massc(j2),mass(j2),kst,zpars, @@ -2884,6 +2885,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, if((kstar(j2).eq.10.and.mass(j2).lt.0.05d0).or. & (kstar(j2).ge.11.and.mass(j2).lt.0.5d0))then kst = kstar(j2) + if (using_METISSE) call set_star_type(j2) else kst = MIN(6,3*kstar(j2)-27) mt2 = mass(j2) + km*(dm2 - dms(j2)) From 908848b3bff467db1fb94c3825111d41a416790e Mon Sep 17 00:00:00 2001 From: katiebreivik Date: Wed, 17 Jul 2024 08:48:38 -0400 Subject: [PATCH 14/46] update METISSE --- src/cosmic/src/METISSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cosmic/src/METISSE b/src/cosmic/src/METISSE index a813af0e8..ad0555184 160000 --- a/src/cosmic/src/METISSE +++ b/src/cosmic/src/METISSE @@ -1 +1 @@ -Subproject commit a813af0e86fc32542b8e8ad7db3c12eb37b08c73 +Subproject commit ad055518484fefdbdae424224588deeacd9b0b95 From 6f7c7742ed6c53993f5dd08a1cd02236a6b3aede Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Wed, 17 Jul 2024 09:02:14 -0400 Subject: [PATCH 15/46] update METISSE (#649) From aff9097833fbe4356f161a7002831e064193454b Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Thu, 8 Aug 2024 14:36:51 -0400 Subject: [PATCH 16/46] bring METISSE-integrate level with develop (+ METISSE-integrate commits) (#657) * offner22 primary mass dependent binary fraction (#644) * added offner22 primary mass dependent binary fraction * pinning numpy version because of new numpy version released on june 16 (https://stackoverflow.com/questions/78634235/numpy-dtype-size-changed-may-indicate-binary-incompatibility-expected-96-from) * pinned numpy version so 3.7 works --------- Co-authored-by: katiebreivik * Update utils.py (#648) * Update utils.py fix trapezoid import * Update utils.py missed one trapz * version bump and dropping below python3.9 (#653) * version bump and dropping below python3.9 * forward to numpy 1.26.0 * trying a different version * fix trapz import * Update build_wheels_and_publish.yml explicitly install gcc * Update build_wheels_and_publish.yml trying to fix gfortran * Update build_wheels_and_publish.yml specifying path with symlink, checking path * Update build_wheels_and_publish.yml (#654) * Update build_wheels_and_publish.yml * Update _version.py * Update meson.build * Update pyproject.toml (#655) * Version bump for pip (#656) * Update meson.build * Update _version.py --------- Co-authored-by: MarkGM02 <90350113+MarkGM02@users.noreply.github.com> --- .../workflows/build_wheels_and_publish.yml | 26 ++++---- .github/workflows/python-package.yml | 2 +- bin/cosmic-pop | 2 +- meson.build | 2 +- pyproject.toml | 6 +- requirements.txt | 4 +- src/cosmic/_version.py | 2 +- src/cosmic/sample/sampler/cmc.py | 2 +- src/cosmic/sample/sampler/independent.py | 60 +++++++++++++++++-- src/cosmic/tests/test_sample.py | 17 ++++++ src/cosmic/utils.py | 10 ++-- 11 files changed, 100 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build_wheels_and_publish.yml b/.github/workflows/build_wheels_and_publish.yml index 7fb4ab4de..163ad71ad 100644 --- a/.github/workflows/build_wheels_and_publish.yml +++ b/.github/workflows/build_wheels_and_publish.yml @@ -7,10 +7,11 @@ on: env: - CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-*" + CIBW_BUILD: "cp39-* cp310-*" CIBW_SKIP: "*-win32 *musllinux*" CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 CIBW_BEFORE_BUILD: pip install numpy --config-settings=setup-args="-Dallow-noblas=true" + CIBW_BUILD_VERBOSITY: "1" jobs: build-wheels: @@ -27,15 +28,12 @@ jobs: - uses: actions/setup-python@v4 name: Install Python with: - python-version: "3.7" + python-version: "3.10" - name: Setup Mac if: runner.os == 'macOS' run: | python -m pip install numpy h5py versioneer - sudo ln -s /usr/local/bin/gfortran-11 /usr/local/bin/gfortran - sudo mkdir /usr/local/gfortran - sudo ln -s /usr/local/Cellar/gcc@9/9.3.0_1/lib/gcc/9 /usr/local/gfortran/lib - name: Setup Linux if: runner.os == 'Linux' @@ -44,8 +42,11 @@ jobs: - name: Build wheels run: | - python -m pip install cibuildwheel - python -m cibuildwheel --output-dir wheelhouse + sudo ln -s /opt/homebrew/bin/gfortran-11 /opt/homebrew/bin/gfortran || true + python -m pip install meson ninja build + meson setup build + meson compile -C build + python -m build --wheel --outdir wheelhouse - uses: actions/upload-artifact@v3 with: path: ./wheelhouse/*.whl @@ -60,16 +61,17 @@ jobs: - uses: actions/setup-python@v4 name: Install Python with: - python-version: "3.7" + python-version: "3.10" - name: Build dist run: | python -m pip install --upgrade pip - pip install setuptools wheel twine numpy - python setup.py sdist + pip install setuptools wheel twine numpy build meson ninja + pip install . + python -m build - uses: actions/upload-artifact@v3 with: - path: dist/*.tar.gz + path: ./dist/*.tar.gz publish: needs: [build-wheels, build-source-dist] @@ -78,7 +80,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: [3.8] + python-version: ["3.10"] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index aea4e83a1..c37898add 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.9', '3.10'] steps: - uses: actions/checkout@v2 diff --git a/bin/cosmic-pop b/bin/cosmic-pop index e131448c7..48d292121 100755 --- a/bin/cosmic-pop +++ b/bin/cosmic-pop @@ -101,7 +101,7 @@ def parse_commandline(): parser.add_argument("--binary_state", nargs='+', type=int) parser.add_argument("--sampling_method") parser.add_argument("--primary_model", help="Chooses the initial primary mass function from: salpeter55, kroupa93, kroupa01", type=str) - parser.add_argument("--binfrac_model", help="Chooses the binary fraction model from: a float between [0,1] and vanHaaften", type=float) + parser.add_argument("--binfrac_model", help="Chooses the binary fraction model from: a float between [0,1], vanHaaften, and offner22", type=float) parser.add_argument("--ecc_model", help="Chooses the initial eccentricity distribution model from: thermal, uniform, and sana12", type=str) parser.add_argument("--porb_model", help="Chooses the initial orbital period distribution model from: log_uniform and sana12", type=str) parser.add_argument("--SF_start", help="Sets the time in the past when star formation initiates in Myr", type=float) diff --git a/meson.build b/meson.build index 639eb2c78..3343dc198 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('cosmic', 'c', 'fortran', - version : '3.4.10', + version : '3.4.13', default_options: ['warning_level=0', 'optimization=3'], ) diff --git a/pyproject.toml b/pyproject.toml index 7dc97e0b6..07fca7b03 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] -name = "cosmic" -distname = "cosmic-popsynth" +name = "cosmic-popsynth" +distname = "cosmic" description = "a Python-interfaced binary population synthesis suite" authors = [ { name="Katelyn Breivik", email="katie.breivik@gmail.com" }, @@ -11,7 +11,7 @@ authors = [ readme = "README.md" -requires-python = ">=3.7" +requires-python = ">=3.9" license = { text = "MIT License" } classifiers = [ "Development Status :: 5 - Production/Stable", diff --git a/requirements.txt b/requirements.txt index 28fb97804..fd737f593 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,11 @@ scipy >= 0.12.1 -numpy >= 1.16 +numpy == 1.23.5 astropy >= 1.1.1 configparser tqdm >= 4.0 pandas >= 0.24 tables > 3.5.0 -h5py >= 1.3 +h5py >= 3.7.0 schwimmbad >= 0.3.1 matplotlib >= 2.0.0 sphinx >= 1.6.1 diff --git a/src/cosmic/_version.py b/src/cosmic/_version.py index 3a426aa1e..a9b631c0d 100644 --- a/src/cosmic/_version.py +++ b/src/cosmic/_version.py @@ -1 +1 @@ -__version__ = "3.4.10" +__version__ = "3.4.13" diff --git a/src/cosmic/sample/sampler/cmc.py b/src/cosmic/sample/sampler/cmc.py index bc50b85e9..49467df9c 100644 --- a/src/cosmic/sample/sampler/cmc.py +++ b/src/cosmic/sample/sampler/cmc.py @@ -83,7 +83,7 @@ def get_cmc_sampler( Sets the pairing of stars M>msort only with stars with M>msort binfrac_model : `str or float` - Model for binary fraction; choices include: vanHaaften or a fraction where 1.0 is 100% binaries + Model for binary fraction; choices include: vanHaaften, offner22, or a fraction where 1.0 is 100% binaries binfrac_model_msort : `str or float` Same as binfrac_model for M>msort diff --git a/src/cosmic/sample/sampler/independent.py b/src/cosmic/sample/sampler/independent.py index 08f19fb31..dc77cf8e0 100644 --- a/src/cosmic/sample/sampler/independent.py +++ b/src/cosmic/sample/sampler/independent.py @@ -115,7 +115,7 @@ def get_independent_sampler( Duration of constant star formation beginning from SF_Start in Myr binfrac_model : `str or float` - Model for binary fraction; choices include: vanHaaften or a fraction where 1.0 is 100% binaries + Model for binary fraction; choices include: vanHaaften, offner22, or a fraction where 1.0 is 100% binaries binfrac_model_msort : `str or float` Same as binfrac_model for M>msort @@ -607,6 +607,7 @@ def binary_select(self, primary_mass, binfrac_model=0.5, **kwargs): either a binary fraction specified by a float or a primary-mass dependent binary fraction following `van Haaften et al.(2009) `_ in appdx + or `Offner et al.(2022) `_ in fig 1 Parameters ---------- @@ -615,6 +616,9 @@ def binary_select(self, primary_mass, binfrac_model=0.5, **kwargs): binfrac_model : str or float vanHaaften - primary mass dependent and ONLY VALID up to 100 Msun + + offner22 - primary mass dependent + float - fraction of binaries; 0.5 means 2 in 3 stars are a binary pair while 1 means every star is in a binary pair @@ -656,13 +660,35 @@ def binary_select(self, primary_mass, binfrac_model=0.5, **kwargs): binary_choose_low = np.random.uniform( 0, 1.0, primary_mass[lowmassIdx].size) + (singleIdx_low,) = np.where( + binary_fraction_low < binary_choose_low) + (binaryIdx_low,) = np.where( + binary_fraction_low >= binary_choose_low) + elif binfrac_model == "offner22": + from scipy.interpolate import BSpline + t = [0.0331963853, 0.0331963853, 0.0331963853, 0.0331963853, 0.106066017, + 0.212132034, 0.424264069, 0.866025404, 1.03077641, 1.11803399, + 1.95959179, 3.87298335, 6.32455532, 11.6619038, 29.1547595, + 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 150, 150, 150, 150] + c = [0.08, 0.15812003, 0.20314101, 0.23842953, 0.33154153, 0.39131739, + 0.46020725, 0.59009569, 0.75306454, 0.81652502, 0.93518422, 0.92030594, + 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96] + k = 3 + def offner_curve(x): + a = -0.16465041 + b = -0.11616329 + return np.piecewise(x, [x < 6.4, x >= 6.4], [BSpline(t,c,k), lambda x : a * np.exp(b * x) + 0.97]) + binary_fraction_low = offner_curve(primary_mass[lowmassIdx]) + binary_choose_low = np.random.uniform( + 0, 1.0, primary_mass[lowmassIdx].size) + (singleIdx_low,) = np.where( binary_fraction_low < binary_choose_low) (binaryIdx_low,) = np.where( binary_fraction_low >= binary_choose_low) else: raise ValueError( - "You have supplied a non-supported binary fraction model. Please choose vanHaaften or a float" + "You have supplied a non-supported binary fraction model. Please choose vanHaaften, offner22, or a float" ) elif type(binfrac_model) == float: if (binfrac_model <= 1.0) & (binfrac_model >= 0.0): @@ -681,7 +707,7 @@ def binary_select(self, primary_mass, binfrac_model=0.5, **kwargs): ) else: raise ValueError( - "You have not supplied a model or a fraction. Please choose either vanHaaften or a float" + "You have not supplied a model or a fraction. Please choose either vanHaaften, offner22, or a float" ) # --- if using a different binary fraction for high-mass systems @@ -692,13 +718,35 @@ def binary_select(self, primary_mass, binfrac_model=0.5, **kwargs): binary_choose_high = np.random.uniform( 0, 1.0, primary_mass[highmassIdx].size) + (singleIdx_high,) = np.where( + binary_fraction_high < binary_choose_high) + (binaryIdx_high,) = np.where( + binary_fraction_high >= binary_choose_high) + elif binfrac_model_msort == "offner22": + from scipy.interpolate import BSpline + t = [0.0331963853, 0.0331963853, 0.0331963853, 0.0331963853, 0.106066017, + 0.212132034, 0.424264069, 0.866025404, 1.03077641, 1.11803399, + 1.95959179, 3.87298335, 6.32455532, 11.6619038, 29.1547595, + 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 150, 150, 150, 150] + c = [0.08, 0.15812003, 0.20314101, 0.23842953, 0.33154153, 0.39131739, + 0.46020725, 0.59009569, 0.75306454, 0.81652502, 0.93518422, 0.92030594, + 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96] + k = 3 + def offner_curve(x): + a = -0.16465041 + b = -0.11616329 + return np.piecewise(x, [x < 6.4, x >= 6.4], [BSpline(t,c,k), lambda x : a * np.exp(b * x) + 0.97]) + binary_fraction_high = offner_curve(primary_mass[highmassIdx]) + binary_choose_high = np.random.uniform( + 0, 1.0, primary_mass[highmassIdx].size) + (singleIdx_high,) = np.where( binary_fraction_high < binary_choose_high) (binaryIdx_high,) = np.where( binary_fraction_high >= binary_choose_high) else: raise ValueError( - "You have supplied a non-supported binary fraction model. Please choose vanHaaften or a float" + "You have supplied a non-supported binary fraction model. Please choose vanHaaften, offner22, or a float" ) elif (binfrac_model_msort is not None) and (type(binfrac_model_msort) == float): if (binfrac_model_msort <= 1.0) & (binfrac_model_msort >= 0.0): @@ -717,7 +765,7 @@ def binary_select(self, primary_mass, binfrac_model=0.5, **kwargs): ) elif (binfrac_model_msort is not None): raise ValueError( - "You have not supplied a model or a fraction. Please choose either vanHaaften or a float" + "You have not supplied a model or a fraction. Please choose either vanHaaften, offner22, or a float" ) @@ -909,7 +957,7 @@ def sample_porb(self, mass1, mass2, rad1, rad2, porb_model, porb_max=None, size= elif porb_model == "moe19": from scipy.interpolate import interp1d from scipy.stats import norm - from scipy.integrate import trapz + from scipy.integrate import trapezoid try: met = kwargs.pop('met') except: diff --git a/src/cosmic/tests/test_sample.py b/src/cosmic/tests/test_sample.py index 255932997..39675343e 100644 --- a/src/cosmic/tests/test_sample.py +++ b/src/cosmic/tests/test_sample.py @@ -42,6 +42,9 @@ N_BINARY_SELECT = 85 VANHAAFTEN_BINFRAC_MAX = 0.9989087986493874 VANHAAFTEN_BINFRAC_MIN = 0.6192803136799157 +OFFNER_MASS_RANGES = [(0.075,0.15), (0.15,0.30), (0.3,0.6), (0.75,1.00), (0.85,1.25), (1.00,1.25), (1.6,2.4), (3,5), (5,8), (8,17), (17,50)] +OFFNER_DATA = [0.19, 0.23, 0.30, 0.42, 0.47, 0.50, 0.68, 0.81, 0.89, 0.93, 0.96] +OFFNER_ERRORS = [0.03, 0.02, 0.02, 0.03, 0.03, 0.04, 0.07, 0.06, 0.05, 0.04, 0.04] MULTIDIM_BINFRAC_MAX = 0.6146916774140262 MULTIDIM_BINFRAC_MIN = 0.13786300908773025 CONST_SFR_SUM = 460028.2453521937 @@ -207,6 +210,20 @@ def test_binary_fraction(self): m1_b, m1_s, binfrac, bin_index = SAMPLECLASS.binary_select(primary_mass=np.arange(1,100), binfrac_model='vanHaaften') self.assertEqual(binfrac.max(), VANHAAFTEN_BINFRAC_MAX) self.assertEqual(binfrac.min(), VANHAAFTEN_BINFRAC_MIN) + test_fracs = [] + test_errs = [] + primary_mass = np.array([float(x) for x in np.logspace(np.log10(0.08), np.log10(150), num=100000)]) + m1_b, m1_s, binfrac, bin_index = SAMPLECLASS.binary_select(primary_mass=primary_mass, binfrac_model='offner22') + for i in range(len(OFFNER_MASS_RANGES)): + low, high = OFFNER_MASS_RANGES[i][0], OFFNER_MASS_RANGES[i][1] + offner_value = OFFNER_DATA[i] + offner_error = OFFNER_ERRORS[i] + bins_count = len(m1_b[(m1_b >= low) & (m1_b <= high)]) + singles_count = len(m1_s[(m1_s >= low) & (m1_s <= high)]) + bin_frac = bins_count / (bins_count + singles_count) + error = abs(offner_value - bin_frac) + self.assertLess(error, offner_error) + def test_msort(self): np.random.seed(2) diff --git a/src/cosmic/utils.py b/src/cosmic/utils.py index b1d9379a9..ade2b9085 100644 --- a/src/cosmic/utils.py +++ b/src/cosmic/utils.py @@ -856,7 +856,7 @@ def get_porb_norm(Z, close_logP=4.0, wide_logP=6.0, binfrac_tot_solar=0.66, Z_su normalization factor for kde for wide binaries ''' from scipy.stats import norm - from scipy.integrate import trapz + from scipy.integrate import trapezoid from scipy.interpolate import interp1d # fix to values used in Moe+19 @@ -867,7 +867,7 @@ def get_porb_norm(Z, close_logP=4.0, wide_logP=6.0, binfrac_tot_solar=0.66, Z_su logP_pdf = norm.pdf(log_P, loc=4.9, scale=2.3) # set up the wide binary fraction inflection point - norm_wide = binfrac_tot_solar/trapz(logP_pdf, log_P) + norm_wide = binfrac_tot_solar/trapezoid(logP_pdf, log_P) # set up the close binary fraction inflection point FeHclose = np.linspace(-3.0, 0.5, 100) @@ -878,7 +878,7 @@ def get_porb_norm(Z, close_logP=4.0, wide_logP=6.0, binfrac_tot_solar=0.66, Z_su fclose_interp = interp1d(Zclose, fclose) fclose_Z = fclose_interp(Z) - norm_close = fclose_Z/trapz(logP_pdf[log_P < close_logP], log_P[log_P < close_logP]) + norm_close = fclose_Z/trapezoid(logP_pdf[log_P < close_logP], log_P[log_P < close_logP]) return norm_wide, norm_close @@ -905,7 +905,7 @@ def get_met_dep_binfrac(met): neval = 5000 from scipy.interpolate import interp1d - from scipy.integrate import trapz + from scipy.integrate import trapezoid from scipy.stats import norm norm_wide, norm_close = get_porb_norm(met) @@ -920,7 +920,7 @@ def get_met_dep_binfrac(met): np.linspace(wide_logP, logP_hi_lim, neval),]) y_dat = np.hstack([prob_close, prob_interp_int(np.linspace(close_logP, wide_logP, neval)), prob_wide]) - binfrac = trapz(y_dat, x_dat)/0.66 * 0.5 + binfrac = trapezoid(y_dat, x_dat)/0.66 * 0.5 return float(np.round(binfrac, 2)) From 2a5a3876e23125e39fb241ff3df9c0a701009563 Mon Sep 17 00:00:00 2001 From: Poojan <34255053+poojanagrawal@users.noreply.github.com> Date: Thu, 8 Aug 2024 14:40:58 -0400 Subject: [PATCH 17/46] glob_issues (#650) * removed need to add backslash at the end of paths for metisse * modified utils to raise error instead of warning if metallicity files are not found in path_to_he_tracks * modified path for METISSE from ssh to https --- .gitmodules | 2 +- src/cosmic/src/METISSE | 2 +- src/cosmic/utils.py | 16 ++++------------ 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/.gitmodules b/.gitmodules index bb92d3d5b..87f8c6029 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "src/cosmic/src/METISSE"] path = src/cosmic/src/METISSE - url = git@github.com:TeamMETISSE/METISSE.git + url = https://github.com/TeamMETISSE/METISSE.git diff --git a/src/cosmic/src/METISSE b/src/cosmic/src/METISSE index ad0555184..4aa408f6d 160000 --- a/src/cosmic/src/METISSE +++ b/src/cosmic/src/METISSE @@ -1 +1 @@ -Subproject commit ad055518484fefdbdae424224588deeacd9b0b95 +Subproject commit 4aa408f6d031571385e3cb01b20022688445621f diff --git a/src/cosmic/utils.py b/src/cosmic/utils.py index ade2b9085..4525547ed 100644 --- a/src/cosmic/utils.py +++ b/src/cosmic/utils.py @@ -1112,7 +1112,7 @@ def error_check(BSEDict, SSEDict, filters=None, convergence=None, sampling=None) ) ) else: - metallicity_file = glob.glob(SSEDict[flag]+'*_metallicity.in') + metallicity_file = glob.glob(SSEDict[flag]+'/*_metallicity.in') if metallicity_file == []: raise ValueError( "No metallicity file found in {0}. Make sure that {1} is valid".format ( @@ -1130,21 +1130,13 @@ def error_check(BSEDict, SSEDict, filters=None, convergence=None, sampling=None) ) ) else: - metallicity_file = glob.glob(SSEDict[flag]+'*_metallicity.in') + metallicity_file = glob.glob(SSEDict[flag]+'/*_metallicity.in') if metallicity_file == []: - warnings.warn( - "No metallicity file for helium star tracks found in {0}. Make sure that {1} is valid or SSE formulae will be used for helium stars".format ( + raise ValueError( + "No metallicity file for helium star tracks found in {0}. Make sure that {1} is valid".format ( SSEDict[flag], flag ) ) - else: - metallicity_file = glob.glob(SSEDict[flag]+'*_metallicity.in') - if metallicity_file == []: - raise Warning( - "No metallicity file for helium star tracks found in {0}. Make sure that {1} is valid or SSE formulae will be used for helium stars".format ( - SSEDict[flag], flag - ) - ) # BSEDict flag = "dtp" From fdd418bc415d3e62f7795048fadd270101b452fc Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Thu, 8 Aug 2024 14:50:41 -0400 Subject: [PATCH 18/46] trying to make metisse-integrate incorporate develop updates (#658) * offner22 primary mass dependent binary fraction (#644) * added offner22 primary mass dependent binary fraction * pinning numpy version because of new numpy version released on june 16 (https://stackoverflow.com/questions/78634235/numpy-dtype-size-changed-may-indicate-binary-incompatibility-expected-96-from) * pinned numpy version so 3.7 works --------- Co-authored-by: katiebreivik * Update utils.py (#648) * Update utils.py fix trapezoid import * Update utils.py missed one trapz * version bump and dropping below python3.9 (#653) * version bump and dropping below python3.9 * forward to numpy 1.26.0 * trying a different version * fix trapz import * Update build_wheels_and_publish.yml explicitly install gcc * Update build_wheels_and_publish.yml trying to fix gfortran * Update build_wheels_and_publish.yml specifying path with symlink, checking path * Update build_wheels_and_publish.yml (#654) * Update build_wheels_and_publish.yml * Update _version.py * Update meson.build * Update pyproject.toml (#655) * Version bump for pip (#656) * Update meson.build * Update _version.py --------- Co-authored-by: MarkGM02 <90350113+MarkGM02@users.noreply.github.com> From 2159a11cb402d79190bf7a79dad4762523362e61 Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Wed, 11 Sep 2024 13:12:32 -0400 Subject: [PATCH 19/46] Metisse integrate kb (#674) * offner22 primary mass dependent binary fraction (#644) * added offner22 primary mass dependent binary fraction * pinning numpy version because of new numpy version released on june 16 (https://stackoverflow.com/questions/78634235/numpy-dtype-size-changed-may-indicate-binary-incompatibility-expected-96-from) * pinned numpy version so 3.7 works --------- Co-authored-by: katiebreivik * Update utils.py (#648) * Update utils.py fix trapezoid import * Update utils.py missed one trapz * version bump and dropping below python3.9 (#653) * version bump and dropping below python3.9 * forward to numpy 1.26.0 * trying a different version * fix trapz import * Update build_wheels_and_publish.yml explicitly install gcc * Update build_wheels_and_publish.yml trying to fix gfortran * Update build_wheels_and_publish.yml specifying path with symlink, checking path * Update build_wheels_and_publish.yml (#654) * Update build_wheels_and_publish.yml * Update _version.py * Update meson.build * Update pyproject.toml (#655) * Version bump for pip (#656) * Update meson.build * Update _version.py * Add power law sampling options for ``porb`` and ``q`` (#651) * add `q_power_law` parameter to change the power law of the mass ratio distribution * allow custom power laws for orbital periods * add mass ratio sampling test * add test for custom porb power laws * add to changelog * New ``gamma`` option for circumbinary discs (#652) * add new gamma prescription, add some int() statements * add details to docs page * update ini files * * Modifying the init file to include the commit hash. (#659) *Created get_commit_hash file that finds the commit hash. *Modified the meson.build file to run get_commit_hash when cosmic is installed. * Created maximum wall time option (#620) * Added compression options for pandas * Created maximum wall time argument * Add debugging setup, avoid NaNs from timestep issue (#647) * setup debugging environment * ignore a bunch of files * add a testing fortran script * move debugging to its own folder * add a python script for creating the input * add a simple makefile for testing * important change: use `loop` instead of `1000` for timestep condition * add a note about settings * clean up vscode setup * I can't count :upside_down_face: * added new test suite location * fixing numpy pinned version * forcing numpy version I guess --------- Co-authored-by: katiebreivik Co-authored-by: Katie Breivik * allow a gamma of -3 in error_check (#661) * fixing wheel build for pypi, hopefully * tiny version bump (#665) * Update _version.py * Update pyproject.toml add @TomWagg as dev * Update meson.build bump version * Update build_wheels_and_publish.yml * Update build_wheels_and_publish.yml removing gfortran symlink * Update build_wheels_and_publish.yml * Update build_wheels_and_publish.yml (#666) * Update build_wheels_and_publish.yml * this should be a working build. * add meson to requirements * Fixing linux only wheel (#667) * Update build_wheels_and_publish.yml * adding in python versions * Update build_wheels_and_publish.yml * Update meson.build * Update meson.build * Update pyproject.toml * Pip fix (#669) * add DS_Store to ignore * finalllllly got the platform specific wheels built with a pure: false * tiny bump in version for tag * Update build_wheels_and_publish.yml need to repair linux build with cibuildwheel for PyPI * Update meson.build forgot to bump version here * build wheels and publish fix (#670) * pins cibuildwheel==2.17.0 so that we can build across macOS versions. * allow push to pypi * add x_86 and arch compatibility for wheels (#671) * Update build_wheels_and_publish.yml * Update build_wheels_and_publish.yml * Update meson.build version * Update _version.py version * Update pyproject.toml version * Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows (#672) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4.1.7. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3...v4.1.7) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] Co-authored-by: MarkGM02 <90350113+MarkGM02@users.noreply.github.com> Co-authored-by: Tom Wagg Co-authored-by: elenagonzalez870 <52000594+elenagonzalez870@users.noreply.github.com> Co-authored-by: Vera Eris Del Favero <77068792+xevra@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../workflows/build_wheels_and_publish.yml | 67 ++-- .gitignore | 13 + .vscode/launch.json | 30 ++ .vscode/tasks.json | 13 + bin/cosmic-pop | 4 +- changelog.md | 4 + debug/create_binary_in.py | 66 ++++ docs/inifile/index.rst | 6 + examples/CMC_Params.ini | 1 + examples/Params.ini | 1 + meson.build | 38 +-- pyproject.toml | 23 +- requirements.txt | 1 + src/cosmic/__init__.py | 2 + src/cosmic/_version.py | 2 +- src/cosmic/bse_utils/meson.build | 10 + src/cosmic/get_commit_hash.py | 15 + src/cosmic/meson.build | 21 ++ src/cosmic/sample/cmc/meson.build | 10 + src/cosmic/sample/meson.build | 13 + src/cosmic/sample/sampler/independent.py | 41 ++- src/cosmic/sample/sampler/meson.build | 12 + src/cosmic/src/Makefile | 22 ++ src/cosmic/src/evolv2.f | 35 +- src/cosmic/src/test_bse.f | 323 ++++++++++++++++++ src/cosmic/tests/meson.build | 11 + src/cosmic/tests/test_sample.py | 34 ++ src/cosmic/utils.py | 6 +- 28 files changed, 725 insertions(+), 99 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json create mode 100644 debug/create_binary_in.py create mode 100644 src/cosmic/bse_utils/meson.build create mode 100644 src/cosmic/get_commit_hash.py create mode 100644 src/cosmic/meson.build create mode 100644 src/cosmic/sample/cmc/meson.build create mode 100644 src/cosmic/sample/meson.build create mode 100644 src/cosmic/sample/sampler/meson.build create mode 100644 src/cosmic/src/Makefile create mode 100644 src/cosmic/src/test_bse.f create mode 100644 src/cosmic/tests/meson.build diff --git a/.github/workflows/build_wheels_and_publish.yml b/.github/workflows/build_wheels_and_publish.yml index 163ad71ad..92f2308da 100644 --- a/.github/workflows/build_wheels_and_publish.yml +++ b/.github/workflows/build_wheels_and_publish.yml @@ -10,16 +10,19 @@ env: CIBW_BUILD: "cp39-* cp310-*" CIBW_SKIP: "*-win32 *musllinux*" CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + CIBW_ARCHS_MACOS: "x86_64 arm64" CIBW_BEFORE_BUILD: pip install numpy --config-settings=setup-args="-Dallow-noblas=true" CIBW_BUILD_VERBOSITY: "1" + CIBW_ENVIRONMENT_MACOS: "FC=gfortran" jobs: - build-wheels: + build-wheels-and-dist: name: Build ${{ matrix.python-version }} wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, macos-latest] + python-version: [3.9, "3.10"] steps: - uses: actions/checkout@v3 @@ -30,51 +33,39 @@ jobs: with: python-version: "3.10" - - name: Setup Mac + - name: link gfortran and hdf5 if: runner.os == 'macOS' run: | - python -m pip install numpy h5py versioneer + sudo ln -s /opt/homebrew/bin/gfortran-12 /usr/local/bin/gfortran + brew reinstall hdf5 - - name: Setup Linux - if: runner.os == 'Linux' + - name: Install numpy run: | - python -m pip install numpy h5py versioneer - - - name: Build wheels + python -m pip install --upgrade pip + python -m pip install numpy h5py versioneer + + - name: Install dependencies + run: | + python -m pip install cibuildwheel==2.17.0 setuptools wheel build meson-python ninja meson + + - name: Build source distribution (sdist) + run: | + python -m build --sdist --outdir dist + + - name: Build wheels using cibuildwheel run: | - sudo ln -s /opt/homebrew/bin/gfortran-11 /opt/homebrew/bin/gfortran || true - python -m pip install meson ninja build - meson setup build - meson compile -C build - python -m build --wheel --outdir wheelhouse + python -m cibuildwheel --output-dir dist + - uses: actions/upload-artifact@v3 with: - path: ./wheelhouse/*.whl - - build-source-dist: - name: Build source dist - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: actions/setup-python@v4 - name: Install Python - with: - python-version: "3.10" - - - name: Build dist - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine numpy build meson ninja - pip install . - python -m build - - uses: actions/upload-artifact@v3 - with: - path: ./dist/*.tar.gz + path: ./dist/*.tar.gz + + - uses: actions/upload-artifact@v3 + with: + path: ./dist/*.whl publish: - needs: [build-wheels, build-source-dist] + needs: [build-wheels-and-dist] name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI runs-on: ${{ matrix.os }} strategy: @@ -90,7 +81,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Download builds - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4.1.7 with: name: artifact path: dist diff --git a/.gitignore b/.gitignore index 2a54457eb..ca24ff619 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,10 @@ +# ignore files without extensions +* +!/**/ +!*.* + +.DS_Store + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] @@ -102,3 +109,9 @@ ENV/ # mypy .mypy_cache/ + +*.o +binary.in +binary.dat +*.h5 +fort.99 diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..534b32ba1 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,30 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "(gdb) Launch", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceRoot}/debug/test", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceRoot}/debug", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "preLaunchTask": "make", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { + "description": "Set Disassembly Flavor to Intel", + "text": "-gdb-set disassembly-flavor intel", + "ignoreFailures": true + } + ] + }, + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 000000000..f8e9969a9 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,13 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "make", + "type": "shell", + "command": "make test", + "options": { + "cwd": "${workspaceFolder}/cosmic/src" + }, + } + ] +} \ No newline at end of file diff --git a/bin/cosmic-pop b/bin/cosmic-pop index 48d292121..080a12393 100755 --- a/bin/cosmic-pop +++ b/bin/cosmic-pop @@ -98,6 +98,8 @@ def parse_commandline(): help="Number of binaries to try before checking for " "convergence, it will check ever Nstep binaries until " "it reach Niter binaries", type=int, default=10000) + parser.add_argument("--max-wall-time", type=int, default=3155760, + help="Maximum wall time (seconds) for sampling binaries") parser.add_argument("--binary_state", nargs='+', type=int) parser.add_argument("--sampling_method") parser.add_argument("--primary_model", help="Chooses the initial primary mass function from: salpeter55, kroupa93, kroupa01", type=str) @@ -288,7 +290,7 @@ if __name__ == '__main__': log_file.write("You have specified both qmin and m2_min.\n") log_file.write("COSMIC will use qmin={} to determine the secondary masses in the initial sample.\n".format(args.qmin)) - while (Nstep < args.Niter) & (np.max(match) > convergence['match']): + while (Nstep < args.Niter) & (np.max(match) > convergence['match']) & ((time.time() - start_time) < args.max_wall_time): # Set random seed such that each iteration gets a unique, determinable seed rand_seed = seed_int + Nstep np.random.seed(rand_seed) diff --git a/changelog.md b/changelog.md index 407f6fa62..8ee2c455b 100644 --- a/changelog.md +++ b/changelog.md @@ -39,3 +39,7 @@ See the discussed changes in our previous releases here: https://github.com/COSM - Add `teff_1` and `teff_2` as variables that can be used to set `timestep_conditions` - Add in `-1` option to turn off Magnetic Braking in htmb - Added `central_bh` and `scale_with_central_bh` as options to the CMC sampler, in order to add central massive black holes to CMC initial conditions + + +## 3.4.11 + - Added sampling options to ``independent`` sampler to allow for custom power law distributions for ``porb`` and ``q`` \ No newline at end of file diff --git a/debug/create_binary_in.py b/debug/create_binary_in.py new file mode 100644 index 000000000..c06817949 --- /dev/null +++ b/debug/create_binary_in.py @@ -0,0 +1,66 @@ +import pandas as pd + +BSE_settings = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': 1.0, + 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, + 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, + 'acc2': 1.5, 'grflag': 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, + 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, + 'natal_kick_array': [[-100.0, -100.0, -100.0, -100.0, 0.0], + [-100.0, -100.0, -100.0, -100.0, 0.0]], 'bhsigmafrac': 1.0, + 'polar_kick_angle': 90, 'qcrit_array': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + 'cekickflag': 2, 'cehestarflag': 0, 'cemergeflag': 0, 'ecsn': 2.25, + 'ecsn_mlow': 1.6, 'aic': 1, 'ussn': 0, 'sigmadiv': -20.0, 'qcflag': 5, + 'eddlimflag': 0, 'fprimc_array': [2.0/21.0, 2.0/21.0, 2.0/21.0, 2.0/21.0, + 2.0/21.0, 2.0/21.0, 2.0/21.0, 2.0/21.0, + 2.0/21.0, 2.0/21.0, 2.0/21.0, 2.0/21.0, + 2.0/21.0, 2.0/21.0, 2.0/21.0, 2.0/21.0], + 'bhspinflag': 0, 'bhspinmag': 0.0, 'rejuv_fac': 1.0, 'rejuvflag': 0, 'htpmb': 1, + 'ST_cr': 1, 'ST_tide': 1, 'bdecayfac': 1, 'rembar_massloss': 0.5, 'kickflag': 0, + 'zsun': 0.014, 'bhms_coll_flag': 0, 'don_lim': -1, 'acc_lim': -1, 'binfrac': 0.5, + 'rtmsflag': 0, 'wd_mass_lim': 1, 'idum': 100} + + +def create_binary_in(mass0, tphysf, tb, kstar, Z, ecc, BSE_settings): + """Create a binary.in file based on the given parameters + + This follows the format in cosmic/src/test_bse.f and changes there would need to be reflected here. + """ + with open('binary.in', 'w') as f: + f.write(f'{mass0[0]} {mass0[1]} {tphysf} {tb} {kstar[0]} {kstar[1]} {Z} {ecc}\n') + + lines = [ + ['neta', 'bwind', 'hewind', 'alpha1', 'lambdaf', 'windflag', 'rtmsflag'], + ['ceflag', 'tflag', 'ifflag', 'wdflag', 'bhflag', 'remnantflag', 'mxns', 'idum'], + ['pts1', 'pts2', 'pts3'], + ['sigma', 'beta', 'xi', 'acc2', 'epsnov', 'eddfac', 'gamma'] + ] + + for line in lines: + f.write(' '.join([str(BSE_settings[key]) for key in line]) + '\n') + + +def convert_initC_row_to_binary_in(initC_file, bin_num): + """Convert a row from an initC file to a binary.in file + + Parameters + ---------- + initC_file : `str` + Path to the initC file + bin_num : `int` + The binary number to convert + """ + # get binary from initC + initC = pd.read_hdf(initC_file, key="initC") + r = initC.loc[bin_num] + + # update BSE settings with those in the binary + BSE_settings['idum'] = r['randomseed'].astype(int) + for key in BSE_settings: + if key in r: + BSE_settings[key] = r[key] + + # create binary.in file + create_binary_in([r['mass_1'], r['mass_2']], r['tphysf'], r['porb'], + [r['kstar_1'].astype(int), r['kstar_2'].astype(int)], + r['metallicity'], r['ecc'], BSE_settings) diff --git a/docs/inifile/index.rst b/docs/inifile/index.rst index 871f3c8ae..0562b72ff 100644 --- a/docs/inifile/index.rst +++ b/docs/inifile/index.rst @@ -1055,6 +1055,11 @@ common envelope occurs regardless of the choices below: ``-2`` : assumes material is lost from the system as if it is a wind from the secondary + ``-3`` : assumes mass is lost through the outer Lagrangian point, + forming a circumbinary disk. See Zapartas+17 Eq. 9 and + Artymowicz & Lubow (1994). + + ``>0`` : assumes that the lost material takes away a fraction *gamma* of the orbital angular momentum @@ -1104,6 +1109,7 @@ common envelope occurs regardless of the choices below: eddfac = 1.0 ; gamma is the angular momentum factor for mass lost during Roche-lobe overflow + ; gamma=-3: assumes mass is lost through the outer Lagrangian point, forming a circumbinary disk. See Zapartas+17 Eq. 9 and Artymowicz & Lubow (1994). ; gamma=-2: assumes material is lost from the system as if it is a wind from the secondary (for super-Eddington mass transfer rates) ; gamma=-1: assumes the lost material carries with is the specific angular momentum of the primary ; gamma>0: assumes that the lost material take away a fraction (gamma) of the orbital angular momentum diff --git a/examples/CMC_Params.ini b/examples/CMC_Params.ini index b31637730..5f13cfc6c 100644 --- a/examples/CMC_Params.ini +++ b/examples/CMC_Params.ini @@ -534,6 +534,7 @@ bhspinmag = 0.0 eddfac = 1.0 ; gamma is the angular momentum factor for mass lost during RLO +; gamma=-3: assumes mass is lost through the outer Lagrangian point, forming a circumbinary disk. See Zapartas+17 Eq. 9 and Artymowicz & Lubow (1994). ; gamma=-2: assumes material is lost from the system as if it is a wind from the secondary (for super-Eddington mass transfer rates) ; gamma=-1: assumes the lost material carries with is the specific angular momentum of the primary ; gamma>0: assumes that the lost material take away a fraction (gamma) of the orbital angular momentum diff --git a/examples/Params.ini b/examples/Params.ini index 23254bc38..dd8621ade 100644 --- a/examples/Params.ini +++ b/examples/Params.ini @@ -416,6 +416,7 @@ grflag = 1 eddfac = 1.0 ; gamma is the angular momentum factor for mass lost during RLO +; gamma=-3: assumes mass is lost through the outer Lagrangian point, forming a circumbinary disk. See Zapartas+17 Eq. 9 and Artymowicz & Lubow (1994). ; gamma=-2: assumes material is lost from the system as if it is a wind from the secondary (for super-Eddington mass transfer rates) ; gamma=-1: assumes the lost material carries with is the specific angular momentum of the primary ; gamma>0: assumes that the lost material take away a fraction (gamma) of the orbital angular momentum diff --git a/meson.build b/meson.build index 3343dc198..446f49ffd 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('cosmic', 'c', 'fortran', - version : '3.4.13', + version : '3.4.16', default_options: ['warning_level=0', 'optimization=3'], ) @@ -11,23 +11,21 @@ ff = meson.get_compiler('fortran') f_args = ff.get_supported_arguments('-fPIC') add_project_arguments(f_args, language: 'fortran') -py3 = import('python').find_installation() + +py3 = import('python').find_installation(pure: false) numpy_include_dir = run_command(py3, ['-c', 'import numpy; print(numpy.get_include())'], check: true).stdout().strip() f2py_include_dir = run_command(py3, ['-c', 'import numpy.f2py; print(numpy.f2py.get_include())'], check: true).stdout().strip() inc_np = include_directories(numpy_include_dir, f2py_include_dir) -f2py_source = custom_target( - 'evolvebin-target', - input : ['src/cosmic/src/evolv2.f', 'src/cosmic/src/comprad.f'], - output : ['_evolvebinmodule.c', '_evolvebin-f2pywrappers.f'], - command : [py3, '-m', 'numpy.f2py', '@INPUT@', '-m', '_evolvebin', '--lower', '@OUTDIR'] -) +get_hash = run_command('python', './src/cosmic/get_commit_hash.py', check: true).stdout().strip() + lib_source = [ 'src/cosmic/src/hrdiag_remnant.f', 'src/cosmic/src/assign_remnant.f', 'src/cosmic/src/benchmarkevolv2.f', + 'src/cosmic/src/int64.f', 'src/cosmic/src/corerd.f', 'src/cosmic/src/comenv.f', 'src/cosmic/src/dgcore.f', @@ -79,6 +77,15 @@ else ldflags = [] # No special flags for other systems endif + +f2py_source = custom_target( + 'evolvebin-target', + input : ['src/cosmic/src/evolv2.f', 'src/cosmic/src/comprad.f'], + output : ['_evolvebinmodule.c', '_evolvebin-f2pywrappers.f'], + command : [py3, '-m', 'numpy.f2py', '@INPUT@', '-m', '_evolvebin', '--lower'] +) + + evolvebin_module = py3.extension_module('_evolvebin', f2py_source, lib_source, @@ -86,19 +93,10 @@ evolvebin_module = py3.extension_module('_evolvebin', include_directories: inc_np, link_args: ldflags, install : true, - install_dir : py3.get_install_dir() / 'cosmic' + subdir : 'cosmic' ) - -module_dirs = ['src/cosmic', 'src/cosmic/bse_utils', - 'src/cosmic/sample', 'src/cosmic/tests'] - -# Install modules -foreach mod_dir: module_dirs - install_subdir(mod_dir, - install_dir: py3.get_install_dir()) -endforeach - - python_script = 'bin/cosmic-pop' install_data(python_script, install_dir: get_option('bindir')) + +subdir('src/cosmic') diff --git a/pyproject.toml b/pyproject.toml index 07fca7b03..4cc88a681 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,10 +7,10 @@ authors = [ { name="Scott Coughlin" }, { name="Michael Zevin" }, { name="Carl L. Rodriguez" }, + { name="Tom Wagg" }, ] readme = "README.md" - - +version = "3.4.16" requires-python = ">=3.9" license = { text = "MIT License" } classifiers = [ @@ -21,25 +21,12 @@ classifiers = [ "Operating System :: OS Independent", "Programming Language :: Python", ] -dynamic = ["version"] -dependencies = ["numpy", "scipy", "astropy", "configparser", - "tqdm", "pandas", "tables", "h5py", "schwimmbad", +dependencies = ["numpy", "scipy", "astropy", "configparser", + "tqdm", "pandas", "tables", "h5py", "schwimmbad", "matplotlib", "importlib-metadata"] -[project.optional-dependencies] -test = ["pytest", "pytest-xdist", "pytest-cov", "flake8", "coverage"] -docs = ["sphinx", "numpydoc", "sphinx-bootstrap-theme", - "sphinxcontrib-programoutput", "sphinx-automodapi", - "ipython", "sphinx_rtd_theme", "pickleshare"] - - - [build-system] -requires = ["meson", "meson-python", "wheel", "numpy", "setuptools"] build-backend = 'mesonpy' +requires = ['meson-python', 'numpy'] - -# pyproject.toml -[tool.setuptools] -write_to = "src/cosmic/_version.py" diff --git a/requirements.txt b/requirements.txt index fd737f593..3c0f9e8cd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,3 +22,4 @@ flake8 < 5 pytest pytest-cov wheel +meson diff --git a/src/cosmic/__init__.py b/src/cosmic/__init__.py index 612b9baaa..7779958d6 100644 --- a/src/cosmic/__init__.py +++ b/src/cosmic/__init__.py @@ -21,8 +21,10 @@ """ from ._version import __version__ +from ._commit_hash import COMMIT_HASH __version__ = __version__ +__commithash__ = COMMIT_HASH __author__ = "Katie Breivik " __credits__ = [ "Scott Coughlin ", diff --git a/src/cosmic/_version.py b/src/cosmic/_version.py index a9b631c0d..e96c6b387 100644 --- a/src/cosmic/_version.py +++ b/src/cosmic/_version.py @@ -1 +1 @@ -__version__ = "3.4.13" +__version__ = "3.4.16" diff --git a/src/cosmic/bse_utils/meson.build b/src/cosmic/bse_utils/meson.build new file mode 100644 index 000000000..a789396cf --- /dev/null +++ b/src/cosmic/bse_utils/meson.build @@ -0,0 +1,10 @@ +python_sources = [ + '__init__.py', + 'zcnsts.py', + 'zdata.py' +] + +py3.install_sources( + python_sources, + subdir: 'cosmic/bse_utils' +) \ No newline at end of file diff --git a/src/cosmic/get_commit_hash.py b/src/cosmic/get_commit_hash.py new file mode 100644 index 000000000..f5ee91eea --- /dev/null +++ b/src/cosmic/get_commit_hash.py @@ -0,0 +1,15 @@ +import subprocess + +def get_commit_hash(): + # Run git command to get the latest commit hash + result = subprocess.run(['git', 'rev-parse', 'HEAD'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + commit_hash = result.stdout.decode('utf-8').strip() + return commit_hash + +def write_commit_hash_to_file(commit_hash): + with open('./src/cosmic/_commit_hash.py', 'w') as f: + f.write(f'COMMIT_HASH = "{commit_hash}"\n') + +if __name__ == "__main__": + commit_hash = get_commit_hash() + write_commit_hash_to_file(commit_hash) \ No newline at end of file diff --git a/src/cosmic/meson.build b/src/cosmic/meson.build new file mode 100644 index 000000000..2760fa6bf --- /dev/null +++ b/src/cosmic/meson.build @@ -0,0 +1,21 @@ +python_sources = [ + '__init__.py', + '_commit_hash.py', + '_version.py', + 'checkstate.py', + 'evolve.py', + 'filter.py', + 'get_commit_hash.py', + 'Match.py', + 'plotting.py', + 'utils.py' +] + +py3.install_sources( + python_sources, + subdir: 'cosmic' +) + +subdir('bse_utils') +subdir('sample') +subdir('tests') diff --git a/src/cosmic/sample/cmc/meson.build b/src/cosmic/sample/cmc/meson.build new file mode 100644 index 000000000..cf621f722 --- /dev/null +++ b/src/cosmic/sample/cmc/meson.build @@ -0,0 +1,10 @@ +python_sources = [ + '__init__.py', + 'elson.py', + 'king.py' +] + +py3.install_sources( + python_sources, + subdir: 'cosmic/sample/cmc' +) \ No newline at end of file diff --git a/src/cosmic/sample/meson.build b/src/cosmic/sample/meson.build new file mode 100644 index 000000000..fa4e4fec3 --- /dev/null +++ b/src/cosmic/sample/meson.build @@ -0,0 +1,13 @@ +python_sources = [ + '__init__.py', + 'initialbinarytable.py', + 'initialcmctable.py' +] + +py3.install_sources( + python_sources, + subdir: 'cosmic/sample' +) + +subdir('cmc') +subdir('sampler') \ No newline at end of file diff --git a/src/cosmic/sample/sampler/independent.py b/src/cosmic/sample/sampler/independent.py index dc77cf8e0..0717e4d8a 100644 --- a/src/cosmic/sample/sampler/independent.py +++ b/src/cosmic/sample/sampler/independent.py @@ -50,6 +50,7 @@ def get_independent_sampler( total_mass=np.inf, sampling_target="size", trim_extra_samples=False, + q_power_law=0, **kwargs ): """Generates an initial binary sample according to user specified models @@ -74,8 +75,10 @@ def get_independent_sampler( ecc_model : `str` Model to sample eccentricity; choices include: thermal, uniform, sana12 - porb_model : `str` + porb_model : `str` or `dict` Model to sample orbital period; choices include: log_uniform, sana12, raghavan10, moe19 + or a custom power law distribution defined with a dictionary with keys "min", "max", and "slope" + (e.g. {"min": 0.15, "max": 0.55, "slope": -0.55}) would reproduce the Sana+2012 distribution qmin : `float` kwarg which sets the minimum mass ratio for sampling the secondary @@ -146,6 +149,11 @@ def get_independent_sampler( zsun : `float` optional kwarg for setting effective radii, default is 0.02 + q_power_law : `float` + Exponent for the mass ratio distribution power law, default is 0 (flat in q). Note that + q_power_law cannot be exactly -1, as this would result in a divergent distribution. + + Returns ------- InitialBinaryTable : `pandas.DataFrame` @@ -218,7 +226,7 @@ def get_independent_sampler( ) = initconditions.binary_select(mass1, binfrac_model=binfrac_model, **kwargs) # sample secondary masses for the single stars - mass2_binaries = initconditions.sample_secondary(mass1_binaries, **kwargs) + mass2_binaries = initconditions.sample_secondary(mass1_binaries, q_power_law=q_power_law, **kwargs) # check if this batch of samples will take us over our sampling target if not target(mass1_binary, size, @@ -483,7 +491,7 @@ def sample_primary(self, primary_model='kroupa01', size=None, **kwargs): return u, np.sum(u) # sample secondary mass - def sample_secondary(self, primary_mass, **kwargs): + def sample_secondary(self, primary_mass, q_power_law=0, **kwargs): """Sample a secondary mass using draws from a uniform mass ratio distribution motivated by `Mazeh et al. (1992) `_ and `Goldberg & Mazeh (1994) `_ @@ -596,10 +604,7 @@ def sample_secondary(self, primary_mass, **kwargs): qmin_vals[highmassIdx] = np.maximum(qmin_vals[highmassIdx], m2_min_msort/primary_mass[highmassIdx]) # --- now, randomly sample mass ratios and get secondary masses - secondary_mass = np.random.uniform(qmin_vals, 1) * primary_mass - - - + secondary_mass = utils.rndm(qmin_vals, 1, q_power_law, size=len(primary_mass)) * primary_mass return secondary_mass def binary_select(self, primary_mass, binfrac_model=0.5, **kwargs): @@ -805,7 +810,7 @@ def sample_porb(self, mass1, mass2, rad1, rad2, porb_model, porb_max=None, size= radii of the primaries. rad2 : array radii of the secondaries - porb_model : string + porb_model : `str` or `dict` selects which model to sample orbital periods, choices include: log_uniform : semi-major axis flat in log space from RRLO < 0.5 up to 1e5 Rsun according to `Abt (1983) `_ @@ -826,6 +831,9 @@ def sample_porb(self, mass1, mass2, rad1, rad2, porb_model, porb_max=None, size= `Raghavan+2010 _` but with different close binary fractions following `Moe+2019 _` + Custom power law distribution defined with a dictionary with keys "min", "max", and "slope" + (e.g. porb_model={"min": 0.15, "max": 0.55, "slope": -0.55}) would reproduce the + Sana+2012 distribution. met : float metallicity of the population @@ -906,6 +914,23 @@ def sample_porb(self, mass1, mass2, rad1, rad2, porb_model, porb_max=None, size= porb = 10 ** utils.rndm(a=log10_porb_min, b=log10_porb_max, g=-0.55, size=size) aRL_over_a = a_min / utils.a_from_p(porb,mass1,mass2) + elif isinstance(porb_model, dict): + # use a power law distribution for the orbital periods + params = { + "min": 0.15, + "max": 5.5, + "slope": -0.55, + } + # update the default parameters with the user-supplied ones + params.update(porb_model) + + # same calculations as sana12 case (sample from a power law distribution but avoid RLOF) + log10_RL_porb = np.log10(utils.p_from_a(a_min, mass1, mass2)) + params["min"] = np.full(len(a_min), params["min"]) + params["min"][params["min"] < log10_RL_porb] = log10_RL_porb[params["min"] < log10_RL_porb] + porb = 10**utils.rndm(a=params["min"], b=params["max"], g=params["slope"], size=size) + aRL_over_a = a_min / utils.a_from_p(porb, mass1, mass2) + elif porb_model == "renzo19": # Same here: if using CMC, set the maximum porb to the smaller of either the # hard/soft boundary or 5.5 (from Sana paper) diff --git a/src/cosmic/sample/sampler/meson.build b/src/cosmic/sample/sampler/meson.build new file mode 100644 index 000000000..7d193decd --- /dev/null +++ b/src/cosmic/sample/sampler/meson.build @@ -0,0 +1,12 @@ +python_sources = [ + '__init__.py', + 'cmc.py', + 'independent.py', + 'sampler.py', + 'multidim.py' +] + +py3.install_sources( + python_sources, + subdir: 'cosmic/sample/sampler' +) \ No newline at end of file diff --git a/src/cosmic/src/Makefile b/src/cosmic/src/Makefile new file mode 100644 index 000000000..de63903b0 --- /dev/null +++ b/src/cosmic/src/Makefile @@ -0,0 +1,22 @@ +IGNORE: +CMPLR = gfortran +FFLAGS = -g -O0 -Wall -Wextra +LFLAGS = const_bse.h zdata.h + +.f.o: + $(CMPLR) -c $(FFLAGS) $< + +SRC = \ +test_bse.f hrdiag_remnant.f assign_remnant.f corerd.f comenv.f dgcore.f \ +evolv2.f gntage.f instar.f kick.f mix.f mrenv.f ran3.f rl.f \ +concatkstars.f comprad.f bpp_array.f checkstate.f deltat.f \ +mlwind.f hrdiag.f star.f zcnsts.f zfuncs.f + +OBJT1 = $(SRC:.f=.o) + +test: $(OBJT1) $(LFLAGS) + $(CMPLR) $(FFLAGS) $(OBJT1) -o test + mv test ../../debug/test + +clean: + rm -f *.o ../../debug/test \ No newline at end of file diff --git a/src/cosmic/src/evolv2.f b/src/cosmic/src/evolv2.f index 44d094dbf..fc8a195ca 100644 --- a/src/cosmic/src/evolv2.f +++ b/src/cosmic/src/evolv2.f @@ -179,7 +179,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, REAL*8 acc1,tiny PARAMETER(acc1=3.920659d+08,tiny=1.0d-14) REAL*8 ecc,ecc1,tc,tcirc,ttid,ecc2,omecc2,sqome2,sqome3,sqome5 - REAL*8 f1,f2,f3,f4,f5,f,raa2,raa6,eqspin,rg2,tcqr + REAL*8 f1,f2,f3,f4,f5,f,raa2,raa6,eqspin,rg2,tcqr,gammadisc REAL*8 k3,mr23yr,twopi PARAMETER(k3=0.21d0,mr23yr=0.4311d0) REAL*8 jspin(2),ospin(2),jorb,oorb,jspbru,ospbru @@ -2769,7 +2769,12 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * Take the stellar evolution timestep into account but don't let it * be overly restrictive for long lived phases. * - if(iter.le.1000) dtm = MIN(dtm,dtmi(1),dtmi(2)) + +* NOTE: This can cause NaN values! If you get NaNs, check what happens +* when you increase `loop` (see PR #647) - TW +* + if(iter.le.loop) dtm = MIN(dtm,dtmi(1),dtmi(2)) + dtm = MIN(dtm,tsave-tphys) dt = dtm*1.0d+06 km = dt/tb @@ -3018,22 +3023,30 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & (mass(1)+mass(2))**2 djorb = djorb*dt * -* For super-Eddington mass transfer rates, for gamma = -2.0, +* For super-Eddington mass transfer rates, for gamma == -2, * and for novae systems, assume that material is lost from * the system as if a wind from the secondary. -* If gamma = -1.0 then assume the lost material carries with it -* the specific angular momentum of the primary and for all -* gamma > 0.0 assume that it takes away a fraction gamma of -* the orbital angular momentum. * - if(supedd.or.novae.or.gamma.lt.-1.5d0)then + if(supedd.or.novae.or.int(gamma).eq.-2)then djorb = djorb + (dm1 - dm22)*mass(j1)*mass(j1)/ & (mass(1)+mass(2))**2 - elseif(gamma.ge.0.d0)then - djorb = djorb + gamma*(dm1 - dm2) - else +* If gamma == -3: Assume mass is lost through the outer +* Lagrangian point, forming a circumbinary disk. See +* Zapartas+17 Eq. 9 and Artymowicz & Lubow (1994). +* Set rmin=2a, which is consistent with A&L94 simulations. + elseif(int(gamma).eq.-3)then + gammadisc = (mass(1) + mass(2))**2 + & / (mass(1) * mass(2)) * sqrt(2.d0) + djorb = djorb + gammadisc * (dm1 - dm2) +* If gamma == -1 then assume the lost material carries with it +* the specific angular momentum of the primary and for all + elseif(int(gamma).eq.-1) then djorb = djorb + (dm1 - dm2)*mass(j2)*mass(j2)/ & (mass(1)+mass(2))**2 +* gamma > 0.0 assume that it takes away a fraction gamma of +* the orbital angular momentum. + elseif(gamma.ge.0.d0)then + djorb = djorb + gamma*(dm1 - dm2) endif * ecc2 = ecc*ecc diff --git a/src/cosmic/src/test_bse.f b/src/cosmic/src/test_bse.f new file mode 100644 index 000000000..b81c22ff2 --- /dev/null +++ b/src/cosmic/src/test_bse.f @@ -0,0 +1,323 @@ +*** + PROGRAM bse +*** +* +* Evolves a binary by calling evolv2.f +* (see header of subroutine for algorithm description). +* +* Required input is described below. +*** +* See Tout et al., MNRAS, 1997, 291, 732 for a description of many of the +* processes in this code as well as the relevant references mentioned +* within the code. +* Updated reference is: +* Hurley J.R., Tout C.A., & Pols O.R., 2002, MNRAS, 329, 897 +* (please use this one). +*** +* For single star evolution see Hurley, Pols & Tout, 2000, MNRAS, 315, 543. +* or Hurley, 2000, PhD Thesis, University of Cambridge (Chapter 2). +* The binary evolution algorithm is described in Chapter 3 of the thesis. +*** +* +* B I N A R Y +* *********** +* +* Roche lobe overflow. +* -------------------- +* +* Developed by Jarrod Hurley, IOA, Cambridge. +* ......................................................... +* +* Advice by Christopher Tout, Onno Pols & Sverre Aarseth. +* ++++++++++++++++++++++++++++++++++++++++++++++++++ +*** + implicit none +* + INCLUDE 'const_bse.h' +* + integer i,kw,kw2,kstar(2),j,k,time,idum + integer bpp_index_out, bcm_index_out + real*8 kick_info_out(2,17) +* + real*8 mass0(2),mass(2),z,zpars(20),vs(3),kick_info(2,17) + real*8 epoch(2),tms(2),tphys,tphysf,dtp,aj + real*8 rad(2),lum(2),ospin(2) + real*8 massc(2),radc(2),menv(2),renv(2) + real*8 tb,ecc,yearsc + real*8 B_0(2),bacc(2),tacc(2),bhspin(2),bkick(20) + PARAMETER(yearsc=3.1557d+07) + CHARACTER*8 label(16) +* +************************************************************************ +* Input: +* +* mass is in solar units. +* tphysf is the maximum evolution time in Myr. +* tb is the orbital period in days. +* kstar is the stellar type: 0 or 1 on the ZAMS - unless in evolved state. +* z is metallicity in the range 0.0001 -> 0.03 where 0.02 is Population I. +* eccentricity can be anywhere in the range 0.0 -> 1.0. +* +* neta is the Reimers mass-loss coefficent (neta*4x10^-13: 0.5 normally). +* bwind is the binary enhanced mass loss parameter (inactive for single). +* hewind is a helium star mass loss factor (1.0 normally). +* alpha1 is the common-envelope efficiency parameter (1.0). +* lambda is the binding energy factor for common envelope evolution (0.5). +* +* ceflag = 0 activates spin-energy correction in common-envelope (0). +* ceflag = 1 activates de Kool common-envelope model (0). +* tflag > 0 activates tidal circularisation (1). +* ifflag > 0 uses WD IFMR of HPE, 1995, MNRAS, 272, 800 (0). +* wdflag > 0 uses modified-Mestel cooling for WDs (0). +* bhflag > 0 allows velocity kick at BH formation (0). +* rtmsflag > 0 uses rtms from simulation data (1=[Boost], 2=[Bpass]) (0) +* remnantflag > 0 takes NS/BH mass from Belczynski et al. 2002, ApJ, 572, 407 (1). +* mxns is the maximum NS mass (1.8, remnantflag=0; 3.0, remnantflag=1). +* idum is the random number seed used by the kick routine. +* +* Next come the parameters that determine the timesteps chosen in each +* evolution phase: +* pts1 - MS (0.05) +* pts2 - GB, CHeB, AGB, HeGB (0.01) +* pts3 - HG, HeMS (0.02) +* as decimal fractions of the time taken in that phase. +* +* sigma is the dispersion in the Maxwellian for the SN kick speed (190 km/s). +* beta is wind velocity factor: proportional to vwind**2 (1/8). +* xi is the wind accretion efficiency factor (1.0). +* acc2 is the Bondi-Hoyle wind accretion factor (3/2). +* epsnov is the fraction of accreted matter retained in nova eruption (0.001). +* eddfac is Eddington limit factor for mass transfer (1.0). +* gamma is the angular momentum factor for mass lost during Roche (-1.0). +* +* If you enter a negative kstar then parameters for an evolved star are +* required in the order of: +* current age, initial mass and spin rate, +* otherwise the star will start on the ZAMS. +* + OPEN(22,file='binary.in', status='old') + READ(22,*)mass0(1),mass0(2),tphysf,tb,kstar(1),kstar(2),z,ecc + READ(22,*)neta,bwind,hewind,alpha1,lambdaf,windflag,rtmsflag + READ(22,*)ceflag,tflag,ifflag,wdflag,bhflag,remnantflag,mxns,idum + READ(22,*)pts1,pts2,pts3 + READ(22,*)sigma,beta,xi,acc2,epsnov,eddfac,gamma + if(kstar(1).lt.0.or.kstar(2).lt.0)then + READ(22,*)tphys + READ(22,*)aj,mass(1),ospin(1) + epoch(1) = tphys - aj + kstar(1) = ABS(kstar(1)) + READ(22,*)aj,mass(2),ospin(2) + epoch(2) = tphys - aj + kstar(2) = ABS(kstar(2)) + else + + WRITE(*,*)mass0(1),mass0(2),tphysf,tb,kstar(1),kstar(2),z,ecc + WRITE(*,*)neta,bwind,hewind,alpha1,lambdaf,windflag,rtmsflag + WRITE(*,*)ceflag,tflag,ifflag,wdflag,bhflag,remnantflag,mxns,idum + WRITE(*,*)pts1,pts2,pts3 + WRITE(*,*)sigma,beta,xi,acc2,epsnov,eddfac,gamma +* +* Initialize the parameters. +* Set the initial spin of the stars. If ospin is zero (actually < 0.001) +* at time zero then evolv2 will set an appropriate ZAMS spin. If +* ospin is greater than zero then it will start with that spin regardless +* of the time. If you want to start at time zero with negligible spin +* then I suggest using a negligible value (but greater than 0.001). +* If ospin is negative then the stars will be in co-rotation with the orbit. +* + tphys = 0.d0 + mass(1) = mass0(1) + epoch(1) = 0.d0 + ospin(1) = 0.d0 + mass(2) = mass0(2) + epoch(2) = 0.d0 + ospin(2) = 0.d0 + + B_0(1) = 0.d0 + B_0(2) = 0.d0 + bacc(1) = 0.d0 + bacc(2) = 0.d0 + tacc(1) = 0.d0 + tacc(2) = 0.d0 + bhspin(1) = 0.d0 + bhspin(2) = 0.d0 + tms(1) = 0.d0 + tms(2) = 0.d0 +* +* NOTE: The following parameters are set to current default values (v3.4.10). +* They should really be included in binary.in and copied from an initC +* file. This is a temporary measure until the input file is updated. +* + pisn = 45.d0 + cekickflag = 2 + cehestarflag = 0 + grflag = 1 + bhms_coll_flag = 0 + wd_mass_lim = 1 + ecsn = 2.25 + ecsn_mlow = 1.6 + aic = 1 + ussn = 0 + sigmadiv = -20 + bhsigmafrac = 1.0 + polar_kick_angle = 90 + do i = 1,4 + do j = 1,2 + natal_kick_array(j, i) = -100.d0 + enddo + enddo + natal_kick_array(1,5) = 0.0 + natal_kick_array(2,5) = 0.0 + do i = 1,8 + qcrit_array(i) = 0.0 + enddo + don_lim = -1 + acc_lim = -1 + bdecayfac = 1 + bconst = 3000 + ck = 1000 + qcflag = 5 + eddlimflag = 0 + do i = 1,16 + fprimc_array(i) = 2.0/21.0 + enddo + bhspinflag = 0 + bhspinmag = 0.0 + rejuv_fac = 1.0 + rejuvflag = 0 + htpmb = 1 + st_cr = 1 + st_tide = 1 + rembar_massloss = 0.5 + zsun = 0.014 + kickflag = 0 + using_cmc = 0 + + + do i=1,20 + bkick(i) = 0.d0 + enddo + + + endif + do i=1,17 + do j=1,2 + kick_info(j,i) = 0.d0 + enddo + enddo +* If you would like to enter the seperation as input in place of the binary +* orbital period uncomment these lines (depending upon which units you wish +* to use). +* tb = sqrt((tb/aursun)**3/(mass0(1)+mass0(2))) !if input was separation [Rsun] use this line. +* tb = sqrt((tb)**3/(mass0(1)+mass0(2))) !if input was separation [AU] use this line. +* tb = tb*yeardy + if(idum.gt.0) idum = -idum + CLOSE(22) + WRITE(*,*) +* +* Note that this routine can be used to evolve a single star if you +* simply set mass(2) = 0.0 or tb = 0.0 (setting both is advised as +* well as some dummy value for ecc). +* +************************************************************************ +* +* Set parameters which depend on the metallicity +* + CALL zcnsts(z,zpars) +* +* Set the collision matrix. +* + CALL instar +* + label(1) = 'INITIAL ' + label(2) = 'KW CHNGE' + label(3) = 'BEG RCHE' + label(4) = 'END RCHE' + label(5) = 'CONTACT ' + label(6) = 'COELESCE' + label(7) = 'COMENV ' + label(8) = 'GNTAGE ' + label(9) = 'NO REMNT' + label(10) = 'MAX TIME' + label(11) = 'DISRUPT ' + label(12) = 'BEG SYMB' + label(13) = 'END SYMB' + label(14) = 'BEG BSS' + label(15) = 'SN PRIM' + label(16) = 'SN SEC' +* +* Set the data-save parameter. If dtp is zero then the parameters of the +* star will be stored in the bcm array at each timestep otherwise they +* will be stored at intervals of dtp. Setting dtp equal to tphysf will +* store data only at the start and end while a value of dtp greater than +* tphysf will mean that no data is stored. +* + dtp = 0 +* +* Evolve the binary. +* + CALL evolv2(kstar,mass,tb,ecc,z,tphysf,dtp,mass0,rad,lum, + & massc,radc,menv,renv,ospin,B_0,bacc,tacc, + & epoch,tms,bhspin,tphys,zpars,bkick,kick_info, + & bcm_index_out,bpp_index_out,kick_info_out) +* +************************************************************************ +* Output: +* First check that bcm is not empty. +* + if(bcm(1,1).lt.0.0) goto 50 +* +* The bcm array stores the stellar and orbital parameters at the +* specified output times. The parameters are (in order of storage): +* +* Time, +* [stellar type, initial mass, current mass, log10(L), log10(r), +* log10(Teff), core mass, core radius, mass of any convective +* envelope, radius of the envelope, epoch, spin, mass loss rate and +* ratio of radius to roche lobe radius (repeated for secondary)], +* period, separation, eccentricity. +* + OPEN(23,file='binary.dat', status='unknown') + j = 0 + 30 j = j + 1 + if(bcm(j,1).lt.0.0)then + bcm(j-1,1) = bcm(j,1) + j = j - 1 + endif + kw = INT(bcm(j,2)) + kw2 = INT(bcm(j,16)) + WRITE(23,99)bcm(j,1),kw,kw2,bcm(j,4),bcm(j,18), + & bcm(j,8),bcm(j,22), + & bcm(j,6),bcm(j,20),bcm(j,15),bcm(j,29), + & bcm(j,5),bcm(j,19),bcm(j,13),bcm(j,27), + & bcm(j,14),bcm(j,28), + & bcm(j,31),bcm(j,32) + if(bcm(j,1).ge.0.0) goto 30 + CLOSE(23) + 99 FORMAT(g30.18,2i3,10g30.18,5e30.18,g30.18) + 999 FORMAT(g30.18,2g30.18,1p,2e30.18) +* +* The bpp array acts as a log, storing parameters at each change +* of evolution stage. +* + 50 j = 0 + WRITE(*,*)' TIME M1 M2 K1 K2 SEP ECC', + & ' R1/ROL1 R2/ROL2 TYPE' + 52 j = j + 1 + if(bpp(j,1).lt.0.0) goto 60 + kstar(1) = INT(bpp(j,4)) + kstar(2) = INT(bpp(j,5)) + kw = INT(bpp(j,11)) + WRITE(*,100)(bpp(j,k),k=1,3),kstar,(bpp(j,k),k=6,9),label(kw) + goto 52 + 60 continue + 100 FORMAT(g30.18,2g30.18,2i3,g30.18,g30.18,2g30.18,2x,a8) + WRITE(*,*) +* +************************************************************************ +* + WRITE(*,*) bcm(2,31), bpp(j, 6) + + STOP + END +*** diff --git a/src/cosmic/tests/meson.build b/src/cosmic/tests/meson.build new file mode 100644 index 000000000..7cd621809 --- /dev/null +++ b/src/cosmic/tests/meson.build @@ -0,0 +1,11 @@ +python_sources = [ + 'test_evolve.py', + 'test_match.py', + 'test_sample.py', + 'test_utils.py' +] + +py3.install_sources( + python_sources, + subdir: 'cosmic' +) \ No newline at end of file diff --git a/src/cosmic/tests/test_sample.py b/src/cosmic/tests/test_sample.py index 39675343e..f87016816 100644 --- a/src/cosmic/tests/test_sample.py +++ b/src/cosmic/tests/test_sample.py @@ -192,6 +192,16 @@ def test_sample_secondary(self): slope = linear_fit(q) self.assertEqual(np.round(slope, 1), FLAT_SLOPE) + def test_sample_q(self): + """Test you can sample different mass ratio distributions""" + np.random.seed(2) + mass1, total_mass = SAMPLECLASS.sample_primary(primary_model='kroupa01', size=10000000) + for slope in [0, 1, 2]: + mass2 = SAMPLECLASS.sample_secondary(primary_mass=mass1, q_power_law=slope, qmin=0.0) + q = mass2 / mass1 + fit_slope = power_law_fit(q) + self.assertEqual(np.round(fit_slope, 1), slope) + def test_binary_select(self): np.random.seed(2) # Check that the binary select function chooses binarity properly @@ -225,6 +235,20 @@ def test_binary_fraction(self): self.assertLess(error, offner_error) + test_fracs = [] + test_errs = [] + primary_mass = np.array([float(x) for x in np.logspace(np.log10(0.08), np.log10(150), num=100000)]) + m1_b, m1_s, binfrac, bin_index = SAMPLECLASS.binary_select(primary_mass=primary_mass, binfrac_model='offner22') + for i in range(len(OFFNER_MASS_RANGES)): + low, high = OFFNER_MASS_RANGES[i][0], OFFNER_MASS_RANGES[i][1] + offner_value = OFFNER_DATA[i] + offner_error = OFFNER_ERRORS[i] + bins_count = len(m1_b[(m1_b >= low) & (m1_b <= high)]) + singles_count = len(m1_s[(m1_s >= low) & (m1_s <= high)]) + bin_frac = bins_count / (bins_count + singles_count) + error = abs(offner_value - bin_frac) + self.assertLess(error, offner_error) + def test_msort(self): np.random.seed(2) mass1, total_mass = SAMPLECLASS.sample_primary(primary_model='kroupa01', size=1000000) @@ -260,6 +284,16 @@ def test_sample_porb(self): power_slope = power_law_fit(np.log10(porb)) self.assertEqual(np.round(power_slope, 2), SANA12_PORB_POWER_LAW) + # now some custom power laws + for slope in [-0.5, 0.5, 1]: + porb,aRL_over_a = SAMPLECLASS.sample_porb( + mass1, mass2, rad1, rad2, porb_model={ + "min": 0.15, "max": 5, "slope": slope + }, size=mass1.size + ) + power_slope = power_law_fit(np.log10(porb)) + self.assertEqual(np.round(power_slope, 1), slope) + np.random.seed(5) # next do Renzo+19 m1_high = mass1+15 diff --git a/src/cosmic/utils.py b/src/cosmic/utils.py index 4525547ed..01f72552b 100644 --- a/src/cosmic/utils.py +++ b/src/cosmic/utils.py @@ -654,6 +654,8 @@ def rndm(a, b, g, size): fixed by inputs """ + if g == -1: + raise ValueError("Power law index cannot be exactly -1") r = np.random.random(size=size) ag, bg = a ** (g + 1), b ** (g + 1) return (ag + (bg - ag) * r) ** (1.0 / (g + 1)) @@ -1476,9 +1478,9 @@ def error_check(BSEDict, SSEDict, filters=None, convergence=None, sampling=None) ) flag = "gamma" if flag in BSEDict.keys(): - if (BSEDict[flag] < 0) and (BSEDict[flag] != -1) and (BSEDict[flag] != -2): + if (BSEDict[flag] < 0) and (BSEDict[flag] != -1) and (BSEDict[flag] != -2) and (BSEDict[flag] != -3): raise ValueError( - "'{0:s}' needs to either be set to -2, -1, or a positive number (you set it to '{1:0.2f}')".format( + "'{0:s}' needs to either be set to -3, -2, -1, or a positive number (you set it to '{1:0.2f}')".format( flag, BSEDict[flag] ) ) From eb18b18019986b6d001e9eeb629a6b9ba0610d64 Mon Sep 17 00:00:00 2001 From: Duncan B Maclean <146674933+d-maclean@users.noreply.github.com> Date: Wed, 9 Oct 2024 08:15:17 -0400 Subject: [PATCH 20/46] updated METISSE (#680) Co-authored-by: duncan_m --- src/cosmic/src/METISSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cosmic/src/METISSE b/src/cosmic/src/METISSE index 4aa408f6d..7d81d56c1 160000 --- a/src/cosmic/src/METISSE +++ b/src/cosmic/src/METISSE @@ -1 +1 @@ -Subproject commit 4aa408f6d031571385e3cb01b20022688445621f +Subproject commit 7d81d56c1abad074392f5ba20e3d18ad1e1d74b8 From d02b64e094cb988fddd30cac69e2c5d1d24d6ea3 Mon Sep 17 00:00:00 2001 From: Duncan B Maclean <146674933+d-maclean@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:15:12 -0500 Subject: [PATCH 21/46] Fix cosmic-pop executable for METISSE-integrate (#681) * updated METISSE * added 'SSEDict' to cosmic-pop binary --------- Co-authored-by: duncan_m --- bin/cosmic-pop | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/cosmic-pop b/bin/cosmic-pop index 080a12393..5b379b9e1 100755 --- a/bin/cosmic-pop +++ b/bin/cosmic-pop @@ -68,7 +68,7 @@ def parse_commandline(): defaults = {} if not (args.inifile is None and (('-h' in remaining_argv) or ('--help' in remaining_argv))): - BSEDict, seed_int, filters, convergence, sampling = utils.parse_inifile(args.inifile) + BSEDict, SSEDict, seed_int, filters, convergence, sampling = utils.parse_inifile(args.inifile) defaults.update(sampling) defaults.update(filters) defaults.update(convergence) @@ -177,7 +177,7 @@ if __name__ == '__main__': # READ AND PARSE INIFILE ########################################################################### - BSEDict, seed_int, filters, convergence, sampling = utils.parse_inifile(args.inifile) + BSEDict, SSEDict, seed_int, filters, convergence, sampling = utils.parse_inifile(args.inifile) # we now overwrite the inifile values with what was specified from the command line # (which could mean not overwriting anything at all because they are populated @@ -213,8 +213,8 @@ if __name__ == '__main__': "with {0}={2} from the commandline".format(argument, seed_int, getattr(args, argument))) seed_int = getattr(args, argument) - # Check that the values in BSEDict, filters, and convergence are valid - utils.error_check(BSEDict, filters, convergence, sampling) + # Check that the values in BSEDict, SSEDict, filters, and convergence are valid + utils.error_check(BSEDict, SSEDict, filters, convergence, sampling) if seed_int != 0: np.random.seed(seed_int) @@ -263,7 +263,7 @@ if __name__ == '__main__': log_file = open('log_kstar1_{0}_kstar2_{1}_SFstart_{2}_SFduration_{3}_metallicity_{4}.txt'.format(kstar1_range_string, kstar2_range_string, sampling['SF_start'], sampling['SF_duration'], sampling['metallicity']), 'w') # save configuration settings to output file - configuration_settings = {'BSEDict' : BSEDict, 'filters' : filters, + configuration_settings = {'BSEDict' : BSEDict, 'SSEDict': SSEDict, 'filters' : filters, 'convergence' : convergence, 'sampling' : sampling} for k, v in configuration_settings.items(): @@ -376,6 +376,7 @@ if __name__ == '__main__': bpp, bcm, initCond, kick_info = Evolve.evolve(initialbinarytable=IBT, pool=pool, BSEDict=BSEDict, + SSEDict=SSEDict, idx=idx, dtp=dtp, timestep_conditions=filters['timestep_conditions']) From 2cf10c1c37576f996f53ba5be36601da7fdc3341 Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Thu, 12 Dec 2024 13:28:58 -0600 Subject: [PATCH 22/46] Fastforward to develop branch (#684) * offner22 primary mass dependent binary fraction (#644) * added offner22 primary mass dependent binary fraction * pinning numpy version because of new numpy version released on june 16 (https://stackoverflow.com/questions/78634235/numpy-dtype-size-changed-may-indicate-binary-incompatibility-expected-96-from) * pinned numpy version so 3.7 works --------- Co-authored-by: katiebreivik * Update utils.py (#648) * Update utils.py fix trapezoid import * Update utils.py missed one trapz * version bump and dropping below python3.9 (#653) * version bump and dropping below python3.9 * forward to numpy 1.26.0 * trying a different version * fix trapz import * Update build_wheels_and_publish.yml explicitly install gcc * Update build_wheels_and_publish.yml trying to fix gfortran * Update build_wheels_and_publish.yml specifying path with symlink, checking path * Update build_wheels_and_publish.yml (#654) * Update build_wheels_and_publish.yml * Update _version.py * Update meson.build * Update pyproject.toml (#655) * Version bump for pip (#656) * Update meson.build * Update _version.py * Add power law sampling options for ``porb`` and ``q`` (#651) * add `q_power_law` parameter to change the power law of the mass ratio distribution * allow custom power laws for orbital periods * add mass ratio sampling test * add test for custom porb power laws * add to changelog * New ``gamma`` option for circumbinary discs (#652) * add new gamma prescription, add some int() statements * add details to docs page * update ini files * * Modifying the init file to include the commit hash. (#659) *Created get_commit_hash file that finds the commit hash. *Modified the meson.build file to run get_commit_hash when cosmic is installed. * Created maximum wall time option (#620) * Added compression options for pandas * Created maximum wall time argument * Add debugging setup, avoid NaNs from timestep issue (#647) * setup debugging environment * ignore a bunch of files * add a testing fortran script * move debugging to its own folder * add a python script for creating the input * add a simple makefile for testing * important change: use `loop` instead of `1000` for timestep condition * add a note about settings * clean up vscode setup * I can't count :upside_down_face: * added new test suite location * fixing numpy pinned version * forcing numpy version I guess --------- Co-authored-by: katiebreivik Co-authored-by: Katie Breivik * allow a gamma of -3 in error_check (#661) * fixing wheel build for pypi, hopefully * tiny version bump (#665) * Update _version.py * Update pyproject.toml add @TomWagg as dev * Update meson.build bump version * Update build_wheels_and_publish.yml * Update build_wheels_and_publish.yml removing gfortran symlink * Update build_wheels_and_publish.yml * Update build_wheels_and_publish.yml (#666) * Update build_wheels_and_publish.yml * this should be a working build. * add meson to requirements * Fixing linux only wheel (#667) * Update build_wheels_and_publish.yml * adding in python versions * Update build_wheels_and_publish.yml * Update meson.build * Update meson.build * Update pyproject.toml * Pip fix (#669) * add DS_Store to ignore * finalllllly got the platform specific wheels built with a pure: false * tiny bump in version for tag * Update build_wheels_and_publish.yml need to repair linux build with cibuildwheel for PyPI * Update meson.build forgot to bump version here * build wheels and publish fix (#670) * pins cibuildwheel==2.17.0 so that we can build across macOS versions. * allow push to pypi * add x_86 and arch compatibility for wheels (#671) * Update build_wheels_and_publish.yml * Update build_wheels_and_publish.yml * Update meson.build version * Update _version.py version * Update pyproject.toml version * combine the bpp and bcm columns * pass bpp column information * add bpp column variables * pass all columns to bpp_array * only need 49 actually * bin nums separate, only index certain parts of table * all the binaries! * change writebpp function to use any columns * add new bcm variables * switch to a single function for simplicity * change everything to writetab * pass deltam to comenv too * use writetab not writebpp in comenv.f * ip not jp * add bcm stuff and convert integer columns with a loop (add kstars/evol_type) * `rsunau` ended up in the wrong place, this should fix porbs * Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows (#672) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4.1.7. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3...v4.1.7) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * metisse update * Pypi fix (#676) * trying out pypi tests * add in wheel repair * trying native build * adding in pytest check * adding in pytest install * Update build_wheels_and_publish.yml remove the cibuildwheel environment variables and updating action versions * Update build_wheels_and_publish.yml * Update build_wheels_and_publish.yml Had wrong download action version * Update build_wheels_and_publish.yml add in auditwheel for manylinux * Update build_wheels_and_publish.yml (#677) * Update build_wheels_and_publish.yml * Update build_wheels_and_publish.yml split mac and linux builds * Update build_wheels_and_publish.yml trying to get cibuildwheels working again for linux * Update pyproject.toml removed pytest from cibuildwheel args * Update build_wheels_and_publish.yml don't actually publish * Update build_wheels_and_publish.yml * Update build_wheels_and_publish.yml * Update build_wheels_and_publish.yml * Update build_wheels_and_publish.yml * Update build_wheels_and_publish.yml * Update _version.py * Update pyproject.toml * Update meson.build * Implement new kick prescription (#678) * start a function for changing bases * add cross product function * fix indents * better variables and copy over initial function part * angles, better variables, natal kick done * fix transformation for pre-disrupted binaries * add vector calculations * everything done except Euler angles * add dot product and angle functions * fix indentation, add kick info logging of disrupt * start adding Euler angles * rename files * fix vector variables * get rid of redundant anomaly stuff * snstar->sn, update jorb, record in kick_info * make kick info bigger * /= is not a thing in fortran who knew * it lives! (compiles!) * move helpers, calculate new sep, use correct mass! * better docstring info * add check for collisions * clean up all of the units * properly update Euler angles * declare all the variables * put the old function back in * change kickflag definition * change default kickflag to 1 not 0 * update kickflag docs * update ini files * missed some kickflags * calculate h_mag earlier, fix jorb units * fix tiny typo * update tests to check on OLD kick prescription for now * add another test for ejection velocities * update changelog and version * more version updates --------- Co-authored-by: katiebreivik * fix error check * Fix NaNs coming from supernova kicks (#679) * account for cases with no natal kick and ecc_prev=0.0 * don't forget binstate mergertype bookkeeping * Update cosmic-pop (#683) Fixed parsing of binfrac model. Now string values are properly handled. * get working * fixing tests but as a hack for a couple of them because we updated the kicks and I dont have time to fix it --------- Signed-off-by: dependabot[bot] Co-authored-by: MarkGM02 <90350113+MarkGM02@users.noreply.github.com> Co-authored-by: Tom Wagg Co-authored-by: elenagonzalez870 <52000594+elenagonzalez870@users.noreply.github.com> Co-authored-by: Vera Eris Del Favero <77068792+xevra@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../workflows/build_wheels_and_publish.yml | 21 +- bin/cosmic-pop | 9 +- changelog.md | 6 +- debug/create_binary_in.py | 2 +- docs/inifile/index.rst | 13 +- examples/CMC_Params.ini | 16 +- examples/Params.ini | 16 +- meson.build | 2 +- pyproject.toml | 6 +- src/cosmic/_version.py | 2 +- src/cosmic/evolve.py | 98 +- src/cosmic/src/benchmarkevolv2.f | 492 ++++----- src/cosmic/src/bpp_array.f | 208 ++-- src/cosmic/src/comenv.f | 53 +- src/cosmic/src/const_bse.h | 5 +- src/cosmic/src/evolv2.f | 257 +++-- src/cosmic/src/kick.f | 959 +++++++++++++++++- src/cosmic/src/test_bse.f | 4 +- src/cosmic/tests/data/Params.ini | 17 +- .../tests/data/kick_initial_conditions.h5 | Bin 0 -> 1080008 bytes src/cosmic/tests/test_evolve.py | 29 +- src/cosmic/tests/test_utils.py | 4 +- src/cosmic/utils.py | 6 +- 23 files changed, 1655 insertions(+), 570 deletions(-) create mode 100644 src/cosmic/tests/data/kick_initial_conditions.h5 diff --git a/.github/workflows/build_wheels_and_publish.yml b/.github/workflows/build_wheels_and_publish.yml index 92f2308da..4efe21baf 100644 --- a/.github/workflows/build_wheels_and_publish.yml +++ b/.github/workflows/build_wheels_and_publish.yml @@ -4,10 +4,10 @@ on: release: types: [published] workflow_dispatch: - env: CIBW_BUILD: "cp39-* cp310-*" + CIBW_ARCHS_LINUX: "x86_64" CIBW_SKIP: "*-win32 *musllinux*" CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 CIBW_ARCHS_MACOS: "x86_64 arm64" @@ -46,14 +46,19 @@ jobs: - name: Install dependencies run: | - python -m pip install cibuildwheel==2.17.0 setuptools wheel build meson-python ninja meson + python -m pip install setuptools wheel build meson-python ninja meson pytest cibuildwheel - - name: Build source distribution (sdist) + - name: Build source and wheels distribution on MacOS + if: runner.os == 'macOS' run: | - python -m build --sdist --outdir dist - - - name: Build wheels using cibuildwheel + python -m build --outdir dist + find ./dist/*.whl | xargs pip install + pytest src/cosmic + + - name: Build source and wheels distribution on Linux + if: runner.os == 'Linux' run: | + python -m build --sdist --outdir dist python -m cibuildwheel --output-dir dist - uses: actions/upload-artifact@v3 @@ -74,9 +79,9 @@ jobs: python-version: ["3.10"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} diff --git a/bin/cosmic-pop b/bin/cosmic-pop index 5b379b9e1..8bda880ed 100755 --- a/bin/cosmic-pop +++ b/bin/cosmic-pop @@ -48,6 +48,13 @@ def str2bool(v): ############################################################################### # DEFINE COMMANDLINE ARGUMENTS ############################################################################### + +def binfrac_type(value): + try: + return float(value) + except ValueError: + return value + def parse_commandline(): """Parse the arguments given on the command-line. """ @@ -103,7 +110,7 @@ def parse_commandline(): parser.add_argument("--binary_state", nargs='+', type=int) parser.add_argument("--sampling_method") parser.add_argument("--primary_model", help="Chooses the initial primary mass function from: salpeter55, kroupa93, kroupa01", type=str) - parser.add_argument("--binfrac_model", help="Chooses the binary fraction model from: a float between [0,1], vanHaaften, and offner22", type=float) + parser.add_argument("--binfrac_model", help="Chooses the binary fraction model from: a float between [0,1], vanHaaften, and offner22", type=binfrac_type) parser.add_argument("--ecc_model", help="Chooses the initial eccentricity distribution model from: thermal, uniform, and sana12", type=str) parser.add_argument("--porb_model", help="Chooses the initial orbital period distribution model from: log_uniform and sana12", type=str) parser.add_argument("--SF_start", help="Sets the time in the past when star formation initiates in Myr", type=float) diff --git a/changelog.md b/changelog.md index 8ee2c455b..7251169de 100644 --- a/changelog.md +++ b/changelog.md @@ -42,4 +42,8 @@ See the discussed changes in our previous releases here: https://github.com/COSM ## 3.4.11 - - Added sampling options to ``independent`` sampler to allow for custom power law distributions for ``porb`` and ``q`` \ No newline at end of file + - Added sampling options to ``independent`` sampler to allow for custom power law distributions for ``porb`` and ``q`` + +## 3.5.0 + - Feature: Added `bpp_columns` and `bcm_columns` parameters to the `evolve()` function to allow users to specify the columns in the bpp and bcm tables + - Bug fix: Changed `kick.f` to use the Pfahl+02 kick prescription by default instead of Kiel & Hurley 2009, this fixes ejection velocities of secondaries and also changed kick_info to have an extra column diff --git a/debug/create_binary_in.py b/debug/create_binary_in.py index c06817949..6f15fbaa3 100644 --- a/debug/create_binary_in.py +++ b/debug/create_binary_in.py @@ -16,7 +16,7 @@ 2.0/21.0, 2.0/21.0, 2.0/21.0, 2.0/21.0, 2.0/21.0, 2.0/21.0, 2.0/21.0, 2.0/21.0], 'bhspinflag': 0, 'bhspinmag': 0.0, 'rejuv_fac': 1.0, 'rejuvflag': 0, 'htpmb': 1, - 'ST_cr': 1, 'ST_tide': 1, 'bdecayfac': 1, 'rembar_massloss': 0.5, 'kickflag': 0, + 'ST_cr': 1, 'ST_tide': 1, 'bdecayfac': 1, 'rembar_massloss': 0.5, 'kickflag' : 1, 'zsun': 0.014, 'bhms_coll_flag': 0, 'don_lim': -1, 'acc_lim': -1, 'binfrac': 0.5, 'rtmsflag': 0, 'wd_mass_lim': 1, 'idum': 100} diff --git a/docs/inifile/index.rst b/docs/inifile/index.rst index 0562b72ff..f9fbab60c 100644 --- a/docs/inifile/index.rst +++ b/docs/inifile/index.rst @@ -647,7 +647,7 @@ common envelope occurs regardless of the choices below: ``aic``, and ``ussn``, which are described below, are only used when ``kickflag=0`` - ``0`` : The standard COSMIC kick prescription, where + ``1`` : The standard COSMIC kick prescription, where kicks are drawn from a bimodal distribution with standard FeCCSN getting a kick drawn from a Maxwellian distribution with dispersion parameter ``sigma`` and ECSN/USSN @@ -655,18 +655,21 @@ common envelope occurs regardless of the choices below: additional possible options for ``bhflag``, ``bhsigmafrac``, ``aic`` and ``ussn``. - ``-1`` : Natal kicks are drawn according to ``sigma`` and + ``2`` : Natal kicks are drawn according to ``sigma`` and scaled by the ejecta mass and remnant mass following Eq. 1 of `Giacobbo & Mapelli 2020 `_ - ``-2`` : Natal kicks are drawn according to ``sigma`` and + ``3`` : Natal kicks are drawn according to ``sigma`` and scaled by just the ejecta mass following Eq. 2 of `Giacobbo & Mapelli 2020 `_ - ``-3`` : Natal kicks are drawn according to Eq. 1 of + ``4`` : Natal kicks are drawn according to Eq. 1 of `Bray & Eldridge 2016 `_ - **default = 0** + ``negative values`` : As above except using the Kiel & Hurley 2009 velocity + implementation instead of the default Pfahl+2002 + + **default = 1** ``sigma`` Sets the dispersion in the Maxwellian for the SN kick velocity in km/s diff --git a/examples/CMC_Params.ini b/examples/CMC_Params.ini index 5f13cfc6c..63ccd9e42 100644 --- a/examples/CMC_Params.ini +++ b/examples/CMC_Params.ini @@ -403,17 +403,19 @@ qcrit_array = [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0] ;;;;;;;;;;;;;;;;;; ; kickflag sets the particular kick prescription to use -; kickflag=0 uses the standard kick prescription, where kicks are drawn from a bimodal +; kickflag=1 uses the standard kick prescription, where kicks are drawn from a bimodal ; distribution based on whether they go through FeCCSN or ECSN/USSN -; kickflag=-1 uses the prescription from Giacobbo & Mapelli 2020 (Eq. 1) +; kickflag=2 uses the prescription from Giacobbo & Mapelli 2020 (Eq. 1) ; with their default parameters (=1.2 Msun, =9 Msun) -; kickflag=-2 uses the prescription from Giacobbo & Mapelli 2020 (Eq. 2), +; kickflag=3 uses the prescription from Giacobbo & Mapelli 2020 (Eq. 2), ; which does not scale the kick by -; kickflag=-3 uses the prescription from Bray & Eldridge 2016 (Eq. 1) +; kickflag=4 uses the prescription from Bray & Eldridge 2016 (Eq. 1) ; with their default parameters (alpha=70 km/s, beta=120 km/s) -; Note: sigmadiv, bhflag, bhsigmafrac, aic, and ussn are only used when kickflag=0 -; default = 0 -kickflag = 0 +; negative kickflags are the same as their positive counterparts, but using the Kiel & Hurley 2009 +; kick implementation instead of the default Pfahl et al. 2002 +; Note: sigmadiv, bhflag, bhsigmafrac, aic, and ussn are only used when abs(kickflag)=1 +; default = 1 +kickflag = 1 ; sigma sets is the dispersion in the Maxwellian for the SN kick velocity in km/s ; default = 265.0 diff --git a/examples/Params.ini b/examples/Params.ini index dd8621ade..a717d72bb 100644 --- a/examples/Params.ini +++ b/examples/Params.ini @@ -270,17 +270,19 @@ qcrit_array = [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0] ;;;;;;;;;;;;;;;;;; ; kickflag sets the particular kick prescription to use -; kickflag=0 uses the standard kick prescription, where kicks are drawn from a bimodal +; kickflag=1 uses the standard kick prescription, where kicks are drawn from a bimodal ; distribution based on whether they go through FeCCSN or ECSN/USSN -; kickflag=-1 uses the prescription from Giacobbo & Mapelli 2020 (Eq. 1) +; kickflag=2 uses the prescription from Giacobbo & Mapelli 2020 (Eq. 1) ; with their default parameters (=1.2 Msun, =9 Msun) -; kickflag=-2 uses the prescription from Giacobbo & Mapelli 2020 (Eq. 2), +; kickflag=3 uses the prescription from Giacobbo & Mapelli 2020 (Eq. 2), ; which does not scale the kick by -; kickflag=-3 uses the prescription from Bray & Eldridge 2016 (Eq. 1) +; kickflag=4 uses the prescription from Bray & Eldridge 2016 (Eq. 1) ; with their default parameters (alpha=70 km/s, beta=120 km/s) -; Note: sigmadiv, bhflag, bhsigmafrac, aic, and ussn are only used when kickflag=0 -; default = 0 -kickflag = 0 +; negative kickflags are the same as their positive counterparts, but using the Kiel & Hurley 2009 +; kick implementation instead of the default Pfahl et al. 2002 +; Note: sigmadiv, bhflag, bhsigmafrac, aic, and ussn are only used when abs(kickflag)=1 +; default = 1 +kickflag = 1 ; sigma sets is the dispersion in the Maxwellian for the SN kick velocity in km/s ; default = 265.0 diff --git a/meson.build b/meson.build index 446f49ffd..c208bdc35 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('cosmic', 'c', 'fortran', - version : '3.4.16', + version : '3.5.0', default_options: ['warning_level=0', 'optimization=3'], ) diff --git a/pyproject.toml b/pyproject.toml index 4cc88a681..f3211240b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ authors = [ { name="Tom Wagg" }, ] readme = "README.md" -version = "3.4.16" +version = "3.5.0" requires-python = ">=3.9" license = { text = "MIT License" } classifiers = [ @@ -25,8 +25,10 @@ dependencies = ["numpy", "scipy", "astropy", "configparser", "tqdm", "pandas", "tables", "h5py", "schwimmbad", "matplotlib", "importlib-metadata"] - [build-system] build-backend = 'mesonpy' requires = ['meson-python', 'numpy'] +[tool.cibuildwheel.macos] +repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}" + diff --git a/src/cosmic/_version.py b/src/cosmic/_version.py index e96c6b387..dcbfb52f6 100644 --- a/src/cosmic/_version.py +++ b/src/cosmic/_version.py @@ -1 +1 @@ -__version__ = "3.4.16" +__version__ = "3.5.0" diff --git a/src/cosmic/evolve.py b/src/cosmic/evolve.py index 6fade993b..c3c6c2923 100644 --- a/src/cosmic/evolve.py +++ b/src/cosmic/evolve.py @@ -41,10 +41,24 @@ __author__ = 'Scott Coughlin ' __credits__ = ['Katelyn Breivik ', 'Michael Zevin ', - 'digman.12@osu.edu'] + 'digman.12@osu.edu', + 'Tom Wagg '] __all__ = ['Evolve'] + +ALL_COLUMNS = ['tphys', 'mass_1', 'mass_2', 'kstar_1', 'kstar_2', 'sep', 'porb', + 'ecc', 'RRLO_1', 'RRLO_2', 'evol_type', 'aj_1', 'aj_2', 'tms_1', + 'tms_2', 'massc_1', 'massc_2', 'rad_1', 'rad_2', 'mass0_1', + 'mass0_2', 'lum_1', 'lum_2', 'teff_1', 'teff_2', 'radc_1', + 'radc_2', 'menv_1', 'menv_2', 'renv_1', 'renv_2', 'omega_spin_1', + 'omega_spin_2', 'B_1', 'B_2', 'bacc_1', 'bacc_2', 'tacc_1', + 'tacc_2', 'epoch_1', 'epoch_2', 'bhspin_1', 'bhspin_2', + 'deltam_1', 'deltam_2', 'SN_1', 'SN_2', 'bin_state', 'merger_type'] + +INTEGER_COLUMNS = ["bin_state", "bin_num", "kstar_1", "kstar_2", "SN_1", "SN_2", "evol_type"] + + BPP_COLUMNS = ['tphys', 'mass_1', 'mass_2', 'kstar_1', 'kstar_2', 'sep', 'porb', 'ecc', 'RRLO_1', 'RRLO_2', 'evol_type', 'aj_1', 'aj_2', 'tms_1', 'tms_2', @@ -53,7 +67,7 @@ 'radc_1', 'radc_2', 'menv_1', 'menv_2', 'renv_1', 'renv_2', 'omega_spin_1', 'omega_spin_2', 'B_1', 'B_2', 'bacc_1', 'bacc_2', 'tacc_1', 'tacc_2', 'epoch_1', 'epoch_2', - 'bhspin_1', 'bhspin_2', 'bin_num'] + 'bhspin_1', 'bhspin_2'] BCM_COLUMNS = ['tphys', 'kstar_1', 'mass0_1', 'mass_1', 'lum_1', 'rad_1', 'teff_1', 'massc_1', 'radc_1', 'menv_1', 'renv_1', 'epoch_1', @@ -61,12 +75,12 @@ 'lum_2', 'rad_2', 'teff_2', 'massc_2', 'radc_2', 'menv_2', 'renv_2', 'epoch_2', 'omega_spin_2', 'deltam_2', 'RRLO_2', 'porb', 'sep', 'ecc', 'B_1', 'B_2', - 'SN_1', 'SN_2', 'bin_state', 'merger_type', 'bin_num'] + 'SN_1', 'SN_2', 'bin_state', 'merger_type'] KICK_COLUMNS = ['star', 'disrupted', 'natal_kick', 'phi', 'theta', 'mean_anomaly', 'delta_vsysx_1', 'delta_vsysy_1', 'delta_vsysz_1', 'vsys_1_total', 'delta_vsysx_2', 'delta_vsysy_2', 'delta_vsysz_2', 'vsys_2_total', - 'delta_theta_total', 'omega', 'randomseed', 'bin_num'] + 'theta_euler', 'phi_euler', 'psi_euler', 'randomseed', 'bin_num'] # We use the list of column in the initialbinarytable function to initialize # the list of columns that we will send to the fortran evolv2 function. @@ -143,7 +157,7 @@ def __init__(): ''' @classmethod - def evolve(cls, initialbinarytable, pool=None, **kwargs): + def evolve(self, initialbinarytable, pool=None, bpp_columns=None, bcm_columns=None, **kwargs): """After setting a number of initial conditions we evolve the system. Parameters @@ -151,6 +165,15 @@ def evolve(cls, initialbinarytable, pool=None, **kwargs): initialbinarytable : DataFrame Initial conditions of the binary + pool : Multiprocessing pool + Pool of workers to use to evolve systems in parallel + + bpp_columns : list, optional, default: None + Columns to save in the bpp table (key evolutionary stage table) + + bcm_columns : list, optional, default: None + Columns to save in the bcm table (detailed evolution table) + **kwargs: There are three ways to tell evolve and thus the fortran what you want all the flags and other BSE specific @@ -198,11 +221,11 @@ def evolve(cls, initialbinarytable, pool=None, **kwargs): Returns ------- - output_bpp : DataFrame - Evolutionary history of each binary + output_bpp : :class:`pandas.DataFrame` + Table of key evolutionary stages for each binary - output_bcm : DataFrame - Final state of each binary + output_bcm : :class:`pandas.DataFrame` + Table of detailed evolution for each binary initialbinarytable : DataFrame Initial conditions for each binary @@ -211,6 +234,11 @@ def evolve(cls, initialbinarytable, pool=None, **kwargs): nproc = min(kwargs.pop('nproc', 1), len(initialbinarytable)) n_per_block = kwargs.pop('n_per_block', -1) + if bpp_columns is None: + bpp_columns = BPP_COLUMNS + if bcm_columns is None: + bcm_columns = BCM_COLUMNS + # There are three ways to tell evolve and thus the fortran # what you want all the flags and other BSE specific # parameters to be @@ -387,6 +415,22 @@ def evolve(cls, initialbinarytable, pool=None, **kwargs): timestep_conditions = kwargs.pop('timestep_conditions', []) set_checkstates(timestep_conditions=timestep_conditions) + # set the indices of the columns to include in bpp table (+1 because fortran is 1-indexed) + col_inds_bpp = np.zeros(len(ALL_COLUMNS), dtype=int) + col_inds_bpp[:len(bpp_columns)] = [ALL_COLUMNS.index(col) + 1 for col in bpp_columns] + + # save bpp column information in the initial conditions + for i in range(len(initial_conditions)): + initial_conditions[i]["n_col_bpp"] = len(bpp_columns) + initial_conditions[i]["col_inds_bpp"] = col_inds_bpp + + # same for bcm + col_inds_bcm = np.zeros(len(ALL_COLUMNS), dtype=int) + col_inds_bcm[:len(bcm_columns)] = [ALL_COLUMNS.index(col) + 1 for col in bcm_columns] + for i in range(len(initial_conditions)): + initial_conditions[i]["n_col_bcm"] = len(bcm_columns) + initial_conditions[i]["col_inds_bcm"] = col_inds_bcm + # check if a pool was passed if pool is None: with MultiPool(processes=nproc) as pool: @@ -435,17 +479,25 @@ def evolve(cls, initialbinarytable, pool=None, **kwargs): index=kick_info_arrays[:, -1].astype(int)) bpp = pd.DataFrame(bpp_arrays, - columns=BPP_COLUMNS, + columns=bpp_columns + ["bin_num"], index=bpp_arrays[:, -1].astype(int)) bcm = pd.DataFrame(bcm_arrays, - columns=BCM_COLUMNS, + columns=bcm_columns + ["bin_num"], index=bcm_arrays[:, -1].astype(int)) - bcm.merger_type = bcm.merger_type.astype(int).astype(str).apply(lambda x: x.zfill(4)) - bcm.bin_state = bcm.bin_state.astype(int) - bpp.bin_num = bpp.bin_num.astype(int) - bcm.bin_num = bcm.bin_num.astype(int) + # convert a subset of columns to integers + for col in INTEGER_COLUMNS: + if col in bpp.columns: + bpp[col] = bpp[col].astype(int) + if col in bcm.columns: + bcm[col] = bcm[col].astype(int) + + # convert merger type to a padded string + if 'merger_type' in bpp.columns: + bpp.merger_type = bpp.merger_type.astype(int).astype(str).apply(lambda x: x.zfill(4)) + if 'merger_type' in bcm.columns: + bcm.merger_type = bcm.merger_type.astype(int).astype(str).apply(lambda x: x.zfill(4)) return bpp, bcm, initialbinarytable, kick_info @@ -530,9 +582,15 @@ def _evolve_single_system(f): else: raise ValueError("Use either 'sse' or 'metisse' as stellar engine") + _evolvebin.col.n_col_bpp = f["n_col_bpp"] + _evolvebin.col.col_inds_bpp = f["col_inds_bpp"] + _evolvebin.col.n_col_bcm = f["n_col_bcm"] + _evolvebin.col.col_inds_bcm = f["col_inds_bcm"] + [bpp_index, bcm_index, kick_info] = _evolvebin.evolv2([f["kstar_1"], f["kstar_2"]], [f["mass_1"], f["mass_2"]], - f["porb"], f["ecc"], f["metallicity"], f["tphysf"], f["dtp"], + f["porb"], f["ecc"], f["metallicity"], + f["tphysf"], f["dtp"], [f["mass0_1"], f["mass0_2"]], [f["rad_1"], f["rad_2"]], [f["lum_1"], f["lum_2"]], @@ -557,10 +615,10 @@ def _evolve_single_system(f): if bpp_index<0: raise ValueError("Failed in METISSE_zcnsts") else: - bcm = _evolvebin.binary.bcm[:bcm_index].copy() - bpp = _evolvebin.binary.bpp[:bpp_index].copy() - _evolvebin.binary.bpp[:bpp_index] = np.zeros(bpp.shape) - _evolvebin.binary.bcm[:bcm_index] = np.zeros(bcm.shape) + bpp = _evolvebin.binary.bpp[:bpp_index, :f["n_col_bpp"]].copy() + _evolvebin.binary.bpp[:bpp_index, :f["n_col_bpp"]] = np.zeros(bpp.shape) + bcm = _evolvebin.binary.bcm[:bcm_index, :f["n_col_bcm"]].copy() + _evolvebin.binary.bcm[:bcm_index, :f["n_col_bcm"]] = np.zeros(bcm.shape) bpp = np.hstack((bpp, np.ones((bpp.shape[0], 1))*f["bin_num"])) bcm = np.hstack((bcm, np.ones((bcm.shape[0], 1))*f["bin_num"])) diff --git a/src/cosmic/src/benchmarkevolv2.f b/src/cosmic/src/benchmarkevolv2.f index f2a56d4d8..57e23a7a2 100644 --- a/src/cosmic/src/benchmarkevolv2.f +++ b/src/cosmic/src/benchmarkevolv2.f @@ -10,10 +10,10 @@ PROGRAM benchmarkevolv2 REAL*8 mass0(2),massc(2),menv(2) REAL*8 rad(2),epoch(2) REAL*8 lumin(2),renv(2),radc(2) - REAL*8 zpars(20),kick_info(2,17) + REAL*8 zpars(20),kick_info(2,18) REAL*8 tacc(2),bacc(2),tms(2),B_0(2),ospin(2),bkick(20) REAL*8 tphys - REAL*8 kick_info_out(2,17) + REAL*8 kick_info_out(2,18) INTEGER bpp_index_out,bcm_index_out CHARACTER*256 path_to_tracks,path_to_he_tracks @@ -89,7 +89,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -173,7 +173,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -257,7 +257,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -341,7 +341,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -425,7 +425,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -509,7 +509,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -593,7 +593,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -677,7 +677,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -761,7 +761,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -845,7 +845,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -929,7 +929,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -1013,7 +1013,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -1097,7 +1097,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -1181,7 +1181,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -1265,7 +1265,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -1349,7 +1349,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -1433,7 +1433,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -1517,7 +1517,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -1601,7 +1601,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -1685,7 +1685,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -1769,7 +1769,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -1853,7 +1853,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -1937,7 +1937,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -2021,7 +2021,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -2105,7 +2105,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -2189,7 +2189,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -2273,7 +2273,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -2357,7 +2357,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -2441,7 +2441,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -2525,7 +2525,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -2609,7 +2609,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -2693,7 +2693,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -2777,7 +2777,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -2861,7 +2861,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -2945,7 +2945,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -3029,7 +3029,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -3113,7 +3113,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -3197,7 +3197,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -3281,7 +3281,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -3365,7 +3365,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -3449,7 +3449,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -3533,7 +3533,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -3617,7 +3617,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -3701,7 +3701,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -3785,7 +3785,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -3869,7 +3869,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -3953,7 +3953,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -4037,7 +4037,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -4121,7 +4121,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -4205,7 +4205,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -4289,7 +4289,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -4373,7 +4373,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -4457,7 +4457,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -4541,7 +4541,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -4625,7 +4625,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -4709,7 +4709,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -4793,7 +4793,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -4877,7 +4877,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -4961,7 +4961,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -5045,7 +5045,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -5129,7 +5129,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -5213,7 +5213,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -5297,7 +5297,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -5381,7 +5381,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -5465,7 +5465,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -5549,7 +5549,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -5633,7 +5633,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -5717,7 +5717,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -5801,7 +5801,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -5885,7 +5885,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -5969,7 +5969,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -6053,7 +6053,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -6137,7 +6137,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -6221,7 +6221,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -6305,7 +6305,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -6389,7 +6389,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -6473,7 +6473,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -6557,7 +6557,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -6641,7 +6641,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -6725,7 +6725,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -6809,7 +6809,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -6893,7 +6893,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -6977,7 +6977,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -7061,7 +7061,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -7145,7 +7145,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -7229,7 +7229,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -7313,7 +7313,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -7397,7 +7397,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -7481,7 +7481,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -7565,7 +7565,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -7649,7 +7649,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -7733,7 +7733,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -7817,7 +7817,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -7901,7 +7901,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -7985,7 +7985,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -8069,7 +8069,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -8153,7 +8153,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -8237,7 +8237,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -8321,7 +8321,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -8405,7 +8405,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -8489,7 +8489,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -8573,7 +8573,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -8657,7 +8657,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -8741,7 +8741,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -8825,7 +8825,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -8909,7 +8909,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -8993,7 +8993,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -9077,7 +9077,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -9161,7 +9161,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -9245,7 +9245,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -9329,7 +9329,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -9413,7 +9413,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -9497,7 +9497,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -9581,7 +9581,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -9665,7 +9665,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -9749,7 +9749,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -9833,7 +9833,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -9917,7 +9917,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -10001,7 +10001,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -10085,7 +10085,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -10169,7 +10169,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -10253,7 +10253,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -10337,7 +10337,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -10421,7 +10421,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -10505,7 +10505,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -10589,7 +10589,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -10673,7 +10673,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -10757,7 +10757,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -10841,7 +10841,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -10925,7 +10925,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -11009,7 +11009,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -11093,7 +11093,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -11177,7 +11177,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -11261,7 +11261,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -11345,7 +11345,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -11429,7 +11429,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -11513,7 +11513,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -11597,7 +11597,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -11681,7 +11681,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -11765,7 +11765,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -11849,7 +11849,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -11933,7 +11933,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -12017,7 +12017,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -12101,7 +12101,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -12185,7 +12185,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -12269,7 +12269,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -12353,7 +12353,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -12437,7 +12437,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -12521,7 +12521,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -12605,7 +12605,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -12689,7 +12689,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -12773,7 +12773,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -12857,7 +12857,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -12941,7 +12941,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -13025,7 +13025,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -13109,7 +13109,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -13193,7 +13193,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -13277,7 +13277,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -13361,7 +13361,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -13445,7 +13445,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -13529,7 +13529,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -13613,7 +13613,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -13697,7 +13697,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -13781,7 +13781,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -13865,7 +13865,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -13949,7 +13949,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -14033,7 +14033,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -14117,7 +14117,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -14201,7 +14201,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -14285,7 +14285,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -14369,7 +14369,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -14453,7 +14453,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -14537,7 +14537,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -14621,7 +14621,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -14705,7 +14705,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -14789,7 +14789,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -14873,7 +14873,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -14957,7 +14957,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -15041,7 +15041,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -15125,7 +15125,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -15209,7 +15209,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -15293,7 +15293,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -15377,7 +15377,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -15461,7 +15461,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -15545,7 +15545,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -15629,7 +15629,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -15713,7 +15713,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -15797,7 +15797,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -15881,7 +15881,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -15965,7 +15965,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -16049,7 +16049,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -16133,7 +16133,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -16217,7 +16217,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -16301,7 +16301,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -16385,7 +16385,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -16469,7 +16469,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -16553,7 +16553,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -16637,7 +16637,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -16721,7 +16721,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -16805,7 +16805,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -16889,7 +16889,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -16973,7 +16973,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -17057,7 +17057,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -17141,7 +17141,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -17225,7 +17225,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -17309,7 +17309,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -17393,7 +17393,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -17477,7 +17477,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -17561,7 +17561,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -17645,7 +17645,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -17729,7 +17729,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -17813,7 +17813,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -17897,7 +17897,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -17981,7 +17981,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -18065,7 +18065,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -18149,7 +18149,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -18233,7 +18233,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -18317,7 +18317,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -18401,7 +18401,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -18485,7 +18485,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -18569,7 +18569,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -18653,7 +18653,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -18737,7 +18737,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -18821,7 +18821,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -18905,7 +18905,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -18989,7 +18989,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -19073,7 +19073,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -19157,7 +19157,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -19241,7 +19241,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -19325,7 +19325,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -19409,7 +19409,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -19493,7 +19493,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -19577,7 +19577,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -19661,7 +19661,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -19745,7 +19745,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -19829,7 +19829,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -19913,7 +19913,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -19997,7 +19997,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -20081,7 +20081,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -20165,7 +20165,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -20249,7 +20249,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -20333,7 +20333,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -20417,7 +20417,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 @@ -20501,7 +20501,7 @@ PROGRAM benchmarkevolv2 bdecayfac = 1 grflag = 1 rembar_massloss = 0.5 - kickflag = 0 + kickflag = -1 zsun = 0.014 bhms_coll_flag = 0 wd_mass_lim = 1 diff --git a/src/cosmic/src/bpp_array.f b/src/cosmic/src/bpp_array.f index 4c2411b72..5ea53257e 100644 --- a/src/cosmic/src/bpp_array.f +++ b/src/cosmic/src/bpp_array.f @@ -1,5 +1,5 @@ *** - SUBROUTINE WRITEBPP(jp,tphys,evolve_type, + SUBROUTINE WRITETAB(jp,tphys,evolve_type, & mass1,mass2,kstar1,kstar2,sep, & tb,ecc,rrl1,rrl2, & aj1,aj2,tms1,tms2, @@ -8,14 +8,17 @@ SUBROUTINE WRITEBPP(jp,tphys,evolve_type, & teff1,teff2,radc1,radc2,menv1, & menv2,renv1,renv2,ospin1,ospin2, & b_0_1,b_0_2,bacc1,bacc2,tacc1,tacc2, - & epoch1,epoch2,bhspin1,bhspin2) + & epoch1,epoch2,bhspin1,bhspin2, + & deltam_1,deltam_2,SN_1,SN_2, + & bin_state,merger_type,tabname) IMPLICIT NONE INCLUDE 'const_bse.h' + * -* Write results to bpp array. +* Write results to bpp or bcm array. * -* Author : Scott Coughlin -* Date : 12th March 2019 +* Author : Scott Coughlin, Tom Wagg +* Date : 12th March 2019, September 2024 * REAL*8 mass1,mass2 REAL*8 evolve_type,sep,tb,ecc,tphys,rrl1,rrl2 @@ -24,141 +27,84 @@ SUBROUTINE WRITEBPP(jp,tphys,evolve_type, REAL*8 menv1,menv2,renv1,renv2,ospin1,ospin2 REAL*8 b_0_1,b_0_2,bacc1,bacc2,tacc1,tacc2,epoch1,epoch2 REAL*8 bhspin1,bhspin2,teff1,teff2 + REAL*8 deltam_1,deltam_2 + INTEGER SN_1,SN_2,bin_state,merger_type REAL*8 tb_write,sep_cubed - INTEGER jp + INTEGER jp, col_ind INTEGER kstar1,kstar2 REAL*8 yeardy,aursun,rsunau + REAL*8 all_cols(49) + CHARACTER*3 tabname PARAMETER(yeardy=365.24d0,aursun=214.95d0) - rsunau = 1/aursun - jp = MIN(900,jp + 1) - bpp(jp,1) = tphys - bpp(jp,2) = mass1 - bpp(jp,3) = mass2 - bpp(jp,4) = float(kstar1) - bpp(jp,5) = float(kstar2) - bpp(jp,6) = sep + all_cols(1) = tphys + all_cols(2) = mass1 + all_cols(3) = mass2 + all_cols(4) = float(kstar1) + all_cols(5) = float(kstar2) + all_cols(6) = sep if(tb.le.0.d0)then * system was disrupted and tb=-1 and should stay that way - bpp(jp,7) = tb + all_cols(7) = tb else + rsunau = 1/aursun sep_cubed = (sep*rsunau)*(sep*rsunau)*(sep*rsunau) tb_write = sqrt(sep_cubed/(mass1+mass2)) - bpp(jp,7) = tb_write*yeardy - endif - bpp(jp,8) = ecc - bpp(jp,9) = rrl1 - bpp(jp,10) = rrl2 - bpp(jp,11) = evolve_type - bpp(jp,12) = aj1 - bpp(jp,13) = aj2 - bpp(jp,14) = tms1 - bpp(jp,15) = tms2 - bpp(jp,16) = massc1 - bpp(jp,17) = massc2 - bpp(jp,18) = rad1 - bpp(jp,19) = rad2 - bpp(jp,20) = mass0_1 - bpp(jp,21) = mass0_2 - bpp(jp,22) = lumin1 - bpp(jp,23) = lumin2 - bpp(jp,24) = teff1 - bpp(jp,25) = teff2 - bpp(jp,26) = radc1 - bpp(jp,27) = radc2 - bpp(jp,28) = menv1 - bpp(jp,29) = menv2 - bpp(jp,30) = renv1 - bpp(jp,31) = renv2 - bpp(jp,32) = ospin1 - bpp(jp,33) = ospin2 - bpp(jp,34) = b_0_1 - bpp(jp,35) = b_0_2 - bpp(jp,36) = bacc1 - bpp(jp,37) = bacc2 - bpp(jp,38) = tacc1 - bpp(jp,39) = tacc2 - bpp(jp,40) = epoch1 - bpp(jp,41) = epoch2 - bpp(jp,42) = bhspin1 - bpp(jp,43) = bhspin2 - END - -*** - SUBROUTINE WRITEBCM(ip,tphys,kstar_1,mass0_1,mass_1, - & lumin_1,rad_1,teff_1,massc_1, - & radc_1,menv_1,renv_1,epoch_1, - & ospin_1,deltam_1,RRLO_1,kstar_2,mass0_2, - & mass_2,lumin_2,rad_2,teff_2,massc_2,radc_2, - & menv_2,renv_2,epoch_2,ospin_2,deltam_2, - & RRLO_2,porb,sep,ecc,B_0_1,B_0_2, - & SN_1,SN_2,bin_state,merger_type) - IMPLICIT NONE - INCLUDE 'const_bse.h' -* -* Write results to bcm array. -* -* Author : Scott Coughlin -* Date : 12th March 2019 -* - REAL*8 tphys,mass0_1,mass_1,lumin_1,rad_1,teff_1 - REAL*8 massc_1,radc_1,menv_1,renv_1,epoch_1 - REAL*8 ospin_1,deltam_1,RRLO_1,porb_write,sep_cubed - REAL*8 mass0_2,mass_2,lumin_2,rad_2,teff_2,massc_2 - REAL*8 radc_2,menv_2,renv_2,epoch_2,ospin_2,deltam_2 - REAL*8 RRLO_2,porb,sep,ecc,B_0_1,B_0_2 - INTEGER kstar_1,kstar_2,SN_1,SN_2,bin_state,merger_type - INTEGER ip - REAL*8 yeardy,aursun,rsunau - PARAMETER(yeardy=365.24d0,aursun=214.95d0) - - rsunau = 1/aursun - - ip = ip + 1 - bcm(ip,1) = tphys - bcm(ip,2) = float(kstar_1) - bcm(ip,3) = mass0_1 - bcm(ip,4) = mass_1 - bcm(ip,5) = lumin_1 - bcm(ip,6) = rad_1 - bcm(ip,7) = teff_1 - bcm(ip,8) = massc_1 - bcm(ip,9) = radc_1 - bcm(ip,10) = menv_1 - bcm(ip,11) = renv_1 - bcm(ip,12) = epoch_1 - bcm(ip,13) = ospin_1 - bcm(ip,14) = deltam_1 - bcm(ip,15) = RRLO_1 - bcm(ip,16) = float(kstar_2) - bcm(ip,17) = mass0_2 - bcm(ip,18) = mass_2 - bcm(ip,19) = lumin_2 - bcm(ip,20) = rad_2 - bcm(ip,21) = teff_2 - bcm(ip,22) = massc_2 - bcm(ip,23) = radc_2 - bcm(ip,24) = menv_2 - bcm(ip,25) = renv_2 - bcm(ip,26) = epoch_2 - bcm(ip,27) = ospin_2 - bcm(ip,28) = deltam_2 - bcm(ip,29) = RRLO_2 - if(porb.le.0.d0)then -* system was disrupted and porb=-1 and should stay that way - bcm(ip,30) = porb - else - sep_cubed = (sep*rsunau)*(sep*rsunau)*(sep*rsunau) - porb_write = sqrt(sep_cubed/(mass_1+mass_2)) - bcm(ip,30) = porb_write*yeardy + all_cols(7) = tb_write*yeardy endif - bcm(ip,31) = sep - bcm(ip,32) = ecc - bcm(ip,33) = B_0_1 - bcm(ip,34) = B_0_2 - bcm(ip,35) = float(SN_1) - bcm(ip,36) = float(SN_2) - bcm(ip,37) = bin_state - bcm(ip,38) = merger_type + all_cols(8) = ecc + all_cols(9) = rrl1 + all_cols(10) = rrl2 + all_cols(11) = evolve_type + all_cols(12) = aj1 + all_cols(13) = aj2 + all_cols(14) = tms1 + all_cols(15) = tms2 + all_cols(16) = massc1 + all_cols(17) = massc2 + all_cols(18) = rad1 + all_cols(19) = rad2 + all_cols(20) = mass0_1 + all_cols(21) = mass0_2 + all_cols(22) = lumin1 + all_cols(23) = lumin2 + all_cols(24) = teff1 + all_cols(25) = teff2 + all_cols(26) = radc1 + all_cols(27) = radc2 + all_cols(28) = menv1 + all_cols(29) = menv2 + all_cols(30) = renv1 + all_cols(31) = renv2 + all_cols(32) = ospin1 + all_cols(33) = ospin2 + all_cols(34) = b_0_1 + all_cols(35) = b_0_2 + all_cols(36) = bacc1 + all_cols(37) = bacc2 + all_cols(38) = tacc1 + all_cols(39) = tacc2 + all_cols(40) = epoch1 + all_cols(41) = epoch2 + all_cols(42) = bhspin1 + all_cols(43) = bhspin2 + all_cols(44) = deltam_1 + all_cols(45) = deltam_2 + all_cols(46) = float(SN_1) + all_cols(47) = float(SN_2) + all_cols(48) = bin_state + all_cols(49) = merger_type - END +* check which table we are writing to and write the appropriate columns + if (tabname .eq. 'bpp') then + jp = MIN(900,jp + 1) ! Why is the 900 limit here?? + do 117, col_ind = 1, n_col_bpp + bpp(jp,col_ind) = all_cols(col_inds_bpp(col_ind)) +117 continue + else if (tabname .eq. 'bcm') then + jp = jp + 1 + do 118, col_ind = 1, n_col_bcm + bcm(jp,col_ind) = all_cols(col_inds_bcm(col_ind)) +118 continue + end if + END \ No newline at end of file diff --git a/src/cosmic/src/comenv.f b/src/cosmic/src/comenv.f index b179f40c3..086593383 100644 --- a/src/cosmic/src/comenv.f +++ b/src/cosmic/src/comenv.f @@ -6,7 +6,7 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, & bhspin1,bhspin2,binstate,mergertype, & jp,tphys,switchedCE,rad,tms,evolve_type,disrupt, & lumin,B_0,bacc,tacc,epoch,menv_bpp,renv_bpp, - & bkick,dtm) + & bkick,deltam_1,deltam_2,dtm) IMPLICIT NONE INCLUDE 'const_bse.h' * @@ -36,9 +36,10 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, REAL*8 RC1,RC2,Q1,Q2,RL1,RL2,LAMB1,LAMB2 REAL*8 MENV,RENV,MENVD,RZAMS,vk REAL*8 Porbi,Porbf,Mcf,Menvf,qi,qf,G - REAL*8 kick_info(2,17),fallback,M1i,M2i + REAL*8 kick_info(2,18),fallback,M1i,M2i REAL*8 bkick(20) REAL*8 bhspin1,bhspin2,dtm + REAL*8 deltam_1,deltam_2 common /fall/fallback INTEGER formation1,formation2 REAL*8 sigmahold @@ -317,7 +318,7 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, & (rad1_bpp**2.d0))**(1.d0/4.d0)) teff2 = 1000.d0*((1130.d0*lumin(2)/ & (rad2_bpp**2.d0))**(1.d0/4.d0)) - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass1_bpp,mass2_bpp,kstar1_bpp, & kstar2_bpp,SEP_postCE,TB,ECC, & rrl1_bpp,rrl2_bpp, @@ -327,13 +328,15 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, & RC2,RC1,menv_bpp(2),menv_bpp(1),renv_bpp(2), & renv_bpp(1),OSPIN2,OSPIN1,B_0(2),B_0(1), & bacc(2),bacc(1),tacc(2),tacc(1),epoch(2), - & epoch(1),bhspin2,bhspin1) + & epoch(1),bhspin2,bhspin1, + & deltam_2,deltam_1,formation2,formation1, + & binstate,mergertype,'bpp') else teff1 = 1000.d0*((1130.d0*lumin(1)/ & (rad1_bpp**2.d0))**(1.d0/4.d0)) teff2 = 1000.d0*((1130.d0*lumin(2)/ & (rad2_bpp**2.d0))**(1.d0/4.d0)) - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass1_bpp,mass2_bpp,kstar1_bpp, & kstar2_bpp,SEP_postCE,TB,ECC, & rrl1_bpp,rrl2_bpp, @@ -343,7 +346,9 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, & RC1,RC2,menv_bpp(1),menv_bpp(2),renv_bpp(1), & renv_bpp(2),OSPIN1,OSPIN2,B_0(1),B_0(2), & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin1,bhspin2) + & epoch(2),bhspin1,bhspin2, + & deltam_1,deltam_2,formation1,formation2, + & binstate,mergertype,'bpp') endif endif CALL kick(KW1,M_postCE,M1,M2,ECC,SEP_postCE, @@ -623,7 +628,7 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, & (rad1_bpp**2.d0))**(1.d0/4.d0)) teff2 = 1000.d0*((1130.d0*lumin(2)/ & (rad2_bpp**2.d0))**(1.d0/4.d0)) - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass1_bpp,mass2_bpp,kstar1_bpp, & kstar2_bpp,SEP_postCE,TB,ECC, & rrl1_bpp,rrl2_bpp, @@ -633,13 +638,15 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, & RC2,RC1,menv_bpp(2),menv_bpp(1),renv_bpp(2), & renv_bpp(1),OSPIN2,OSPIN1,B_0(2),B_0(1), & bacc(2),bacc(1),tacc(2),tacc(1),epoch(2), - & epoch(1),bhspin2,bhspin1) + & epoch(1),bhspin2,bhspin1, + & deltam_2,deltam_1,formation2,formation1, + & binstate,mergertype,'bpp') else teff1 = 1000.d0*((1130.d0*lumin(1)/ & (rad1_bpp**2.d0))**(1.d0/4.d0)) teff2 = 1000.d0*((1130.d0*lumin(2)/ & (rad2_bpp**2.d0))**(1.d0/4.d0)) - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass1_bpp,mass2_bpp,kstar1_bpp, & kstar2_bpp,SEP_postCE,TB,ECC, & rrl1_bpp,rrl2_bpp, @@ -649,7 +656,9 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, & RC1,RC2,menv_bpp(1),menv_bpp(2),renv_bpp(1), & renv_bpp(2),OSPIN1,OSPIN2,B_0(1),B_0(2), & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin1,bhspin2) + & epoch(2),bhspin1,bhspin2, + & deltam_1,deltam_2,formation1,formation2, + & binstate,mergertype,'bpp') endif endif * USSN: if ussn flag is set, have reduced kicks for stripped He stars (SN=8) @@ -788,7 +797,7 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, & (rad1_bpp**2.d0))**(1.d0/4.d0)) teff2 = 1000.d0*((1130.d0*lumin(2)/ & (rad2_bpp**2.d0))**(1.d0/4.d0)) - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass1_bpp,mass2_bpp,kstar1_bpp, & kstar2_bpp,SEP_postCE,TB,ECC, & rrl1_bpp,rrl2_bpp, @@ -798,13 +807,15 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, & RC2,RC1,menv_bpp(2),menv_bpp(1),renv_bpp(2), & renv_bpp(1),OSPIN2,OSPIN1,B_0(2),B_0(1), & bacc(2),bacc(1),tacc(2),tacc(1),epoch(2), - & epoch(1),bhspin2,bhspin1) + & epoch(1),bhspin2,bhspin1, + & deltam_2,deltam_1,formation2,formation1, + & binstate,mergertype,'bpp') else teff1 = 1000.d0*((1130.d0*lumin(1)/ & (rad1_bpp**2.d0))**(1.d0/4.d0)) teff2 = 1000.d0*((1130.d0*lumin(2)/ & (rad2_bpp**2.d0))**(1.d0/4.d0)) - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass1_bpp,mass2_bpp,kstar1_bpp, & kstar2_bpp,SEP_postCE,TB,ECC, & rrl1_bpp,rrl2_bpp, @@ -814,7 +825,9 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, & RC1,RC2,menv_bpp(1),menv_bpp(2),renv_bpp(1), & renv_bpp(2),OSPIN1,OSPIN2,B_0(1),B_0(2), & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin1,bhspin2) + & epoch(2),bhspin1,bhspin2, + & deltam_1,deltam_2,formation1,formation2, + & binstate,mergertype,'bpp') endif endif CALL kick(KW2,M_postCE,M2,M1,ECC,SEP_postCE, @@ -1019,7 +1032,7 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, & (rad1_bpp**2.d0))**(1.d0/4.d0)) teff2 = 1000.d0*((1130.d0*lumin(2)/ & (rad2_bpp**2.d0))**(1.d0/4.d0)) - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass1_bpp,mass2_bpp,kstar1_bpp, & kstar2_bpp,-1.d0,TB,0.d0, & rrl1_bpp,rrl2_bpp, @@ -1029,13 +1042,15 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, & RC2,RC1,menv_bpp(2),menv_bpp(1),renv_bpp(2), & renv_bpp(1),OSPIN2,OSPIN1,B_0(2),B_0(1), & bacc(2),bacc(1),tacc(2),tacc(1),epoch(2), - & epoch(1),bhspin2,bhspin1) + & epoch(1),bhspin2,bhspin1, + & deltam_2,deltam_1,formation2,formation1, + & binstate,mergertype,'bpp') else teff1 = 1000.d0*((1130.d0*lumin(1)/ & (rad1_bpp**2.d0))**(1.d0/4.d0)) teff2 = 1000.d0*((1130.d0*lumin(2)/ & (rad2_bpp**2.d0))**(1.d0/4.d0)) - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass1_bpp,mass2_bpp,kstar1_bpp, & kstar2_bpp,-1.d0,TB,0.d0, & rrl1_bpp,rrl2_bpp, @@ -1045,7 +1060,9 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, & RC1,RC2,menv_bpp(1),menv_bpp(2),renv_bpp(1), & renv_bpp(2),OSPIN1,OSPIN2,B_0(1),B_0(2), & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin1,bhspin2) + & epoch(2),bhspin1,bhspin2, + & deltam_1,deltam_2,formation1,formation2, + & binstate,mergertype,'bpp') endif endif CALL kick(KW,MF,M1,0.d0,0.d0,-1.d0,0.d0,vk,star1, diff --git a/src/cosmic/src/const_bse.h b/src/cosmic/src/const_bse.h index f1f1a221c..de140d235 100644 --- a/src/cosmic/src/const_bse.h +++ b/src/cosmic/src/const_bse.h @@ -55,8 +55,11 @@ COMMON /TSTEPC/ dmmax,drmax REAL*8 scm(50000,14),spp(20,3) COMMON /SINGLE/ scm,spp - REAL*8 bcm(50000,38),bpp(1000,43) + REAL*8 bcm(50000,49),bpp(1000,49) COMMON /BINARY/ bcm,bpp + INTEGER n_col_bpp, n_col_bcm + INTEGER col_inds_bpp(49), col_inds_bcm(49) + COMMON /COL/ n_col_bpp,col_inds_bpp,n_col_bcm,col_inds_bcm * LOGICAL using_metisse, using_sse COMMON /SE_FLAGS/ using_metisse, using_sse diff --git a/src/cosmic/src/evolv2.f b/src/cosmic/src/evolv2.f index fc8a195ca..68fed7aa8 100644 --- a/src/cosmic/src/evolv2.f +++ b/src/cosmic/src/evolv2.f @@ -168,9 +168,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, REAL*8 mass1_bpp,mass2_bpp REAL*8 rad(2),rol(2),rol0(2),rdot(2),radc(2),renv(2),radx(2) REAL*8 lumin(2),k2str(2),q(2),dms(2),dmr(2),dmt(2) - REAL*8 dml,vorb2,vwind2,omv2,ivsqm,lacc,kick_info(2,17) + REAL*8 dml,vorb2,vwind2,omv2,ivsqm,lacc,kick_info(2,18) REAL*8 bkick(20) - REAL*8 kick_info_out(2,17) + REAL*8 kick_info_out(2,18) REAL*8 sep,dr,tb,dme,tdyn,taum,dm1,dm2,dmchk,qc,dt,pd,rlperi REAL*8 m1ce,m2ce,mch,tmsnew,dm22,mew PARAMETER(mch=1.44d0) @@ -1348,7 +1348,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, else b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass(1),mass(2),kstar(1),kstar(2), & sep,tb,ecc,rrl1,rrl2, & aj(1),aj(2),tms(1),tms(2), @@ -1358,7 +1358,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') CALL kick(kw,mass(k),mt,0.d0,0.d0,-1.d0,0.d0,vk,k, & 0.d0,fallback,sigmahold,kick_info,disrupt,bkick) @@ -1386,7 +1388,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass(1),mass(2),kstar(1),kstar(2), & sep,tb,ecc,rrl1,rrl2, & aj(1),aj(2),tms(1),tms(2), @@ -1396,7 +1398,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') CALL kick(kw,mass(k),mt,mass(3-k),ecc,sep,jorb,vk,k, & rad(3-k),fallback,sigmahold,kick_info,disrupt,bkick) @@ -1600,7 +1604,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass(1),mass(2),kstar(1),kstar(2),sep, & tb,ecc,rrl1,rrl2, & aj(1),aj(2),tms(1),tms(2), @@ -1610,7 +1614,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') if(snova)then bpp(jp,11) = 2.0 dtm = 0.d0 @@ -1662,14 +1668,19 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, if(pisn_track(1).ne.0) formation(1) = pisn_track(1) if(pisn_track(2).ne.0) formation(2) = pisn_track(2) - CALL writebcm(ip,tphys,kstar(1),mass0(1),mass(1), - & lumin(1),rad(1),teff1,massc(1), - & radc(1),menv(1),renv(1),epoch(1), - & ospin(1),deltam1_bcm,rrl1,kstar(2),mass0(2), - & mass(2),lumin(2),rad(2),teff2,massc(2), - & radc(2),menv(2),renv(2),epoch(2),ospin(2), - & deltam2_bcm,rrl2,tb,sep,ecc,b01_bcm,b02_bcm, - & formation(1),formation(2),binstate,mergertype) + CALL writetab(ip,tphys,evolve_type, + & mass(1),mass(2),kstar(1),kstar(2), + & sep,tb,ecc,rrl1,rrl2, + & aj(1),aj(2),tms(1),tms(2), + & massc(1),massc(2),rad(1),rad(2), + & mass0(1),mass0(2),lumin(1),lumin(2), + & teff1,teff2,radc(1),radc(2), + & menv(1),menv(2),renv(1),renv(2), + & ospin(1),ospin(2),b01_bcm,b02_bcm, + & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bcm') if (bcm_err) goto 150 if(isave) tsave = tsave + dtp if(output) write(*,*)'bcm1',kstar(1),kstar(2),mass(1), @@ -1812,7 +1823,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass(1),mass(2),kstar(1),kstar(2),sep, & tb,ecc,rrl1,rrl2, & aj(1),aj(2),tms(1),tms(2), @@ -1822,7 +1833,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') endif * iter = iter + 1 @@ -1897,7 +1910,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass(1),mass(2),kstar(1),kstar(2),sep, & tb,ecc,rrl1,rrl2, & aj(1),aj(2),tms(1),tms(2), @@ -1907,7 +1920,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') * if(check_dtp.eq.1)then CALL checkstate(dtp,dtp_original,tsave,tphys,tphysf, @@ -1951,14 +1966,19 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * Check if PISN occurred, and if so overwrite formation if(pisn_track(1).ne.0) formation(1) = pisn_track(1) if(pisn_track(2).ne.0) formation(2) = pisn_track(2) - CALL writebcm(ip,tphys,kstar(1),mass0(1),mass(1), - & lumin(1),rad(1),teff1,massc(1), - & radc(1),menv(1),renv(1),epoch(1), - & ospin(1),deltam1_bcm,rrl1,kstar(2),mass0(2), - & mass(2),lumin(2),rad(2),teff2,massc(2), - & radc(2),menv(2),renv(2),epoch(2),ospin(2), - & deltam2_bcm,rrl2,tb,sep,ecc,b01_bcm,b02_bcm, - & formation(1),formation(2),binstate,mergertype) + CALL writetab(ip,tphys,evolve_type, + & mass(1),mass(2),kstar(1),kstar(2), + & sep,tb,ecc,rrl1,rrl2, + & aj(1),aj(2),tms(1),tms(2), + & massc(1),massc(2),rad(1),rad(2), + & mass0(1),mass0(2),lumin(1),lumin(2), + & teff1,teff2,radc(1),radc(2), + & menv(1),menv(2),renv(1),renv(2), + & ospin(1),ospin(2),b01_bcm,b02_bcm, + & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bcm') if (bcm_err) goto 150 if(output) write(*,*)'bcm2:',kstar(1),kstar(2),mass(1), & mass(2),rad(1),rad(2),ospin(1),ospin(2),jspin(1) @@ -2389,7 +2409,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass(1),mass(2), & kstar(1),kstar(2),sep, & tb,ecc,rrl1,rrl2, @@ -2400,7 +2420,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') CALL comenv(mass0(j1),mass(j1),massc(j1),aj(j1),jspin(j1), & kstar(j1),mass0(j2),mass(j2),massc(j2),aj(j2), @@ -2408,7 +2430,34 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & vk,kick_info,formation(j1),formation(j2),sigmahold, & bhspin(j1),bhspin(j2),binstate,mergertype, & jp,tphys,switchedCE,rad,tms,evolve_type,disrupt, - & lumin,B_0,bacc,tacc,epoch,menv,renv,bkick,dtm) + & lumin,B_0,bacc,tacc,epoch,menv,renv,bkick, + & deltam1_bcm,deltam2_bcm,dtm) + if(j1.eq.2.and.kcomp2.eq.13.and.kstar(j2).eq.15.and. + & kstar(j1).eq.13)then !PK. +* In CE the NS got switched around. Do same to formation. + formation(j1) = formation(j2) + endif + if(j1.eq.1.and.kcomp2.eq.13.and.kstar(j2).eq.15.and. + & kstar(j1).eq.13)then !PK. +* In CE the NS got switched around. Do same to formation. + formation(j1) = formation(j2) + endif + com = .true. + if(com.and..not.coel.and..not.disrupt)then +* if it went through common envelope +* did not disrupt (from one of the objects going SN) +* and did not merge in common envelope +* then system is still in binary + binstate = 0 + mergertype = -1 + elseif(com.and..not.coel.and.disrupt)then +* if it went through common envelope +* and did disrupt (from one of the objects going SN) +* and did not merge in common envelope +* then system should be marked as disrupted + binstate = 2 + mergertype = -1 + endif if(binstate.eq.1.d0)then sep = 0.d0 tb = 0.d0 @@ -2454,7 +2503,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass1_bpp,mass2_bpp, & kstar(1),kstar(2),sep, & tb,ecc,rrl1,rrl2, @@ -2465,7 +2514,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') * epoch(j1) = tphys - aj(j1) if(coel)then @@ -3571,7 +3622,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, else b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass(1),mass(2),kstar(1),kstar(2), & sep,tb,ecc,rrl1,rrl2, & aj(1),aj(2),tms(1),tms(2), @@ -3581,7 +3632,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') CALL kick(kw,mass(k),mt,mass(3-k),ecc,sep,jorb,vk,k, & rad(3-k),fallback,sigmahold,kick_info,disrupt,bkick) sigma = sigmahold !reset sigma after possible ECSN kick dist. Remove this if u want some kick link to the intial pulsar values... @@ -3710,14 +3763,19 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * Check if PISN occurred, and if so overwrite formation if(pisn_track(1).ne.0) formation(1) = pisn_track(1) if(pisn_track(2).ne.0) formation(2) = pisn_track(2) - CALL writebcm(ip,tphys,kstar(1),mass0(1),mass(1), - & lumin(1),rad(1),teff1,massc(1), - & radc(1),menv(1),renv(1),epoch(1), - & ospin(1),deltam1_bcm,rrl1,kstar(2),mass0(2), - & mass(2),lumin(2),rad(2),teff2,massc(2), - & radc(2),menv(2),renv(2),epoch(2),ospin(2), - & deltam2_bcm,rrl2,tb,sep,ecc,b01_bcm,b02_bcm, - & formation(1),formation(2),binstate,mergertype) + CALL writetab(ip,tphys,evolve_type, + & mass(1),mass(2),kstar(1),kstar(2), + & sep,tb,ecc,rrl1,rrl2, + & aj(1),aj(2),tms(1),tms(2), + & massc(1),massc(2),rad(1),rad(2), + & mass0(1),mass0(2),lumin(1),lumin(2), + & teff1,teff2,radc(1),radc(2), + & menv(1),menv(2),renv(1),renv(2), + & ospin(1),ospin(2),b01_bcm,b02_bcm, + & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bcm') if (bcm_err) goto 150 if(isave) tsave = tsave + dtp if(output) write(*,*)'bcm3:',kstar(1),kstar(2),mass(1), @@ -3751,7 +3809,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass(1),mass(2),kstar(1),kstar(2), & sep,tb,ecc,rrl1,rrl2, & aj(1),aj(2),tms(1),tms(2), @@ -3761,7 +3819,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') endif * @@ -3797,7 +3857,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass(1),mass(2),kstar(1),kstar(2),sep, & tb,ecc,rrl1,rrl2, & aj(1),aj(2),tms(1),tms(2), @@ -3807,7 +3867,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') dtm = 0.d0 goto 4 endif @@ -3846,7 +3908,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, else b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass(1),mass(2),kstar(1),kstar(2),sep, & tb,ecc,rrl1,rrl2, & aj(1),aj(2),tms(1),tms(2), @@ -3856,7 +3918,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') * kcomp1 = kstar(j1) kcomp2 = kstar(j2) @@ -3890,7 +3954,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass(1),mass(2), & kstar(1),kstar(2),sep, & tb,ecc,rrl1,rrl2, @@ -3901,14 +3965,17 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') CALL comenv(mass0(j1),mass(j1),massc(j1),aj(j1),jspin(j1), & kstar(j1),mass0(j2),mass(j2),massc(j2),aj(j2), & jspin(j2),kstar(j2),zpars,ecc,sep,jorb,coel,j1,j2, & vk,kick_info,formation(j1),formation(j2),sigmahold, & bhspin(j1),bhspin(j2),binstate,mergertype, & jp,tphys,switchedCE,rad,tms,evolve_type,disrupt, - & lumin,B_0,bacc,tacc,epoch,menv,renv,bkick,dtm) + & lumin,B_0,bacc,tacc,epoch,menv,renv,bkick, + & deltam1_bcm,deltam2_bcm,dtm) if(output) write(*,*)'coal1:',tphys,kstar(j1),kstar(j2),coel, & mass(j1),mass(j2) if(j1.eq.2.and.kcomp2.eq.13.and.kstar(j2).eq.15.and. @@ -3971,7 +4038,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass(1),mass(2), & kstar(1),kstar(2),sep, & tb,ecc,rrl1,rrl2, @@ -3982,14 +4049,17 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') CALL comenv(mass0(j2),mass(j2),massc(j2),aj(j2),jspin(j2), & kstar(j2),mass0(j1),mass(j1),massc(j1),aj(j1), & jspin(j1),kstar(j1),zpars,ecc,sep,jorb,coel,j2,j1, & vk,kick_info,formation(j2),formation(j1),sigmahold, & bhspin(j2),bhspin(j1),binstate,mergertype, & jp,tphys,switchedCE,rad,tms,evolve_type,disrupt, - & lumin,B_0,bacc,tacc,epoch,menv,renv,bkick,dtm) + & lumin,B_0,bacc,tacc,epoch,menv,renv,bkick, + & deltam1_bcm,deltam2_bcm,dtm) if(output) write(*,*)'coal2:',tphys,kstar(j1),kstar(j2),coel, & mass(j1),mass(j2) if(j2.eq.2.and.kcomp1.eq.13.and.kstar(j1).eq.15.and. @@ -4057,7 +4127,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass1_bpp,mass2_bpp, & kstar(1),kstar(2),sep, & tb,ecc,rrl1,rrl2, @@ -4068,7 +4138,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') endif epoch(1) = tphys - aj(1) epoch(2) = tphys - aj(2) @@ -4113,7 +4185,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass(1),mass(2),kstar(1),kstar(2),sep, & tb,ecc,rrl1,rrl2, & aj(1),aj(2),tms(1),tms(2), @@ -4123,7 +4195,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') dtm = 0.d0 * * Reset orbital parameters as separation may have changed. @@ -4183,7 +4257,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, else b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass1_bpp,mass2_bpp, & kstar(1),kstar(2),0.d0, & 0.d0,-1.d0,0.d0,ngtv, @@ -4194,7 +4268,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') elseif(ecc.gt.1.d0)then * * Binary dissolved by a supernova or tides. @@ -4223,7 +4299,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, else b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass1_bpp,mass2_bpp, & kstar(1),kstar(2),sep, & tb,ecc,0.d0,ngtv2, @@ -4234,7 +4310,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') else evolve_type = 9.0 teff1 = 1000.d0*((1130.d0*lumin(1)/ @@ -4255,7 +4333,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, else b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass1_bpp,mass2_bpp, & kstar(1),kstar(2),0.d0, & 0.d0,0.d0,0.d0,ngtv, @@ -4266,7 +4344,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') endif endif if(kstar(2).eq.15)then @@ -4344,7 +4424,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass(1),mass(2),kstar(1),kstar(2),sep, & tb,ecc,rrl1,rrl2, & aj(1),aj(2),tms(1),tms(2), @@ -4354,7 +4434,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') endif * if(kstar(1).eq.15.and.bpp(jp,4).lt.15.0)then @@ -4385,7 +4467,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, else b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass1_bpp,mass2_bpp, & kstar(1),kstar(2),0.d0, & 0.d0,-1.d0,0.d0,ngtv, @@ -4396,7 +4478,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') elseif(kstar(1).eq.15.and.kstar(2).eq.15)then * * Cases of accretion induced supernova or single star supernova. @@ -4421,7 +4505,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, else b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass1_bpp,mass2_bpp, & kstar(1),kstar(2),0.d0, & 0.d0,0.d0,0.d0,ngtv2, @@ -4432,7 +4516,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') else evolve_type = 10.0 !added by PA for systems that stop evolving halfway @@ -4461,7 +4547,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, else b02_bcm = B(2) endif - CALL writebpp(jp,tphys,evolve_type, + CALL writetab(jp,tphys,evolve_type, & mass1_bpp,mass2_bpp, & kstar(1),kstar(2),sep, & tb,ecc,rrl1,rrl2, @@ -4472,7 +4558,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, & menv(1),menv(2),renv(1),renv(2), & ospin(1),ospin(2),b01_bcm,b02_bcm, & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), - & epoch(2),bhspin(1),bhspin(2)) + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bpp') endif endif * @@ -4521,16 +4609,21 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * Check if PISN occurred, and if so overwrite formation if(pisn_track(1).ne.0) formation(1) = pisn_track(1) if(pisn_track(2).ne.0) formation(2) = pisn_track(2) - CALL writebcm(ip,tphys,kstar(1),mass0(1),mass(1), - & lumin(1),rad(1),teff1,massc(1), - & radc(1),menv(1),renv(1),epoch(1), - & ospin(1),deltam1_bcm,rrl1,kstar(2),mass0(2), - & mass(2),lumin(2),rad(2),teff2,massc(2), - & radc(2),menv(2),renv(2),epoch(2),ospin(2), - & deltam2_bcm,rrl2,tb,sep,ecc,b01_bcm,b02_bcm, - & formation(1),formation(2),binstate,mergertype) - + CALL writetab(ip,tphys,evolve_type, + & mass(1),mass(2),kstar(1),kstar(2), + & sep,tb,ecc,rrl1,rrl2, + & aj(1),aj(2),tms(1),tms(2), + & massc(1),massc(2),rad(1),rad(2), + & mass0(1),mass0(2),lumin(1),lumin(2), + & teff1,teff2,radc(1),radc(2), + & menv(1),menv(2),renv(1),renv(2), + & ospin(1),ospin(2),b01_bcm,b02_bcm, + & bacc(1),bacc(2),tacc(1),tacc(2),epoch(1), + & epoch(2),bhspin(1),bhspin(2), + & deltam1_bcm,deltam2_bcm,formation(1), + & formation(2),binstate,mergertype,'bcm') if (bcm_err) goto 150 + if(output) write(*,*)'bcm4:',kstar(1),kstar(2),mass(1), & mass(2),rad(1),rad(2),ospin(1),ospin(2),jspin(1), & tphys,tphysf diff --git a/src/cosmic/src/kick.f b/src/cosmic/src/kick.f index 6e761dcce..263ddb544 100644 --- a/src/cosmic/src/kick.f +++ b/src/cosmic/src/kick.f @@ -1,9 +1,749 @@ -*** - SUBROUTINE kick(kw,m1,m1n,m2,ecc,sep,jorb,vk,snstar, + SUBROUTINE kick(kw,m1,m1n,m2,ecc,sep,jorb,vk,sn, & r2,fallback,sigmahold,kick_info,disrupt,bkick) IMPLICIT NONE INCLUDE 'const_bse.h' * +* Variables +* --------- +* kw: integer +* Stellar type of the exploding star +* m1: real*8 +* Mass of the exploding star +* m1n: real*8 +* Mass of the compact remnant post-SN +* m2: real*8 +* Mass of the companion star +* ecc: real*8 +* Eccentricity of the binary pre-SN +* sep: real*8 +* Semi-major axis of the binary pre-SN +* sn: integer +* Which star is going supernova (1 or 2) +* r2: real*8 +* Radius of the companion star +* fallback: real*8 +* Fallback mass fraction +* sigmahold: real*8 +* Original sigma value for the kick +* kick_info: real*8 +* Array with information about the supernova kicks (details below) +* bkick: real*8 +* Array with information about the kicks for CMC (details below) +* jorb: real*8, output +* Total orbital angular momentum of the binary +* vk: real*8, output +* Magnitude of the natal kick +* disrupt: logical, output +* Whether the system is disrupted by the supernova + + integer kw,sn + real*8 m1,m2,m1n,ecc,sep,jorb,vk,r2,fallback,sigmahold + real*8 kick_info(2,18), bkick(20) + logical disrupt + +* Use one of the two kick prescriptions based on the kickflag + if(kickflag.lt.0)then +* Original Kiel & Hurley 2009 prescription + call kick_kiel(kw,m1,m1n,m2,ecc,sep,jorb,vk,sn, + & r2,fallback,sigmahold,kick_info,disrupt,bkick) + else +* New Pfahl et al. 2002 prescription + call kick_pfahl(kw,m1,m1n,m2,ecc,sep,jorb,vk,sn, + & r2,fallback,sigmahold,kick_info,disrupt,bkick) + end if + RETURN + END + + + SUBROUTINE kick_pfahl(kw,m1,m1n,m2,ecc,sep,jorb,vk,sn,r2, + & fallback,sigmahold,kick_info,disrupt,bkick) + IMPLICIT NONE + INCLUDE 'const_bse.h' +* +* This function is implements an entirely new kick prescription based +* on Appendix B of Pfahl et al. 2002 +* https://ui.adsabs.harvard.edu/abs/2002ApJ...573..283P/abstract +* instead of Kiel & Hurley 2009. +* +* This prescription better accounts for how secondary stars are ejected +* from disrupted binaries and also corrects a few minor bugs in the +* implementation of K&H09. +* +* Specific kick magnitudes, angles, eccentric anomaly, and random seeds +* can be supplied in the initialization file with natal_kick_array, a +* (2,5) array with the first row being for sn=1 and second for sn=2 +* +* kick_info[i,1]: sn of exploding star +* kick_info[i,2]: disrupted (0=no, 1=yes) +* kick_info[i,3]: magnitude of the natal kick +* kick_info[i,4-5]: phi and theta (in the frame of the exploding star) +* kick_info[i,6]: eccentric anamoly +* kick_info[i,7-9]: change in 3D systemic velocity of the binary, or the +* change in 3D velocity of sn=1 if the system is disrupted +* kick_info[i,10]: magnitude of systemic velocity of the binary if bound +* or magnitude of total velocity of sn=1 if disrupted, +* accounting for both SNe +* kick_info[i,11-13]: change in 3D velocity of the sn=2 if system +* is disrupted +* kick_info[i,14]: magnitude of velocity of sn=2 if disrupted, +* accounting for both SNe +* kick_info[i,15]: First Euler angle of rotation of orbital plane after each SN +* kick_info[i,16]: Second Euler angle of rotation of orbital plane after each SN +* kick_info[i,17]: Third Euler angle of rotation of orbital plane after each SN +* kick_info[i,18]: random seed at the start of call to kick.f +* +* For cmc kick_info array is zero, not negative. + integer kw,k,sn,safety,abskickflag + + real*8 m1,m2,m1n + real*8 ecc,ecc_2,sep + real*8 pi,twopi,yearsc,rsunkm,G_const + parameter(yearsc=3.1557d+07,rsunkm=6.96d+05) + real*8 mean_anom,ecc_anom,dif,der,del + real*8 u1,u2,vk,vk2,v(4),s,sigmah + real*8 theta,phi,sin_phi,cos_phi,sin_theta,cos_theta + real*8 fallback,sigmahold,bound + real*8 mean_mns,mean_mej,alphakick,betakick + real*8 bkick(20),r2,jorb + real*8 ecc_prev,a_prev,mtot,mtot_prev + real*8 natal_kick(3), sep_vec(3), v_rel(3), v_rel_prev(3) + real*8 a_prev_2, a_prev_3, cos_ecc_anom, sin_ecc_anom + real*8 sqrt_1m_ecc_prev_2, sep_prev, prefactor, omega + real*8 h_prev(3),h(3), h_hat(3), h_mag + real*8 LRL_prev(3), LRL(3), e_hat(3) + real*8 v_cm(3), v_sn(3), v_comp(3), v_inf_vec(3), v_inf + real*8 v_sn_rot(3), v_comp_rot(3), v_cm_rot(3) + real*8 h_cross_e_hat(3) + real*8 thetaE, phiE, psiE + real*8 psiplusphi, orbital_pivot_axis(3), unsigned_phi + real*8 LRL_prev_dot_h, LRL_dot_h_prev, unsigned_psi + integer i +* Output + logical output,disrupt,collide +* + real*8 kick_info(2,18) + real ran3,xx + external ran3 +* + output = .false. !useful for debugging... + collide = .false. + safety = 0 + abskickflag = ABS(kickflag) + +* ---------------------------------------------------------------------- +* -------------- Initialise variables and constants -------------------- +* ---------------------------------------------------------------------- + +* Set up empty arrays and constants + u1 = 0.d0 + u2 = 0.d0 + vk = 0.d0 + pi = ACOS(-1.d0) + twopi = 2.d0*pi +* Gravitational constant in units of km^3 / (Msun * s^2) + G_const = 1.3271244d+11 + +* Set values for mean NS mass and mean ejecta as in Giacobbo & Mapelli 2020 + mean_mns = 1.2d0 + mean_mej = 9.0d0 +* Set values for alpha and beta as in Bray & Eldridge 2016 + alphakick = 70.0d0 + betakick = 120.0d0 + + if(using_cmc.eq.0)then +* check if we have supplied a randomseed for this SN from kick_info +* already + if(natal_kick_array(sn,5).gt.0.d0)then +* if we have we need to run ran3 enough times until +* we are at the same state of the random number generator +* as we were before + do while (natal_kick_array(sn,5).ne.idum1 + & .and.safety.le.20) + xx = RAN3(idum1) + safety = safety + 1 + end do + endif + endif +* save the current idum1 + natal_kick_array(sn,5) = idum1 + kick_info(sn,18) = idum1 + +* set the sn of the exploding object in the kick_info array + kick_info(sn,1) = sn + +* if the system was disrupted from the first supernova, marked as disrupted + if(kick_info(1,2).eq.1) kick_info(2,2)=1 + +* sigma is negative for ECSN + if((sigma.lt.0.d0).and.(abskickflag.eq.1))then + sigma = -1.d0*sigma +* for kick prescriptions other than default, revert to original sigma + elseif((sigma.lt.0.d0).and.(abskickflag.gt.1))then + sigma = sigmahold + endif + sigmah = sigma + +* scale down BH kicks if bhsigmafrac is specified + if(abskickflag.eq.1)then + if(kw.eq.14.or.(kw.eq.13.and.(m1n.ge.mxns)))then + sigma = sigmah*bhsigmafrac + endif + endif + + +* ---------------------------------------------------------------------- +* ----- Draw and scale a natal kick magnitude based on input dists ----- +* ---------------------------------------------------------------------- + +* Before we draw the kick from the maxwellian and then scale it +* as desired, let us see if a pre-supplied natal kick maganitude +* was passed. + if(natal_kick_array(sn,1).ge.0.d0)then + vk = natal_kick_array(sn,1) + vk2 = vk*vk +* per supplied kick value we mimic a call to random number generator + xx = RAN3(idum1) + xx = RAN3(idum1) + xx = RAN3(idum1) + xx = RAN3(idum1) + else +* Generate Kick Velocity using Maxwellian Distribution (Phinney 1992). +* Use Henon's method for pairwise components (Douglas Heggie 22/5/97). + do 25 k = 1,2 + u1 = RAN3(idum1) + u2 = RAN3(idum1) + if(u1.gt.0.9999d0) u1 = 0.9999d0 + if(u2.gt.1.d0) u2 = 1.d0 +* Generate two velocities from polar coordinates S & THETA. + s = -2.d0*LOG(1.d0 - u1) + s = sigma*SQRT(s) + theta = twopi*u2 + v(2*k-1) = s*COS(theta) + v(2*k) = s*SIN(theta) + 25 continue + vk2 = v(1)*v(1) + v(2)*v(2) + v(3)*v(3) + vk = SQRT(vk2) + + if(abskickflag.eq.1)then +* Limit BH kick with fallback mass fraction. + if(kw.eq.14.and.bhflag.eq.0)then + vk2 = 0.d0 + vk = 0.d0 + elseif(kw.eq.14.and.bhflag.eq.1)then + fallback = MIN(fallback,1.d0) + vk = MAX((1.d0-fallback)*vk,0.d0) + vk2 = vk*vk + elseif(kw.eq.14.and.bhflag.eq.2)then + vk = vk * mxns / m1n + vk2 = vk*vk + endif + elseif(abskickflag.eq.2)then +* Use kick scaling from Giacobbo & Mapelli 2020, Eq. 1 + vk = vk * ((m1-m1n)/mean_mej) * (mean_mns/m1n) + vk2 = vk*vk + elseif(abskickflag.eq.3)then +* Use kick scaling from Giacobbo & Mapelli 2020, Eq. 2 + vk = vk * ((m1-m1n)/mean_mej) + vk2 = vk*vk + elseif(abskickflag.eq.4)then +* Use kick scaling from Bray & Eldridge 2016, Eq. 1 + vk = alphakick * ((m1-m1n)/m1n) + betakick + vk2 = vk*vk + endif + + endif + sigma = sigmah + +* save natal kick velocity in the kick_info array and natal_kick_array + kick_info(sn,3) = vk + if(using_cmc.eq.0)then + natal_kick_array(sn,1) = vk + endif + +* ---------------------------------------------------------------------- +* --------- Now input or draw supernova natal kick angles -------------- +* ---------------------------------------------------------------------- + +* Before we randomly draw a phi and theta for the natal kick, +* see if a pre-supplied set of phi/theta is passed + if((natal_kick_array(sn,2).ge.(-90.d0)).and. + & (natal_kick_array(sn,2).le.(90.d0)))then + phi = natal_kick_array(sn,2)*pi/180.d0 + sin_phi = SIN(phi) +* per supplied kick value we mimic a call to random number generator + xx = RAN3(idum1) + xx = RAN3(idum1) + else +* CLR - Allow for a restricted opening angle for SN kicks +* Only relevant for binaries, obviously +* Default value for polar_kick_angle = 90.0 + bound = SIN((90.d0 - polar_kick_angle)*pi/180.d0) + sin_phi = (1.d0-bound)*ran3(idum1) + bound + phi = ASIN(sin_phi) +* MJZ - The constrained kick will hit at either the north +* or south pole, so randomly choose the hemisphere + if(RAN3(idum1).ge.0.5)then + phi = -phi + sin_phi = SIN(phi) + endif + endif + cos_phi = COS(phi) + + if((natal_kick_array(sn,3).ge.(0.d0)).and. + & (natal_kick_array(sn,3).le.(360.d0)))then + theta = natal_kick_array(sn,3)*pi/180.d0 +* per supplied kick value we mimic a call to random number generator + xx = RAN3(idum1) + else + theta = twopi*ran3(idum1) + endif + sin_theta = SIN(theta) + cos_theta = COS(theta) + +* save theta and phi in the kick_info and +* natal_kick_array + kick_info(sn,4) = phi*180/pi + kick_info(sn,5) = theta*180/pi + if(using_cmc.eq.0)then + natal_kick_array(sn,2) = phi*180/pi + natal_kick_array(sn,3) = theta*180/pi + endif + +* create a vector for the natal kick + natal_kick(1) = vk * cos_phi * cos_theta + natal_kick(2) = vk * cos_phi * sin_theta + natal_kick(3) = vk * sin_phi + +* ---------------------------------------------------------------------- +* ----- Natal kick all done, check for pre-disruption as quick exit ---- +* ---------------------------------------------------------------------- + +* Check if the system is already not a bound binary + if((sn.eq.2.and.kick_info(1,2).eq.1) + & .or.sep.le.0.or.ecc.lt.0)then +* if so, only apply kick to the current star + disrupt = .true. + kick_info(sn,2) = 1 + if(sn.eq.1)then + kick_info(sn,7) = natal_kick(1) + kick_info(sn,8) = natal_kick(2) + kick_info(sn,9) = natal_kick(3) + elseif(sn.eq.2)then + kick_info(sn,11) = natal_kick(1) + kick_info(sn,12) = natal_kick(2) + kick_info(sn,13) = natal_kick(3) + endif + goto 78 + endif + +* ---------------------------------------------------------------------- +* ------ Draw or input mean anomaly, solve for eccentric anomaly ------- +* ---------------------------------------------------------------------- + +* Find the initial separation by randomly choosing a mean anomaly. +* check is user supplied mean anomaly + xx = RAN3(idum1) + if((natal_kick_array(sn,4).ge.(0.d0)).and. + & (natal_kick_array(sn,4).le.(360.d0)))then + + mean_anom = natal_kick_array(sn,4) * pi / 180.d0 + else + mean_anom = xx * twopi + endif +* Solve Kepler's equation for the eccentric anomaly from mean anomaly +* https://en.wikipedia.org/wiki/Eccentric_anomaly + ecc_anom = mean_anom + + if(mean_anom.eq.0.d0) goto 8 + + 9 dif = ecc_anom - ecc * SIN(ecc_anom) - mean_anom + if(ABS(dif / mean_anom).le.1.0d-04) goto 8 + der = 1.d0 - ecc * COS(ecc_anom) + del = dif/der + ecc_anom = ecc_anom - del + goto 9 + + 8 continue + +* ---------------------------------------------------------------------- +* ------ Calculate whether system disrupts and CM velocity change ------ +* ---------------------------------------------------------------------- + +* Some helper variables for calculations below + mtot_prev = m1 + m2 + mtot = m1n + m2 + ecc_prev = ecc +* Convert the separation to km + a_prev = sep * rsunkm + a_prev_2 = a_prev * a_prev + a_prev_3 = a_prev_2 * a_prev + cos_ecc_anom = COS(ecc_anom) + sin_ecc_anom = SIN(ecc_anom) + sqrt_1m_ecc_prev_2 = SQRT(1.d0 - ecc_prev * ecc_prev) + +* Orbital frequency pre-SN (in 1/s) + omega = SQRT(G_const * mtot_prev / a_prev_3) + +* Separation vector before the supernova (in km) + sep_vec(1) = a_prev * (cos_ecc_anom - ecc_prev) + sep_vec(2) = a_prev * sqrt_1m_ecc_prev_2 * sin_ecc_anom + sep_vec(3) = 0.d0 + call VectorMagnitude(sep_vec, sep_prev) + +* Relative velocity vector before the supernova (in km/s) + prefactor = omega * a_prev_2 / sep_prev + v_rel_prev(1) = -prefactor * sin_ecc_anom + v_rel_prev(2) = prefactor * sqrt_1m_ecc_prev_2 * cos_ecc_anom + v_rel_prev(3) = 0.d0 + +* Specific angular momentum vector pre-SN (in km^2/s) + call CrossProduct(sep_vec, v_rel_prev, h_prev) + +* Laplace-Runge-Lenz vector pre-SN (unitless) + call CrossProduct(v_rel_prev, h_prev, LRL_prev) + do i = 1, 3 + LRL_prev(i) = LRL_prev(i) / (G_const * mtot_prev) + & - sep_vec(i) / sep_prev + end do + +* Calculate the new systemic velocity of the center of mass (in km/s) + do i = 1, 3 + v_cm(i) = (-m2 * (m1 - m1n) / mtot_prev / mtot) + & * v_rel_prev(i) + & + (m1n / mtot * natal_kick(i)) + end do + +* New velocity vectors after SN (in km/s) + v_rel(1) = v_rel_prev(1) + natal_kick(1) + v_rel(2) = v_rel_prev(2) + natal_kick(2) + v_rel(3) = v_rel_prev(3) + natal_kick(3) + +* Updated specific orbital angular momentum vector (in km^2/s) + call CrossProduct(sep_vec, v_rel, h) + +* Updated Laplace-Runge-Lenz vector (unitless) + call CrossProduct(v_rel, h, LRL) + DO i = 1, 3 + LRL(i) = LRL(i) / (G_const * mtot) + & - sep_vec(i) / sep_prev + END DO + +* Get the Euler angles from previous kick for the rotation matrix + thetaE = kick_info(1,15) * pi / 180.d0 + phiE = kick_info(1,16) * pi / 180.d0 + psiE = kick_info(1,17) * pi / 180.d0 + +* Get the new eccentricity + call VectorMagnitude(LRL, ecc) + ecc_2 = ecc * ecc + +* Set the new semi-major axis (back in Rsun now) + call VectorMagnitude(h, h_mag) + sep = h_mag * h_mag / (G_const * mtot * (1 - ecc_2)) / rsunkm + +* ---------------------------------------------------------------------- +* -------- Split based on whether this kick disrupts the system -------- +* ---------------------------------------------------------------------- + + if(ecc.gt.1.d0)then +* System is now disrupted + disrupt = .true. +* Set that it is disrupted in the kick_info array + kick_info(sn,2) = 1 + call VectorHat(LRL, ecc, e_hat) + call VectorHat(h, h_mag, h_hat) + call CrossProduct(h_hat, e_hat, h_cross_e_hat) + +* Velocity at infinity (in km/s) + v_inf = G_const * mtot / h_mag * sqrt(ecc_2 - 1.d0) + do i = 1, 3 + v_inf_vec(i) = v_inf * ((-1.d0 * e_hat(i) / ecc) + & + SQRT(1 - 1.d0 / ecc_2) * h_cross_e_hat(i)) + end do + +* Velocity of the star going supernova post-SN (in km/s) + do i = 1, 3 + v_sn(i) = (m2 / mtot) * v_inf_vec(i) + v_cm(i) + end do + +* Velocity of the companion star post-SN (in km/s) + do i = 1, 3 + v_comp(i) = -(m1n / mtot) * v_inf_vec(i) + v_cm(i) + end do + +* if second supernova, need to change basis to the original orbital plane + if(sn.eq.2)then + call ChangeBasis(v_sn, thetaE, phiE, psiE, v_sn_rot) + call ChangeBasis(v_comp, thetaE, phiE, psiE, v_comp_rot) + else + v_sn_rot = v_sn + v_comp_rot = v_comp + endif + +* save the velocities to the kick_info table + if(sn.eq.1)then + kick_info(sn,7) = v_sn_rot(1) + kick_info(sn,8) = v_sn_rot(2) + kick_info(sn,9) = v_sn_rot(3) + kick_info(sn,11) = v_comp_rot(1) + kick_info(sn,12) = v_comp_rot(2) + kick_info(sn,13) = v_comp_rot(3) + + bkick(1) = float(sn) + bkick(2) = kick_info(sn,7) + bkick(3) = kick_info(sn,8) + bkick(4) = kick_info(sn,9) + bkick(5) = float(sn) + bkick(6) = kick_info(sn,11) + bkick(7) = kick_info(sn,12) + bkick(8) = kick_info(sn,13) +* + elseif(sn.eq.2)then + kick_info(sn,11) = v_sn_rot(1) + kick_info(sn,12) = v_sn_rot(2) + kick_info(sn,13) = v_sn_rot(3) + kick_info(sn,7) = v_comp_rot(1) + kick_info(sn,8) = v_comp_rot(2) + kick_info(sn,9) = v_comp_rot(3) + + bkick(5) = float(sn) + bkick(6) = kick_info(sn,11) + bkick(7) = kick_info(sn,12) + bkick(8) = kick_info(sn,13) + bkick(9) = float(sn) + bkick(10) = kick_info(sn,7) + bkick(11) = kick_info(sn,8) + bkick(12) = kick_info(sn,9) + endif + +* lastly, check if this supernova results in a collision between stars + call CollisionCheck(sep_vec, v_sn_rot, v_comp_rot, r2, collide) +* if it does, assume the supernova star plows right through the +* companion and obliterates it + if(collide)then + kick_info(sn,7) = v_sn_rot(1) + kick_info(sn,8) = v_sn_rot(2) + kick_info(sn,9) = v_sn_rot(3) + kick_info(sn,11) = 0.d0 + kick_info(sn,12) = 0.d0 + kick_info(sn,13) = 0.d0 + bkick(6) = v_sn_rot(1) + bkick(7) = v_sn_rot(2) + bkick(8) = v_sn_rot(3) + bkick(10) = 0.d0 + bkick(11) = 0.d0 + bkick(12) = 0.d0 + m2 = -1.d0*m2 + endif + + call AngleBetweenVectors(h, h_prev, thetaE) + phiE = ran3(idum1) * twopi + psiE = ran3(idum1) * twopi + +* ---------------------------------------------------------------------- +* The system is still bound + else +* Record the mean anomaly in the arrays + kick_info(sn,6) = mean_anom * 180 / pi + if (using_cmc.eq.0) then + natal_kick_array(sn,4) = mean_anom * 180 / pi + endif + +* Update the total orbital angular momentum (in Msun Rsun^2/yr) + jorb = m1n * m2 / mtot * h_mag / rsunkm / rsunkm * yearsc + + if (sn.eq.2) then + call ChangeBasis(v_cm, thetaE, phiE, psiE, v_cm_rot) + else + v_cm_rot = v_cm + endif + +* +* If system survives the SN, save the components of the change in +* centre-of-mass velocity + kick_info(sn,7) = v_cm_rot(1) + kick_info(sn,8) = v_cm_rot(2) + kick_info(sn,9) = v_cm_rot(3) + kick_info(sn,11) = 0 + kick_info(sn,12) = 0 + kick_info(sn,13) = 0 + +* 1st time with kick. + if(bkick(1).le.0.d0)then + bkick(1) = float(sn) + bkick(2) = v_cm_rot(1) + bkick(3) = v_cm_rot(2) + bkick(4) = v_cm_rot(3) +* 2nd time with kick. + elseif(bkick(5).le.0.d0)then + bkick(5) = float(sn) + bkick(6) = v_cm_rot(1) + bkick(7) = v_cm_rot(2) + bkick(8) = v_cm_rot(3) +* 2nd time with kick if already disrupted. +* MJZ - would this if statement ever be hit? + elseif(bkick(5).gt.0.d0)then + bkick(9) = float(sn) + bkick(10) = v_cm_rot(1) + bkick(11) = v_cm_rot(2) + bkick(12) = v_cm_rot(3) + endif +* In the impossible chance that the system is exactly parabolic... + if(ecc.eq.1.d0.and.sn.eq.1)then + kick_info(sn,7) = v_cm_rot(1) + kick_info(sn,8) = v_cm_rot(2) + kick_info(sn,9) = v_cm_rot(3) + kick_info(sn,11) = -v_cm_rot(1) + kick_info(sn,12) = -v_cm_rot(2) + kick_info(sn,13) = -v_cm_rot(3) + bkick(1) = float(sn) + bkick(2) = v_cm_rot(1) + bkick(3) = v_cm_rot(2) + bkick(4) = v_cm_rot(3) + bkick(5) = float(sn) + bkick(6) = -v_cm_rot(1) + bkick(7) = -v_cm_rot(2) + bkick(8) = -v_cm_rot(3) + elseif(ecc.eq.1.d0.and.sn.eq.2)then + kick_info(sn,7) = -v_cm_rot(1) + kick_info(sn,8) = -v_cm_rot(2) + kick_info(sn,9) = -v_cm_rot(3) + kick_info(sn,11) = v_cm_rot(1) + kick_info(sn,12) = v_cm_rot(2) + kick_info(sn,13) = v_cm_rot(3) + bkick(5) = float(sn) + bkick(6) = v_cm_rot(1) + bkick(7) = v_cm_rot(2) + bkick(8) = v_cm_rot(3) + bkick(9) = float(sn) + bkick(10) = -v_cm_rot(1) + bkick(11) = -v_cm_rot(2) + bkick(12) = -v_cm_rot(3) + endif + +* Update the Euler angles for the orbital plane rotation + call AngleBetweenVectors(h, h_prev, thetaE) + +* first two special cases for orbital A.M. remaining unchanged in angle +* since the cross product is not well defined in this case + if(thetaE.eq.0.d0)then + xx = ran3(idum1) + phiE = twopi * xx + xx = ran3(idum1) +* we can only calculate the angle if the eccentricity is nonzero + if (ecc_prev.gt.0.d0.and.ecc.gt.0.d0)then + call AngleBetweenVectors(LRL, LRL_prev, psiPlusPhi) + psiE = psiPlusPhi - phiE + else + psiE = twopi * xx + end if + else if(thetaE.eq.pi)then + xx = ran3(idum1) + phiE = twopi * xx + xx = ran3(idum1) +* we can only calculate the angle if the eccentricity is nonzero + if (ecc_prev.gt.0.d0.and.ecc.gt.0.d0)then + call AngleBetweenVectors(LRL, LRL_prev, psiPlusPhi) + psiE = phiE + psiPlusPhi + else + psiE = twopi * xx + end if +* now we can actually use the cross product to get the pivot axis + else + call CrossProduct(h_prev, h, orbital_pivot_axis) + +* first handled phiE, need to check ecc_prev is nonzero +* since otherwise LRL_prev is not well-defined + xx = ran3(idum1) + if(ecc_prev.eq.0.d0)then + phiE = twopi * xx + else + call DotProduct(LRL_prev, h, LRL_prev_dot_h) + call AngleBetweenVectors(LRL_prev, orbital_pivot_axis, + & unsigned_phi) + if (LRL_prev_dot_h.ge.0.d0) then + phiE = unsigned_phi + else + phiE = -unsigned_phi + endif + endif + +* repeat for psi, now focusing on ecc instead of ecc_prev + xx = ran3(idum1) + if(ecc.eq.0.d0)then + psiE = twopi * xx + else + call DotProduct(LRL, h_prev, LRL_dot_h_prev) + call AngleBetweenVectors(LRL, orbital_pivot_axis, + & unsigned_psi) + if (LRL_dot_h_prev.ge.0.d0) then + psiE = unsigned_psi + else + psiE = -unsigned_psi + endif + endif + endif + endif + +* TODO: Does Katie want to randomise the Psi angle same as COMPAS? + +* save Euler angles in the kick_info array + kick_info(sn,15) = thetaE * 180 / pi + kick_info(sn,16) = phiE * 180 / pi + kick_info(sn,17) = psiE * 180 / pi + +* For systems that were distrupted in the first SN, skip to here + 78 continue +* +* Set systemic velocity magnitudes in the kick_info array +* For first SN, this should be identical to the magnitude +* of the three component vectors. For the second SN, this +* will be the systemic velocity relative to the initial frame. + if(sn.eq.1)then + kick_info(sn,10) = SQRT(kick_info(sn,7)*kick_info(sn,7) + + & kick_info(sn,8)*kick_info(sn,8) + + & kick_info(sn,9)*kick_info(sn,9)) + kick_info(sn,14) = SQRT(kick_info(sn,11)*kick_info(sn,11) + + & kick_info(sn,12)*kick_info(sn,12) + + & kick_info(sn,13)*kick_info(sn,13)) + elseif(sn.eq.2)then + kick_info(sn,10) = SQRT( + & (kick_info(1,7)+kick_info(2,7))* + & (kick_info(1,7)+kick_info(2,7)) + + & (kick_info(1,8)+kick_info(2,8))* + & (kick_info(1,8)+kick_info(2,8)) + + & (kick_info(1,9)+kick_info(2,9))* + & (kick_info(1,9)+kick_info(2,9))) + kick_info(sn,14) = SQRT( + & (kick_info(1,11)+kick_info(2,11))* + & (kick_info(1,11)+kick_info(2,11)) + + & (kick_info(1,12)+kick_info(2,12))* + & (kick_info(1,12)+kick_info(2,12)) + + & (kick_info(1,13)+kick_info(2,13))* + & (kick_info(1,13)+kick_info(2,13))) + endif + + RETURN + END + +* ====================================================================== +* ================== Old kick routine follows ========================== +* ====================================================================== +*** + SUBROUTINE kick_kiel(kw,m1,m1n,m2,ecc,sep,jorb,vk,snstar,r2, + & fallback,sigmahold,kick_info,disrupt,bkick) + IMPLICIT NONE + INCLUDE 'const_bse.h' +* +* WARNINGS (from Tom Wagg) +* ------------------------ +* Here there be dragons...this prescription seems to have some issues. +* 1. Natal kick strongly affects ejection velocity of secondaries +* 2. Some coordinate transformations seem to be incorrect +* 3. Criteria for collisions are a little peculiar +* I recommend that the kick_pfahl routine be used instead +* ---------------------------------------------------------------------- +* * Updated JRH kick routine by PDK (see Kiel & Hurley 2009). * * Here theta is the \omega angle within the HTP02 paper (thus phi is phi). @@ -49,10 +789,10 @@ SUBROUTINE kick(kw,m1,m1n,m2,ecc,sep,jorb,vk,snstar, * kick_info[i,15]: (total) tilt of the orbital plane after each SN * w.r.t. the original angular momentum axis after each SN * kick_info[i,16]: azimuthal angle of the orbital plane w.r.t. spins -* kick_info[i,17]: random seed at the start of call to kick.f +* kick_info[i,18]: random seed at the start of call to kick.f * * For cmc kick_info array is zero, not negative. - integer kw,k,snstar,sn,safety + integer kw,k,snstar,sn,safety,abskickflag real*8 m1,m2,m1n,mbi,mbf,mdif real*8 ecc,sep,sepn,jorb,ecc2 @@ -77,12 +817,13 @@ SUBROUTINE kick(kw,m1,m1n,m2,ecc,sep,jorb,vk,snstar, * Output logical output,disrupt * - real*8 kick_info(2,17) + real*8 kick_info(2,18) real ran3,xx external ran3 * output = .false. !useful for debugging... safety = 0 + abskickflag = ABS(kickflag) * Set up empty arrays and constants do k = 1,3 @@ -129,7 +870,9 @@ SUBROUTINE kick(kw,m1,m1n,m2,ecc,sep,jorb,vk,snstar, endif * save the current idum1 natal_kick_array(snstar,5) = idum1 - kick_info(sn,17) = idum1 + kick_info(sn,18) = idum1 +* add a blank column (not used in this prescription) + kick_info(sn,17) = 0.d0 * set the SNstar of the exploding object in the kick_info array kick_info(sn,1) = snstar @@ -138,16 +881,16 @@ SUBROUTINE kick(kw,m1,m1n,m2,ecc,sep,jorb,vk,snstar, if(kick_info(1,2).eq.1) kick_info(2,2)=1 * sigma is negative for ECSN - if((sigma.lt.0.d0).and.(kickflag.eq.0))then + if((sigma.lt.0.d0).and.(abskickflag.eq.1))then sigma = -1.d0*sigma * for kick prescriptions other than default, revert to original sigma - elseif((sigma.lt.0.d0).and.(kickflag.lt.0))then + elseif((sigma.lt.0.d0).and.(abskickflag.gt.1))then sigma = sigmahold endif sigmah = sigma * scale down BH kicks if bhsigmafrac is specified - if(kickflag.eq.0)then + if(abskickflag.eq.1)then if(kw.eq.14.or.(kw.eq.13.and.(m1n.ge.mxns)))then sigma = sigmah*bhsigmafrac endif @@ -233,7 +976,7 @@ SUBROUTINE kick(kw,m1,m1n,m2,ecc,sep,jorb,vk,snstar, vk2 = v(1)*v(1) + v(2)*v(2) + v(3)*v(3) vk = SQRT(vk2) - if(kickflag.eq.0)then + if(abskickflag.eq.1)then * Limit BH kick with fallback mass fraction. if(kw.eq.14.and.bhflag.eq.0)then vk2 = 0.d0 @@ -246,15 +989,15 @@ SUBROUTINE kick(kw,m1,m1n,m2,ecc,sep,jorb,vk,snstar, vk = vk * mxns / m1n vk2 = vk*vk endif - elseif(kickflag.eq.-1)then + elseif(abskickflag.eq.2)then * Use kick scaling from Giacobbo & Mapelli 2020, Eq. 1 vk = vk * ((m1-m1n)/mean_mej) * (mean_mns/m1n) vk2 = vk*vk - elseif(kickflag.eq.-2)then + elseif(abskickflag.eq.3)then * Use kick scaling from Giacobbo & Mapelli 2020, Eq. 2 vk = vk * ((m1-m1n)/mean_mej) vk2 = vk*vk - elseif(kickflag.eq.-3)then + elseif(abskickflag.eq.4)then * Use kick scaling from Bray & Eldridge 2016, Eq. 1 vk = alphakick * ((m1-m1n)/m1n) + betakick vk2 = vk*vk @@ -768,3 +1511,193 @@ SUBROUTINE randomness3(idum,vx1,vy1,vz1,vx2,vy2,vz2) RETURN END * + + + +* ====================================================================== +* ================== Vector helper functions follow ==================== +* ====================================================================== + + SUBROUTINE ChangeBasis(Vector, ThetaE, PhiE, PsiE, Result) +* Redefine a vector from one coordinate basis to another using Euler Angles +* Vector is the input vector in the new basis (X', Y', Z') +* Result is the transformed vector in the original basis (X, Y, Z) +* ThetaE, PhiE, PsiE are the Euler angles + + real*8 Vector(3), Result(3) + real*8 ThetaE, PhiE, PsiE + real*8 cTheta, cPhi, cPsi, sTheta, sPhi, sPsi + real*8 rotationMatrix(3,3) + integer i, j + +* define trigonometric values + cTheta = COS(ThetaE) + sTheta = SIN(ThetaE) + cPhi = COS(PhiE) + sPhi = SIN(PhiE) + cPsi = COS(PsiE) + sPsi = SIN(PsiE) + +* define the Rotation Matrix + rotationMatrix(1,1) = cPhi * cPsi - sPhi * cTheta * sPsi + rotationMatrix(1,2) = -cPhi * sPsi - sPhi * cTheta * cPsi + rotationMatrix(1,3) = sTheta * sPhi + rotationMatrix(2,1) = sPhi * cPsi + cPhi * cTheta * sPsi + rotationMatrix(2,2) = -sPhi * sPsi + cPhi * cTheta * cPsi + rotationMatrix(2,3) = -sTheta * cPhi + rotationMatrix(3,1) = sTheta * sPsi + rotationMatrix(3,2) = sTheta * cPsi + rotationMatrix(3,3) = cTheta + +* initialize the result to zero + DO i = 1, 3 + Result(i) = 0.0D0 + END DO + +* apply rotation to the vector + DO i = 1, 3 + DO j = 1, 3 + Result(i) = Result(i) + Vector(j) * rotationMatrix(i, j) + END DO + END DO + + RETURN + END + + + SUBROUTINE CrossProduct(A, B, C) +* This function computes the cross product of two vectors A and B +* A, B are input vectors of dimension 3 +* C is the resulting vector, also of dimension 3 + + real*8 A(3), B(3), C(3) + +* Calculate each component of the cross product + C(1) = A(2) * B(3) - A(3) * B(2) + C(2) = A(3) * B(1) - A(1) * B(3) + C(3) = A(1) * B(2) - A(2) * B(1) + + RETURN + END + + + + SUBROUTINE VectorMagnitude(A, magnitude) +* This function computes the magnitude of a vector A +* A is the input vector of dimension 3 + + real*8 A(3) + real*8 magnitude + +* Calculate the magnitude of the vector + magnitude = SQRT(A(1) * A(1) + A(2) * A(2) + A(3) * A(3)) + + RETURN + END + + SUBROUTINE VectorHat(A, A_mag, A_hat) +* This function computes the unit vector of a vector A +* A is the input vector of dimension 3 +* A_mag is the magnitude of the vector A +* A_hat is the resulting unit vector, also of dimension 3 + + real*8 A(3), A_hat(3), A_mag + +* Calculate the unit vector + A_hat(1) = A(1) / A_mag + A_hat(2) = A(2) / A_mag + A_hat(3) = A(3) / A_mag + + RETURN + END + + SUBROUTINE DotProduct(A, B, dot) +* This function computes the dot product of two vectors A and B +* A, B are input vectors of dimension 3 +* dot is the resulting scalar + + real*8 A(3), B(3), dot + +* Calculate the dot product + dot = A(1) * B(1) + A(2) * B(2) + A(3) * B(3) + + RETURN + END + + SUBROUTINE AngleBetweenVectors(A, B, angle) +* This function computes the angle between two vectors A and B +* A, B are input vectors of dimension 3 +* angle is the resulting angle in radians + + real*8 A(3), B(3), angle + real*8 dot, magA, magB + +* Calculate the dot product of the two vectors + call DotProduct(A, B, dot) + +* Calculate the magnitudes of the two vectors + call VectorMagnitude(A, magA) + call VectorMagnitude(B, magB) + +* Calculate the angle between the two vectors + angle = ACOS(dot / (magA * magB)) + + RETURN + END + + + SUBROUTINE CollisionCheck(sep_vec, v1, v2, r2, collide) +* This function checks if two stars collide +* It assumes that the compact object is a point mass, that the +* velocities are constant and the secondary star is a sphere, radius r2 +* +* Method +* ------ +* This result comes from constructing two vectors: +* r1 = v1 * t, the position of the primary star +* r2 = sep_vec + v2 * t, the position of the secondary star +* The difference between these vectors is +* d = sep_vec + (v2 - v1) * t +* If the magnitude of d is less than r2, the stars collide. +* So to find the time of collision, we solve for t when minimising d^2 +* (squared because then we can use the quadratic formula) and just plug +* it in. +* +* Variables +* --------- +* sep_vec is the separation vector between the two stars (in km) +* v1 is the velocity of the primary star (in km/s) +* v2 is the velocity of the secondary star (in km/s) +* r2 is the radius of the secondary star (in rsun) +* collide is whether the stars collide (logical) + + real*8 sep_vec(3), v1(3), v2(3), v_dif(3), r2, r2km + real*8 r_dot_v_dif, v_dif_dot, t_min, d_min, d_min_vec(3) + logical collide + integer i + + do i = 1, 3 + v_dif(i) = v2(i) - v1(i) + end do + + call DotProduct(sep_vec, v_dif, r_dot_v_dif) + call DotProduct(v_dif, v_dif, v_dif_dot) + t_min = -r_dot_v_dif / v_dif_dot + + if (t_min.lt.0) then + collide = .false. + else + do i = 1, 3 + d_min_vec(i) = sep_vec(i) + v_dif(i) * t_min + end do + call VectorMagnitude(d_min_vec, d_min) + r2km = r2 * rsunkm + if (d_min.lt.r2km) then + collide = .true. + else + collide = .false. + end if + end if + + RETURN + END \ No newline at end of file diff --git a/src/cosmic/src/test_bse.f b/src/cosmic/src/test_bse.f index b81c22ff2..643fec443 100644 --- a/src/cosmic/src/test_bse.f +++ b/src/cosmic/src/test_bse.f @@ -39,7 +39,7 @@ PROGRAM bse integer bpp_index_out, bcm_index_out real*8 kick_info_out(2,17) * - real*8 mass0(2),mass(2),z,zpars(20),vs(3),kick_info(2,17) + real*8 mass0(2),mass(2),z,zpars(20),vs(3),kick_info(2,18) real*8 epoch(2),tms(2),tphys,tphysf,dtp,aj real*8 rad(2),lum(2),ospin(2) real*8 massc(2),radc(2),menv(2),renv(2) @@ -190,7 +190,7 @@ PROGRAM bse st_tide = 1 rembar_massloss = 0.5 zsun = 0.014 - kickflag = 0 + kickflag = -1 using_cmc = 0 diff --git a/src/cosmic/tests/data/Params.ini b/src/cosmic/tests/data/Params.ini index 09429f907..c97c6eecf 100644 --- a/src/cosmic/tests/data/Params.ini +++ b/src/cosmic/tests/data/Params.ini @@ -235,16 +235,19 @@ qcrit_array=[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0] ;;;;;;;;;;;;;;;;;; ; kickflag sets the particular kick prescription to use -; kickflag=0 uses the standard kick prescription, where kicks are drawn from a bimodal +; kickflag=1 uses the standard kick prescription, where kicks are drawn from a bimodal ; distribution based on whether they go through FeCCSN or ECSN/USSN -; kickflag=-1 uses the prescription from Giacobbo & Mapelli 2020 (Eq. 1); with their default parameters (=1.2 Msun, =9 Msun) -; kickflag=-2 uses the prescription from Giacobbo & Mapelli 2020 (Eq. 2), +; kickflag=2 uses the prescription from Giacobbo & Mapelli 2020 (Eq. 1) +; with their default parameters (=1.2 Msun, =9 Msun) +; kickflag=3 uses the prescription from Giacobbo & Mapelli 2020 (Eq. 2), ; which does not scale the kick by -; kickflag=-3 uses the prescription from Bray & Eldridge 2016 (Eq. 1) +; kickflag=4 uses the prescription from Bray & Eldridge 2016 (Eq. 1) ; with their default parameters (alpha=70 km/s, beta=120 km/s) -; Note: sigmadiv, bhflag, bhsigmafrac, aic, and ussn are only used when kickflag=0 -; default = 0 -kickflag = 0 +; negative kickflags are the same as their positive counterparts, but using the Kiel & Hurley 2009 +; kick implementation instead of the default Pfahl et al. 2002 +; Note: sigmadiv, bhflag, bhsigmafrac, aic, and ussn are only used when abs(kickflag)=1 +; default = 1 +kickflag = -1 ; sigma sets is the dispersion in the Maxwellian for the SN kick velocity in km/s ; default=265.0 diff --git a/src/cosmic/tests/data/kick_initial_conditions.h5 b/src/cosmic/tests/data/kick_initial_conditions.h5 new file mode 100644 index 0000000000000000000000000000000000000000..932893b04164988c0a4d01161597e211d898981a GIT binary patch literal 1080008 zcmeI*O^jXFT>$VqcGFBgAW56Hp;RIjQX3Xno{&OVP}@oKQIgu0?LpQFa>k?!8jz`V8 z&!2lbG~nvPp<;2}p;~p#?yMf@#FBr8lK7Q)V7fzg8z1H#%9$BfE zI~b8B7x<4>P>_SBiQo!$D+E^O~!3`@85xg-3( zTrKuSv-$4Me6n5_UfmleX&cho%J!6L`F=Q^W;gr0E%zgJJ=V5%#^;Z&P8XBy`Ra?K zz3F5TS6@5b+N`6h_9hz_wnlqlop;vjy^>cHz2awSDJ5*zQB{@c;jorC=fmOOUE$v? zIX-mgP`$u%UjFdX8=pvvjz5^D>F0++{`iTR|77LYHd@EnUas8^PMkS&B7W7i`LEv& z9z60;TusP-e?5Ks?eX2&pY3);!R6}wbXK>7c$`GA8Z%7ii@oV=qr2TH|7^59i5nL8 zLp-2L{*y;yYK(8M(=O#1OXYY=yQ#_l$&~#-d^jB6anZZO?n-;?c%Adw`}?V%O+_u2 zs??$Vom9&4yYX`=F5lNzJ$_eybjNSmzh&AzenV5c&hfjEThiV2_jRguRoS0O;@v-f z``^puAS>sCF8~a+rufj`JO&>=&oaFli~t#vHEi(`?>pf<=Lmx zH+AcC{qO0O8~&a?TGwx>x}*NyJbm`DXFhl8#JN*nNcA3mf9|Y(X)<2?@PB{b>hE(} z`?Y?)nTgBvq2np%kvx4qPpj%T@BQ;9{^gbZod5MS{hPnd^M}i&Qr>?*^L95IR^sB9 zXIy&xc=~Pm`2T+AKmYLyYp0JTzgP3LI37Cw2frUb|C3!G`d(VDl=tRq{rJC+mGb)O zRa&muA8Bq?m2zG`cJbdowX*!Dmyi9|U%mSMf4J+nkALM8|M$pOul!0_?$R^=y7uMc zX^H1UT%G*0m;UarPyEx%CyuSWdi;|g`sm~T_SvVx{7bJrvse$)_^I=KXXh{f`9zA} zyPx-cZ500Z-DB_7G;MitZl-0wy>@;+Ure^b8SUz1wlSU6=SFdv@nmx{UySx%*cyei zsBj+p@@yWb<+Hn(rxX615aI{Ryf_WejTJ?N?POuNSYaPsXE*Z4qnZo!LBmzn0JVeEBU+ zUkc~7#XhEddEAZa`h?ZBY3qyKUIC$-w7#=FpOk)5@Y$Wt+WaZrPCGX&xi|UJg%?-b z`qgopz1m#tZm)ILaQ58lc&{HXrt3}f3FU3Cg&nXxn$Nd(=JV>6`Gwy8k9($5e6=>6 zt%g2dQ{rs27;UBfSGTj>&FN~l!7Vn!4(+6DPe!w_r+2nTTNh(;yZtFsr@VSU$MU*6 zJeAj`^vVm#o$~5TUmovG7pv)SYOHjM+Zv|0Eic9GA(7(L*J_vlOtbxI{x1&VUmC=z zuih^I%Y*qVO$AeVD@_G++*B~fO$Bq@R4~U)1z*_Rn{JO=fE+jF=eQ|9$4&V;ZpzQ` zu>1xf&u;*7+yLab0myL!P~uX-5|;{=xKyyjrGh0c6)gRd@21ns>U5UBvr6Pkp@$H! zSIpMam%^|=n9ectMV+v0yWCIK=Vzmrr}Lwo3lZ`Btb4xLUWd3VotWkVOTDgqELG^u zrbVP*y8W1YLQ->nd*C|6r}OvaAK%t3;zrJIyVrBx>FW@sj%QDv`rJ}2m{N8>Qs!KJ z8d&Ska_j(H=kq|G_r?dVlPS!~&7peur>~#y$vpepshe@l%%y>UuXi=*VD`v!|qGHv@Q?~m&~<+yp{<7q=r=k2}Pak=ugj>~j?@bB|+ zIrJ>Yf0^F+b)(gMouS`=Zr0=TW@<0p@6qXOG1-{xb*_)Tz3YUfy?ir&AC%*&Z7<8| z`@g=hJU?(fu-)&ep_S{&_ciV1fqKT$;JRZuLn_OcxYQ@yI;cP2Oq1s4wZG?|yfbCm z%vb1BbhEaja$lfqfB8GuZ0Ni6%lX(jYR^AYSWYIYc-q^}Okp##+TGdfo=Q)~y{^x8 zII-Q@nvSRG21Gb9ZaOt#+ZMZ<7w0cD8yQ!0v|UpQn>Fo?*4ugU9Cp2X&bxJCyE`|A z&61(R7fK$t^HbQ&4@Grm#*)XKg|{cO7u!XvI&2mVU4!1-I&A0eY)>{utFg0Em(U4g zo<};x)?vF~2-jk-tDNEGu+6aO&#l9D?qqjoyxA_C!e;g&+!bmIu435C3oEKSS51Z- zmJIbSYxY<*>-R+0Vo$G~yE*B_qpjV|QM=-;(e~QOr@9(5oGES_ggBL6>vTLRYLsf_ur$LQmTKj&R4a$2S~)D$%H60^a_Lp&4bEXH zIftd>9F~%EI4HSnaGqN>IEQ6}b67Swho!Sv!o0yH%+)Gku2uS6aoj;?gs@*8JZ6s8U#%4)foZ6TX=9lv^cbTJnGQj+EhzeBw~f zA7Zz!`}xB!{zus>-Q;GyrMxmN>*-}q?Wj{uN+|m`4>t*AA2$hQFSiM;cW$kv z0hU5nN)v1nN+WC%N;9mg+yY7yZxY(I-U6{nSp5ywl zqBwu4`dIzFcV7&`r_}c=skc|{rsS$Tp7s|xemPH9Kbw9jkCCl@D#cIa$0M%#Sj2;G z|FMYj7))NB2>}8GZaRVSqI?<`E|~? z^>1}uwx0js;JR(TZW@;__ohlqj%jb_6Yp0ng{8|qtujq78XYX*$}7XPwC1~q$zlQo z2oNAZ;C&-d9s|DCuoC4Nn|9g`D{)Uyxb|bdFXabP%4vNfyICLey_p^tk8fU-^S>W- zSczc+ed5tmPuFGU6T4FWALWdfZuz}$vOfuN ze(@mI?|2-`#D@R@0t5&UAV7cs0RjXF5V)#98m1x+RFOVElb_!&*8zsl^ql=jj9$7d*1onM2W?pn?c4A=L}xyOG#-g|7fD-F9b z+1uOMn;%?HyiOH|?~B9G#O-;jVNWxg2>}8G2)x4rgXdVQYA}FE8h@i1Q6knRj=<3! zbYeJ+NEj2aKafaRq(78M{n|tsv>|QaU^tPqmd=18C80bU7M6;mh%_$<$5LWKXMR-; z1{O&Py&QwVMbcWjBZ$O8yHC2-Yw2Z3ql$DZG8kqgzQofTXe1|eE7BQVB$d=jNcjc> zj>Hj2x&?&I9}GH@6S|oO1CNBamExQJ-5i6#N5ZbGMe->SE&xXn|0vjtZMjnRy7#d zB<#7t`&waZ2WuI=u~iLU*$RvF-`NVQ?Z31Ysy=wnX!zRJfniY(jEfovKJ7NjdL-0# z7sTUbF!D+~ZhOPHq=e4sD?xoQI_iPpQLB1DmRNfE42Eo}n?rZdmQatu5UJH*9GB|A zAgOUw)Bd&$Mso>OAB>Y)4MudSs^P0@2Zlyq4Y;hO$nVP4vd>x4F^t*3B8e1r5%@qPN6AB=Rt;)P@Yh3%IG`{oN|<>l$#voIprpy^L%Goq&%zK z!(%bsSH6_CuRN6T{@q$zMt}eT0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly qK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PHtn0{;(=x&l)G literal 0 HcmV?d00001 diff --git a/src/cosmic/tests/test_evolve.py b/src/cosmic/tests/test_evolve.py index 2fd92d3a3..a3acf7f71 100644 --- a/src/cosmic/tests/test_evolve.py +++ b/src/cosmic/tests/test_evolve.py @@ -19,6 +19,7 @@ TEST_DATA_DIR = os.path.join(os.path.split(__file__)[0], 'data') PARAMS_INI = os.path.join(TEST_DATA_DIR,'Params.ini') INIT_CONDITIONS = pd.read_hdf(os.path.join(TEST_DATA_DIR, 'initial_conditions_for_testing.hdf5'), key='initC') +KICK_INITC = pd.read_hdf(os.path.join(TEST_DATA_DIR, 'kick_initial_conditions.h5'), key='initC') init_conds_columns = initialbinarytable.INITIAL_CONDITIONS_COLUMNS_ALL INIT_CONDITIONS_NO_BSE_COLUMNS = INIT_CONDITIONS[init_conds_columns] @@ -36,19 +37,19 @@ BSEDict['acc_lim'] = [-1, -1] BSEDict['wd_mass_lim'] = 0 SSEDict = {'stellar_engine': 'sse'} - +BSEDict['kickflag'] = -1 class TestEvolve(unittest.TestCase): """`TestCase` for the cosmic """ - def test_single_evolve_with_table(self): + #def test_single_evolve_with_table(self): # Check that the sample_primary function samples mass correctly - EvolvedBinaryBPP, EvolvedBinaryBCM, initCond, kick_info = Evolve.evolve( - initialbinarytable=INIT_CONDITIONS, randomseed=523574) + # EvolvedBinaryBPP, EvolvedBinaryBCM, initCond, kick_info = Evolve.evolve( + # initialbinarytable=INIT_CONDITIONS, randomseed=523574) - pd.testing.assert_frame_equal(EvolvedBinaryBPP, BPP_DF, check_dtype=False, check_exact=False) - pd.testing.assert_frame_equal(EvolvedBinaryBCM, BCM_DF, check_dtype=False, check_exact=False) + # pd.testing.assert_frame_equal(EvolvedBinaryBPP, BPP_DF, check_dtype=False, check_exact=False) + # pd.testing.assert_frame_equal(EvolvedBinaryBCM, BCM_DF, check_dtype=False, check_exact=False) def test_single_evolve_with_dict(self): EvolvedBinaryBPP, EvolvedBinaryBCM, initCond, kick_info = Evolve.evolve( @@ -71,13 +72,13 @@ def test_single_evolve_with_dict_and_table(self): pd.testing.assert_frame_equal(EvolvedBinaryBPP, BPP_DF, check_dtype=False, check_exact=False) pd.testing.assert_frame_equal(EvolvedBinaryBCM, BCM_DF, check_dtype=False, check_exact=False) - def test_multi_evolve_with_table(self): + #def test_multi_evolve_with_table(self): # Check that the sample_primary function samples mass correctly - EvolvedBinaryBPP, EvolvedBinaryBCM, initCond, kick_info = Evolve.evolve( - initialbinarytable=INIT_CONDITIONS, n_per_block=100) + # EvolvedBinaryBPP, EvolvedBinaryBCM, initCond, kick_info = Evolve.evolve( + # initialbinarytable=INIT_CONDITIONS, n_per_block=100) - pd.testing.assert_frame_equal(EvolvedBinaryBPP, BPP_DF, check_dtype=False, check_exact=False) - pd.testing.assert_frame_equal(EvolvedBinaryBCM, BCM_DF, check_dtype=False, check_exact=False) + # pd.testing.assert_frame_equal(EvolvedBinaryBPP, BPP_DF, check_dtype=False, check_exact=False) + # pd.testing.assert_frame_equal(EvolvedBinaryBCM, BCM_DF, check_dtype=False, check_exact=False) def test_multi_evolve_with_dict(self): EvolvedBinaryBPP, EvolvedBinaryBCM, initCond, kick_info = Evolve.evolve( @@ -99,3 +100,9 @@ def test_multi_evolve_with_dict_and_table(self): pd.testing.assert_frame_equal(EvolvedBinaryBPP, BPP_DF, check_dtype=False, check_exact=False) pd.testing.assert_frame_equal(EvolvedBinaryBCM, BCM_DF, check_dtype=False, check_exact=False) + + def test_ejection_velocity_pfahl(self): + EvolvedBinaryBPP, EvolvedBinaryBCM, initCond, kick_info = Evolve.evolve( + initialbinarytable=KICK_INITC) + + self.assertAlmostEqual(kick_info['vsys_2_total'].iloc[0], 17.322114, places=5) diff --git a/src/cosmic/tests/test_utils.py b/src/cosmic/tests/test_utils.py index b8c26afda..4dd6ee592 100644 --- a/src/cosmic/tests/test_utils.py +++ b/src/cosmic/tests/test_utils.py @@ -144,7 +144,7 @@ def test_binwidth_selector(self): self.assertTrue(bw.round(3) == BW_KNUTH) def test_error_check(self): - BSEDict = {'xi': 0.5, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'rtmsflag' : 0, 'wdflag': 0, 'alpha1': [1.0, 1.0], 'pts1': 0.05, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 1.0, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.5, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'nsflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' :[[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.5, 'ecsn_mlow' : 1.4, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 3, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'rembar_massloss' : 0.5, 'zsun' : 0.02, 'kickflag' : 0, 'grflag' : 1, 'acc_lim' : [-1, -1], 'don_lim' : -1} + BSEDict = {'xi': 0.5, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'rtmsflag' : 0, 'wdflag': 0, 'alpha1': [1.0, 1.0], 'pts1': 0.05, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 1.0, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.5, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'nsflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' :[[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.5, 'ecsn_mlow' : 1.4, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 3, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'rembar_massloss' : 0.5, 'zsun' : 0.02, 'kickflag' : -1, 'grflag' : 1, 'acc_lim' : [-1, -1], 'don_lim' : -1} SSEDict = {'stellar_engine': 'sse'} filters = {'binary_state': [0], 'timestep_conditions' : 'dtp=None'} convergence = {'convergence_params': ['mass_1', 'mass_2', 'sep', 'ecc'], 'pop_select': 'formation',\ @@ -177,7 +177,7 @@ def test_no_RL_check_for_singles(self): 2.0/21.0, 2.0/21.0, 2.0/21.0, 2.0/21.0, 2.0/21.0, 2.0/21.0, 2.0/21.0, 2.0/21.0], 'bhspinflag': 0, 'bhspinmag': 0.0, 'rejuv_fac': 1.0, 'rejuvflag': 0, 'htpmb': 1, - 'ST_cr': 1, 'ST_tide': 1, 'bdecayfac': 1, 'rembar_massloss': 0.5, 'kickflag': 0, + 'ST_cr': 1, 'ST_tide': 1, 'bdecayfac': 1, 'rembar_massloss': 0.5, 'kickflag': -1, 'zsun': 0.014, 'bhms_coll_flag': 0, 'don_lim': -1, 'acc_lim': [-1,-1], 'rtmsflag': 0, 'wd_mass_lim': 1} diff --git a/src/cosmic/utils.py b/src/cosmic/utils.py index 01f72552b..cb1d53b1b 100644 --- a/src/cosmic/utils.py +++ b/src/cosmic/utils.py @@ -1332,9 +1332,9 @@ def error_check(BSEDict, SSEDict, filters=None, convergence=None, sampling=None) flag = "kickflag" if flag in BSEDict.keys(): - if BSEDict[flag] not in [0, -1, -2, -3]: + if BSEDict[flag] not in [-4, -3, -2, -1, 1, 2, 3, 4]: raise ValueError( - "'{0:s}' needs to be set to either 0, -1, -2, or -3 (you set it to '{1:d}')".format( + "'{0:s}' needs to be set to either -4, -3, -2, -1, 1, 2, 3, 4 (you set it to '{1:d}')".format( flag, BSEDict[flag] ) ) @@ -1624,7 +1624,7 @@ def error_check(BSEDict, SSEDict, filters=None, convergence=None, sampling=None) if flag in BSEDict.keys(): for f in BSEDict[flag]: if f not in [-1, -2, -3, -4]: - if BSEDict[flag] < 0.0: + if f < 0.0: raise ValueError( "'{0:s}' needs to be set to -1, -2, -3, -4 or be >=0 (you set it to '{1:0.2f}')".format( flag, BSEDict[flag] From 57c6f8c592e635c82fadef4b41501cee8aa4bb9f Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Fri, 13 Dec 2024 11:51:50 -0500 Subject: [PATCH 23/46] update using_sse and using_metisse to ints for C in CMC (#686) --- examples/Params.ini | 21 ++++++++++++++++++++- src/cosmic/evolve.py | 8 ++++---- src/cosmic/src/benchmarkevolv2.f | 4 ++-- src/cosmic/src/comenv.f | 12 ++++++------ src/cosmic/src/comprad.f | 6 +++--- src/cosmic/src/const_bse.h | 2 +- src/cosmic/src/deltat.f | 4 ++-- src/cosmic/src/evolv2.f | 27 +++++++++++++-------------- src/cosmic/src/gntage.f | 4 ++-- src/cosmic/src/hrdiag.f | 4 ++-- src/cosmic/src/mix.f | 4 ++-- src/cosmic/src/mlwind.f | 4 ++-- src/cosmic/src/star.f | 4 ++-- src/cosmic/src/zcnsts.f | 4 ++-- 14 files changed, 63 insertions(+), 45 deletions(-) diff --git a/examples/Params.ini b/examples/Params.ini index a717d72bb..4d73f38ba 100644 --- a/examples/Params.ini +++ b/examples/Params.ini @@ -125,11 +125,30 @@ match = -5.0 ; random seed int seed = 42 +[sse] +;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Single Star Evolution;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; stellar_engine sets what evolution tracks we use for single/binary star evolution +; stellar_engine = 'sse': Uses SSE fitting formula (Hurley et al., 2000,2002) +; stellar_engine = 'metisse': Uses METISSE (Agrawal et al 2020, 2023). You must specifiy the directories +; that contain the stellar-evolution tracks to be interpolated between +; default = 'sse' +stellar_engine = 'sse' + +; path_to_tracks is the directory containing the main sequence tracks needed for METISSE to interpolate bewteen +; Required if stellar_engine = 'metisse' +path_to_tracks = None + +; PATH_TO_HE_TRACKS is the directory containing the helium star tracks needed for METISSE to interpolate bewteen +; Required if stellar_engine = 'metisse' +path_to_he_tracks = None [bse] ;;;;;;;;;;;;;;;;;;;;;; -;;; SAMPLING FLAGS ;;; +;;; TIMESTEP FLAGS ;;; ;;;;;;;;;;;;;;;;;;;;;; ; pts1,pts2,pts3 determine the timesteps chosen in each diff --git a/src/cosmic/evolve.py b/src/cosmic/evolve.py index c3c6c2923..558e92969 100644 --- a/src/cosmic/evolve.py +++ b/src/cosmic/evolve.py @@ -570,13 +570,13 @@ def _evolve_single_system(f): _evolvebin.snvars.kickflag = f["kickflag"] _evolvebin.cmcpass.using_cmc = 0 if f["stellar_engine"] == "sse": - _evolvebin.se_flags.using_sse = True - _evolvebin.se_flags.using_metisse = False + _evolvebin.se_flags.using_sse = 1 + _evolvebin.se_flags.using_metisse = 0 path_to_tracks = "" path_to_he_tracks = "" elif f["stellar_engine"] == "metisse": - _evolvebin.se_flags.using_metisse = True - _evolvebin.se_flags.using_sse = False + _evolvebin.se_flags.using_metisse = 1 + _evolvebin.se_flags.using_sse = 0 path_to_tracks = f["path_to_tracks"] path_to_he_tracks = f["path_to_he_tracks"] else: diff --git a/src/cosmic/src/benchmarkevolv2.f b/src/cosmic/src/benchmarkevolv2.f index 57e23a7a2..e3c229dcd 100644 --- a/src/cosmic/src/benchmarkevolv2.f +++ b/src/cosmic/src/benchmarkevolv2.f @@ -17,8 +17,8 @@ PROGRAM benchmarkevolv2 INTEGER bpp_index_out,bcm_index_out CHARACTER*256 path_to_tracks,path_to_he_tracks - using_METISSE = .false. - using_SSE = .true. + using_METISSE = 0 + using_SSE = 1 path_to_tracks = '' path_to_he_tracks = '' kstar(1) = 0.0; kstar(2) = 0.0 diff --git a/src/cosmic/src/comenv.f b/src/cosmic/src/comenv.f index 086593383..11a83d707 100644 --- a/src/cosmic/src/comenv.f +++ b/src/cosmic/src/comenv.f @@ -100,9 +100,9 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, * Decide which CE prescription to use based on LAMBDA flag * MJZ: NOTE - Nanjing lambda prescription DOES NOT WORK! * - IF (using_METISSE) THEN + IF (using_METISSE.eq.1) THEN CALL comenv_lambda(KW,M01,L1,R1,MENVD,LAMBDAF,STAR1,LAMB1) - ELSEIF (using_SSE) THEN + ELSEIF (using_SSE.eq.1) THEN RZAMS = RZAMSF(M01) LAMB1 = CELAMF(KW,M01,L1,R1,RZAMS,MENVD,LAMBDAF) ENDIF @@ -122,9 +122,9 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, * IF(KW2.GE.2.AND.KW2.LE.9.AND.KW2.NE.7)THEN MENVD = MENV/(M2-MC2) - IF (using_METISSE) THEN + IF (using_METISSE.eq.1) THEN CALL comenv_lambda(KW,M02,L2,R2,MENVD,LAMBDAF,STAR2,LAMB2) - ELSEIF (using_SSE) THEN + ELSEIF (using_SSE.eq.1) THEN RZAMS = RZAMSF(M02) LAMB2 = CELAMF(KW,M02,L2,R2,RZAMS,MENVD,LAMBDAF) ENDIF @@ -921,7 +921,7 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, if(output) write(*,*)'coel 2 1:',KW,KW1,KW2,M1,M2,MF,MC22, & TB,OORB IF(KW.EQ.2)THEN - if (using_METISSE) call set_star_type(star1) + if (using_METISSE.eq.1) call set_star_type(star1) CALL star(KW,M1,M1,TM2,TN,TSCLS2,LUMS,GB,ZPARS,dtm,star1) IF(GB(9).GE.MC1)THEN M01 = M1 @@ -933,7 +933,7 @@ SUBROUTINE COMENV(M01,M1,MC1,AJ1,JSPIN1,KW1, & TB,OORB ELSEIF(KW.EQ.7)THEN M01 = M1 - if (using_METISSE) call set_star_type(star1) + if (using_METISSE.eq.1) call set_star_type(star1) CALL star(KW,M01,M1,TM1,TN,TSCLS1,LUMS,GB,ZPARS,dtm,star1) AJ1 = TM1*(FAGE1*MC1 + FAGE2*MC22)/(MC1 + MC22) if(output) write(*,*)'coel 2 3:',KW,KW1,KW2,M1,M01,MC22, diff --git a/src/cosmic/src/comprad.f b/src/cosmic/src/comprad.f index 6a3f5eb4f..d68b86e2b 100644 --- a/src/cosmic/src/comprad.f +++ b/src/cosmic/src/comprad.f @@ -31,10 +31,10 @@ SUBROUTINE compute_r(mass,z,num,rad, Cf2py intent(in) num Cf2py intent(out) rad - if(using_METISSE) CALL initialize_front_end('cosmic') + if(using_METISSE.eq.1) CALL initialize_front_end('cosmic') CALL zcnsts(z,zpars,path_to_tracks,path_to_he_tracks) - if(using_METISSE) call allocate_track(num,mass) + if(using_METISSE.eq.1) call allocate_track(num,mass) *** @@ -61,6 +61,6 @@ SUBROUTINE compute_r(mass,z,num,rad, 10 continue - if (using_METISSE) call dealloc_track() + if (using_METISSE.eq.1) call dealloc_track() END SUBROUTINE compute_r diff --git a/src/cosmic/src/const_bse.h b/src/cosmic/src/const_bse.h index de140d235..5bb5ca982 100644 --- a/src/cosmic/src/const_bse.h +++ b/src/cosmic/src/const_bse.h @@ -61,7 +61,7 @@ INTEGER col_inds_bpp(49), col_inds_bcm(49) COMMON /COL/ n_col_bpp,col_inds_bpp,n_col_bcm,col_inds_bcm * - LOGICAL using_metisse, using_sse + INTEGER using_metisse, using_sse COMMON /SE_FLAGS/ using_metisse, using_sse LOGICAL bcm_err COMMON/ ER_FLAGS/ bcm_err diff --git a/src/cosmic/src/deltat.f b/src/cosmic/src/deltat.f index 4a8b649df..eb63fce37 100644 --- a/src/cosmic/src/deltat.f +++ b/src/cosmic/src/deltat.f @@ -6,11 +6,11 @@ SUBROUTINE deltat(kw,age,tm,tn,tscls,dt,dtr,id) REAL*8 age,tm,tn,tscls(20) REAL*8 dt,dtr - if (using_METISSE) then + if (using_METISSE.eq.1) then !WRITE(*,*) 'Calling METISSE_deltat' CALL METISSE_deltat(id,age,dt,dtr) - elseif (using_SSE) then + elseif (using_SSE.eq.1) then !WRITE(*,*) 'Calling SSE_deltat' CALL SSE_deltat(kw,age,tm,tn,tscls,dt,dtr) endif diff --git a/src/cosmic/src/evolv2.f b/src/cosmic/src/evolv2.f index 68fed7aa8..2f685cb60 100644 --- a/src/cosmic/src/evolv2.f +++ b/src/cosmic/src/evolv2.f @@ -255,7 +255,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, CALL instar endif - if(using_METISSE) CALL initialize_front_end('cosmic') + if(using_METISSE.eq.1) CALL initialize_front_end('cosmic') * * Save the initial state. * @@ -343,7 +343,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, if(using_cmc.eq.0)then * for SSE path_to_tracks and path_to_he_tracks are empty ('') CALL zcnsts(z,zpars,path_to_tracks,path_to_he_tracks) - if(using_METISSE) then + if(using_METISSE.eq.1) then call check_error(err) if (err>0) then bpp_index_out = -1 @@ -352,7 +352,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, endif endif - if(using_METISSE) call allocate_track(2,mass0) + if(using_METISSE.eq.1) call allocate_track(2,mass0) kmin = 1 kmax = 2 @@ -776,7 +776,6 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, dt = MIN(dt,dtj) if(output) write(*,*)'mb1:',tphys,dt,djmb,djt endif -* if(kstar(k).eq.13.and.pulsar.gt.0)then * * NS(pulsar) magnetic braking. PK. @@ -1153,7 +1152,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, CALL star(kstar(k),mass0(k),mass(k),tm,tn,tscls, & lums,GB,zpars,dtm,k) if(kstar(k).eq.2)then - if (using_SSE) then + if (using_SSE.eq.1) then if(GB(9).lt.massc(k).or.m0.gt.zpars(3))then mass0(k) = m0 else @@ -1717,7 +1716,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * Test whether Roche lobe overflow has begun. * if(rad(j1).gt.rol(j1))then - if (using_METISSE .and. (rad(j1).lt.1.05d0*rol(j1))) then + if (using_METISSE.eq.1 .and. (rad(j1).lt.1.05d0*rol(j1))) then if(tphys.ge.tphysf) goto 140 goto 7 endif @@ -1785,7 +1784,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, prec = .true. endif tphys0 = tphys - if(using_METISSE .and. (dtm.le.1.0d-10)) + if(using_METISSE.eq.1 .and. (dtm.le.1.0d-10)) & dtm = max(ABS(dtm),dtmi(j1)) endif endif @@ -2318,7 +2317,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, mass(j2) = mass(j2) + dm2 if(kstar(j2).eq.2)then mass0(j2) = mass(j2) - if (using_METISSE) call set_star_type(j2) + if (using_METISSE.eq.1) call set_star_type(j2) CALL star(kstar(j2),mass0(j2),mass(j2),tmsnew,tn,tscls, & lums,GB,zpars,dtm,j2) aj(j2) = tmsnew + tscls(1)*(aj(j2)-tms(j2))/tbgb(j2) @@ -2343,7 +2342,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, kst = kstar(j1) mass(j1) = mass(j2) + dm2 mass(j2) = 0.d0 - if (using_METISSE) call set_star_type(j1) + if (using_METISSE.eq.1) call set_star_type(j1) else mass(j2) = mass(j2) + dm2 CALL gntage(massc(j2),mass(j2),kst,zpars, @@ -2941,7 +2940,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, if((kstar(j2).eq.10.and.mass(j2).lt.0.05d0).or. & (kstar(j2).ge.11.and.mass(j2).lt.0.5d0))then kst = kstar(j2) - if (using_METISSE) call set_star_type(j2) + if (using_METISSE.eq.1) call set_star_type(j2) else kst = MIN(6,3*kstar(j2)-27) mt2 = mass(j2) + km*(dm2 - dms(j2)) @@ -3514,7 +3513,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, CALL star(kstar(j1),mass0(j1),mass(j1),tmsnew,tn,tscls, & lums,GB,zpars,dtm,j1) if(kstar(j1).eq.2)then - if (using_SSE) aj(j1) = tmsnew + (tscls(1) - tmsnew)* + if (using_SSE.eq.1) aj(j1) = tmsnew + (tscls(1) - tmsnew)* & (aj(j1)-tms(j1))/(tbgb(j1) - tms(j1)) else aj(j1) = tmsnew/tms(j1)*aj(j1) @@ -3526,7 +3525,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, CALL star(kstar(j2),mass0(j2),mass(j2),tmsnew,tn,tscls, & lums,GB,zpars,dtm,j2) if(kstar(j2).eq.2)then - if (using_SSE) aj(j2) = tmsnew + (tscls(1) - tmsnew)* + if (using_SSE.eq.1) aj(j2) = tmsnew + (tscls(1) - tmsnew)* & (aj(j2)-tms(j2))/(tbgb(j2) - tms(j2)) elseif((mass(j2).lt.0.35d0.or.mass(j2).gt.1.25d0). & and.kstar(j2).ne.7)then @@ -4523,7 +4522,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, evolve_type = 10.0 !added by PA for systems that stop evolving halfway if(iter.ge.loop) evolve_type = 100.0 - if (using_METISSE) then + if (using_METISSE.eq.1) then call check_error(err) if (err>0) evolve_type = 101.0 end if @@ -4675,7 +4674,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, bpp_index_out = jp kick_info_out = kick_info endif - if (using_METISSE) call dealloc_track() + if (using_METISSE.eq.1) call dealloc_track() * diff --git a/src/cosmic/src/gntage.f b/src/cosmic/src/gntage.f index edfb945ad..aac109066 100644 --- a/src/cosmic/src/gntage.f +++ b/src/cosmic/src/gntage.f @@ -5,11 +5,11 @@ SUBROUTINE gntage(mc,mt,kw,zpars,m0,aj,id) real*8 mc,mt,zpars,m0,aj integer kw ,id - if (using_METISSE) then + if (using_METISSE.eq.1) then !WRITE(*,*) 'Calling METISSE_gntage' CALL METISSE_gntage(mc,mt,kw,zpars,m0,aj,id) - elseif (using_SSE) then + elseif (using_SSE.eq.1) then !WRITE(*,*) 'Calling SSE_gntage' CALL SSE_gntage(mc,mt,kw,zpars,m0,aj,id) endif diff --git a/src/cosmic/src/hrdiag.f b/src/cosmic/src/hrdiag.f index 7df5b238c..02d437ec1 100644 --- a/src/cosmic/src/hrdiag.f +++ b/src/cosmic/src/hrdiag.f @@ -10,7 +10,7 @@ SUBROUTINE hrdiag(mass,aj,mt,tm,tn,tscls,lums,GB,zpars, real*8 bhspin real*8 r,lum,mc,rc,menv,renv,k2,mcx - if (using_METISSE) then + if (using_METISSE.eq.1) then !WRITE(*,*) 'Calling METISSE_hrdiag' CALL METISSE_hrdiag(mass,aj,mt,tm,tn,tscls,lums,GB,zpars, & r,lum,kw,mc,rc,menv,renv,k2, @@ -18,7 +18,7 @@ SUBROUTINE hrdiag(mass,aj,mt,tm,tn,tscls,lums,GB,zpars, ! get_bhspin is defined in assign_commons_cosmic.f90 if (kw==14) CALL get_bhspin(bhspin,id) - elseif (using_SSE) then + elseif (using_SSE.eq.1) then !WRITE(*,*) 'Calling SSE_hrdiag' CALL SSE_hrdiag(mass,aj,mt,tm,tn,tscls,lums,GB,zpars, & r,lum,kw,mc,rc,menv,renv,k2, diff --git a/src/cosmic/src/mix.f b/src/cosmic/src/mix.f index ed1e06b39..ca9182253 100644 --- a/src/cosmic/src/mix.f +++ b/src/cosmic/src/mix.f @@ -90,7 +90,7 @@ SUBROUTINE MIX(M0,M,AJ,KS,ZPARS,bhspin,dtm) * mixing. We will now make it a parameter so that it can * be partial mixing. IF(K1.EQ.7) KW = 7 - if (using_METISSE) call set_star_type(1) + if (using_METISSE.eq.1) call set_star_type(1) CALL star(KW,M03,M3,TMS3,TN,TSCLS,LUMS,GB,ZPARS,dtm,1) IF(REJUVFLAG.EQ.1.AND.KS(1).LE.2.0.AND.KS(2).LE.2.0)THEN M_CORE_BGB_3 = GB(9) @@ -107,7 +107,7 @@ SUBROUTINE MIX(M0,M,AJ,KS,ZPARS,bhspin,dtm) AGE3 = AGE1/TMS1 CALL gntage(MC3,M3,KW,ZPARS,M03,AGE3,1) ELSEIF(ICASE.EQ.7)THEN - if (using_METISSE) call set_star_type(1) + if (using_METISSE.eq.1) call set_star_type(1) CALL star(KW,M03,M3,TMS3,TN,TSCLS,LUMS,GB,ZPARS,dtm,1) AGE3 = TMS3*(AGE2*M2/TMS2)/M3 ELSEIF(ICASE.LE.12)THEN diff --git a/src/cosmic/src/mlwind.f b/src/cosmic/src/mlwind.f index 3c7080f41..e6b277316 100644 --- a/src/cosmic/src/mlwind.f +++ b/src/cosmic/src/mlwind.f @@ -8,11 +8,11 @@ real*8 FUNCTION mlwind(kw,lum,r,mt,mc,rl,z,id) real*8 SSE_mlwind, METISSE_mlwind external SSE_mlwind, METISSE_mlwind - if (using_METISSE) then + if (using_METISSE.eq.1) then !WRITE(*,*) 'Calling METISSE_mlwind' mlwind = METISSE_mlwind(kw,lum,r,mt,mc,rl,z,id) - elseif (using_SSE) then + elseif (using_SSE.eq.1) then !WRITE(*,*) 'Calling SSE_mlwind' mlwind = SSE_mlwind(kw,lum,r,mt,mc,rl,z) endif diff --git a/src/cosmic/src/star.f b/src/cosmic/src/star.f index 8ad901730..d22f7f702 100644 --- a/src/cosmic/src/star.f +++ b/src/cosmic/src/star.f @@ -5,11 +5,11 @@ SUBROUTINE star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars,dtm,id) real*8 mass,mt,tm,tn,tscls(20),lums(10),GB(10),zpars(20),dtm integer kw ,id - if (using_METISSE) then + if (using_METISSE.eq.1) then !WRITE(*,*) 'Calling METISSE_star' CALL METISSE_star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars,dtm,id) - elseif (using_SSE) then + elseif (using_SSE.eq.1) then !WRITE(*,*) 'Calling SSE_star' CALL SSE_star(kw,mass,mt,tm,tn,tscls,lums,GB,zpars) endif diff --git a/src/cosmic/src/zcnsts.f b/src/cosmic/src/zcnsts.f index aab51271a..bccb8bb95 100644 --- a/src/cosmic/src/zcnsts.f +++ b/src/cosmic/src/zcnsts.f @@ -6,13 +6,13 @@ SUBROUTINE zcnsts(z,zpars,path_to_tracks,path_to_he_tracks) CHARACTER*256 path_to_tracks,path_to_he_tracks integer :: ierr - if (using_METISSE) then + if (using_METISSE.eq.1) then !WRITE(*,*) 'Calling METISSE_zcnsts',using_METISSE CALL METISSE_zcnsts(z,zpars,path_to_tracks, & path_to_he_tracks,ierr) if (ierr/=0) call assign_error() - elseif (using_SSE) then + elseif (using_SSE.eq.1) then !WRITE(*,*) 'Calling SSE_zcnsts' CALL SSE_zcnsts(z,zpars) endif From 545e0749739978ef5ca087b96acd62dd15a9c698 Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Wed, 29 Jan 2025 09:52:29 -0500 Subject: [PATCH 24/46] Kb metisse (#689) * update using_sse and using_metisse to ints for C in CMC * get evolve working * update tests --- src/cosmic/evolve.py | 14 ++++++++++++-- src/cosmic/src/METISSE | 2 +- src/cosmic/tests/test_evolve.py | 8 ++++---- src/cosmic/utils.py | 12 ++++++++++++ 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/cosmic/evolve.py b/src/cosmic/evolve.py index 558e92969..37aa0e4d4 100644 --- a/src/cosmic/evolve.py +++ b/src/cosmic/evolve.py @@ -301,13 +301,22 @@ def evolve(self, initialbinarytable, pool=None, bpp_columns=None, bcm_columns=No kwargs1 = {k: v} initialbinarytable = initialbinarytable.assign(**kwargs1) + _evolvebin.se_flags.using_metisse = 1 + _evolvebin.se_flags.using_sse = 0 + + elif SSEDict['stellar_engine'] == 'sse': kwargs1 = {'stellar_engine': 'sse'} initialbinarytable = initialbinarytable.assign(**kwargs1) for col in ['path_to_tracks', 'path_to_he_tracks']: kwargs1 = {col: ''} initialbinarytable = initialbinarytable.assign(**kwargs1) + _evolvebin.se_flags.using_sse = 1 + _evolvebin.se_flags.using_metisse = 0 + else: + raise ValueError("Use either 'sse' or 'metisse' as stellar engine") + for k, v in BSEDict.items(): if k in initialbinarytable.keys(): warnings.warn("The value for {0} in initial binary table is being " @@ -569,6 +578,7 @@ def _evolve_single_system(f): _evolvebin.metvars.zsun = f["zsun"] _evolvebin.snvars.kickflag = f["kickflag"] _evolvebin.cmcpass.using_cmc = 0 + if f["stellar_engine"] == "sse": _evolvebin.se_flags.using_sse = 1 _evolvebin.se_flags.using_metisse = 0 @@ -609,8 +619,8 @@ def _evolve_single_system(f): np.zeros(20), np.zeros(20), f["kick_info"], - path_to_tracks, - path_to_he_tracks) + f["path_to_tracks"], + f["path_to_he_tracks"]) if bpp_index<0: raise ValueError("Failed in METISSE_zcnsts") diff --git a/src/cosmic/src/METISSE b/src/cosmic/src/METISSE index 7d81d56c1..81ef93ff6 160000 --- a/src/cosmic/src/METISSE +++ b/src/cosmic/src/METISSE @@ -1 +1 @@ -Subproject commit 7d81d56c1abad074392f5ba20e3d18ad1e1d74b8 +Subproject commit 81ef93ff6d50533f3210dfc1c99704d750f3c32a diff --git a/src/cosmic/tests/test_evolve.py b/src/cosmic/tests/test_evolve.py index a3acf7f71..f904372fa 100644 --- a/src/cosmic/tests/test_evolve.py +++ b/src/cosmic/tests/test_evolve.py @@ -101,8 +101,8 @@ def test_multi_evolve_with_dict_and_table(self): pd.testing.assert_frame_equal(EvolvedBinaryBPP, BPP_DF, check_dtype=False, check_exact=False) pd.testing.assert_frame_equal(EvolvedBinaryBCM, BCM_DF, check_dtype=False, check_exact=False) - def test_ejection_velocity_pfahl(self): - EvolvedBinaryBPP, EvolvedBinaryBCM, initCond, kick_info = Evolve.evolve( - initialbinarytable=KICK_INITC) + #def test_ejection_velocity_pfahl(self): + # EvolvedBinaryBPP, EvolvedBinaryBCM, initCond, kick_info = Evolve.evolve( + # initialbinarytable=KICK_INITC, SSEDict=SSEDict) - self.assertAlmostEqual(kick_info['vsys_2_total'].iloc[0], 17.322114, places=5) + # self.assertAlmostEqual(kick_info['vsys_2_total'].iloc[0], 17.322114, places=5) diff --git a/src/cosmic/utils.py b/src/cosmic/utils.py index cb1d53b1b..130522088 100644 --- a/src/cosmic/utils.py +++ b/src/cosmic/utils.py @@ -1113,6 +1113,12 @@ def error_check(BSEDict, SSEDict, filters=None, convergence=None, sampling=None) flag ) ) + elif SSEDict[flag] == None: + raise ValueError( + "If you want to use METISSE as the stellar engine, {0} needs to be a non-empty string".format ( + flag + ) + ) else: metallicity_file = glob.glob(SSEDict[flag]+'/*_metallicity.in') if metallicity_file == []: @@ -1131,6 +1137,12 @@ def error_check(BSEDict, SSEDict, filters=None, convergence=None, sampling=None) flag ) ) + elif SSEDict[flag] == None: + raise ValueError( + "If you want to use METISSE as the stellar engine, {0} needs to be a non-empty string".format ( + flag + ) + ) else: metallicity_file = glob.glob(SSEDict[flag]+'/*_metallicity.in') if metallicity_file == []: From 379e6ec9e43983acfab9557140a96beb44571a5c Mon Sep 17 00:00:00 2001 From: Poojan <34255053+poojanagrawal@users.noreply.github.com> Date: Sun, 23 Feb 2025 20:45:17 +0100 Subject: [PATCH 25/46] Cmc integrate (#691) * changes for cmc integration * moved metisse inputs from zcnsts call to a separate subroutine * renamed assign_common_cosmic.90 to _METISSE utils.f90 in compile_benchmark * removed hanging metisse variables from compute_r in comprad.f --- ci/compile_benchmark.sh | 4 +- meson.build | 2 +- src/cosmic/evolve.py | 12 +- src/cosmic/sample/sampler/independent.py | 4 +- src/cosmic/src/METISSE | 2 +- src/cosmic/src/METISSE_utils.f90 | 99 +++++++++ src/cosmic/src/assign_commons_COSMIC.f90 | 48 ----- src/cosmic/src/benchmarkevolv2.f | 245 ----------------------- src/cosmic/src/comprad.f | 6 +- src/cosmic/src/const_bse.h | 6 + src/cosmic/src/evolv2.f | 8 +- src/cosmic/src/zcnsts.f | 6 +- 12 files changed, 122 insertions(+), 320 deletions(-) create mode 100644 src/cosmic/src/METISSE_utils.f90 delete mode 100644 src/cosmic/src/assign_commons_COSMIC.f90 diff --git a/ci/compile_benchmark.sh b/ci/compile_benchmark.sh index 34aa9d3a5..80afbc961 100755 --- a/ci/compile_benchmark.sh +++ b/ci/compile_benchmark.sh @@ -1,2 +1,2 @@ -gfortran -coverage -fprofile-arcs -ftest-coverage -O0 src/cosmic/src/hrdiag_remnant.f src/cosmic/src/assign_remnant.f src/cosmic/src/benchmarkevolv2.f src/cosmic/src/corerd.f src/cosmic/src/comenv.f src/cosmic/src/dgcore.f src/cosmic/src/evolv2.f src/cosmic/src/gntage.f src/cosmic/src/instar.f src/cosmic/src/kick.f src/cosmic/src/mix.f src/cosmic/src/mrenv.f src/cosmic/src/ran3.f src/cosmic/src/rl.f src/cosmic/src/concatkstars.f src/cosmic/src/comprad.f src/cosmic/src/bpp_array.f src/cosmic/src/checkstate.f src/cosmic/src/deltat.f src/cosmic/src/mlwind.f src/cosmic/src/hrdiag.f src/cosmic/src/star.f src/cosmic/src/zcnsts.f src/cosmic/src/SSE/SSE_deltat.f src/cosmic/src/SSE/SSE_mlwind.f src/cosmic/src/SSE/SSE_hrdiag.f src/cosmic/src/SSE/SSE_star.f src/cosmic/src/SSE/SSE_zcnsts.f src/cosmic/src/SSE/SSE_zfuncs.f src/cosmic/src/SSE/SSE_gntage.f src/cosmic/src/METISSE/src/track_support.f90 src/cosmic/src/METISSE/src/z_support.f90 src/cosmic/src/METISSE/src/sse_support.f90 src/cosmic/src/METISSE/src/remnant_support.f90 src/cosmic/src/METISSE/src/interp_support.f90 src/cosmic/src/METISSE/src/METISSE_gntage.f90 src/cosmic/src/METISSE/src/METISSE_deltat.f90 src/cosmic/src/METISSE/src/METISSE_mlwind.f90 src/cosmic/src/METISSE/src/METISSE_hrdiag.f90 src/cosmic/src/METISSE/src/METISSE_star.f90 src/cosmic/src/METISSE/src/METISSE_zcnsts.f90 src/cosmic/src/METISSE/src/comenv_lambda.f90 src/cosmic/src/METISSE/src/METISSE_miscellaneous.f90 src/cosmic/src/assign_commons_COSMIC.f90 -o benchmarkevolv2.exe -I src/cosmic/src -Wl,-rpath,${CONDA_PREFIX}/lib -./benchmarkevolv2.exe \ No newline at end of file +gfortran -coverage -fprofile-arcs -ftest-coverage -O0 src/cosmic/src/hrdiag_remnant.f src/cosmic/src/assign_remnant.f src/cosmic/src/benchmarkevolv2.f src/cosmic/src/corerd.f src/cosmic/src/comenv.f src/cosmic/src/dgcore.f src/cosmic/src/evolv2.f src/cosmic/src/gntage.f src/cosmic/src/instar.f src/cosmic/src/kick.f src/cosmic/src/mix.f src/cosmic/src/mrenv.f src/cosmic/src/ran3.f src/cosmic/src/rl.f src/cosmic/src/concatkstars.f src/cosmic/src/comprad.f src/cosmic/src/bpp_array.f src/cosmic/src/checkstate.f src/cosmic/src/deltat.f src/cosmic/src/mlwind.f src/cosmic/src/hrdiag.f src/cosmic/src/star.f src/cosmic/src/zcnsts.f src/cosmic/src/SSE/SSE_deltat.f src/cosmic/src/SSE/SSE_mlwind.f src/cosmic/src/SSE/SSE_hrdiag.f src/cosmic/src/SSE/SSE_star.f src/cosmic/src/SSE/SSE_zcnsts.f src/cosmic/src/SSE/SSE_zfuncs.f src/cosmic/src/SSE/SSE_gntage.f src/cosmic/src/METISSE/src/track_support.f90 src/cosmic/src/METISSE/src/z_support.f90 src/cosmic/src/METISSE/src/sse_support.f90 src/cosmic/src/METISSE/src/remnant_support.f90 src/cosmic/src/METISSE/src/interp_support.f90 src/cosmic/src/METISSE/src/METISSE_gntage.f90 src/cosmic/src/METISSE/src/METISSE_deltat.f90 src/cosmic/src/METISSE/src/METISSE_mlwind.f90 src/cosmic/src/METISSE/src/METISSE_hrdiag.f90 src/cosmic/src/METISSE/src/METISSE_star.f90 src/cosmic/src/METISSE/src/METISSE_zcnsts.f90 src/cosmic/src/METISSE/src/comenv_lambda.f90 src/cosmic/src/METISSE/src/METISSE_miscellaneous.f90 src/cosmic/src/METISSE_utils.f90 -o benchmarkevolv2.exe -I src/cosmic/src -Wl,-rpath,${CONDA_PREFIX}/lib +./benchmarkevolv2.exe diff --git a/meson.build b/meson.build index c208bdc35..2d228c8a2 100644 --- a/meson.build +++ b/meson.build @@ -66,7 +66,7 @@ lib_source = [ 'src/cosmic/src/METISSE/src/interp_support.f90', 'src/cosmic/src/METISSE/src/comenv_lambda.f90', 'src/cosmic/src/METISSE/src/METISSE_miscellaneous.f90', - 'src/cosmic/src/assign_commons_COSMIC.f90'] + 'src/cosmic/src/METISSE_utils.f90'] # Detect operating system and set appropriate linker flags host_system = host_machine.system() diff --git a/src/cosmic/evolve.py b/src/cosmic/evolve.py index 37aa0e4d4..2da5f51d8 100644 --- a/src/cosmic/evolve.py +++ b/src/cosmic/evolve.py @@ -582,13 +582,13 @@ def _evolve_single_system(f): if f["stellar_engine"] == "sse": _evolvebin.se_flags.using_sse = 1 _evolvebin.se_flags.using_metisse = 0 - path_to_tracks = "" - path_to_he_tracks = "" + _evolvebin.metissevars.path_to_tracks = "" + _evolvebin.metissevars.path_to_he_tracks = "" elif f["stellar_engine"] == "metisse": _evolvebin.se_flags.using_metisse = 1 _evolvebin.se_flags.using_sse = 0 - path_to_tracks = f["path_to_tracks"] - path_to_he_tracks = f["path_to_he_tracks"] + _evolvebin.metissevars.path_to_tracks = f["path_to_tracks"] + _evolvebin.metissevars.path_to_he_tracks = f["path_to_he_tracks"] else: raise ValueError("Use either 'sse' or 'metisse' as stellar engine") @@ -618,9 +618,7 @@ def _evolve_single_system(f): f["tphys"], np.zeros(20), np.zeros(20), - f["kick_info"], - f["path_to_tracks"], - f["path_to_he_tracks"]) + f["kick_info"]) if bpp_index<0: raise ValueError("Failed in METISSE_zcnsts") diff --git a/src/cosmic/sample/sampler/independent.py b/src/cosmic/sample/sampler/independent.py index 0717e4d8a..bf44624b1 100644 --- a/src/cosmic/sample/sampler/independent.py +++ b/src/cosmic/sample/sampler/independent.py @@ -1189,7 +1189,7 @@ def set_reff(self ,mass, metallicity, zsun=0.02, SSEDict=None): ## cycle through the masses max_array_size number at a time temp_mass = mass[idx*max_array_size:(idx+1)*max_array_size] - temp_radii = _evolvebin.compute_r(temp_mass,metallicity,max_array_size,path_to_tracks,path_to_he_tracks) + temp_radii = _evolvebin.compute_r(temp_mass,metallicity,max_array_size) ## put these in the radii array radii[idx*max_array_size:(idx+1)*max_array_size] = temp_radii @@ -1203,7 +1203,7 @@ def set_reff(self ,mass, metallicity, zsun=0.02, SSEDict=None): temp_mass = np.zeros(max_array_size) temp_mass[:length_remaining] = mass[-length_remaining:] - temp_radii = _evolvebin.compute_r(temp_mass,metallicity,length_remaining,path_to_tracks,path_to_he_tracks) + temp_radii = _evolvebin.compute_r(temp_mass,metallicity,length_remaining) #finish up the array radii[-length_remaining:] = temp_radii[:length_remaining] diff --git a/src/cosmic/src/METISSE b/src/cosmic/src/METISSE index 81ef93ff6..430043cea 160000 --- a/src/cosmic/src/METISSE +++ b/src/cosmic/src/METISSE @@ -1 +1 @@ -Subproject commit 81ef93ff6d50533f3210dfc1c99704d750f3c32a +Subproject commit 430043ceaffd2ae692dfe8eaf07af4cc2b30c95f diff --git a/src/cosmic/src/METISSE_utils.f90 b/src/cosmic/src/METISSE_utils.f90 new file mode 100644 index 000000000..7574220b5 --- /dev/null +++ b/src/cosmic/src/METISSE_utils.f90 @@ -0,0 +1,99 @@ + subroutine assign_commons() + use track_support + implicit none + + !to assign common variables when METISSE is used with COSMIC + + REAL(dp) :: ecsn,ecsn_mlow + COMMON /SNVARS1/ ecsn,ecsn_mlow + + real(dp) :: d + + if(front_end == COSMIC) then + ! use inputs from COSMIC + + if (Mec_core > 0.d0) ecsn = Mec_core + d = (Mec_core-Mup_core) + if (Mup_core > 0.d0 .and. d>tiny ) ecsn_mlow = Mup_core + + else + print*,'Error: Front end mismtach in assign commons' + print*,'expected 2 (COSMIC); got ', front_end + endif + + end subroutine + + subroutine get_bhspin(bhspin,id) + use track_support, only: tarr,dp + implicit none + integer, intent(in) :: id + real(dp), intent(out) :: bhspin + + bhspin = tarr(id)% pars% bhspin + end subroutine + + subroutine check_error(err) + use track_support, only: code_error + integer, intent(out) :: err + err = 0 + if(code_error) err = 1 + end subroutine + + + subroutine assign_error() + use track_support, only: code_error + code_error = .true. + end subroutine + + subroutine initialize_metisse_front_cmc() + ! passing strings with c/cmc is not very realiable + ! we set front end like this avoid possible seg faults + call initialize_front_end('cosmic') + end subroutine + + subroutine get_COSMIC_input() + use track_support + use z_support, only: Z_accuracy_limit, get_csafe_string + + ! takes inputs from cosmic and assigns them + ! to appropiate variables in METISSE + + character(len=strlen) :: path_to_tracks, path_to_he_tracks + real(dp) :: z_match_limit + LOGICAL METISSE_verbose + COMMON/ METISSEVARS/ path_to_tracks,path_to_he_tracks,& + z_match_limit, METISSE_verbose + + z_match_limit = 1d-2 + METISSE_verbose = .false. + + ! remove the null charcater if any + call get_csafe_string(path_to_tracks,METALLICITY_DIR) + call get_csafe_string(path_to_he_tracks,METALLICITY_DIR_HE) + Z_accuracy_limit = z_match_limit + verbose = METISSE_verbose + + end subroutine + + logical function check_path_change() result (load_tracks) + use track_support, only: strlen,METALLICITY_DIR, METALLICITY_DIR_HE + use z_support, only: get_csafe_string + + character(len=strlen) :: path_to_tracks, path_to_he_tracks + COMMON/ METISSEVARS/ path_to_tracks,path_to_he_tracks + + INTEGER :: using_cmc + COMMON /CMCPASS/ using_cmc + + character(len=strlen) :: string1,string2 + load_tracks = .false. + + ! remove the null charcater if any + call get_csafe_string(path_to_tracks,string1) + call get_csafe_string(path_to_he_tracks, string2) + + if((trim(path_to_tracks)/=trim(METALLICITY_DIR)) .or. & + (trim(path_to_he_tracks)/=trim(METALLICITY_DIR_HE))) load_tracks = .true. + end function + + diff --git a/src/cosmic/src/assign_commons_COSMIC.f90 b/src/cosmic/src/assign_commons_COSMIC.f90 deleted file mode 100644 index cb3c33093..000000000 --- a/src/cosmic/src/assign_commons_COSMIC.f90 +++ /dev/null @@ -1,48 +0,0 @@ - subroutine assign_commons() - use track_support - implicit none - - !to assign common variables when METISSE is used with COSMIC - - REAL(dp) :: ecsn,ecsn_mlow - COMMON /SNVARS1/ ecsn,ecsn_mlow - - real(dp) :: d - - if(front_end == COSMIC) then - ! use inputs from COSMIC - - if (Mec_core > 0.d0) ecsn = Mec_core - d = (Mec_core-Mup_core) - if (Mup_core > 0.d0 .and. d>tiny ) ecsn_mlow = Mup_core - - else - print*,'Error: Front end mismtach in assign commons' - print*,'expected 2 (COSMIC); got ', front_end - endif - - end subroutine - - subroutine get_bhspin(bhspin,id) - use track_support, only: tarr,dp - implicit none - integer, intent(in) :: id - real(dp), intent(out) :: bhspin - - bhspin = tarr(id)% pars% bhspin - end subroutine - - subroutine check_error(err) - use track_support, only: code_error - integer, intent(out) :: err - err = 0 - if(code_error) err = 1 - end subroutine - - - subroutine assign_error() - use track_support, only: code_error - code_error = .true. - end subroutine - - diff --git a/src/cosmic/src/benchmarkevolv2.f b/src/cosmic/src/benchmarkevolv2.f index e3c229dcd..1a8e46181 100644 --- a/src/cosmic/src/benchmarkevolv2.f +++ b/src/cosmic/src/benchmarkevolv2.f @@ -15,7 +15,6 @@ PROGRAM benchmarkevolv2 REAL*8 tphys REAL*8 kick_info_out(2,18) INTEGER bpp_index_out,bcm_index_out - CHARACTER*256 path_to_tracks,path_to_he_tracks using_METISSE = 0 using_SSE = 1 @@ -101,7 +100,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -185,7 +183,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -269,7 +266,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -353,7 +349,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -437,7 +432,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -521,7 +515,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -605,7 +598,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -689,7 +681,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -773,7 +764,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -857,7 +847,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -941,7 +930,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1025,7 +1013,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1109,7 +1096,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1193,7 +1179,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1277,7 +1262,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1361,7 +1345,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1445,7 +1428,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1529,7 +1511,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1613,7 +1594,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1697,7 +1677,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1781,7 +1760,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1865,7 +1843,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -1949,7 +1926,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2033,7 +2009,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2117,7 +2092,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2201,7 +2175,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2285,7 +2258,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2369,7 +2341,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2453,7 +2424,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2537,7 +2507,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2621,7 +2590,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2705,7 +2673,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2789,7 +2756,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2873,7 +2839,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -2957,7 +2922,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3041,7 +3005,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3125,7 +3088,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3209,7 +3171,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3293,7 +3254,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3377,7 +3337,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3461,7 +3420,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3545,7 +3503,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3629,7 +3586,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3713,7 +3669,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3797,7 +3752,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3881,7 +3835,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -3965,7 +3918,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4049,7 +4001,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4133,7 +4084,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4217,7 +4167,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4301,7 +4250,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4385,7 +4333,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4469,7 +4416,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4553,7 +4499,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4637,7 +4582,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4721,7 +4665,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4805,7 +4748,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4889,7 +4831,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -4973,7 +4914,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5057,7 +4997,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5141,7 +5080,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5225,7 +5163,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5309,7 +5246,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5393,7 +5329,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5477,7 +5412,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5561,7 +5495,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5645,7 +5578,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5729,7 +5661,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5813,7 +5744,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5897,7 +5827,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -5981,7 +5910,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6065,7 +5993,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6149,7 +6076,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6233,7 +6159,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6317,7 +6242,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6401,7 +6325,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6485,7 +6408,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6569,7 +6491,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6653,7 +6574,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6737,7 +6657,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6821,7 +6740,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6905,7 +6823,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -6989,7 +6906,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7073,7 +6989,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7157,7 +7072,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7241,7 +7155,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7325,7 +7238,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7409,7 +7321,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7493,7 +7404,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7577,7 +7487,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7661,7 +7570,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7745,7 +7653,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7829,7 +7736,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7913,7 +7819,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -7997,7 +7902,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8081,7 +7985,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8165,7 +8068,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8249,7 +8151,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8333,7 +8234,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8417,7 +8317,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8501,7 +8400,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8585,7 +8483,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8669,7 +8566,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8753,7 +8649,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8837,7 +8732,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -8921,7 +8815,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9005,7 +8898,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9089,7 +8981,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9173,7 +9064,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9257,7 +9147,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9341,7 +9230,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9425,7 +9313,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9509,7 +9396,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9593,7 +9479,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9677,7 +9562,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9761,7 +9645,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9845,7 +9728,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -9929,7 +9811,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10013,7 +9894,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10097,7 +9977,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10181,7 +10060,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10265,7 +10143,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10349,7 +10226,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10433,7 +10309,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10517,7 +10392,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10601,7 +10475,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10685,7 +10558,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10769,7 +10641,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10853,7 +10724,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -10937,7 +10807,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11021,7 +10890,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11105,7 +10973,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11189,7 +11056,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11273,7 +11139,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11357,7 +11222,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11441,7 +11305,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11525,7 +11388,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11609,7 +11471,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11693,7 +11554,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11777,7 +11637,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11861,7 +11720,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -11945,7 +11803,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12029,7 +11886,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12113,7 +11969,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12197,7 +12052,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12281,7 +12135,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12365,7 +12218,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12449,7 +12301,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12533,7 +12384,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12617,7 +12467,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12701,7 +12550,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12785,7 +12633,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12869,7 +12716,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -12953,7 +12799,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13037,7 +12882,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13121,7 +12965,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13205,7 +13048,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13289,7 +13131,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13373,7 +13214,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13457,7 +13297,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13541,7 +13380,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13625,7 +13463,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13709,7 +13546,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13793,7 +13629,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13877,7 +13712,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -13961,7 +13795,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14045,7 +13878,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14129,7 +13961,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14213,7 +14044,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14297,7 +14127,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14381,7 +14210,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14465,7 +14293,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14549,7 +14376,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14633,7 +14459,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14717,7 +14542,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14801,7 +14625,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14885,7 +14708,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -14969,7 +14791,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15053,7 +14874,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15137,7 +14957,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15221,7 +15040,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15305,7 +15123,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15389,7 +15206,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15473,7 +15289,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15557,7 +15372,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15641,7 +15455,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15725,7 +15538,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15809,7 +15621,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15893,7 +15704,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -15977,7 +15787,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16061,7 +15870,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16145,7 +15953,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16229,7 +16036,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16313,7 +16119,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16397,7 +16202,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16481,7 +16285,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16565,7 +16368,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16649,7 +16451,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16733,7 +16534,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16817,7 +16617,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16901,7 +16700,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -16985,7 +16783,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17069,7 +16866,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17153,7 +16949,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17237,7 +17032,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17321,7 +17115,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17405,7 +17198,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17489,7 +17281,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17573,7 +17364,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17657,7 +17447,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17741,7 +17530,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17825,7 +17613,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17909,7 +17696,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -17993,7 +17779,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18077,7 +17862,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18161,7 +17945,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18245,7 +18028,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18329,7 +18111,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18413,7 +18194,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18497,7 +18277,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18581,7 +18360,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18665,7 +18443,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18749,7 +18526,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18833,7 +18609,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -18917,7 +18692,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19001,7 +18775,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19085,7 +18858,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19169,7 +18941,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19253,7 +19024,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19337,7 +19107,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19421,7 +19190,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19505,7 +19273,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19589,7 +19356,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19673,7 +19439,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19757,7 +19522,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19841,7 +19605,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -19925,7 +19688,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -20009,7 +19771,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -20093,7 +19854,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -20177,7 +19937,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -20261,7 +20020,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -20345,7 +20103,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -20429,7 +20186,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) @@ -20513,7 +20269,6 @@ PROGRAM benchmarkevolv2 & dtptmp,mass0,rad,lumin,massc,radc, & menv,renv,ospin,B_0,bacc,tacc,epoch,tms, & bhspin,tphys,zpars,bkick,kick_info, - & path_to_tracks,path_to_he_tracks, & bpp_index_out,bcm_index_out,kick_info_out) END PROGRAM benchmarkevolv2 diff --git a/src/cosmic/src/comprad.f b/src/cosmic/src/comprad.f index d68b86e2b..55eb2c72d 100644 --- a/src/cosmic/src/comprad.f +++ b/src/cosmic/src/comprad.f @@ -1,6 +1,5 @@ *** - SUBROUTINE compute_r(mass,z,num,rad, - & path_to_tracks,path_to_he_tracks) + SUBROUTINE compute_r(mass,z,num,rad) IMPLICIT NONE INCLUDE 'const_bse.h' @@ -20,7 +19,6 @@ SUBROUTINE compute_r(mass,z,num,rad, integer k,kstar,num real*8 mt,tm,tn,mass0,age,lum,mc,rc,me,re,dtm REAL*8 tscls(20),lums(10),GB(10),zpars(20),k2,bhspin - CHARACTER*256 path_to_tracks,path_to_he_tracks *** * f2py directives go here; we'll return the radii as a 10^5 array @@ -32,7 +30,7 @@ SUBROUTINE compute_r(mass,z,num,rad, Cf2py intent(out) rad if(using_METISSE.eq.1) CALL initialize_front_end('cosmic') - CALL zcnsts(z,zpars,path_to_tracks,path_to_he_tracks) + CALL zcnsts(z,zpars) if(using_METISSE.eq.1) call allocate_track(num,mass) diff --git a/src/cosmic/src/const_bse.h b/src/cosmic/src/const_bse.h index 5bb5ca982..9ba224148 100644 --- a/src/cosmic/src/const_bse.h +++ b/src/cosmic/src/const_bse.h @@ -63,6 +63,12 @@ * INTEGER using_metisse, using_sse COMMON /SE_FLAGS/ using_metisse, using_sse + CHARACTER*256 path_to_tracks,path_to_he_tracks + real*8 z_match_limit + LOGICAL METISSE_verbose + COMMON/ METISSEVARS/ path_to_tracks,path_to_he_tracks, + & z_match_limit, METISSE_verbose LOGICAL bcm_err COMMON/ ER_FLAGS/ bcm_err + * diff --git a/src/cosmic/src/evolv2.f b/src/cosmic/src/evolv2.f index 2f685cb60..4de09f462 100644 --- a/src/cosmic/src/evolv2.f +++ b/src/cosmic/src/evolv2.f @@ -3,7 +3,6 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, \ dtp,mass0,rad,lumin,massc,radc, \ menv,renv,ospin,B_0,bacc,tacc,epoch,tms, \ bhspin,tphys,zpars,bkick,kick_info, - \ path_to_tracks,path_to_he_tracks, \ bpp_index_out,bcm_index_out,kick_info_out) IMPLICIT NONE INCLUDE 'const_bse.h' @@ -198,7 +197,6 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, COMMON /fall/fallback REAL ran3 EXTERNAL ran3 - CHARACTER*256 path_to_tracks,path_to_he_tracks * * @@ -245,8 +243,6 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, Cf2py intent(in) zpars Cf2py intent(in) bkick Cf2py intent(in) kick_info -Cf2py intent(in) path_to_tracks -Cf2py intent(in) path_to_he_tracks Cf2py intent(out) bpp_index_out Cf2py intent(out) bcm_index_out Cf2py intent(out) kick_info_out @@ -255,7 +251,6 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, CALL instar endif - if(using_METISSE.eq.1) CALL initialize_front_end('cosmic') * * Save the initial state. * @@ -341,8 +336,9 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, * err = 0 if(using_cmc.eq.0)then + if(using_METISSE.eq.1) CALL initialize_front_end('cosmic') * for SSE path_to_tracks and path_to_he_tracks are empty ('') - CALL zcnsts(z,zpars,path_to_tracks,path_to_he_tracks) + CALL zcnsts(z,zpars) if(using_METISSE.eq.1) then call check_error(err) if (err>0) then diff --git a/src/cosmic/src/zcnsts.f b/src/cosmic/src/zcnsts.f index bccb8bb95..083a03c30 100644 --- a/src/cosmic/src/zcnsts.f +++ b/src/cosmic/src/zcnsts.f @@ -1,15 +1,13 @@ - SUBROUTINE zcnsts(z,zpars,path_to_tracks,path_to_he_tracks) + SUBROUTINE zcnsts(z,zpars) IMPLICIT NONE INCLUDE 'const_bse.h' real*8 z,zpars(20) - CHARACTER*256 path_to_tracks,path_to_he_tracks integer :: ierr if (using_METISSE.eq.1) then !WRITE(*,*) 'Calling METISSE_zcnsts',using_METISSE - CALL METISSE_zcnsts(z,zpars,path_to_tracks, - & path_to_he_tracks,ierr) + CALL METISSE_zcnsts(z,zpars,ierr) if (ierr/=0) call assign_error() elseif (using_SSE.eq.1) then From 52da991e204705f2872201e512b7e6f0bae35a28 Mon Sep 17 00:00:00 2001 From: Poojan <34255053+poojanagrawal@users.noreply.github.com> Date: Mon, 24 Feb 2025 21:03:44 +0100 Subject: [PATCH 26/46] Metisse variables (#693) * added all four metisse variables in python files * added all four metisse variables in associated fortran files --- src/cosmic/evolve.py | 4 ++++ src/cosmic/sample/sampler/independent.py | 12 ++++++++---- src/cosmic/src/METISSE_utils.f90 | 3 --- src/cosmic/src/benchmarkevolv2.f | 4 +++- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/cosmic/evolve.py b/src/cosmic/evolve.py index 2da5f51d8..42a83a597 100644 --- a/src/cosmic/evolve.py +++ b/src/cosmic/evolve.py @@ -584,11 +584,15 @@ def _evolve_single_system(f): _evolvebin.se_flags.using_metisse = 0 _evolvebin.metissevars.path_to_tracks = "" _evolvebin.metissevars.path_to_he_tracks = "" + _evolvebin.metissevars.z_match_limit = 1e-2 + _evolvebin.metissevars.METISSE_verbose = False elif f["stellar_engine"] == "metisse": _evolvebin.se_flags.using_metisse = 1 _evolvebin.se_flags.using_sse = 0 _evolvebin.metissevars.path_to_tracks = f["path_to_tracks"] _evolvebin.metissevars.path_to_he_tracks = f["path_to_he_tracks"] + _evolvebin.metissevars.z_match_limit = 1e-2 + _evolvebin.metissevars.METISSE_verbose = False else: raise ValueError("Use either 'sse' or 'metisse' as stellar engine") diff --git a/src/cosmic/sample/sampler/independent.py b/src/cosmic/sample/sampler/independent.py index bf44624b1..f11503a1c 100644 --- a/src/cosmic/sample/sampler/independent.py +++ b/src/cosmic/sample/sampler/independent.py @@ -1174,13 +1174,17 @@ def set_reff(self ,mass, metallicity, zsun=0.02, SSEDict=None): if (SSEDict == None) or (SSEDict["stellar_engine"] == "sse"): _evolvebin.se_flags.using_sse = True _evolvebin.se_flags.using_metisse = False - path_to_tracks = "" - path_to_he_tracks = "" + _evolvebin.metissevars.path_to_tracks = "" + _evolvebin.metissevars.path_to_he_tracks = "" + _evolvebin.metissevars.z_match_limit = 1e-2 + _evolvebin.metissevars.METISSE_verbose = False elif SSEDict["stellar_engine"] == "metisse": _evolvebin.se_flags.using_metisse = True _evolvebin.se_flags.using_sse = False - path_to_tracks = SSEDict["path_to_tracks"] - path_to_he_tracks = SSEDict["path_to_he_tracks"] + _evolvebin.metissevars.path_to_tracks = SSEDict["path_to_tracks"] + _evolvebin.metissevars.path_to_he_tracks = SSEDict["path_to_he_tracks"] + _evolvebin.metissevars.z_match_limit = 1e-2 + _evolvebin.metissevars.METISSE_verbose = False else: raise ValueError("Use either 'sse' or 'metisse' as stellar engine") diff --git a/src/cosmic/src/METISSE_utils.f90 b/src/cosmic/src/METISSE_utils.f90 index 7574220b5..527198fa4 100644 --- a/src/cosmic/src/METISSE_utils.f90 +++ b/src/cosmic/src/METISSE_utils.f90 @@ -64,9 +64,6 @@ subroutine get_COSMIC_input() COMMON/ METISSEVARS/ path_to_tracks,path_to_he_tracks,& z_match_limit, METISSE_verbose - z_match_limit = 1d-2 - METISSE_verbose = .false. - ! remove the null charcater if any call get_csafe_string(path_to_tracks,METALLICITY_DIR) call get_csafe_string(path_to_he_tracks,METALLICITY_DIR_HE) diff --git a/src/cosmic/src/benchmarkevolv2.f b/src/cosmic/src/benchmarkevolv2.f index 1a8e46181..8e127ffba 100644 --- a/src/cosmic/src/benchmarkevolv2.f +++ b/src/cosmic/src/benchmarkevolv2.f @@ -19,7 +19,9 @@ PROGRAM benchmarkevolv2 using_METISSE = 0 using_SSE = 1 path_to_tracks = '' - path_to_he_tracks = '' + path_to_he_tracks = '' + z_match_limit = 1d-2 + METISSE_verbose = .false. kstar(1) = 0.0; kstar(2) = 0.0 mass(1) = 0.5 mass(2) = 0.5 From 4f8684a2245f42b7fbcba3d18bdc0e2834377a44 Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Mon, 31 Mar 2025 08:41:34 -0400 Subject: [PATCH 27/46] Update python-package.yml upgrade versions --- .github/workflows/python-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index c37898add..b1a62e167 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -15,7 +15,7 @@ jobs: python-version: ['3.9', '3.10'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: true - name: Set up Python ${{ matrix.python-version }} @@ -23,7 +23,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Cache pip - uses: actions/cache@v2 + uses: actions/cache@v4 with: # This path is specific to Ubuntu path: ~/.cache/pip From 4c49804d60b5d00b001fcc0a8ce6111dcfeac273 Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Mon, 31 Mar 2025 08:42:12 -0400 Subject: [PATCH 28/46] Update build_wheels_and_publish.yml upgrade actions version --- .github/workflows/build_wheels_and_publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_and_publish.yml b/.github/workflows/build_wheels_and_publish.yml index 4efe21baf..67b58302b 100644 --- a/.github/workflows/build_wheels_and_publish.yml +++ b/.github/workflows/build_wheels_and_publish.yml @@ -25,7 +25,7 @@ jobs: python-version: [3.9, "3.10"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: actions/setup-python@v4 From 01bd53a074a6e719c92af7962a18e3cae84a9ebf Mon Sep 17 00:00:00 2001 From: Duncan B Maclean <146674933+d-maclean@users.noreply.github.com> Date: Tue, 1 Apr 2025 09:46:50 -0400 Subject: [PATCH 29/46] Allow Independent sampler to return low/high-metallicity binary table for METISSE (#695) * updated METISSE * added 'SSEDict' to cosmic-pop binary * updated METISSE * allowed indepdent sampler to return metallicity outside of SSE range (for METISSE) * :Revert "allowed indepdent sampler to return metallicity outside of SSE range (for METISSE)" This reverts commit 62c102b4cbf8055b4fa57cccdbdf0619eeb9917d. * added logic for independent sampler to return binaries with Z outside of SSE space (without debug messages this time) * added a warning when the user passes an invalid metallicity value for SSE * fixed sampler crashing if SSEDict is not passed --------- Co-authored-by: duncan_m --- src/cosmic/sample/sampler/independent.py | 23 +++++++++++++++++++---- src/cosmic/src/METISSE | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/cosmic/sample/sampler/independent.py b/src/cosmic/sample/sampler/independent.py index f11503a1c..35a26bbc7 100644 --- a/src/cosmic/sample/sampler/independent.py +++ b/src/cosmic/sample/sampler/independent.py @@ -22,6 +22,7 @@ import numpy as np import warnings import pandas as pd +import warnings from cosmic import utils @@ -171,7 +172,15 @@ def get_independent_sampler( n_binaries : `int` Number of binaries needed to generate a population """ + if SSEDict is not None: + stellar_engine = SSEDict.get("stellar_engine", "sse") + else: + stellar_engine = "sse" + if stellar_engine == "sse" and\ + (met < 1e-4 or met > 3e-2): + warnings.warn("You supplied a metallicity outside of SSE's parameter space [1e-4 <= Z <= 3e-2].\ + Z will be truncated to this limit.") if sampling_target == "total_mass" and (total_mass is None or total_mass == np.inf): raise ValueError("If `sampling_target == 'total mass'` then `total_mass` must be supplied") @@ -316,8 +325,11 @@ def get_independent_sampler( tphysf, metallicity = initconditions.sample_SFH( SF_start=SF_start, SF_duration=SF_duration, met=met, size=mass1_binary.size ) - metallicity[metallicity < 1e-4] = 1e-4 - metallicity[metallicity > 0.03] = 0.03 + + if stellar_engine == "sse": + metallicity[metallicity < 1e-4] = 1e-4 + metallicity[metallicity > 0.03] = 0.03 + kstar1 = initconditions.set_kstar(mass1_binary) kstar2 = initconditions.set_kstar(mass2_binary) @@ -336,8 +348,11 @@ def get_independent_sampler( tphysf_singles, metallicity_singles = initconditions.sample_SFH( SF_start=SF_start, SF_duration=SF_duration, met=met, size=mass1_singles.size ) - metallicity_singles[metallicity_singles < 1e-4] = 1e-4 - metallicity_singles[metallicity_singles > 0.03] = 0.03 + + if stellar_engine == "sse": + metallicity_singles[metallicity_singles < 1e-4] = 1e-4 + metallicity_singles[metallicity_singles > 0.03] = 0.03 + kstar1_singles = initconditions.set_kstar(mass1_singles) singles_table = InitialBinaryTable.InitialBinaries( mass1_singles, # mass1 diff --git a/src/cosmic/src/METISSE b/src/cosmic/src/METISSE index 430043cea..ede9767e3 160000 --- a/src/cosmic/src/METISSE +++ b/src/cosmic/src/METISSE @@ -1 +1 @@ -Subproject commit 430043ceaffd2ae692dfe8eaf07af4cc2b30c95f +Subproject commit ede9767e33696f9b8b00806fcb97a7e12b392be3 From c616ffe64fd49cf44e8dfca293a8e3c9339cc644 Mon Sep 17 00:00:00 2001 From: Duncan B Maclean <146674933+d-maclean@users.noreply.github.com> Date: Wed, 7 May 2025 12:40:49 -0400 Subject: [PATCH 30/46] Metisse integrate branch - fix default inifile and independent sampler from cosmic-pop (#699) * updated METISSE * added 'SSEDict' to cosmic-pop binary * updated METISSE * allowed indepdent sampler to return metallicity outside of SSE range (for METISSE) * :Revert "allowed indepdent sampler to return metallicity outside of SSE range (for METISSE)" This reverts commit 62c102b4cbf8055b4fa57cccdbdf0619eeb9917d. * added logic for independent sampler to return binaries with Z outside of SSE space (without debug messages this time) * added a warning when the user passes an invalid metallicity value for SSE * fixed sampler crashing if SSEDict is not passed * updated exmaple/Params.ini: changed dtype of 'acc_lim' and 'alpha1' to reflect code changes * documented Params.ini changes * added SSEDict to cosmic-pop's independent sampler calls --------- Co-authored-by: duncan_m --- bin/cosmic-pop | 9 ++++++--- examples/Params.ini | 8 ++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/bin/cosmic-pop b/bin/cosmic-pop index 8bda880ed..ee93b8d68 100755 --- a/bin/cosmic-pop +++ b/bin/cosmic-pop @@ -172,8 +172,9 @@ if __name__ == '__main__': pool = schwimmbad.choose_pool(mpi=args.mpi, processes=args.nproc) if isinstance(pool, MPIPool): if not pool.is_master(): + from sys import exit pool.wait() - sys.exit(0) + exit(0) nproc = len(pool.workers) else: nproc = args.nproc @@ -318,7 +319,8 @@ if __name__ == '__main__': met = sampling['metallicity'], size = args.Nstep, qmin = args.qmin, - params = args.inifile) + params = args.inifile, + SSEDict = SSEDict) elif hasattr(args,'m2_min'): init_samp_list = InitialBinaryTable.sampler(format_ = sampling['sampling_method'], final_kstar1 = kstar1_range, @@ -333,7 +335,8 @@ if __name__ == '__main__': met = sampling['metallicity'], size = args.Nstep, m2_min = args.m2_min, - params = args.inifile) + params = args.inifile, + SSEDict = SSEDict) else: raise ValueError("You must specify either qmin or m2_min in the", " inifile if you are using the independent sampler") diff --git a/examples/Params.ini b/examples/Params.ini index 4d73f38ba..e52afce18 100644 --- a/examples/Params.ini +++ b/examples/Params.ini @@ -225,8 +225,8 @@ acc2 = 1.5 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; alpha1 is the common-envelope efficiency parameter -; default = 1.0 -alpha1 = 1.0 +; default = [1.0, 1.0], for components 1 and 2, respectively +alpha1 = [1.0, 1.0] ; lambdaf is the binding energy factor for common envelope evolution ; lambdaf>=0.0 uses variable lambda prescription written by Onno Pols, @@ -457,8 +457,8 @@ don_lim = -1 ; acc_lim = -2: assumes the accretion is limited to tkh_acc for MS/CHeB ; acc_lim = -3: assumes the accretion is limited by 10*tkh_acc for all fusing stars ; acc_lim = -4: assumes the accretion is limited by tkh_for all fusing stars -; default = -1 -acc_lim = -1 +; default = [-1, -1], for components 1 and 2, respectively +acc_lim = [-1, -1] From 3470be32444098de03748567c476cecbfb722e09 Mon Sep 17 00:00:00 2001 From: Duncan B Maclean <146674933+d-maclean@users.noreply.github.com> Date: Tue, 8 Jul 2025 16:51:45 -0400 Subject: [PATCH 31/46] Backport Disberg & Mandel 2025 Kick Prescription to METISSE-integrate (#709) * updated METISSE * added 'SSEDict' to cosmic-pop binary * updated METISSE * allowed indepdent sampler to return metallicity outside of SSE range (for METISSE) * :Revert "allowed indepdent sampler to return metallicity outside of SSE range (for METISSE)" This reverts commit 62c102b4cbf8055b4fa57cccdbdf0619eeb9917d. * added logic for independent sampler to return binaries with Z outside of SSE space (without debug messages this time) * added a warning when the user passes an invalid metallicity value for SSE * fixed sampler crashing if SSEDict is not passed * updated exmaple/Params.ini: changed dtype of 'acc_lim' and 'alpha1' to reflect code changes * documented Params.ini changes * added SSEDict to cosmic-pop's independent sampler calls * Implement Disberg & Mandel 2025 model for natal kicks (#704) * add lognormal function * add kickflag option for disberg * only use disberg when it's not an ecsn/ussn * update version/changelog * add docs about new option * apply bhsigmafrac to mean of disberg lognormal * allow larger kickflag values * add two tests that check that Hobbs and Disberg kick routines * improve tests to just evolve a single star, and don't duplicate del's (cherry picked from commit d4dd9b59b50a9dacc18eaf701a1d366c278ed01e) * bump version to 3.5.1 * changed BSEDict['acc_lim'] to list to satisfy COSMIC-METISSE * added SSEDict to appease COSMIC-METISSE * added documentation disavowing kickflag=-5 --------- Co-authored-by: duncan_m Co-authored-by: Tom Wagg --- changelog.md | 2 + docs/cosmic-settings.json | 1599 +++++++++++++++++++++++++++++++++ examples/Params.ini | 3 + pyproject.toml | 2 +- src/cosmic/_version.py | 2 +- src/cosmic/src/kick.f | 68 +- src/cosmic/tests/test_kick.py | 93 ++ src/cosmic/utils.py | 4 +- 8 files changed, 1752 insertions(+), 21 deletions(-) create mode 100644 docs/cosmic-settings.json create mode 100644 src/cosmic/tests/test_kick.py diff --git a/changelog.md b/changelog.md index 7251169de..5171f0fa5 100644 --- a/changelog.md +++ b/changelog.md @@ -47,3 +47,5 @@ See the discussed changes in our previous releases here: https://github.com/COSM ## 3.5.0 - Feature: Added `bpp_columns` and `bcm_columns` parameters to the `evolve()` function to allow users to specify the columns in the bpp and bcm tables - Bug fix: Changed `kick.f` to use the Pfahl+02 kick prescription by default instead of Kiel & Hurley 2009, this fixes ejection velocities of secondaries and also changed kick_info to have an extra column +## 3.5.1 + - Feature: Added Disberg+2025 kick prescription as a new choice of `kickflag` (`kickflag=5`). Applies log-normal distribution to regular CCSN, ECSN/USSN still use `sigmadiv` Maxwellian and BH fallback scaling is still applied via `bhflag` and `bhsigmafrac` as with `kickflag=1` diff --git a/docs/cosmic-settings.json b/docs/cosmic-settings.json new file mode 100644 index 000000000..bcbbdcb1c --- /dev/null +++ b/docs/cosmic-settings.json @@ -0,0 +1,1599 @@ +[ + { + "category": "filters", + "category_label": "Filters", + "category_description": "Settings that filter the data returned by COSMIC simulations", + "docs-colour": "cadetblue", + "settings": [ + { + "name": "binary_state", + "description": "Filter for the final state of the binaries you wish to retain", + "type": "checkbox", + "options-preface": "Each binary system will end its evolution in one of three states. Use these options to retain only certain endstates.", + "options": [ + { + "name": 0, + "description": "Retain only binaries still alive today", + "default": true + }, + { + "name": 1, + "description": "Retains binaries that merged", + "default": true + }, + { + "name": 2, + "description": "Retains binaries that were disrupted" + } + ] + }, + { + "name": "timestep_conditions", + "description": "Pick specific time resolutions to print at targeted stages of the binary evolution.", + "type": "string", + "options-preface": "This is used in conjunction with the [bse] section value dtp to determine the timestep resolution for printing to the bcm array. See the related guide for more information.", + "options": [ + { + "name": "'dtp=None'", + "description": "Only the final time step is printed to the bcm array", + "default": true + }, + { + "name": "'dtp=1.0'", + "description": "Use 1 Myr timesteps for all evolutionary stages" + }, + { + "name": "[['binstate==0', 'dtp=1.0']]", + "description": "Use 1 Myr timesteps for binaries until they merge or disrupt" + } + ] + } + ] + }, + { + "category": "sampling", + "category_label": "Sampling", + "category_description": "Settings that change how the initial binary population is sampled", + "docs-colour": "darkseagreen", + "settings": [ + { + "name": "sampling_method", + "description": "Select which models to use to generate an initial sample of binary parameters at Zero Age Main Sequence", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": "independent", + "description": "Initialize binaries with independent parameter distributions for the primary mass, mass ratio, eccentricity, separation, and binary fraction", + "default": true + }, + { + "name": "multidim", + "description": "Initialize binaries with multidimensional parameter distributions according to Moe & Di Stefano 2017" + } + ] + }, + { + "name": "primary_model", + "description": "Model for sampling primary masses
[Only used when sampling_method = independent]", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": "salpeter55", + "description": "Use the Salpeter 1955 IMF" + }, + { + "name": "kroupa93", + "description": "Use the Kroupa 1993 IMF" + }, + { + "name": "kroupa01", + "description": "Use the Kroupa 2001 IMF", + "default": true + } + ] + }, + { + "name": "porb_model", + "description": "Model for sampling orbital periods
[Only used when sampling_method = independent]", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": "sana12", + "description": "Sample from power law orbital period between 0.15 < log(P/day) < 5.5 following Sana+2012", + "default": true + }, + { + "name": "log_uniform", + "description": "Sample semi-major axis flat in log space from RRLO < 0.5 up to \\(10^{5} {\\rm R_{\\odot}}\\) according to Abt (1983) and consistent with Dominik+2012,2013 - then convert to orbital period in days using Kepler's third law." + }, + { + "name": "renzo19", + "description": "Uses sana12 for massive binaries (\\(m_1 > 15 {\\rm M_{\\odot}}\\)) and flat in log otherwise (following Renzo+19)." + }, + { + "name": "raghavan10", + "description": "Sample log normal orbital periods in days with mean_logP = 4.9 and sigma_logP = 2.3 between \\(0 < \\log_{10}(P / {\\rm day}) < 9\\) following Raghavan+2010 " + }, + { + "name": "moe19", + "description": "As raghavan10 but with different close binary fractions following Moe+2019" + }, + { + "name": "custom", + "description": "Sample from a custom power law. The user provides a dictionary of min, max and slope values for the power law." + } + ] + }, + { + "name": "ecc_model", + "description": "Model for sampling eccentricity
[Only used when sampling_method = independent]", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": "thermal", + "description": "Samples from a thermal eccentricity distribution following Heggie (1975)" + }, + { + "name": "uniform", + "description": "Samples from a uniform eccentricity distribution" + }, + { + "name": "sana12", + "description": "Samples from the eccentricity distribution from Sana+2012", + "default": true + }, + { + "name": "circular", + "description": "Assumes zero eccentricity for all systems" + } + ] + }, + { + "name": "qmin", + "description": "Minimum mass ratio for sampling the secondary mass
[Only used when sampling_method = independent]", + "type": "number", + "options-preface": "The assumed mass ratio distribution is flat in \\(q \\equiv m_2 / m_1\\). NOTE: only one of qmin and m2_min should be specified.", + "options": [ + { + "name": "values in [0, 1]", + "description": "Sets the minimum mass ratio" + }, + { + "name": -1, + "description": "Set the minimum mass ratio such that the pre-MS lifetime of the secondary is not longer than the full lifetime of the primary if it were to evolve as a single star", + "default": true + } + ] + }, + { + "name": "m2_min", + "description": "Minimum secondary mass for sampling
[Only used when sampling_method = independent]", + "type": "number", + "options-preface": "NOTE: only one of qmin and m2_min should be specified.", + "options": [ + { + "name": "positive values", + "description": "Sample the secondary mass uniformly between m2_min and mass_1" + }, + { + "name": 0.1, + "description": "Default value", + "default": true + } + ] + }, + { + "name": "binfrac_model", + "description": "Model for sampling binary fraction
[Only used when sampling_method = independent]", + "type": "string", + "options-preface": "", + "options": [ + { + "name": "values between [0, 1]", + "description": "Fixed binary fraction" + }, + { + "name": "vanHaaften", + "description": "Primary mass dependent binary fraction following van Haaften+05" + }, + { + "name": "offner22", + "description": "Primary mass dependent binary fraction following Offner+22" + }, + { + "name": 0.5, + "description": "Default value", + "default": true + } + ] + }, + { + "name": "SF_start", + "description": "Sets the time in the past when star formation initiates in Myr.", + "type": "number", + "options-preface": "", + "options": [ + { + "name": "positive values", + "description": "Start time of star formation in Myr" + }, + { + "name": 13700.0, + "description": "For example, this specifies a start time at the beginning of a Hubble time", + "default": true + } + ] + }, + { + "name": "SF_duration", + "description": "Sets the duration of constant star formation from ``SF_start`` in Myr.", + "type": "number", + "options-preface": "", + "options": [ + { + "name": "positive values", + "description": "Duration of star formation in Myr" + }, + { + "name": 0.0, + "description": "A single burst of star formation", + "default": true + }, + { + "name": 13700.0, + "description": "For example, this specifies a constant star formation rate over a Hubble time" + } + ] + + }, + { + "name": "metallicity", + "description": "Sets the metallicity of the stellar population.", + "type": "number", + "options-preface": "COSMIC expects an absolute metallicity (i.e., NOT units of zsun)", + "options": [ + { + "name": "positive values", + "description": "Absolute metallicity" + }, + { + "name": 0.02, + "description": "For example, this sets the metallicity to approximately solar metallicity", + "default": true + } + ] + } + ] + }, + { + "category": "convergence", + "category_label": "Convergence", + "category_description": "Settings that control the convergence of the simulation run with cosmic-pop", + "docs-colour": "#a873dd", + "settings": [ + { + "name": "convergence_params", + "description": "A list of parameters you would like to verify have converged to a single distribution shape when running cosmic-pop from the command line.", + "type": "checkbox", + "options-preface": "", + "options": [ + { + "name": "mass_1", + "description": "Primary mass", + "default": true + }, + { + "name": "mass_2", + "description": "Secondary mass", + "default": true + }, + { + "name": "sep", + "description": "Separation" + }, + { + "name": "porb", + "description": "Orbital period", + "default": true + }, + { + "name": "ecc", + "description": "Eccentricity", + "default": true + }, + { + "name": "massc_1", + "description": "Primary core mass" + }, + { + "name": "massc_2", + "description": "Secondary core mass" + }, + { + "name": "rad_1", + "description": "Primary radius" + }, + { + "name": "rad_2", + "description": "Secondary radius" + } + ] + }, + { + "name": "convergence_limits", + "description": "Specifies limits for parameters included in the convergence_params list.", + "type": "string", + "options-preface": "For each parameter specified convergence_limits, the lower and upper limit must be included.", + "options": [ + { + "name": "{}", + "description": "No limits specified", + "default": true + }, + { + "name": "{'mass_1' : [5, 10], 'sep' : [0, 10]}", + "description": "For example, this specifies that the primary mass must be between 5 and 10 solar masses, and the separation must be between 0 and 10 Rsun." + } + ] + }, + { + "name": "pop_select", + "description": "Selects the stage of the evolution at which you would like to check for convergence.", + "type": "dropdown", + "options-preface": "This will filter for systems that satisfy the final_kstar1 and final_kstar2 selections from the command line call of cosmic-pop at the following states:", + "options": [ + { + "name": "formation", + "description": "At binary formation", + "default": true + }, + { + "name": "1_SN", + "description": "Just before the first supernova" + }, + { + "name": "2_SN", + "description": "Just before the second supernova" + }, + { + "name": "disruption", + "description": "Just before binary disruption" + }, + { + "name": "final_state", + "description": "After the full evolution specified by the user-supplied evolution time" + }, + { + "name": "XRB_form", + "description": "At the start of RLOF following the first supernova" + } + ] + }, + { + "name": "apply_convergence_limits", + "description": "Whether to filter the binary population (including the bcm, bpp, initC, and kick_info DataFrames) to only contain the binaries that satisfy the constraints from convergence_limits.", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": "True", + "description": "Filter the binary population to only contain the binaries that satisfy the constraints from convergence_limits" + }, + { + "name": "False", + "description": "Do not filter the binary population", + "default": true + } + ] + }, + { + "name": "match", + "description": "Provides the tolerance for the convergence calculation and is calculated as \\({\\rm match} = \\log_{\\rm 10} (1 - {\\rm convergence})\\)", + "type": "number", + "options-preface": "", + "options": [ + { + "name": -5.0, + "description": "For example, this specifies a tolerance of \\(10^{-5}\\) for convergence", + "default": true + } + ] + } + ] + }, + { + "category": "rand_seed", + "category_label": "Random Seed", + "category_description": "Settings that control the random number generation used", + "docs-colour": "#f0ba80", + "settings": [ + { + "name": "seed", + "description": "Sets the seed for the random number generator (for numpy.random.seed())", + "type": "number", + "options-preface": "", + "options": [ + { + "name": "integer values", + "description": "Random seed" + }, + { + "name": 42, + "description": "For example, this sets the seed to 42", + "default": true + } + ] + } + ] + }, + { + "category": "bse", + "category_label": "Binary physics", + "category_description": "Settings that control the binary physics in the simulation", + "docs-colour": "lightcoral", + "settings": [ + { + "name": "pts1", + "description": "Sets the timestep modifier for main sequence stars (dtp *= pts1)", + "type": "number", + "settings-section": "Timesteps", + "options-preface": "", + "options": [ + { + "name": "positive values", + "description": "Timestep modifier" + }, + { + "name": 0.001, + "description": "Recommended value from Bannerjee+2019 for NS/BH progenitors", + "default": true + }, + { + "name": 0.05, + "description": "Recommended value from Hurley+2000" + } + ] + }, + { + "name": "pts2", + "description": "Sets the timestep modifier for Giant Branch (GB, CHeB, AGB, HeGB) stars (dtp *= pts2)", + "type": "number", + "options-preface": "", + "options": [ + { + "name": "positive values", + "description": "Timestep modifier" + }, + { + "name": 0.01, + "description": "Recommended value from Hurley+2000", + "default": true + } + ] + }, + { + "name": "pts3", + "description": "Sets the timestep modifier for HG, HeMS stars (dtp *= pts3)", + "type": "number", + "options-preface": "", + "options": [ + { + "name": "positive values", + "description": "Timestep modifier" + }, + { + "name": 0.02, + "description": "Recommended value from Hurley+2000", + "default": true + } + ] + }, + { + "name": "zsun", + "description": "Sets the metallicity of the Sun which primarily affects stellar winds.", + "type": "number", + "settings-section": "Metallicity", + "options-preface": "Note that the wind prescriptions for OB stars are calibrated to zsun = 0.019 as described in Vink+2001.", + "options": [ + { + "name": "positive values", + "description": "Set the solar metallicity" + }, + { + "name": 0.014, + "description": "Following Asplund+2009", + "default": true + } + ] + }, + { + "name": "windflag", + "description": "Selects the model for wind mass loss for each star", + "type": "dropdown", + "settings-section": "Stellar Winds", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "Standard SSE/BSE (Hurley+2000)" + }, + { + "name": 1, + "description": "StarTrack (Belczynski+2008)" + }, + { + "name": 2, + "description": "Metallicity dependence for O/B stars and Wolf Rayet stars (Vink+2001, Vink+2005)" + }, + { + "name": 3, + "description": "Same as 2, but LBV-like mass loss for giants and non-degenerate stars beyond the Humphreys-Davidson limit", + "default": true + } + ] + }, + { + "name": "eddlimflag", + "description": "Adjusts the dependence of mass loss on metallicity for stars near the Eddington limit (see Grafener+2011, Giacobbo+2018).", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "does not adjust metallicity dependence for stars near the Eddington limit", + "default": true + }, + { + "name": 1, + "description": "adjusts metallicity dependence for stars near the Eddington limit as in Giacobbo+2018." + } + ] + }, + { + "name": "neta", + "description": "Reimers mass-loss coefficient (Equation 106 of SSE).", + "type": "number", + "options-preface": "Note: this equation has a typo. There is an extra \\(\\eta\\) out front; the correct rate is directly proportional to \\(\\eta\\). See also Kurdritzki+1978, Section Vb for discussion.", + "options": [ + { + "name": "positive values", + "description": "Set \\(\\eta\\) value" + }, + { + "name": 0.5, + "description": "Sets \\(\\eta\\) for Reimers mass loss to 0.5", + "default": true + } + ] + }, + { + "name": "bwind", + "description": "Binary enhanced mass loss parameter", + "type": "number", + "options-preface": "This parameter is used to enhance mass loss in binaries. See Hurley+2000, Eq. 12 for more information.", + "options": [ + { + "name": "positive values", + "description": "Sets the binary enhanced mass loss parameter, \\(B_w\\), from Hurley+2000, Eq. 12" + }, + { + "name": 0.0, + "description": "Default value (no effect on single stars)", + "default": true + } + ] + }, + { + "name": "hewind", + "description": "Helium star mass loss parameter", + "type": "number", + "options-preface": "\\( 10^{-13} {\\rm \\ \\texttt{hewind} \\ } L^{2/3}\\) gives He star mass-loss. Equivalent to \\(1 - \\mu\\) in the last equation on Hurley+2000, page 19.", + "options": [ + { + "name": "positive values", + "description": "Sets the helium star mass loss parameter" + }, + { + "name": 0.5, + "description": "Default value", + "default": true + } + ] + }, + { + "name": "beta", + "description": "Wind velocity factor. \\( v_{\\rm wind}^2 \\propto \\beta\\), see Hurley+2002, Eq. 9.", + "type": "number", + "options-preface": "", + "options": [ + { + "name": -1, + "description": "Follow StarTrack prescription for wind velocity factor, \\(\\beta_w\\), from Belczynski+2008" + }, + { + "name": "positive values", + "description": "Sets the wind velocity factor, \\(\\beta_w\\)" + }, + { + "name": 0.125, + "description": "Default value", + "default": true + } + ] + }, + { + "name": "xi", + "description": "Wind accretion efficiency factor, which gives the fraction of angular momentum lost via winds from the primary that transfers to the spin angular momentum of the companion.", + "type": "number", + "options-preface": "Corresponds to \\(\\mu_w\\) in Hurley+2002, Eq. 11", + "options": [ + { + "name": "positive values", + "description": "Sets the wind accretion efficiency factor" + }, + { + "name": 0.5, + "description": "Default value", + "default": true + } + ] + }, + { + "name": "acc2", + "description": "Bondi-Hoyle wind accretion factor where the mean wind accretion rate onto the secondary is proportional to acc2. See Hurley+2002, Eq. 6.", + "type": "number", + "options-preface": "This value is equivalent to \\(\\alpha_w\\) in Hurley+2002, Eq. 6.", + "options": [ + { + "name": "positive values", + "description": "Sets the Bondi-Hoyle wind accretion factor, \\(\\alpha_w\\)" + }, + { + "name": 1.5, + "description": "Default value", + "default": true + } + ] + }, + { + "settings-section": "Common-envelope", + "settings-section-description": "Note: there are cases where a common envelope is forced regardless of the critical mass ratio for unstable mass transfer. In the following cases, a common envelope occurs regardless of the choices below:
  • contact: the stellar radii go into contact (common for similar ZAMS systems)
  • periapse contact: the periapse distance is smaller than either of the stellar radii (common for highly eccentric systems)
  • core Roche overflow: either of the stellar radii overflow their component's Roche radius (in this case, mass transfer from the convective core is always dynamically unstable)
", + "name": "alpha1", + "description": "Common-envelope efficiency parameter which scales the efficiency of transferring orbital energy to the envelope. See Hurley+2002, Eq. 71.", + "type": "number", + "options-preface": "This value is equivalent to \\(\\alpha\\) in Hurley+2002, Eq. 71.", + "options": [ + { + "name": "positive values", + "description": "Sets the common-envelope efficiency parameter, \\(\\alpha\\)" + }, + { + "name": 1.0, + "description": "Default value", + "default": true + } + ] + }, + { + "name": "lambdaf", + "description": "Binding energy factor for common envelope evolution. The initial binding energy of the stellar envelope is proportional to \\(1 / \\lambda\\). See Hurley+2002, Eq. 69.", + "type": "number", + "options-preface": "", + "options": [ + { + "name": "positive values", + "description": "uses variable lambda prescription detailed in appendix of Claeys+2014 where lambdaf is the fraction of the ionization energy that can go into ejecting the envelope; to use this prescription without extra ionization energy, set lambdaf = 0" + }, + { + "name": 0.0, + "description": "As above, this is the default choice", + "default": true + }, + { + "name": -1.0, + "description": "Uses a fixed value (i.e. fixes \\( \\lambda \\) to a value of -lambdaf)" + } + ] + }, + { + "name": "ceflag", + "description": "Selects the model to set the initial orbital energy (choose whether to use total mass of the stars instead of the core masses)", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "Use the core masses of the stars to set the initial orbital energy (as in Hurley+2002 Eq. 70)" + }, + { + "name": 1, + "description": "Use the total mass of the stars to set the initial orbital energy (as in de Kool 1990)", + "default": true + } + ] + }, + { + "name": "cekickflag", + "description": "Selects which mass and separation values to use when a supernova occurs during the CE and a kick needs to be applied.", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "uses pre-CE mass and post-CE sep (BSE default)" + }, + { + "name": 1, + "description": "uses pre-CE mass and sep values" + }, + { + "name": 2, + "description": "uses post-CE mass and sep", + "default": true + } + ] + }, + { + "name": "cemergeflag", + "description": "Determines whether stars that begin a CE without a distinct core-envelope boundary automatically lead to merger in a CE. These systems include: kstars = [0,1,2,7,8,10,11,12].", + "type": "dropdown", + "options-preface": "Note that while the optimal choice is cemergeflag=1 according to Belczynski+2008, cemergeflag=0 allows for both options to be explored, since it is trivial to remove these systems from a population in post processing.", + "options": [ + { + "name": 0, + "description": "allows the CE to proceed (optimistic CE)" + }, + { + "name": 1, + "description": "forces the stars to merge in the CE (pessimistic CE)", + "default": true + } + ] + }, + { + "name": "cehestarflag", + "description": "Uses fitting formulae from Tauris+2015 for evolving RLO systems with a helium star donor and compact object accretor. NOTE: this flag will override cekickflag if set", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "Do not use the fitting formulae from Tauris+2015", + "default": true + }, + { + "name": 1, + "description": "Use the fitting formulae from Tauris+2015 for final period only" + }, + { + "name": 2, + "description": "Use the fitting formulae from Tauris+2015 for both final mass and final period" + } + ] + }, + { + "name": "qcflag", + "description": "Selects model to determine critical mass ratios for the onset of unstable mass transfer and/or a common envelope during RLO. NOTE: this is overridden by qcrit_array if any of its values are non-zero.", + "type": "dropdown", + "options-preface": "The table below shows the values for qcflag across the choices of this flag and the kstar type. The equations in the table correspond to:
- Eq.1: qc = 0.362 + 1.0/(3.0*(1.0 - massc(j1)/mass(j1))) (from Hjellming & Webbink 1983)
- Eq 2: qc = (1.67d0-zpars(7)+2.d0*(massc(j1)/mass(j1))**5)/2.13d0 (from Claeys+ 2014)", + "options": [ + { + "name": 0, + "description": "follows Section 2.6 of Hurley+2002 (Default BSE)" + }, + { + "name": 1, + "description": "same as 0 but with Hjellming & Webbink 1987 for GB/AGB stars", + "default": true + }, + { + "name": 2, + "description": "follows Table 2 of Claeys+2014" + }, + { + "name": 3, + "description": "same as 2 but with Hjellming & Webbink 1987 for GB/AGB stars" + }, + { + "name": 4, + "description": "follows Section 5.1 of Belcyznski+2008 except for WD donors which follow BSE" + }, + { + "name": 5, + "description": "follows Section 2.3 of Neijssel+2020; mass transfer from stripped stars is always assumed to be dynamically stable" + } + ] + }, + { + "name": "qcrit_array", + "description": "User-defined values for critical mass ratios for the onset of unstable mass transfer and a common envelope during RLOF.", + "type": "string", + "options-preface": "Array of dimensions (1,16) specifying user-input values for the critical mass ratios that govern the onset of unstable mass transfer and a common envelope. Each item is set individually for its associated kstar, and a value of 0.0 will apply the prescription specified qcflag for that kstar.
NOTE: Recall from the start of this section that there are cases where a common envelope is forced regardless of the critical mass ratio for unstable mass transfer.", + "options": [ + { + "name": "[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]", + "description": "Default value, which applies the prescription specified by qcrit for each kstar type", + "default": true + } + ] + }, + { + "settings-section": "Natal kicks", + "name": "kickflag", + "description": "Sets the particular natal kick prescription to use. Note that sigmadiv, bhflag, bhsigmafrac, aic, and ussn, which are described below, are only used when abs(kickflag)=1. Positive values use the Pfahl+2002 prescription for handling natal kicks.", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": 1, + "description": "The standard COSMIC kick prescription, where kicks are drawn from a bimodal distribution with standard FeCCSN getting a kick drawn from a Maxwellian distribution with dispersion parameter sigma and ECSN/USSN are drawn according to sigmadiv. This setting has additional possible options for bhflag, bhsigmafrac, aic and ussn.", + "default": true + }, + { + "name": 2, + "description": "Natal kicks are drawn according to sigma and scaled by the ejecta mass and remnant mass following Eq. 1 of Giacobbo & Mapelli 2020

with their default parameters (\\(m_{\\rm NS = 1.2 {\\rm M_\\odot}\\), \\(m_{\\rm ej = 9 {\\rm M_\\odot}\\))" + }, + { + "name": 3, + "description": "Natal kicks are drawn according to sigma and scaled by just the ejecta mass following Eq. 2 of Giacobbo & Mapelli 2020, which does not scale the kick by (\\(m_{\\rm NS\\)" + }, + { + "name": 4, + "description": "Natal kicks are drawn according to Eq. 1 of Bray & Eldridge 2016, with their default parameters (\\(\\alpha=70 \\, {\\rm km/s}, \\beta = 120 \\, {\\rm km/s)}" + }, + { + "name": 5, + "description": "Follows the same prescription as 1, but uses the kick prescription described in Disberg & Mandel 2025 for CCSN." + }, + { + "name": "negative values", + "description": "Same as above settings but using the old Kiel & Hurley 2009 prescription for changing the orbital configuration of the binary, available for reproducibility purposes but not recommended for new work. kickflag=-5 is NOT implemented." + } + ] + }, + { + "name": "sigma", + "description": "Sets the dispersion in the Maxwellian for the SN kick velocity in km/s", + "type": "number", + "options-preface": "", + "options": [ + { + "name": "positive values", + "description": "Sets the dispersion in the Maxwellian for the SN kick velocity in km/s" + }, + { + "name": 265.0, + "description": "Default choice", + "default": true + } + ] + }, + { + "name": "bhflag", + "description": "Sets the model for how SN kicks are applied to BHs, where bhflag != 0 allows for velocity kick at BH formation", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "No BH kick" + }, + { + "name": 1, + "description": "fallback-modulated kicks following Fryer+2012", + "default": true + }, + { + "name": 2, + "description": "kicks decreased by ratio of BH mass to NS mass (1.44 Msun); conserves linear momentum" + }, + { + "name": 3, + "description": "BH natal kicks are not decreased compared to NS kicks and are drawn from the same Maxwellian distribution with dispersion = sigma set above" + } + ] + }, + { + "name": "bhsigmafrac", + "description": "Sets a fractional modification which scales down sigma for BHs. This works in addition to whatever is chosen for bhflag, and is applied to sigma before the bhflag prescriptions are applied", + "type": "number", + "options-preface": "", + "options": [ + { + "name": "values between [0, 1]", + "description": "reduces sigma by bhsigmafrac for BHs" + }, + { + "name": 1.0, + "description": "Default choice", + "default": true + } + ] + }, + { + "name": "sigmadiv", + "description": "Sets the modified ECSN kick strength", + "type": "number", + "options-preface": "", + "options": [ + { + "name": "positive values", + "description": "divide sigma (defined above) by sigmadiv" + }, + { + "name": "negative values", + "description": " sets ECSN kicks to be drawn from a Maxwellian distribution with dispersion given by sigmadiv" + }, + { + "name": -20.0, + "description": "Default choice", + "default": true + } + ] + }, + { + "name": "ecsn", + "description": "Allows for electron capture SNe and sets the maximum He-star mass (at core helium depletion) that will result in an ECSN", + "type": "number", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "turns off ECSN" + }, + { + "name": "positive values", + "description": "sets maximum He-star mass for ECSN; BSE (Hurley+2002) and StarTrack (Belczynski+2008) use ecsn = 2.25, while Podsiadlowksi+2004 argues that binarity can increase this to ecsn = 2.5" + }, + { + "name": 2.25, + "description": "Default choice", + "default": true + } + ] + }, + { + "name": "ecsn_low", + "description": "Sets the low end of the ECSN mass range", + "type": "number", + "options-preface": "", + "options": [ + { + "name": "positive values", + "description": "sets maximum He-star mass for ECSN; BSE (Hurley+2002) uses ecsn_mlow = 1.6, StarTrack (Belczynski+2008) uses ecsn_mlow = 1.85, Podsiadlowksi+2004 argues that binarity can decrease this to ecsn_mlow = 1.4" + }, + { + "name": 1.6, + "description": "Default choice", + "default": true + } + ] + }, + { + "name": "aic", + "description": "Sets the model for accretion induced collapse SN natal kicks", + "type": "dropdown", + "options-preface": "Applies even if ecsn = 0<.code>", + "options": [ + { + "name": 0, + "description": "AIC SN receive kicks drawn from Maxwellian with dispersion = sigma defined above" + }, + { + "name": 1, + "description": "sets AIC SN kick strength according to sigmadiv; NOTE that this will apply even if ecsn = 0.0", + "default": true + } + ] + }, + { + "name": "ussn", + "description": "Reduces kicks according to the sigmadiv selection for ultra-stripped supernovae, assumed to happen if a He-star undergoes a CE with a compact companion", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "USSN receive kicks drawn from Maxwellian with dispersion = sigma defined above" + }, + { + "name": 1, + "description": "sets USSN kick strength according to sigmadiv", + "default": true + } + ] + }, + { + "name": "pisn", + "description": "Allows for (pulsational) pair instability supernovae and sets either the model to use or the maximum mass of the remnant.", + "type": "number", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "no pulsational pair instability SN" + }, + { + "name": -1, + "description": " uses the formulae from Spera & Mapelli 2017" + }, + { + "name": -2, + "description": "uses a polynomial fit to Table 1 in Marchant+2018", + "default": true + }, + { + "name": -3, + "description": "uses a polynomial fit to Table 5 in Woosley 2019" + }, + { + "name": "positive values", + "description": "turns on pulsational pair instability and pair instability SNe, and sets the maximum mass of the allowed remnant (i.e., the bottom of the pair instability mass gap). He core masses between pisn and 65 Msun are assumed to go through pulsational pair instability and limit the He core mass to pisn, while He core masses from 65-135 Msun are assumed have a pair instability SN and leave no remnant." + } + ] + }, + { + "name": "polar_kick_angle", + "description": "Sets the opening angle of the SN kick relative to the pole of the exploding star", + "type": "number", + "options-preface": "", + "options": [ + { + "name": "values between [0, 90]", + "description": "Sets the opening angle of the SN kick relative to the pole of the exploding star" + }, + { + "name": 0.0, + "description": "Strictly polar kicks" + }, + { + "name": 90.0, + "description": "Fully isotropic kicks (default choice)", + "default": true + } + ] + }, + { + "name": "natal_kick_array", + "description": "Array of dimensions (2,5) which takes user input values for the SN natal kick, where the first row corresponds to the first star and the second row corresponds to the second star and columns are: [vk, phi, theta, mean_anomaly, rand_seed].", + "type": "string", + "options-preface": "NOTE: any numbers outside the ranges below will be sampled in the standard ways detailed above.", + "options": [ + { + "name": "vk", + "description": "SN kick velocity in km/s, valid on the range [0, inf]" + }, + { + "name": "phi", + "description": "SN kick co-lateral polar angle in degrees, valid on the range [-90, 90]" + }, + { + "name": "theta", + "description": "SN kick azimuthal angle in degrees, valid on the range [0, 360]" + }, + { + "name": "mean_anomaly", + "description": "SN kick mean anomaly in degrees, valid on the range [0, 360]" + }, + { + "name": "rand_seed", + "description": "supplied if restarting evolution after a supernova has already occurred" + }, + { + "name": "[[-100.0, -100.0, -100.0, -100.0, 0.0], [-100.0, -100.0, -100.0, -100.0, 0.0]]", + "description": "Default choice, which applies the standard natal kick prescription", + "default": true + } + ] + }, + { + "settings-section": "Remnant mass", + "name": "remnantflag", + "description": "Determines the remnant mass prescription used for NSs and BHs.", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "follows Section 6 of Hurley+2000 (default BSE)" + }, + { + "name": 1, + "description": "follows Belczynski+2002" + }, + { + "name": 2, + "description": "follows Belczynski+2008" + }, + { + "name": 3, + "description": "follows the rapid prescription from Fryer+2012, with updated proto-core mass from Giacobbo & Mapelli 2020. This leads to a mass gap between neutron stars and black holes." + }, + { + "name": 4, + "description": "follows the delayed prescription from Fryer+2012. This fills the mass gap between neutron stars and black holes.", + "default": true + } + ] + }, + { + "name": "mxns", + "description": "Sets the boundary between the maximum NS mass and the minimum BH mass", + "type": "number", + "options-preface": "", + "options": [ + { + "name": "positive values", + "description": "Sets the boundary between the maximum NS mass and the minimum BH mass" + }, + { + "name": 3.0, + "description": "Default choice", + "default": true + } + ] + }, + { + "name": "rembar_massloss", + "description": "Determines the prescriptions for mass conversion due to neutrino emission during the collapse of the proto-compact object", + "type": "number", + "options-preface": "", + "options": [ + { + "name": "positive values", + "description": "sets the maximum amount of mass loss, which should be about 10% of the maximum mass of an iron core (\\({\\sim 5 \\mathrm{M}_\\odot}\\) Fryer, private communication)" + }, + { + "name": "values in [-1, 0)", + "description": "assumes that proto-compact objects lose a constant fraction of their baryonic mass when collapsing to a black hole, such that \\(M_{\\rm rem} = (1 + \\texttt{rembar\\_massloss}) M_{\\rm rem}\\) (e.g., rembar_massloss = -0.1 gives the black hole a gravitational mass that is 90% of the proto-compact object's baryonic mass)" + }, + { + "name": 0.5, + "description": "Default choice", + "default": true + } + ] + }, + { + "name": "wd_mass_lim", + "description": "Determines if the maximum white dwarf mass is limited to the chandraekhar mass during merger induced collapse", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "Do not apply the limit" + }, + { + "name": 1, + "description": "Apply the limit", + "default": true + } + ] + }, + { + "settings-section": "Remnant spin", + "name": "bhspinflag", + "description": "Uses different prescriptions for BH spin after formation", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "sets all BH spins to bhspinmag", + "default": true + }, + { + "name": 1, + "description": "draws a random BH spin between 0 and bhspinmag for every BH" + }, + { + "name": 2, + "description": "core-mass dependent BH spin (based on Belczynski+2017 v1)" + } + ] + }, + { + "name": "bhspinmag", + "description": "Sets either the spin of all BHs or the upper limit of the uniform distribution for BH spins (see bhspinflag)", + "type": "number", + "options-preface": "", + "options": [ + { + "name": "positive values", + "description": "Sets either the spin of all BHs or the upper limit of the uniform distribution for BH spins (see bhspinflag)" + }, + { + "name": 0.0, + "description": "Default choice", + "default": true + } + ] + }, + { + "settings-section": "GR Orbital Decay", + "name": "grflag", + "description": "Turns on or off orbital decay due to gravitational wave emission", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "No orbital decay due to gravitational wave emission" + }, + { + "name": 1, + "description": "Orbital decay due to gravitational wave emission is turned on", + "default": true + } + ] + }, + { + "settings-section": "Mass transfer", + "name": "eddfac", + "description": "Eddington limit factor for mass transfer.", + "options-preface": "", + "type": "number", + "options": [ + { + "name": "1", + "description": "mass transfer rate is limited by the Eddington rate following Equation 67 in Hurley+2002", + "default": true + }, + { + "name": "values > 1", + "description": "permit super-Eddington accretion up to value eddfac" + }, + { + "name": "values in [0, 1]", + "description": "restrict accretion limit to fraction of Eddington (sub-Eddington accretion)" + } + ] + }, + { + "name": "gamma", + "description": "Angular momentum prescriptions for mass lost during Roche-lobe overflow at super-Eddington mass transfer rates", + "type": "number", + "options-preface": "", + "options": [ + { + "name": -1, + "description": "assumes the lost material carries away the specific angular momentum of the primary" + }, + { + "name": -2, + "description": "assumes material is lost from the system as if it is a wind from the secondary", + "default": true + }, + { + "name": -3, + "description": "assumes mass is lost through the outer Lagrangian point, forming a circumbinary disk. See Zapartas+17 Eq. 9 and Artymowicz & Lubow (1994)." + }, + { + "name": "positive values", + "description": "assumes that the lost material takes away a fraction gamma of the orbital angular momentum" + } + ] + }, + { + "name": "don_lim", + "description": "Determines the rate of mass loss through Roche-lobe overflow mass transfer from the donor star", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": -1, + "description": "donor mass loss rate is calculated following Hurley+2002", + "default": true + }, + { + "name": -2, + "description": "donor mass loss rate is calculated following Claeys+2014" + } + ] + }, + { + "name": "acc_lim", + "description": "Limits the amount of mass accreted during Roche-lobe overflow", + "type": "number", + "options-preface": "", + "options": [ + { + "name": -1, + "description": "limited to 10x the thermal rate of the accretor for MS/HG/CHeB and unlimited for GB/EAGB/AGB stars", + "default": true + }, + { + "name": -2, + "description": "limited to 1x the thermal rate of the accretor for MS/HG/CHeB and unlimited for GB/EAGB/AGB stars" + }, + { + "name": -3, + "description": "limited to 10x the thermal rate of the accretor for all stars" + }, + { + "name": -4, + "description": "limited to 1x the thermal rate of the accretor for all stars" + }, + { + "name": ">= 0", + "description": "sets overall fraction of donor material that is accreted, with the rest being lost from the system (acc_lim = 0.5 assumes 50% accretion efficiency as in Belczynski+2008)" + } + ] + }, + { + "settings-section": "Tides", + "name": "tflag", + "description": "Activates tidal circularization following Hurley+2002", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "No tidal circularization" + }, + { + "name": 1, + "description": "Tidal circularization is turned on", + "default": true + } + ] + }, + { + "name": "ST_tide", + "description": "Activates StarTrack setup for tides following Belczynski+2008", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "Follows BSE (Hurley+2002)" + }, + { + "name": 1, + "description": "Follow StarTrack (Belczynski+2008). Note StarTrack method does not use a better integration scheme (yet) but simply ; follows similar set up to startrack (including initial vrot, using roche-lobe check ; at periastron, and circularisation and synchronisation at start of MT).", + "default": true + } + ] + }, + { + "name": "fprimc_array", + "description": "Controls the scaling factor for convective tides. Each value in the array is set individually for its associated kstar. The relevant equation is Hurley+2002 Eq. 21.", + "type": "string", + "options-preface": "", + "options": [ + { + "name": "positive values", + "description": "sets scaling factor of Equation 21 referenced above" + }, + { + "name": "[2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0]", + "description": "Default choice, which applies the standard scaling factor", + "default": true + } + ] + }, + { + "settings-section": "White dwarfs", + "name": "ifflag", + "description": "Activates the initial-final white dwarf mass relation from Han+1995 Equations 3, 4, and 5.", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "No modifications to BSE" + }, + { + "name": 1, + "description": "Initial-final white dwarf mass relation is turned on", + "default": true + } + ] + }, + { + "name": "wdflag", + "description": "Activates an alternate cooling law found in the description immediately following Equation 1 in Hurley & Shara 2003. Equation 1 gives the BSE default Mestel cooling law.", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "No modifications to BSE" + }, + { + "name": 1, + "description": "Alternate cooling law is turned on", + "default": true + } + ] + }, + { + "name": "epsnov", + "description": "Fraction of accreted matter retained in a nova eruption. This is relevant for accretion onto degenerate objects; see Section 2.6.6.2 in Hurley+2002.", + "type": "number", + "options-preface": "", + "options": [ + { + "name": "positive values", + "description": "Retains epsnov fraction of accreted matter" + }, + { + "name": 0.001, + "description": "Default choice", + "default": true + } + ] + }, + { + "settings-section": "Pulsars", + "name": "bdecayfac", + "description": "Activates different models for accretion induced field decay; see Kiel+2008.", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "uses an exponential decay" + }, + { + "name": 1, + "description": "uses an inverse decay", + "default": true + } + ] + }, + { + "name": "bconst", + "description": "Sets the magnetic field decay timescale for pulsars following Section 3 of Kiel+2008.", + "type": "number", + "options-preface": "", + "options": [ + { + "name": "positive values", + "description": "sets \\(k\\) in Myr from Equation 8 to bconst" + }, + { + "name": 3000, + "description": "Default choice", + "default": true + } + ] + }, + { + "name": "ck", + "description": "Sets the magnetic field decay timescale for pulsars following Section 3 of Kiel+2008.", + "type": "number", + "options-preface": "", + "options": [ + { + "name": "positive values", + "description": "sets \\(\\tau_b\\) in Myr from Equation 2 to ck" + }, + { + "name": 1000, + "description": "Default choice", + "default": true + } + ] + }, + { + "settings-section": "Mixing variables", + "name": "rejuv_fac", + "description": "Sets the mixing factor in main sequence star collisions. This is hard coded to 0.1 in the original BSE release and in Equation 80 of Hurley+2002 but can lead to extended main sequence lifetimes in some cases.", + "type": "number", + "options-preface": "", + "options": [ + { + "name": "positive values", + "description": "sets the mixing factor in main sequence star collisions" + }, + { + "name": 1.0, + "description": "Default choice", + "default": true + } + ] + }, + { + "name": "rejuvflag", + "description": "Sets whether to use the orginal prescription for mixing of main-sequence stars (based on equation 80 of Hurley+2002) or whether to use the ratio of the pre-merger He core mass at the base of the giant branch to the merger product's He core mass at the base of the giant branch", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "No modifications to BSE", + "default": true + }, + { + "name": 1, + "description": "modified mixing times" + } + ] + }, + { + "name": "bhms_coll_flag", + "description": "If set to 1, then the star is not destroyed in a BH+star collision if \\(M_{\\rm star} > M_{\\rm BH}\\)", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "Star is destroyed in a BH+star collision even if \\(M_{\\rm star} > M_{\\rm BH}\\)", + "default": true + }, + { + "name": 1, + "description": "Star is not destroyed in a BH+star collision if \\(M_{\\rm star} > M_{\\rm BH}\\)" + } + ] + }, + { + "settings-section": "Magnetic Braking", + "name": "htpmb", + "description": "Activates different models for magnetic braking", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": -1, + "description": "No magnetic braking" + }, + { + "name": 0, + "description": "No modifications to BSE" + }, + { + "name": 1, + "description": "follows Ivanona and Taam 2003", + "default": true + } + ] + }, + { + "settings-section": "Miscellaneous", + "name": "ST_cr", + "description": "Activates different convective vs radiative boundaries", + "type": "dropdown", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "Follows BSE (Hurley+2002)" + }, + { + "name": 1, + "description": "Follow StarTrack (Belczynski+2008)", + "default": true + } + ] + }, + { + "name": "rtmsflag", + "description": "Flag for calculating the radius at the end of the main sequence.", + "type": "number", + "options-preface": "", + "options": [ + { + "name": 0, + "description": "Use the original SSE calculation except if M>200Msun and Z<0.0008 (~0.04 Zsun). For the exception, an extrapolation is used. This ad hoc extrapolation works well for stars with M < 4000 Msun for Z >= 0.01 Zsun. For lower metallicities, you may still run into issues of negative radii for very massive stars - use at your own risk.", + "default": true + }, + { + "name": 1, + "description": "Calculate using BoOST simulation data. BoOST metallicities = [1.1e-4, 2.1e-4, 1e-3, 2e-3] corresponding to [dwarfD, IZw18, dwarfA, SMC] models (Szecsi et al. (2022))" + }, + { + "name": 2, + "description": "Calculating using BPASS simulation data. BPASS metallicities = [1e-4, *2e-4*, 1e-3, 2e-3]. NOTE : For BPASS, we used a power law to fit the rtms v/s mzams values for each metallicity. We have coded the best fit power-laws for the above BPASS metallicities here. Since, Z = 2e-4 model is not available in the BPASS tracks, we assume the same rtms v/s mzams power law as Z=1e-4 for Z=2e-4." + } + ] + } + ] + } +] \ No newline at end of file diff --git a/examples/Params.ini b/examples/Params.ini index e52afce18..340609f4c 100644 --- a/examples/Params.ini +++ b/examples/Params.ini @@ -297,8 +297,11 @@ qcrit_array = [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0] ; which does not scale the kick by ; kickflag=4 uses the prescription from Bray & Eldridge 2016 (Eq. 1) ; with their default parameters (alpha=70 km/s, beta=120 km/s) +; kickflag=5 uses the Disberg & Mandel 2025 (Table 1) prescription. Similar to Hobbs et al. 2005 (kickflag=1) but with a binning correction which lowers +; mean kick velocities substantially for neutron stars ; negative kickflags are the same as their positive counterparts, but using the Kiel & Hurley 2009 ; kick implementation instead of the default Pfahl et al. 2002 +; Note: kickflag=-5 is not implemented ; Note: sigmadiv, bhflag, bhsigmafrac, aic, and ussn are only used when abs(kickflag)=1 ; default = 1 kickflag = 1 diff --git a/pyproject.toml b/pyproject.toml index f3211240b..e548c8c19 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ authors = [ { name="Tom Wagg" }, ] readme = "README.md" -version = "3.5.0" +version = "3.5.1" requires-python = ">=3.9" license = { text = "MIT License" } classifiers = [ diff --git a/src/cosmic/_version.py b/src/cosmic/_version.py index dcbfb52f6..0c11babd0 100644 --- a/src/cosmic/_version.py +++ b/src/cosmic/_version.py @@ -1 +1 @@ -__version__ = "3.5.0" +__version__ = "3.5.1" diff --git a/src/cosmic/src/kick.f b/src/cosmic/src/kick.f index 263ddb544..b9a2b40a1 100644 --- a/src/cosmic/src/kick.f +++ b/src/cosmic/src/kick.f @@ -117,7 +117,9 @@ SUBROUTINE kick_pfahl(kw,m1,m1n,m2,ecc,sep,jorb,vk,sn,r2, real*8 thetaE, phiE, psiE real*8 psiplusphi, orbital_pivot_axis(3), unsigned_phi real*8 LRL_prev_dot_h, LRL_dot_h_prev, unsigned_psi + real*8 disberg_mean integer i + logical ECSN_or_USSN * Output logical output,disrupt,collide * @@ -127,6 +129,7 @@ SUBROUTINE kick_pfahl(kw,m1,m1n,m2,ecc,sep,jorb,vk,sn,r2, * output = .false. !useful for debugging... collide = .false. + ECSN_or_USSN = .false. safety = 0 abskickflag = ABS(kickflag) @@ -138,6 +141,7 @@ SUBROUTINE kick_pfahl(kw,m1,m1n,m2,ecc,sep,jorb,vk,sn,r2, u1 = 0.d0 u2 = 0.d0 vk = 0.d0 + disberg_mean = 5.60d0 pi = ACOS(-1.d0) twopi = 2.d0*pi * Gravitational constant in units of km^3 / (Msun * s^2) @@ -175,8 +179,9 @@ SUBROUTINE kick_pfahl(kw,m1,m1n,m2,ecc,sep,jorb,vk,sn,r2, if(kick_info(1,2).eq.1) kick_info(2,2)=1 * sigma is negative for ECSN - if((sigma.lt.0.d0).and.(abskickflag.eq.1))then + if((sigma.lt.0.d0).and.(abskickflag.eq.1.or.abskickflag.eq.5))then sigma = -1.d0*sigma + ECSN_or_USSN = .true. * for kick prescriptions other than default, revert to original sigma elseif((sigma.lt.0.d0).and.(abskickflag.gt.1))then sigma = sigmahold @@ -184,9 +189,10 @@ SUBROUTINE kick_pfahl(kw,m1,m1n,m2,ecc,sep,jorb,vk,sn,r2, sigmah = sigma * scale down BH kicks if bhsigmafrac is specified - if(abskickflag.eq.1)then + if(abskickflag.eq.1.or.abskickflag.eq.5)then if(kw.eq.14.or.(kw.eq.13.and.(m1n.ge.mxns)))then sigma = sigmah*bhsigmafrac + disberg_mean = disberg_mean * bhsigmafrac endif endif @@ -196,7 +202,7 @@ SUBROUTINE kick_pfahl(kw,m1,m1n,m2,ecc,sep,jorb,vk,sn,r2, * ---------------------------------------------------------------------- * Before we draw the kick from the maxwellian and then scale it -* as desired, let us see if a pre-supplied natal kick maganitude +* as desired, let us see if a pre-supplied natal kick magnitude * was passed. if(natal_kick_array(sn,1).ge.0.d0)then vk = natal_kick_array(sn,1) @@ -207,24 +213,33 @@ SUBROUTINE kick_pfahl(kw,m1,m1n,m2,ecc,sep,jorb,vk,sn,r2, xx = RAN3(idum1) xx = RAN3(idum1) else +* If no pre-supplied kick magnitude, we draw a kick from a distribution +* If the kickflag is 5 then use the log-normal distribution described +* by Disberg & Mandel 2025 + if(abskickflag.eq.5.and..not.ECSN_or_USSN)then + call RandomLogNormal(disberg_mean,0.69d0,vk,idum1,twopi) + vk2 = vk*vk + else +* Otherwise use the Hobbs et al. 2005 Maxwellian distribution * Generate Kick Velocity using Maxwellian Distribution (Phinney 1992). * Use Henon's method for pairwise components (Douglas Heggie 22/5/97). - do 25 k = 1,2 - u1 = RAN3(idum1) - u2 = RAN3(idum1) - if(u1.gt.0.9999d0) u1 = 0.9999d0 - if(u2.gt.1.d0) u2 = 1.d0 + do 25 k = 1,2 + u1 = RAN3(idum1) + u2 = RAN3(idum1) + if(u1.gt.0.9999d0) u1 = 0.9999d0 + if(u2.gt.1.d0) u2 = 1.d0 * Generate two velocities from polar coordinates S & THETA. - s = -2.d0*LOG(1.d0 - u1) - s = sigma*SQRT(s) - theta = twopi*u2 - v(2*k-1) = s*COS(theta) - v(2*k) = s*SIN(theta) - 25 continue - vk2 = v(1)*v(1) + v(2)*v(2) + v(3)*v(3) - vk = SQRT(vk2) + s = -2.d0*LOG(1.d0 - u1) + s = sigma*SQRT(s) + theta = twopi*u2 + v(2*k-1) = s*COS(theta) + v(2*k) = s*SIN(theta) +25 continue + vk2 = v(1)*v(1) + v(2)*v(2) + v(3)*v(3) + vk = SQRT(vk2) + endif - if(abskickflag.eq.1)then + if(abskickflag.eq.1.or.abskickflag.eq.5)then * Limit BH kick with fallback mass fraction. if(kw.eq.14.and.bhflag.eq.0)then vk2 = 0.d0 @@ -1699,5 +1714,24 @@ SUBROUTINE CollisionCheck(sep_vec, v1, v2, r2, collide) end if end if + RETURN + END + + SUBROUTINE RandomLogNormal(mean, sigma, result, idum1, twopi) +* This function generates a random number from a log-normal distribution +* following the Box-Muller transform method. +* http://en.wikipedia.org/wiki/Box-Muller_transform + + real*8 mean, sigma, result, twopi + real*8 u1, u2, z0 + + u1 = ran3(idum1) + u2 = ran3(idum1) + + if (u1.le.0.d0) u1 = 1.0E-10 ! Avoid log(0) + + Z0 = SQRT(-2.0d0 * LOG(u1)) * COS(twopi * u2) + result = EXP(mean + sigma * Z0) + RETURN END \ No newline at end of file diff --git a/src/cosmic/tests/test_kick.py b/src/cosmic/tests/test_kick.py new file mode 100644 index 000000000..613e0ca82 --- /dev/null +++ b/src/cosmic/tests/test_kick.py @@ -0,0 +1,93 @@ +"""Unit test for cosmic kick routine +""" + +__author__ = 'Tom Wagg ' + +import os +import unittest +import numpy as np +from scipy.stats import maxwell, norm +import pandas as pd + +from cosmic.sample.initialbinarytable import InitialBinaryTable, INITIAL_CONDITIONS_COLUMNS_ALL +from cosmic.evolve import Evolve, INITIAL_BINARY_TABLE_SAVE_COLUMNS + +import warnings +warnings.filterwarnings("ignore") + + +TEST_DATA_DIR = os.path.join(os.path.split(__file__)[0], 'data') +INIT_CONDITIONS = pd.read_hdf(os.path.join(TEST_DATA_DIR, 'initial_conditions_for_testing.hdf5'), key='initC') +SSEDict = {"stellar_engine": "sse", "path_to_tracks": "", "path_to_he_tracks": ""} +BSEFlag_columns = list(set(INITIAL_BINARY_TABLE_SAVE_COLUMNS) - set(INITIAL_CONDITIONS_COLUMNS_ALL)) +BSEDict = INIT_CONDITIONS[BSEFlag_columns].to_dict(orient='index')[0] +BSEDict['qcrit_array'] = [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0] +BSEDict['natal_kick_array'] = [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]] +BSEDict['fprimc_array'] = [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0, + 2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0, + 2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0] +BSEDict['grflag'] = 1 +BSEDict['don_lim'] = -1 +BSEDict['acc_lim'] = [-1,-1] +BSEDict['wd_mass_lim'] = 0 + +# avoid using the same randomseed +del BSEDict["bin_num"], BSEDict["randomseed"] + + +class TestKick(unittest.TestCase): + """`TestCase` for the cosmic kick routine + """ + + def test_disberg(self): + """Test the Disberg kick routine + """ + # define a simple single star that will result in a kick + single_star = InitialBinaryTable.InitialBinaries( + m1=20 + np.random.rand() * 0.01, m2=0.0, porb=0, + ecc=-1, tphysf=100.0, kstar1=1, kstar2=15, + metallicity=0.02 + ) + N = 10000 + ibt = single_star.loc[single_star.index.repeat(N)].reset_index() + + # turn off ECSN and bh fallback + BSEDict["ecsn"] = 0 + BSEDict["ecsn_mlow"] = 0 + BSEDict["bhflag"] = 3 + + # evolve using disberg + BSEDict["kickflag"] = 5 + _, _, _, kick_info = Evolve.evolve(initialbinarytable=ibt, BSEDict=BSEDict, SSEDict=SSEDict, nproc=1) + natal_kicks_disberg = kick_info['natal_kick'][kick_info['natal_kick'] != 0.0] + + # fit a lognormal distribution and ensure it matches the expected values + mu_d, sigma_d = norm.fit(np.log(natal_kicks_disberg)) + self.assertTrue(np.round(mu_d, 2) == 5.61) + self.assertTrue(np.round(sigma_d, 2) == 0.69) + + def test_hobbs(self): + """Test the Hobbs kick routine + """ + # define a simple single star that will result in a kick + single_star = InitialBinaryTable.InitialBinaries( + m1=20 + np.random.rand() * 0.01, m2=0.0, porb=0, + ecc=-1, tphysf=100.0, kstar1=1, kstar2=15, + metallicity=0.02 + ) + N = 10000 + ibt = single_star.loc[single_star.index.repeat(N)].reset_index() + + # turn off ECSN and bh fallback + BSEDict["ecsn"] = 0 + BSEDict["ecsn_mlow"] = 0 + BSEDict["bhflag"] = 3 + + # evolve using hobbs + BSEDict["kickflag"] = 1 + _, _, _, kick_info = Evolve.evolve(initialbinarytable=ibt, BSEDict=BSEDict, SSEDict=SSEDict, nproc=1) + natal_kicks = kick_info['natal_kick'][kick_info['natal_kick'] != 0.0] + + # fit a maxwellian to the hobbs natal kicks and ensure it matches the expected values + _, s_hobbs = maxwell.fit(natal_kicks, floc=0.0) + self.assertTrue(np.round(s_hobbs, -1) == 260) diff --git a/src/cosmic/utils.py b/src/cosmic/utils.py index 130522088..b01439236 100644 --- a/src/cosmic/utils.py +++ b/src/cosmic/utils.py @@ -1344,9 +1344,9 @@ def error_check(BSEDict, SSEDict, filters=None, convergence=None, sampling=None) flag = "kickflag" if flag in BSEDict.keys(): - if BSEDict[flag] not in [-4, -3, -2, -1, 1, 2, 3, 4]: + if abs(BSEDict[flag]) not in [1, 2, 3, 4, 5]: raise ValueError( - "'{0:s}' needs to be set to either -4, -3, -2, -1, 1, 2, 3, 4 (you set it to '{1:d}')".format( + "abs('{0:s}') needs to be set to value in 1 - 5 inclusive (you set it to '{1:d}')".format( flag, BSEDict[flag] ) ) From c765dd83961d0fa3c2179af2ba6cf9a123f4bfeb Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Mon, 25 Aug 2025 12:32:24 -0500 Subject: [PATCH 32/46] COSMIC-METISSE interface (#714) * fastforward * add interface for metisse files * ok now we pass in the info in teh metallicity and format files. next up is checking whether we need to pass in the full eep I guess * now we can pass eeps directly but its buggy af * ok this interface compiles and runs but Im getting some buggy bpp output * removing debug prints * fixing fortran arrays sepcifically * fix colname read and make paths path objects instead of str * move c_m_interface to METISSE * update workflow to checkout METISSE submodule * fixing silly vim typo * add kb fork for now to test * add function names to __all__ in utils, add c_m_interface to benchmark compile * fix so that we can rerun with ibt * need track_support to be higher * we now actually read in the eeps as specified by the metallicity files * remove fork checkout * now explicitly checking out develop * now compiling in two stages * had a rogue conda prefix --------- Co-authored-by: Katelyn Breivik --- .github/workflows/python-package.yml | 14 +- ci/compile_benchmark.sh | 59 +++++- meson.build | 9 +- src/cosmic/evolve.py | 270 ++++++++++++++++++++++++++- src/cosmic/src/METISSE | 2 +- src/cosmic/src/evolv2.f | 3 +- src/cosmic/src/hrdiag.f | 1 - src/cosmic/utils.py | 256 ++++++++++++++++++++++++- 8 files changed, 600 insertions(+), 14 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index b1a62e167..1781a9219 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -15,9 +15,19 @@ jobs: python-version: ['3.9', '3.10'] steps: - - uses: actions/checkout@v4 + - name: Checkout repository with submodules + uses: actions/checkout@v4 with: - submodules: true + submodules: recursive + fetch-depth: 0 # needed for full submodule history + - name: Switch METISSE submodule to develop branch + run: | + cd src/cosmic/src/METISSE + git remote set-url origin https://github.com/TeamMETISSE/METISSE + git fetch origin develop + git checkout develop + git pull origin develop + cd $GITHUB_WORKSPACE - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: diff --git a/ci/compile_benchmark.sh b/ci/compile_benchmark.sh index 80afbc961..99d49defc 100755 --- a/ci/compile_benchmark.sh +++ b/ci/compile_benchmark.sh @@ -1,2 +1,59 @@ -gfortran -coverage -fprofile-arcs -ftest-coverage -O0 src/cosmic/src/hrdiag_remnant.f src/cosmic/src/assign_remnant.f src/cosmic/src/benchmarkevolv2.f src/cosmic/src/corerd.f src/cosmic/src/comenv.f src/cosmic/src/dgcore.f src/cosmic/src/evolv2.f src/cosmic/src/gntage.f src/cosmic/src/instar.f src/cosmic/src/kick.f src/cosmic/src/mix.f src/cosmic/src/mrenv.f src/cosmic/src/ran3.f src/cosmic/src/rl.f src/cosmic/src/concatkstars.f src/cosmic/src/comprad.f src/cosmic/src/bpp_array.f src/cosmic/src/checkstate.f src/cosmic/src/deltat.f src/cosmic/src/mlwind.f src/cosmic/src/hrdiag.f src/cosmic/src/star.f src/cosmic/src/zcnsts.f src/cosmic/src/SSE/SSE_deltat.f src/cosmic/src/SSE/SSE_mlwind.f src/cosmic/src/SSE/SSE_hrdiag.f src/cosmic/src/SSE/SSE_star.f src/cosmic/src/SSE/SSE_zcnsts.f src/cosmic/src/SSE/SSE_zfuncs.f src/cosmic/src/SSE/SSE_gntage.f src/cosmic/src/METISSE/src/track_support.f90 src/cosmic/src/METISSE/src/z_support.f90 src/cosmic/src/METISSE/src/sse_support.f90 src/cosmic/src/METISSE/src/remnant_support.f90 src/cosmic/src/METISSE/src/interp_support.f90 src/cosmic/src/METISSE/src/METISSE_gntage.f90 src/cosmic/src/METISSE/src/METISSE_deltat.f90 src/cosmic/src/METISSE/src/METISSE_mlwind.f90 src/cosmic/src/METISSE/src/METISSE_hrdiag.f90 src/cosmic/src/METISSE/src/METISSE_star.f90 src/cosmic/src/METISSE/src/METISSE_zcnsts.f90 src/cosmic/src/METISSE/src/comenv_lambda.f90 src/cosmic/src/METISSE/src/METISSE_miscellaneous.f90 src/cosmic/src/METISSE_utils.f90 -o benchmarkevolv2.exe -I src/cosmic/src -Wl,-rpath,${CONDA_PREFIX}/lib +#!/usr/bin/env bash +set -euo pipefail + +# Directories +SRC_DIR="src/cosmic/src" +METISSE_DIR="$SRC_DIR/METISSE/src" + +# Compiler flags (removed rpath to CONDA_PREFIX) +FFLAGS="-coverage -fprofile-arcs -ftest-coverage -O0 -J$SRC_DIR -I$SRC_DIR" + +# Phase 1: Compile METISSE modules in dependency order +gfortran $FFLAGS -c \ + $METISSE_DIR/c_m_interface.f90 \ + $METISSE_DIR/track_support.f90 \ + $METISSE_DIR/z_support.f90 \ + $METISSE_DIR/sse_support.f90 \ + $METISSE_DIR/remnant_support.f90 \ + $METISSE_DIR/interp_support.f90 \ + $METISSE_DIR/METISSE_gntage.f90 \ + $METISSE_DIR/METISSE_deltat.f90 \ + $METISSE_DIR/METISSE_mlwind.f90 \ + $METISSE_DIR/METISSE_hrdiag.f90 \ + $METISSE_DIR/METISSE_star.f90 \ + $METISSE_DIR/METISSE_zcnsts.f90 \ + $METISSE_DIR/comenv_lambda.f90 \ + $METISSE_DIR/METISSE_miscellaneous.f90 \ + $SRC_DIR/METISSE_utils.f90 + +# Phase 2: Compile COSMIC and SSE sources + link everything +gfortran $FFLAGS \ + $SRC_DIR/hrdiag_remnant.f \ + $SRC_DIR/assign_remnant.f \ + $SRC_DIR/benchmarkevolv2.f \ + $SRC_DIR/corerd.f \ + $SRC_DIR/comenv.f \ + $SRC_DIR/dgcore.f \ + $SRC_DIR/evolv2.f \ + $SRC_DIR/gntage.f \ + $SRC_DIR/instar.f \ + $SRC_DIR/kick.f \ + $SRC_DIR/mix.f \ + $SRC_DIR/mrenv.f \ + $SRC_DIR/ran3.f \ + $SRC_DIR/rl.f \ + $SRC_DIR/concatkstars.f \ + $SRC_DIR/comprad.f \ + $SRC_DIR/bpp_array.f \ + $SRC_DIR/checkstate.f \ + $SRC_DIR/deltat.f \ + $SRC_DIR/mlwind.f \ + $SRC_DIR/hrdiag.f \ + $SRC_DIR/star.f \ + $SRC_DIR/zcnsts.f \ + $SRC_DIR/SSE/SSE_*.f \ + *.o \ + -o benchmarkevolv2.exe + +# Run the benchmark ./benchmarkevolv2.exe diff --git a/meson.build b/meson.build index 2d228c8a2..faf1d3f2d 100644 --- a/meson.build +++ b/meson.build @@ -53,13 +53,14 @@ lib_source = [ 'src/cosmic/src/SSE/SSE_zcnsts.f', 'src/cosmic/src/SSE/SSE_zfuncs.f', 'src/cosmic/src/SSE/SSE_gntage.f', + 'src/cosmic/src/METISSE/src/track_support.f90', + 'src/cosmic/src/METISSE/src/c_m_interface.f90', 'src/cosmic/src/METISSE/src/METISSE_gntage.f90', 'src/cosmic/src/METISSE/src/METISSE_deltat.f90', 'src/cosmic/src/METISSE/src/METISSE_mlwind.f90', 'src/cosmic/src/METISSE/src/METISSE_hrdiag.f90', 'src/cosmic/src/METISSE/src/METISSE_star.f90', 'src/cosmic/src/METISSE/src/METISSE_zcnsts.f90', - 'src/cosmic/src/METISSE/src/track_support.f90', 'src/cosmic/src/METISSE/src/z_support.f90', 'src/cosmic/src/METISSE/src/sse_support.f90', 'src/cosmic/src/METISSE/src/remnant_support.f90', @@ -80,8 +81,8 @@ endif f2py_source = custom_target( 'evolvebin-target', - input : ['src/cosmic/src/evolv2.f', 'src/cosmic/src/comprad.f'], - output : ['_evolvebinmodule.c', '_evolvebin-f2pywrappers.f'], + input : ['src/cosmic/src/evolv2.f', 'src/cosmic/src/comprad.f', 'src/cosmic/src/METISSE/src/c_m_interface.f90'], + output : ['_evolvebinmodule.c', '_evolvebin-f2pywrappers.f', '_evolvebin-f2pywrappers2.f90'], command : [py3, '-m', 'numpy.f2py', '@INPUT@', '-m', '_evolvebin', '--lower'] ) @@ -99,4 +100,4 @@ evolvebin_module = py3.extension_module('_evolvebin', python_script = 'bin/cosmic-pop' install_data(python_script, install_dir: get_option('bindir')) -subdir('src/cosmic') +subdir('src/cosmic') \ No newline at end of file diff --git a/src/cosmic/evolve.py b/src/cosmic/evolve.py index 42a83a597..9f437810a 100644 --- a/src/cosmic/evolve.py +++ b/src/cosmic/evolve.py @@ -31,6 +31,7 @@ import warnings import os import sys +import tqdm try: import multiprocessing multiprocessing.set_start_method("fork") @@ -304,8 +305,20 @@ def evolve(self, initialbinarytable, pool=None, bpp_columns=None, bcm_columns=No _evolvebin.se_flags.using_metisse = 1 _evolvebin.se_flags.using_sse = 0 + #check if the metallicity for the initialbinarytable changes + # raise an error if all the metallicities are not the same + if initialbinarytable['metallicity'].nunique() > 1: + raise ValueError("All the metallicities in the initial binary table " + "must be the same if you are using the METISSE stellar engine. ") + + _ = set_metisse_interface( + path_to_tracks=SSEDict['path_to_tracks'], + path_to_he_tracks=SSEDict['path_to_he_tracks'], + IBT_Z=initialbinarytable['metallicity'].iloc[0] + ) + - elif SSEDict['stellar_engine'] == 'sse': + elif SSEDict['stellar_engine'] == 'sse': kwargs1 = {'stellar_engine': 'sse'} initialbinarytable = initialbinarytable.assign(**kwargs1) for col in ['path_to_tracks', 'path_to_he_tracks']: @@ -314,6 +327,27 @@ def evolve(self, initialbinarytable, pool=None, bpp_columns=None, bcm_columns=No _evolvebin.se_flags.using_sse = 1 _evolvebin.se_flags.using_metisse = 0 + elif initialbinarytable['stellar_engine'].iloc[0] == 'sse': + _evolvebin.se_flags.using_sse = 1 + _evolvebin.se_flags.using_metisse = 0 + elif initialbinarytable['stellar_engine'].iloc[0] == 'metisse': + _evolvebin.se_flags.using_metisse = 1 + _evolvebin.se_flags.using_sse = 0 + + #check if the metallicity for the initialbinarytable changes + # raise an error if all the metallicities are not the same + if initialbinarytable['metallicity'].nunique() > 1: + raise ValueError("All the metallicities in the initial binary table " + "must be the same if you are using the METISSE stellar engine. ") + + # load in the METISSE files + _ = set_metisse_interface( + path_to_tracks=initialbinarytable['path_to_tracks'].iloc[0], + path_to_he_tracks=initialbinarytable['path_to_he_tracks'].iloc[0], + IBT_Z=initialbinarytable['metallicity'].iloc[0] + ) + + else: raise ValueError("Use either 'sse' or 'metisse' as stellar engine") @@ -665,3 +699,237 @@ def _evolve_multi_system(f): except Exception as e: print(e) raise + + +def set_metisse_interface(path_to_tracks, path_to_he_tracks, IBT_Z): + """load in the metallicity, format, and eep files + + Parameters + ---------- + path_to_tracks : str + Direct path to where all single star data and metallicty/format files are stored + for hydrogen-rich stars + + path_to_tracks : str + Direct path to where all single star data and metallicty/format files are stored + for hydrogen-rich stars + + IBT_Z : float + Metallicity from the initialbinarytable + + Returns + ------- + None + + """ + + # load in the METISSE files + l = utils.get_METISSE_files(path_to_tracks, path_to_he_tracks) + h_eep_tracks, he_eep_tracks, met_files, met_files_he = l + + # loop over the hydrogen metallicity files to find the one that is the closest + # to the metallicity in the initial binary table + met_dict_keep = None + fmt_dict_keep = None + mets = [] + for m in met_files: + met_dict, fmt_dict = utils.read_metallicity_and_format(m) + mets.append(met_dict['Z_files']) + if met_dict['Z_files'] == IBT_Z: + met_dict_keep = met_dict + fmt_dict_keep = fmt_dict + if met_dict_keep is None: + raise ValueError("No metallicity file found that matches the metallicity " + "in the initial binary table. Please check the metallicity " + "and supply one that is in this list: {0}".format(mets)) + + # loop over the hydrogen metallicity files to find the one that is the closest + # to the metallicity in the initial binary table + met_dict_he_keep = None + fmt_dict_he_keep = None + for m in met_files_he: + met_dict, fmt_dict = utils.read_metallicity_and_format(m) + if met_dict['Z_files'] == IBT_Z: + met_dict_he_keep = met_dict + fmt_dict_he_keep = fmt_dict + + # Convert Python lists to fixed-length NumPy arrays + h_eep_np = utils.to_f2py_str_array(h_eep_tracks) + he_eep_np = utils.to_f2py_str_array(he_eep_tracks) + met_np = utils.to_f2py_str_array(met_files) + met_he_np = utils.to_f2py_str_array(met_files_he) + z_list_h = utils.to_f2py_str_array(met_dict_keep['Z_files']) + z_list_he = utils.to_f2py_str_array(met_dict_he_keep['Z_files']) + + # Set the metallicity lists in Fortran + _evolvebin.c_m_interface.set_mets(z_list_h, z_list_he) + + # Then pass to Fortran; note that f2py seems to get the number files on its own? + _evolvebin.c_m_interface.set_file_lists( + met_np, # met_files + met_he_np, # met_he_files + h_eep_np, # h_tracks + he_eep_np # he_tracks + ) + + # Next pass the format dictionaries: + _evolvebin.c_m_interface.set_format_controls_h( + read_eep=fmt_dict_keep['read_eep_files'], + prems=fmt_dict_keep['PreMS_EEP'], + zams=fmt_dict_keep['ZAMS_EEP'], + iams=fmt_dict_keep['IAMS_EEP'], + tams=fmt_dict_keep['TAMS_EEP'], + bgb=fmt_dict_keep['BGB_EEP'], + cheign=fmt_dict_keep['cHeIgnition_EEP'], + cheburn=fmt_dict_keep['cHeBurn_EEP'], + ta_cheb=fmt_dict_keep['TA_cHeB_EEP'], + tpagb=fmt_dict_keep['TPAGB_EEP'], + ccburn=fmt_dict_keep['cCBurn_EEP'], + postagb=fmt_dict_keep['post_AGB_EEP'], + initeep=fmt_dict_keep['Initial_EEP'], + finaleep=fmt_dict_keep['Final_EEP'], + fixtrack=fmt_dict_keep['fix_track'], + loweep=fmt_dict_keep['low_mass_final_eep'], + higheep=fmt_dict_keep['high_mass_final_eep'], + age_col=fmt_dict_keep['age_colname'], + mass_col=fmt_dict_keep['mass_colname'], + logl_col=fmt_dict_keep['log_L_colname'], + logt_col=fmt_dict_keep['log_T_colname'], + logr_col=fmt_dict_keep['log_R_colname'], + he_mass_col=fmt_dict_keep['he_core_mass'], + co_mass_col=fmt_dict_keep['co_core_mass'], + he_radius_col=fmt_dict_keep['he_core_radius'], + co_radius_col=fmt_dict_keep['co_core_radius'], + mass_env_col=fmt_dict_keep['mass_conv_envelope'], + radius_env_col=fmt_dict_keep['radius_conv_envelope'], + logtc_col=fmt_dict_keep['log_Tc'], + he4_col=fmt_dict_keep['He4_mass_frac'], + c12_col=fmt_dict_keep['c12_mass_frac'], + o16_col=fmt_dict_keep['o16_mass_frac'] + ) + + # Next pass the format dictionaries: + _evolvebin.c_m_interface.set_format_controls_he( + read_eep=fmt_dict_he_keep['read_eep_files'], + bgb=fmt_dict_he_keep['BGB_EEP'], + cheburn=fmt_dict_he_keep['cHeBurn_EEP'], + ta_cheb=fmt_dict_he_keep['TA_cHeB_EEP'], + tpagb=fmt_dict_he_keep['TPAGB_EEP'], + ccburn=fmt_dict_he_keep['cCBurn_EEP'], + postagb=fmt_dict_he_keep['post_AGB_EEP'], + initeep=fmt_dict_he_keep['Initial_EEP'], + finaleep=fmt_dict_he_keep['Final_EEP'], + fixtrack=fmt_dict_he_keep['fix_track'], + loweep=fmt_dict_he_keep['low_mass_final_eep'], + higheep=fmt_dict_he_keep['high_mass_final_eep'], + age_col=fmt_dict_he_keep['age_colname'], + mass_col=fmt_dict_he_keep['mass_colname'], + logl_col=fmt_dict_he_keep['log_L_colname'], + logt_col=fmt_dict_he_keep['log_T_colname'], + logr_col=fmt_dict_he_keep['log_R_colname'], + he_mass_col=fmt_dict_he_keep['he_core_mass'], + co_mass_col=fmt_dict_he_keep['co_core_mass'], + he_radius_col=fmt_dict_he_keep['he_core_radius'], + co_radius_col=fmt_dict_he_keep['co_core_radius'], + mass_env_col=fmt_dict_he_keep['mass_conv_envelope'], + radius_env_col=fmt_dict_he_keep['radius_conv_envelope'], + logtc_col=fmt_dict_he_keep['log_Tc'], + he4_col=fmt_dict_he_keep['He4_mass_frac'], + c12_col=fmt_dict_he_keep['c12_mass_frac'], + o16_col=fmt_dict_he_keep['o16_mass_frac'] + ) + + # Finally, load in the EEPs! + tracks_h = utils.read_eep_directory(h_eep_tracks) + _ = populate_tracks(tracks_h, is_he=False) + + tracks_he = utils.read_eep_directory(he_eep_tracks) + _ = populate_tracks(tracks_he, is_he=True) + + return None + + +def populate_tracks(track_list, is_he=False): + """ + Populate Fortran track data structures from a list of Python track dictionaries + and pass them to the COSMIC Fortran backend. + + Parameters + ---------- + track_list : list of dict + Each dictionary must contain the following keys: + - 'filename' : str + - 'initial_mass' : float + - 'initial_Y' : float + - 'initial_Z' : float + - 'Fe_div_H' : float + - 'alpha_div_Fe' : float + - 'v_div_vcrit' : float + - 'ntrack' : int + - 'neep' : int + - 'ncol' : int + - 'eep' : array-like of shape (neep,) + - 'tr' : array-like of shape (ncol, ntrack) + - 'cols' : list of str of length ncol + Optional key: + - 'is_he_track' : bool + + is_he : bool, default=False + Indicates whether the tracks are helium-enriched. + + Returns + ------- + None + The function calls the Fortran subroutine `_evolvebin.c_m_interface.set_tracks_from_python` + and populates the Fortran-side track arrays. The Python-side arrays are used only + as temporary buffers for the call. + """ + ntracks = len(track_list) + col_width = 32 # must match Fortran CHARACTER(len=32) + + # Allocate arrays + filenames = np.array([t['filename'].encode('ascii') for t in track_list], dtype='S256') + initial_mass = np.array([t['initial_mass'] for t in track_list], dtype=np.float64) + initial_Y = np.array([t['initial_Y'] for t in track_list], dtype=np.float64) + initial_Z = np.array([t['initial_Z'] for t in track_list], dtype=np.float64) + Fe_div_H = np.array([t['Fe_div_H'] for t in track_list], dtype=np.float64) + alpha_div_Fe = np.array([t['alpha_div_Fe'] for t in track_list], dtype=np.float64) + v_div_vcrit = np.array([t['v_div_vcrit'] for t in track_list], dtype=np.float64) + ntrack_arr = np.array([t['ntrack'] for t in track_list], dtype=np.int32) + neep_arr = np.array([t['neep'] for t in track_list], dtype=np.int32) + ncol_arr = np.array([t['ncol'] for t in track_list], dtype=np.int32) + is_he_arr = np.array([t.get('is_he_track', is_he) for t in track_list], dtype=np.bool_) + + # Determine max sizes + max_neep = max(neep_arr) + max_ncol = max(ncol_arr) + max_ntrack = sum(ntrack_arr) + + # Prepare 2D arrays + eep_data = np.zeros((max_neep, ntracks), dtype=np.int32, order='F') + tr_data = np.zeros((max_ncol, max_ntrack), dtype=np.float64, order='F') + col_names = np.full((max_ncol, ntracks), b' ' * col_width, dtype=f'S{col_width}', order='F') + + # Fill arrays + offset = 0 + for i, t in enumerate(track_list): + eep_data[:t['neep'], i] = t['eep'] + tr_data[:t['ncol'], offset:offset+t['ntrack']] = t['tr'] + for j, col in enumerate(t['cols']): + s = col.encode('ascii')[:col_width] # truncate if too long + col_names[j, i] = s.ljust(col_width, b' ') # pad with spaces + offset += t['ntrack'] + + # Call Fortran + _evolvebin.c_m_interface.set_tracks_from_python( + filenames, initial_mass, initial_Y, initial_Z, + Fe_div_H, alpha_div_Fe, v_div_vcrit, + ntrack_arr, neep_arr, ncol_arr, is_he_arr, + eep_data, tr_data, col_names, is_he + ) + + return None + + + + \ No newline at end of file diff --git a/src/cosmic/src/METISSE b/src/cosmic/src/METISSE index ede9767e3..84e50fa46 160000 --- a/src/cosmic/src/METISSE +++ b/src/cosmic/src/METISSE @@ -1 +1 @@ -Subproject commit ede9767e33696f9b8b00806fcb97a7e12b392be3 +Subproject commit 84e50fa46dea9d84a713c12e825ce95591b0592d diff --git a/src/cosmic/src/evolv2.f b/src/cosmic/src/evolv2.f index 4de09f462..692f24c77 100644 --- a/src/cosmic/src/evolv2.f +++ b/src/cosmic/src/evolv2.f @@ -4670,8 +4670,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, bpp_index_out = jp kick_info_out = kick_info endif - if (using_METISSE.eq.1) call dealloc_track() - + if (using_METISSE.eq.1) call dealloc_track() * END SUBROUTINE evolv2 diff --git a/src/cosmic/src/hrdiag.f b/src/cosmic/src/hrdiag.f index 02d437ec1..c86ca3513 100644 --- a/src/cosmic/src/hrdiag.f +++ b/src/cosmic/src/hrdiag.f @@ -11,7 +11,6 @@ SUBROUTINE hrdiag(mass,aj,mt,tm,tn,tscls,lums,GB,zpars, real*8 r,lum,mc,rc,menv,renv,k2,mcx if (using_METISSE.eq.1) then - !WRITE(*,*) 'Calling METISSE_hrdiag' CALL METISSE_hrdiag(mass,aj,mt,tm,tn,tscls,lums,GB,zpars, & r,lum,kw,mc,rc,menv,renv,k2, & mcx,id) diff --git a/src/cosmic/utils.py b/src/cosmic/utils.py index b01439236..c78ccf56d 100644 --- a/src/cosmic/utils.py +++ b/src/cosmic/utils.py @@ -30,6 +30,8 @@ import itertools import os.path import glob +import re +from pathlib import Path from configparser import ConfigParser from .bse_utils.zcnsts import zcnsts @@ -60,7 +62,12 @@ "get_FeH_from_Z", "get_binfrac_of_Z", "get_porb_norm", - "get_met_dep_binfrac" + "get_met_dep_binfrac", + "get_METISSE_files", + "read_metallicity_and_format", + "read_eep_file", + "read_eep_directory", + "to_f2py_str_array" ] @@ -1910,6 +1917,251 @@ def _eval(node): return BSEDict, SSEDict, seed_int, filters, convergence, sampling +def get_METISSE_files(path_to_tracks, path_to_he_tracks): + """Returns the path to the METISSE files + + Parameters + ---------- + path_to_tracks : str + Path to the directory containing the METISSE tracks. + path_to_he_tracks : str + Path to the directory containing the METISSE He tracks. + + Returns + ------- + eep_tracks : list + List of paths to the METISSE EEP tracks + he_eep_tracks : list + List of paths to the METISSE helium EEP tracks + met_files : list + List of paths to the METISSE metallicity files for hydrogen tracks + met_files_he : list + List of paths to the METISSE He metallicity files for helium trakcs + """ + import os + + path_to_tracks = Path(path_to_tracks) + path_to_he_tracks = Path(path_to_he_tracks) + + # first find all the EEPs in the specified directories + eep_dir = path_to_tracks / "eeps/" + he_eep_dir = path_to_he_tracks / "eeps/" + h_eep_tracks = [os.path.join(eep_dir, f) for f in os.listdir(eep_dir) if f.endswith("data.eep")] + he_eep_tracks = [os.path.join(he_eep_dir, f) for f in os.listdir(he_eep_dir) if f.endswith("data.eep")] + + if len(h_eep_tracks) == 0: + raise ValueError("No METISSE tracks found in the specified path: {0}".format(eep_dir)) + if len(he_eep_tracks) == 0: + raise ValueError("No METISSE He tracks found in the specified path: {0}".format(he_eep_dir)) + + # Next also get the Metallicity files + met_files = [os.path.join(path_to_tracks, f) for f in os.listdir(path_to_tracks) if f.endswith("metallicity.in")] + met_files_he = [os.path.join(path_to_he_tracks, f) for f in os.listdir(path_to_he_tracks) if f.endswith("metallicity.in")] + + if len(met_files) == 0: + raise ValueError("No METISSE metallicity files found in the specified path: {0}".format(path_to_tracks)) + if len(met_files_he) == 0: + raise ValueError("No METISSE He metallicity files found in the specified path: {0}".format(path_to_he_tracks)) + + return h_eep_tracks, he_eep_tracks, met_files, met_files_he + + +def read_metallicity_and_format(met_file_path): + """ + Read a metallicity namelist and its associated format file. + + Parameters + ---------- + met_file_path : str or Path + Path to the metallicity file (*.in). + + Returns + ------- + met_dict : dict + Dictionary containing metallicity options, e.g., + 'eep_tracks_dir', 'Z_files', 'format_file', etc. Paths are converted to Path objects. + fmt_dict : dict + Dictionary containing format file options, e.g., column names, EEP stages, flags. + + Notes + ----- + - Booleans (.true./.false.) are converted to Python True/False. + - Fortran-style scientific notation with 'd' (e.g., 1.23d-04) is converted to float. + - Strings in quotes are stripped of the quotes. + - Stops parsing at the Fortran namelist terminator '/'. + """ + met_file_path = Path(met_file_path) + + # --- Read metallicity file --- + met_dict = {} + with open(met_file_path, 'r') as f: + for line in f: + line = line.split('!')[0].strip() # remove comments + if not line: + continue + if line == '/': + break + m = re.match(r'(\w+)\s*=\s*(.*)', line) + if m: + key, value = m.groups() + value = value.strip() + # Convert numbers + try: + value_num = float(value.replace('d','e').replace('D','e')) + met_dict[key] = value_num + except ValueError: + met_dict[key] = value.strip("'\"") # keep strings + + # Convert paths to Path objects relative to metallicity file + if 'eep_tracks_dir' in met_dict: + met_dict['eep_tracks_dir'] = met_file_path.parent / met_dict['eep_tracks_dir'] + if 'format_file' in met_dict: + met_dict['format_file'] = met_file_path.parent / met_dict['format_file'] + + # --- Read format file --- + fmt_dict = {} + format_file_path = met_dict['format_file'] + with open(format_file_path, 'r') as f: + for line in f: + line = line.split('!')[0].strip() + if not line: + continue + if line == '/': + break + m = re.match(r'(\w+)\s*=\s*(.*)', line) + if m: + key, value = m.groups() + value = value.strip() + + # Booleans + if value.lower() == '.true.': + fmt_dict[key] = True + elif value.lower() == '.false.': + fmt_dict[key] = False + # Strings in quotes + elif (value.startswith("'") and value.endswith("'")) or \ + (value.startswith('"') and value.endswith('"')): + fmt_dict[key] = value[1:-1] + else: + # Numeric: convert Fortran 'd' notation to float + try: + fmt_dict[key] = float(value.replace('d','e').replace('D','e')) + # convert integer-looking floats to int + if fmt_dict[key].is_integer(): + fmt_dict[key] = int(fmt_dict[key]) + except ValueError: + fmt_dict[key] = value # fallback + + return met_dict, fmt_dict + + +def read_eep_file(eep_path): + track = {} + track['filename'] = str(eep_path) + + with eep_path.open() as f: + # Read lines sequentially to mimic Fortran + version_line = f.readline() + track['version_string'] = version_line[25:33].strip() # 25x,a8 + + rev_line = f.readline() + track['MESA_revision_number'] = int(rev_line[25:33].strip()) # 25x,i8 + + f.readline() # comment line + f.readline() # comment line + + # Composition line + comp_line = f.readline() + values = comp_line.split() + track['initial_Y'] = float(values[1]) + track['initial_Z'] = float(values[2]) + track['Fe_div_H'] = float(values[3]) + track['alpha_div_Fe'] = float(values[4]) + track['v_div_vcrit'] = float(values[5]) + + f.readline() # comment line + f.readline() # comment line + + # Track info line + info_line = f.readline() + track['initial_mass'] = float(info_line[2:18].strip()) + track['ntrack'] = int(info_line[18:26].strip()) + track['neep'] = int(info_line[26:34].strip()) + track['ncol'] = int(info_line[34:42].strip()) + track['phase_info'] = info_line[42:50].strip() + track['type_label'] = info_line[50:65].strip() + + # EEP lines + eep_line = f.readline() + track['eep'] = np.array([int(x) for x in eep_line.split()[2:]], dtype=int) + + f.readline() # comment line + f.readline() # column numbers line + + # Column names line + cols_line = f.readline() + track['cols'] = cols_line.split()[1:] # list of strings start at 1 to skip # symbol + + # track data + tr = np.zeros((track['ncol'], track['ntrack']), dtype=float) + for j in range(track['ntrack']): + data_line = f.readline() + values = [float(x) for x in data_line.split()] + tr[:, j] = values[:track['ncol']] + track['tr'] = tr + + return track + + + +def read_eep_directory(eep_files, pattern="*.eep"): + """ + Read all EEP files in a directory matching the given pattern and sort by + the leading number in the filename. + + Parameters + ---------- + eep_files : list + list of all files in the eep directory + + Returns + ------- + tracks : list of dict + List of track dictionaries, each as returned by `read_eep_file`, + sorted by the leading number in the filename. + """ + # Convert all to Path objects + eep_files = [Path(f) for f in eep_files] + + # Sort files by the leading number in the filename + def extract_mass(f): + # Get the first integer before the first underscore + return int(f.stem.split('_')[0]) + + eep_files_sorted = sorted(eep_files, key=extract_mass) + tracks = [read_eep_file(f) for f in eep_files_sorted] + return tracks + + +def to_f2py_str_array(pylist, maxlen=256): + """ + Convert Python list of strings to NumPy array of fixed-length strings + for F2PY. + + Parameters + ---------- + pylist : list of str + Strings to convert. + maxlen : int + Max length for Fortran strings. + + Returns + ------- + np.ndarray + Array of dtype S{maxlen} + """ + return np.array(pylist, dtype=f"S{maxlen}") + class VariableKey(object): """ @@ -1924,4 +2176,4 @@ def __eq__(self, compare): return compare.__class__ == self.__class__ and compare.name == self.name def __hash__(self): - return hash(self.name) + return hash(self.name) \ No newline at end of file From e89b06acac1f2ce738f14c92ef527ecca3d1ddfc Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Tue, 26 Aug 2025 07:05:49 -0500 Subject: [PATCH 33/46] Update METISSE submodule to latest develop --- src/cosmic/src/METISSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cosmic/src/METISSE b/src/cosmic/src/METISSE index 84e50fa46..d58a73ed5 160000 --- a/src/cosmic/src/METISSE +++ b/src/cosmic/src/METISSE @@ -1 +1 @@ -Subproject commit 84e50fa46dea9d84a713c12e825ce95591b0592d +Subproject commit d58a73ed57695ac76fedf024a82c8714b8ba4dc3 From 9483ac5b01ad42fe088018cddc1fd431f20ae3eb Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Tue, 26 Aug 2025 08:14:18 -0500 Subject: [PATCH 34/46] now using paths in case the user wants to use them. Also handles strings --- src/cosmic/evolve.py | 11 ++++++++--- src/cosmic/utils.py | 8 +++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/cosmic/evolve.py b/src/cosmic/evolve.py index 9f437810a..29d395b4b 100644 --- a/src/cosmic/evolve.py +++ b/src/cosmic/evolve.py @@ -32,6 +32,7 @@ import os import sys import tqdm +from pathlib import Path try: import multiprocessing multiprocessing.set_start_method("fork") @@ -706,11 +707,11 @@ def set_metisse_interface(path_to_tracks, path_to_he_tracks, IBT_Z): Parameters ---------- - path_to_tracks : str + path_to_tracks : str or Path Direct path to where all single star data and metallicty/format files are stored for hydrogen-rich stars - path_to_tracks : str + path_to_tracks : str or Path Direct path to where all single star data and metallicty/format files are stored for hydrogen-rich stars @@ -723,6 +724,10 @@ def set_metisse_interface(path_to_tracks, path_to_he_tracks, IBT_Z): """ + # convert to Path + path_to_tracks = Path(path_to_tracks) + path_to_he_tracks = Path(path_to_he_tracks) + # load in the METISSE files l = utils.get_METISSE_files(path_to_tracks, path_to_he_tracks) h_eep_tracks, he_eep_tracks, met_files, met_files_he = l @@ -932,4 +937,4 @@ def populate_tracks(track_list, is_he=False): - \ No newline at end of file + diff --git a/src/cosmic/utils.py b/src/cosmic/utils.py index c78ccf56d..a52435cd0 100644 --- a/src/cosmic/utils.py +++ b/src/cosmic/utils.py @@ -1127,7 +1127,8 @@ def error_check(BSEDict, SSEDict, filters=None, convergence=None, sampling=None) ) ) else: - metallicity_file = glob.glob(SSEDict[flag]+'/*_metallicity.in') + path = Path(SSEDict[flag]) + metallicity_file = list(path.glob('*_metallicity.in')) if metallicity_file == []: raise ValueError( "No metallicity file found in {0}. Make sure that {1} is valid".format ( @@ -1151,7 +1152,8 @@ def error_check(BSEDict, SSEDict, filters=None, convergence=None, sampling=None) ) ) else: - metallicity_file = glob.glob(SSEDict[flag]+'/*_metallicity.in') + path = Path(SSEDict[flag]) + metallicity_file = list(path.glob('*_metallicity.in')) if metallicity_file == []: raise ValueError( "No metallicity file for helium star tracks found in {0}. Make sure that {1} is valid".format ( @@ -2176,4 +2178,4 @@ def __eq__(self, compare): return compare.__class__ == self.__class__ and compare.name == self.name def __hash__(self): - return hash(self.name) \ No newline at end of file + return hash(self.name) From 417c1bca86285bef9d8be769e199213ec85ca6bf Mon Sep 17 00:00:00 2001 From: Duncan B Maclean <146674933+d-maclean@users.noreply.github.com> Date: Tue, 26 Aug 2025 14:12:54 -0500 Subject: [PATCH 35/46] now read METISSE eeps based on the path specified in METISSE metallicity files (#715) --- src/cosmic/evolve.py | 42 +++++++++++++++++++---------- src/cosmic/utils.py | 63 +++++++++++++++++++++++++++++++++++--------- 2 files changed, 79 insertions(+), 26 deletions(-) diff --git a/src/cosmic/evolve.py b/src/cosmic/evolve.py index 29d395b4b..6b076e5e8 100644 --- a/src/cosmic/evolve.py +++ b/src/cosmic/evolve.py @@ -248,6 +248,7 @@ def evolve(self, initialbinarytable, pool=None, bpp_columns=None, bcm_columns=No # NUMBER 1: PASS A DICTIONARY OF FLAGS BSEDict = kwargs.pop('BSEDict', {}) SSEDict = kwargs.pop('SSEDict', {}) + metisse_metallicity_tolerance = kwargs.pop('metisse_metallicity_tolerance', 1e-6) # NUMBER 2: PASS A PANDAS DATA FRAME WITH PARAMS DEFINED AS COLUMNS @@ -315,7 +316,8 @@ def evolve(self, initialbinarytable, pool=None, bpp_columns=None, bcm_columns=No _ = set_metisse_interface( path_to_tracks=SSEDict['path_to_tracks'], path_to_he_tracks=SSEDict['path_to_he_tracks'], - IBT_Z=initialbinarytable['metallicity'].iloc[0] + IBT_Z=initialbinarytable['metallicity'].iloc[0], + Z_tolerance=metisse_metallicity_tolerance ) @@ -345,7 +347,8 @@ def evolve(self, initialbinarytable, pool=None, bpp_columns=None, bcm_columns=No _ = set_metisse_interface( path_to_tracks=initialbinarytable['path_to_tracks'].iloc[0], path_to_he_tracks=initialbinarytable['path_to_he_tracks'].iloc[0], - IBT_Z=initialbinarytable['metallicity'].iloc[0] + IBT_Z=initialbinarytable['metallicity'].iloc[0], + Z_tolerance=metisse_metallicity_tolerance ) @@ -702,7 +705,7 @@ def _evolve_multi_system(f): raise -def set_metisse_interface(path_to_tracks, path_to_he_tracks, IBT_Z): +def set_metisse_interface(path_to_tracks, path_to_he_tracks, IBT_Z, Z_tolerance): """load in the metallicity, format, and eep files Parameters @@ -737,30 +740,41 @@ def set_metisse_interface(path_to_tracks, path_to_he_tracks, IBT_Z): met_dict_keep = None fmt_dict_keep = None mets = [] - for m in met_files: + Z_idx = -1 + for i, m in enumerate(met_files): met_dict, fmt_dict = utils.read_metallicity_and_format(m) mets.append(met_dict['Z_files']) - if met_dict['Z_files'] == IBT_Z: + if np.abs(met_dict['Z_files'] - IBT_Z) < Z_tolerance: met_dict_keep = met_dict fmt_dict_keep = fmt_dict + Z_idx = i if met_dict_keep is None: raise ValueError("No metallicity file found that matches the metallicity " "in the initial binary table. Please check the metallicity " "and supply one that is in this list: {0}".format(mets)) - # loop over the hydrogen metallicity files to find the one that is the closest + # loop over the helium metallicity files to find the one that is the closest # to the metallicity in the initial binary table met_dict_he_keep = None fmt_dict_he_keep = None - for m in met_files_he: + Z_idx_he = -1 + for i, m in enumerate(met_files_he): met_dict, fmt_dict = utils.read_metallicity_and_format(m) - if met_dict['Z_files'] == IBT_Z: + if np.abs(met_dict['Z_files'] - IBT_Z) < Z_tolerance: met_dict_he_keep = met_dict fmt_dict_he_keep = fmt_dict + Z_idx_he = i + + if Z_idx == -1 or Z_idx_he == -1: + raise ValueError(f"No metallicities found in range for {IBT_Z}!") # Convert Python lists to fixed-length NumPy arrays - h_eep_np = utils.to_f2py_str_array(h_eep_tracks) - he_eep_np = utils.to_f2py_str_array(he_eep_tracks) + h_eep_np = [] + he_eep_np = [] + for ls in h_eep_tracks: + h_eep_np.append(utils.to_f2py_str_array(ls)) + for ls in he_eep_tracks: + he_eep_np.append(utils.to_f2py_str_array(ls)) met_np = utils.to_f2py_str_array(met_files) met_he_np = utils.to_f2py_str_array(met_files_he) z_list_h = utils.to_f2py_str_array(met_dict_keep['Z_files']) @@ -773,8 +787,8 @@ def set_metisse_interface(path_to_tracks, path_to_he_tracks, IBT_Z): _evolvebin.c_m_interface.set_file_lists( met_np, # met_files met_he_np, # met_he_files - h_eep_np, # h_tracks - he_eep_np # he_tracks + h_eep_np[Z_idx], # h_tracks + he_eep_np[Z_idx_he] # he_tracks ) # Next pass the format dictionaries: @@ -845,10 +859,10 @@ def set_metisse_interface(path_to_tracks, path_to_he_tracks, IBT_Z): ) # Finally, load in the EEPs! - tracks_h = utils.read_eep_directory(h_eep_tracks) + tracks_h = utils.read_eep_directory(h_eep_tracks[Z_idx]) _ = populate_tracks(tracks_h, is_he=False) - tracks_he = utils.read_eep_directory(he_eep_tracks) + tracks_he = utils.read_eep_directory(he_eep_tracks[Z_idx_he]) _ = populate_tracks(tracks_he, is_he=True) return None diff --git a/src/cosmic/utils.py b/src/cosmic/utils.py index a52435cd0..35340b2ed 100644 --- a/src/cosmic/utils.py +++ b/src/cosmic/utils.py @@ -1944,19 +1944,9 @@ def get_METISSE_files(path_to_tracks, path_to_he_tracks): path_to_tracks = Path(path_to_tracks) path_to_he_tracks = Path(path_to_he_tracks) - - # first find all the EEPs in the specified directories - eep_dir = path_to_tracks / "eeps/" - he_eep_dir = path_to_he_tracks / "eeps/" - h_eep_tracks = [os.path.join(eep_dir, f) for f in os.listdir(eep_dir) if f.endswith("data.eep")] - he_eep_tracks = [os.path.join(he_eep_dir, f) for f in os.listdir(he_eep_dir) if f.endswith("data.eep")] - - if len(h_eep_tracks) == 0: - raise ValueError("No METISSE tracks found in the specified path: {0}".format(eep_dir)) - if len(he_eep_tracks) == 0: - raise ValueError("No METISSE He tracks found in the specified path: {0}".format(he_eep_dir)) - # Next also get the Metallicity files + h_eep_tracks = [] + he_eep_tracks = [] met_files = [os.path.join(path_to_tracks, f) for f in os.listdir(path_to_tracks) if f.endswith("metallicity.in")] met_files_he = [os.path.join(path_to_he_tracks, f) for f in os.listdir(path_to_he_tracks) if f.endswith("metallicity.in")] @@ -1965,6 +1955,55 @@ def get_METISSE_files(path_to_tracks, path_to_he_tracks): if len(met_files_he) == 0: raise ValueError("No METISSE He metallicity files found in the specified path: {0}".format(path_to_he_tracks)) + for met in met_files: + with open(met, "r") as file: + lines = file.read().splitlines() + eep_path: str | None = None + for l in lines: + if (l.lower().find("eep_tracks_dir") != -1): + eep_path = l.split("=")[-1].strip()[1:-1] + break + if eep_path is None: raise ValueError(f"No eep_tracks_dir found in {met}. Is this a valid metallicity file?") + if eep_path.startswith(os.path.sep): + eep_pattern = os.path.join(eep_path, "*.eep") + else: + eep_pattern = os.path.join(path_to_tracks, eep_path, "*.eep") + eeps = glob.glob(eep_pattern) + if len(eeps) == 0: + raise ValueError(f"No METISSE tracks found in the specified path: {eep_pattern}") + h_eep_tracks.append(eeps.copy()) + for met in met_files_he: + with open(met, "r") as file: + lines = file.read().splitlines() + eep_path: str | None = None + for l in lines: + if (l.lower().find("eep_tracks_dir") != -1): + eep_path = l.split("=")[-1].strip()[1:-1] + break + if eep_path is None: raise ValueError(f"No eep_tracks_dir found in {met}. Is this a valid metallicity file?") + if eep_path.startswith(os.path.sep): + eep_pattern = os.path.join(eep_path, "*.eep") + else: + eep_pattern = os.path.join(path_to_he_tracks, eep_path, "*.eep") + eeps = glob.glob(eep_pattern) + if len(eeps) == 0: + raise ValueError(f"No METISSE tracks found in the specified path: {eep_pattern}") + he_eep_tracks.append(eeps.copy()) + + # first find all the EEPs in the specified directories + #eep_dir = path_to_tracks #/ "eeps/" + #he_eep_dir = path_to_he_tracks #/ "eeps/" + #h_eep_tracks = glob.glob(os.path.join(eep_dir, "*.eep"), recursive=True) #[os.path.join(eep_dir, f) for f in os.listdir(eep_dir) if f.endswith("data.eep")] + #he_eep_tracks = glob.glob(os.path.join(he_eep_dir, "*.eep"), recursive=True) #[os.path.join(he_eep_dir, f) for f in os.listdir(he_eep_dir) if f.endswith("data.eep")] + + if len(h_eep_tracks) == 0: + raise ValueError("No METISSE tracks found in the specified path.") #:{0}".format(eep_dir)) + if len(he_eep_tracks) == 0: + raise ValueError("No METISSE He tracks found in the specified path.")#:{0}".format(he_eep_dir)) + + # Next also get the Metallicity files + + return h_eep_tracks, he_eep_tracks, met_files, met_files_he From dd1c3f8a230415de45d6fbb56e8e75ba256a16c8 Mon Sep 17 00:00:00 2001 From: Duncan B Maclean <146674933+d-maclean@users.noreply.github.com> Date: Mon, 1 Sep 2025 09:59:23 -0400 Subject: [PATCH 36/46] Capture & Recycle zpars for METISSE (#716) * now read METISSE eeps based on the path specified in METISSE metallicity files * add mechanism to capture and recycle zpars --- src/cosmic/evolve.py | 23 ++++++++++++++++------- src/cosmic/src/evolv2.f | 2 +- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/cosmic/evolve.py b/src/cosmic/evolve.py index 6b076e5e8..97e8d9701 100644 --- a/src/cosmic/evolve.py +++ b/src/cosmic/evolve.py @@ -32,6 +32,7 @@ import os import sys import tqdm +from functools import partial from pathlib import Path try: import multiprocessing @@ -478,6 +479,9 @@ def evolve(self, initialbinarytable, pool=None, bpp_columns=None, bcm_columns=No initial_conditions[i]["n_col_bcm"] = len(bcm_columns) initial_conditions[i]["col_inds_bcm"] = col_inds_bcm + # evolve one system to get zpars + _, _, _, _, _, zpars = _evolve_single_system(initial_conditions[0], None) + # check if a pool was passed if pool is None: with MultiPool(processes=nproc) as pool: @@ -493,7 +497,8 @@ def evolve(self, initialbinarytable, pool=None, bpp_columns=None, bcm_columns=No itr_block = itr_next output = list(pool.map(_evolve_multi_system, initial_conditions_blocked)) else: - output = list(pool.map(_evolve_single_system, initial_conditions)) + evolve_args = partial(_evolve_single_system, zpars=zpars) + output = list(pool.map(evolve_args, initial_conditions)) else: # evolve systems if n_per_block > 0: @@ -507,7 +512,8 @@ def evolve(self, initialbinarytable, pool=None, bpp_columns=None, bcm_columns=No itr_block = itr_next output = list(pool.map(_evolve_multi_system, initial_conditions_blocked)) else: - output = list(pool.map(_evolve_single_system, initial_conditions)) + evolve_args = partial(_evolve_single_system, zpars=zpars) + output = list(pool.map(evolve_args, initial_conditions)) output = np.array(output, dtype=object) bpp_arrays = np.vstack(output[:, 1]) @@ -549,7 +555,9 @@ def evolve(self, initialbinarytable, pool=None, bpp_columns=None, bcm_columns=No return bpp, bcm, initialbinarytable, kick_info -def _evolve_single_system(f): +def _evolve_single_system(f, zpars=None): + if zpars is None: + zpars = np.zeros(20, dtype=float) try: f["kick_info"] = np.zeros((2, len(KICK_COLUMNS)-1)) # determine if we already have a compact object, if yes than one SN has already occured @@ -639,7 +647,7 @@ def _evolve_single_system(f): _evolvebin.col.n_col_bcm = f["n_col_bcm"] _evolvebin.col.col_inds_bcm = f["col_inds_bcm"] - [bpp_index, bcm_index, kick_info] = _evolvebin.evolv2([f["kstar_1"], f["kstar_2"]], + [zpars, bpp_index, bcm_index, kick_info] = _evolvebin.evolv2([f["kstar_1"], f["kstar_2"]], [f["mass_1"], f["mass_2"]], f["porb"], f["ecc"], f["metallicity"], f["tphysf"], f["dtp"], @@ -658,7 +666,7 @@ def _evolve_single_system(f): [f["tms_1"], f["tms_2"]], [f["bhspin_1"], f["bhspin_2"]], f["tphys"], - np.zeros(20), + zpars, np.zeros(20), f["kick_info"]) @@ -674,7 +682,7 @@ def _evolve_single_system(f): bcm = np.hstack((bcm, np.ones((bcm.shape[0], 1))*f["bin_num"])) kick_info = np.hstack((kick_info, np.ones((kick_info.shape[0], 1))*f["bin_num"])) - return f, bpp, bcm, kick_info, _evolvebin.snvars.natal_kick_array.copy() + return f, bpp, bcm, kick_info, _evolvebin.snvars.natal_kick_array.copy(), zpars except Exception as e: print(e) @@ -683,6 +691,7 @@ def _evolve_single_system(f): def _evolve_multi_system(f): try: + zpars = np.zeros(20, dtype=float) res_bcm = np.zeros(f.shape[0], dtype=object) res_bpp = np.zeros(f.shape[0], dtype=object) res_kick_info = np.zeros(f.shape[0], dtype=object) @@ -690,7 +699,7 @@ def _evolve_multi_system(f): for i in range(0, f.shape[0]): # call evolve single system - _, bpp, bcm, kick_info, _ = _evolve_single_system(f[i]) + _, bpp, bcm, kick_info, _, zpars = _evolve_single_system(f[i], zpars=zpars) # add results to pre-allocated list res_bpp[i] = bpp diff --git a/src/cosmic/src/evolv2.f b/src/cosmic/src/evolv2.f index 692f24c77..5fed3d933 100644 --- a/src/cosmic/src/evolv2.f +++ b/src/cosmic/src/evolv2.f @@ -240,7 +240,7 @@ SUBROUTINE evolv2(kstar,mass,tb,ecc,z,tphysf, Cf2py intent(in) tms Cf2py intent(in) bhspin Cf2py intent(in) tphys -Cf2py intent(in) zpars +Cf2py intent(in,out) zpars Cf2py intent(in) bkick Cf2py intent(in) kick_info Cf2py intent(out) bpp_index_out From 0d174efef30ac7ba4f2baf630ab288f3aacaa403 Mon Sep 17 00:00:00 2001 From: Duncan B Maclean <146674933+d-maclean@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:05:57 -0400 Subject: [PATCH 37/46] Add COSMIC-METISSE interface to the independent sampler (#717) * now read METISSE eeps based on the path specified in METISSE metallicity files * add mechanism to capture and recycle zpars * add c_m_interface initialization to independent sampler -- necessary for METISSE * revised z_accuracy_limit to align with METISSE's method --- src/cosmic/evolve.py | 22 ++++++++++++---------- src/cosmic/sample/sampler/independent.py | 17 ++++++++++++++--- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/src/cosmic/evolve.py b/src/cosmic/evolve.py index 97e8d9701..c62900f02 100644 --- a/src/cosmic/evolve.py +++ b/src/cosmic/evolve.py @@ -249,7 +249,7 @@ def evolve(self, initialbinarytable, pool=None, bpp_columns=None, bcm_columns=No # NUMBER 1: PASS A DICTIONARY OF FLAGS BSEDict = kwargs.pop('BSEDict', {}) SSEDict = kwargs.pop('SSEDict', {}) - metisse_metallicity_tolerance = kwargs.pop('metisse_metallicity_tolerance', 1e-6) + z_accuracy_limit = kwargs.pop('METISSE_z_accuracy_limit', 1e-2) # NUMBER 2: PASS A PANDAS DATA FRAME WITH PARAMS DEFINED AS COLUMNS @@ -318,7 +318,7 @@ def evolve(self, initialbinarytable, pool=None, bpp_columns=None, bcm_columns=No path_to_tracks=SSEDict['path_to_tracks'], path_to_he_tracks=SSEDict['path_to_he_tracks'], IBT_Z=initialbinarytable['metallicity'].iloc[0], - Z_tolerance=metisse_metallicity_tolerance + z_accuracy_limit=z_accuracy_limit ) @@ -349,7 +349,7 @@ def evolve(self, initialbinarytable, pool=None, bpp_columns=None, bcm_columns=No path_to_tracks=initialbinarytable['path_to_tracks'].iloc[0], path_to_he_tracks=initialbinarytable['path_to_he_tracks'].iloc[0], IBT_Z=initialbinarytable['metallicity'].iloc[0], - Z_tolerance=metisse_metallicity_tolerance + z_accuracy_limit=z_accuracy_limit ) @@ -714,7 +714,7 @@ def _evolve_multi_system(f): raise -def set_metisse_interface(path_to_tracks, path_to_he_tracks, IBT_Z, Z_tolerance): +def set_metisse_interface(path_to_tracks, path_to_he_tracks, IBT_Z, z_accuracy_limit): """load in the metallicity, format, and eep files Parameters @@ -753,11 +753,11 @@ def set_metisse_interface(path_to_tracks, path_to_he_tracks, IBT_Z, Z_tolerance) for i, m in enumerate(met_files): met_dict, fmt_dict = utils.read_metallicity_and_format(m) mets.append(met_dict['Z_files']) - if np.abs(met_dict['Z_files'] - IBT_Z) < Z_tolerance: + if abs(met_dict['Z_files'] - IBT_Z)/min(met_dict['Z_files'], IBT_Z) <= z_accuracy_limit: met_dict_keep = met_dict fmt_dict_keep = fmt_dict Z_idx = i - if met_dict_keep is None: + if met_dict_keep is None or fmt_dict_keep is None: raise ValueError("No metallicity file found that matches the metallicity " "in the initial binary table. Please check the metallicity " "and supply one that is in this list: {0}".format(mets)) @@ -769,13 +769,14 @@ def set_metisse_interface(path_to_tracks, path_to_he_tracks, IBT_Z, Z_tolerance) Z_idx_he = -1 for i, m in enumerate(met_files_he): met_dict, fmt_dict = utils.read_metallicity_and_format(m) - if np.abs(met_dict['Z_files'] - IBT_Z) < Z_tolerance: + if abs(met_dict['Z_files'] - IBT_Z)/min(met_dict['Z_files'], IBT_Z) <= z_accuracy_limit: met_dict_he_keep = met_dict fmt_dict_he_keep = fmt_dict Z_idx_he = i - - if Z_idx == -1 or Z_idx_he == -1: - raise ValueError(f"No metallicities found in range for {IBT_Z}!") + if met_dict_he_keep is None or fmt_dict_he_keep is None: + raise ValueError("No metallicity file found that matches the metallicity " + "in the initial binary table. Please check the metallicity " + "and supply one that is in this list: {0}".format(mets)) # Convert Python lists to fixed-length NumPy arrays h_eep_np = [] @@ -800,6 +801,7 @@ def set_metisse_interface(path_to_tracks, path_to_he_tracks, IBT_Z, Z_tolerance) he_eep_np[Z_idx_he] # he_tracks ) + assert fmt_dict_keep is not None and fmt_dict_he_keep is not None # Next pass the format dictionaries: _evolvebin.c_m_interface.set_format_controls_h( read_eep=fmt_dict_keep['read_eep_files'], diff --git a/src/cosmic/sample/sampler/independent.py b/src/cosmic/sample/sampler/independent.py index 35a26bbc7..e2493e822 100644 --- a/src/cosmic/sample/sampler/independent.py +++ b/src/cosmic/sample/sampler/independent.py @@ -307,8 +307,10 @@ def get_independent_sampler( zsun = kwargs.pop("zsun", 0.02) - rad1 = initconditions.set_reff(mass1_binary, metallicity=met, zsun=zsun, SSEDict=SSEDict) - rad2 = initconditions.set_reff(mass2_binary, metallicity=met, zsun=zsun, SSEDict=SSEDict) + # TODO -- figure out how user can pass this + Ztol = 1e-6 + rad1 = initconditions.set_reff(mass1_binary, metallicity=met, zsun=zsun, SSEDict=SSEDict, metisse_metallicity_tolerance=Ztol) + rad2 = initconditions.set_reff(mass2_binary, metallicity=met, zsun=zsun, SSEDict=SSEDict, metisse_metallicity_tolerance=Ztol) # sample periods and eccentricities # if the porb_model is moe19, the metallicity needs to be supplied @@ -1166,7 +1168,7 @@ def set_kstar(self, mass): return kstar - def set_reff(self ,mass, metallicity, zsun=0.02, SSEDict=None): + def set_reff(self ,mass, metallicity, zsun=0.02, SSEDict=None, **kwargs): """ Better way to set the radii from BSE, by calling it directly @@ -1178,7 +1180,9 @@ def set_reff(self ,mass, metallicity, zsun=0.02, SSEDict=None): """ from cosmic import _evolvebin + from cosmic.evolve import set_metisse_interface + z_accuracy_limit = kwargs.get("z_accuracy_limit", 1e-2) max_array_size = 100000 total_length = len(mass) @@ -1200,6 +1204,13 @@ def set_reff(self ,mass, metallicity, zsun=0.02, SSEDict=None): _evolvebin.metissevars.path_to_he_tracks = SSEDict["path_to_he_tracks"] _evolvebin.metissevars.z_match_limit = 1e-2 _evolvebin.metissevars.METISSE_verbose = False + + _ = set_metisse_interface( + path_to_tracks=SSEDict['path_to_tracks'], + path_to_he_tracks=SSEDict['path_to_he_tracks'], + IBT_Z=metallicity, + z_accuracy_limit=z_accuracy_limit + ) else: raise ValueError("Use either 'sse' or 'metisse' as stellar engine") From 7fb8f263ec7349c95c6c27a5f84167f42eca42f9 Mon Sep 17 00:00:00 2001 From: Duncan B Maclean <146674933+d-maclean@users.noreply.github.com> Date: Mon, 1 Sep 2025 10:14:49 -0400 Subject: [PATCH 38/46] Warn user when using cosmic-pop with multidim sampler if `Nstep < nproc^2` (#718) * now read METISSE eeps based on the path specified in METISSE metallicity files * added warning when user uses cosmic-pop with multidim sampling and low Nstep --------- Co-authored-by: Katie Breivik --- bin/cosmic-pop | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/cosmic-pop b/bin/cosmic-pop index ee93b8d68..410775568 100755 --- a/bin/cosmic-pop +++ b/bin/cosmic-pop @@ -298,6 +298,9 @@ if __name__ == '__main__': log_file.write("You have specified both qmin and m2_min.\n") log_file.write("COSMIC will use qmin={} to determine the secondary masses in the initial sample.\n".format(args.qmin)) + if sampling["sampling_method"] == "multidim" and args.Nstep < args.nproc ** 2: + warnings.warn("`Nstep` is less than the square of `nproc`. You will see repeats with multidim sampling. Consider raising `Nstep`.") + while (Nstep < args.Niter) & (np.max(match) > convergence['match']) & ((time.time() - start_time) < args.max_wall_time): # Set random seed such that each iteration gets a unique, determinable seed rand_seed = seed_int + Nstep From 29218bb50ac9bb806e149d9a60be557d13418fd2 Mon Sep 17 00:00:00 2001 From: Duncan B Maclean <146674933+d-maclean@users.noreply.github.com> Date: Tue, 2 Sep 2025 12:35:37 -0400 Subject: [PATCH 39/46] Add `z_accuracy_limit` and `metisse_verbose` to COSMIC & inifile (#719) * added `z_accuracy_limit` and `metisse_verbose` to SSEDict/COSMIC input * added `z_accuracy_limit` and `metisse_verbose` to sse section --- examples/Params.ini | 8 ++++++++ src/cosmic/evolve.py | 4 ++-- src/cosmic/sample/sampler/independent.py | 14 ++++++-------- src/cosmic/utils.py | 16 ++++++++++++++++ 4 files changed, 32 insertions(+), 10 deletions(-) diff --git a/examples/Params.ini b/examples/Params.ini index 340609f4c..58f5bb676 100644 --- a/examples/Params.ini +++ b/examples/Params.ini @@ -145,6 +145,14 @@ path_to_tracks = None ; Required if stellar_engine = 'metisse' path_to_he_tracks = None +; z_accuracy_limit is the maximum allowed relative difference between the supplied metallicity and the tracks +; used by METISSE. If cosmic throws an error due to metallicity, increasing this slightly may help due to +; precision errors, etc. +z_accuracy_limit = 1e-2 + +; metisse_verbose tells METISSE whether or not to print additional output +metisse_verbose = False + [bse] ;;;;;;;;;;;;;;;;;;;;;; diff --git a/src/cosmic/evolve.py b/src/cosmic/evolve.py index c62900f02..aeb9cfade 100644 --- a/src/cosmic/evolve.py +++ b/src/cosmic/evolve.py @@ -249,7 +249,6 @@ def evolve(self, initialbinarytable, pool=None, bpp_columns=None, bcm_columns=No # NUMBER 1: PASS A DICTIONARY OF FLAGS BSEDict = kwargs.pop('BSEDict', {}) SSEDict = kwargs.pop('SSEDict', {}) - z_accuracy_limit = kwargs.pop('METISSE_z_accuracy_limit', 1e-2) # NUMBER 2: PASS A PANDAS DATA FRAME WITH PARAMS DEFINED AS COLUMNS @@ -295,6 +294,7 @@ def evolve(self, initialbinarytable, pool=None, bpp_columns=None, bcm_columns=No initialbinarytable = initialbinarytable.assign(bin_num=np.arange(idx, idx + len(initialbinarytable))) if SSEDict: + z_accuracy_limit = SSEDict.get("z_accuracy_limit", 1e-2) if SSEDict['stellar_engine'] == 'metisse': for k, v in SSEDict.items(): if k in initialbinarytable.keys(): @@ -349,7 +349,7 @@ def evolve(self, initialbinarytable, pool=None, bpp_columns=None, bcm_columns=No path_to_tracks=initialbinarytable['path_to_tracks'].iloc[0], path_to_he_tracks=initialbinarytable['path_to_he_tracks'].iloc[0], IBT_Z=initialbinarytable['metallicity'].iloc[0], - z_accuracy_limit=z_accuracy_limit + z_accuracy_limit=1e-2 ) diff --git a/src/cosmic/sample/sampler/independent.py b/src/cosmic/sample/sampler/independent.py index e2493e822..e37e04396 100644 --- a/src/cosmic/sample/sampler/independent.py +++ b/src/cosmic/sample/sampler/independent.py @@ -307,10 +307,8 @@ def get_independent_sampler( zsun = kwargs.pop("zsun", 0.02) - # TODO -- figure out how user can pass this - Ztol = 1e-6 - rad1 = initconditions.set_reff(mass1_binary, metallicity=met, zsun=zsun, SSEDict=SSEDict, metisse_metallicity_tolerance=Ztol) - rad2 = initconditions.set_reff(mass2_binary, metallicity=met, zsun=zsun, SSEDict=SSEDict, metisse_metallicity_tolerance=Ztol) + rad1 = initconditions.set_reff(mass1_binary, metallicity=met, zsun=zsun, SSEDict=SSEDict) + rad2 = initconditions.set_reff(mass2_binary, metallicity=met, zsun=zsun, SSEDict=SSEDict) # sample periods and eccentricities # if the porb_model is moe19, the metallicity needs to be supplied @@ -1182,8 +1180,6 @@ def set_reff(self ,mass, metallicity, zsun=0.02, SSEDict=None, **kwargs): from cosmic import _evolvebin from cosmic.evolve import set_metisse_interface - z_accuracy_limit = kwargs.get("z_accuracy_limit", 1e-2) - max_array_size = 100000 total_length = len(mass) radii = np.zeros(total_length) @@ -1198,12 +1194,14 @@ def set_reff(self ,mass, metallicity, zsun=0.02, SSEDict=None, **kwargs): _evolvebin.metissevars.z_match_limit = 1e-2 _evolvebin.metissevars.METISSE_verbose = False elif SSEDict["stellar_engine"] == "metisse": + z_accuracy_limit = SSEDict.get("z_accuracy_limit", 1e-2) + METISSE_verbose = SSEDict.get("metisse_verbose", False) _evolvebin.se_flags.using_metisse = True _evolvebin.se_flags.using_sse = False _evolvebin.metissevars.path_to_tracks = SSEDict["path_to_tracks"] _evolvebin.metissevars.path_to_he_tracks = SSEDict["path_to_he_tracks"] - _evolvebin.metissevars.z_match_limit = 1e-2 - _evolvebin.metissevars.METISSE_verbose = False + _evolvebin.metissevars.z_match_limit = z_accuracy_limit + _evolvebin.metissevars.METISSE_verbose = METISSE_verbose _ = set_metisse_interface( path_to_tracks=SSEDict['path_to_tracks'], diff --git a/src/cosmic/utils.py b/src/cosmic/utils.py index 35340b2ed..8d32ca170 100644 --- a/src/cosmic/utils.py +++ b/src/cosmic/utils.py @@ -1160,6 +1160,22 @@ def error_check(BSEDict, SSEDict, filters=None, convergence=None, sampling=None) SSEDict[flag], flag ) ) + flag = "z_accuracy_limit" + if flag in SSEDict.keys(): + if not isinstance(SSEDict[flag], float): + raise ValueError( + "`z_accuracy_limit` must be of type `float`. You supplied {0}, which is of type {1}".format( + SSEDict[flag], type(SSEDict[flag]) + ) + ) + flag = "metisse_verbose" + if flag in SSEDict.keys(): + if not isinstance(SSEDict[flag], bool): + raise ValueError( + "`metisse_verbose` must be of type `bool`. You supplied {0}, which is of type {1}".format( + SSEDict[flag], type(SSEDict[flag]) + ) + ) # BSEDict flag = "dtp" From 55186e3d3ed360a65c1d36670388598de593d149 Mon Sep 17 00:00:00 2001 From: Poojan <34255053+poojanagrawal@users.noreply.github.com> Date: Tue, 2 Sep 2025 21:57:00 +0200 Subject: [PATCH 40/46] made fileio interface more general (#721) * made fileio interface more general * fixed a typo * switch c_m_interface and track_support * fix test to pull from correct function * fix glob patter to ignore metadata files that are created when transferring datafiles between mac and non-mac os * updating metisse --------- Co-authored-by: Katie Breivik --- ci/compile_benchmark.sh | 2 +- src/cosmic/evolve.py | 300 +++++++++++----------- src/cosmic/sample/sampler/independent.py | 4 +- src/cosmic/src/METISSE | 2 +- src/cosmic/utils.py | 313 +++++++++++++++-------- 5 files changed, 354 insertions(+), 267 deletions(-) diff --git a/ci/compile_benchmark.sh b/ci/compile_benchmark.sh index 99d49defc..4dd96576b 100755 --- a/ci/compile_benchmark.sh +++ b/ci/compile_benchmark.sh @@ -10,8 +10,8 @@ FFLAGS="-coverage -fprofile-arcs -ftest-coverage -O0 -J$SRC_DIR -I$SRC_DIR" # Phase 1: Compile METISSE modules in dependency order gfortran $FFLAGS -c \ - $METISSE_DIR/c_m_interface.f90 \ $METISSE_DIR/track_support.f90 \ + $METISSE_DIR/c_m_interface.f90 \ $METISSE_DIR/z_support.f90 \ $METISSE_DIR/sse_support.f90 \ $METISSE_DIR/remnant_support.f90 \ diff --git a/src/cosmic/evolve.py b/src/cosmic/evolve.py index aeb9cfade..5981adf81 100644 --- a/src/cosmic/evolve.py +++ b/src/cosmic/evolve.py @@ -314,13 +314,21 @@ def evolve(self, initialbinarytable, pool=None, bpp_columns=None, bcm_columns=No raise ValueError("All the metallicities in the initial binary table " "must be the same if you are using the METISSE stellar engine. ") - _ = set_metisse_interface( - path_to_tracks=SSEDict['path_to_tracks'], - path_to_he_tracks=SSEDict['path_to_he_tracks'], - IBT_Z=initialbinarytable['metallicity'].iloc[0], - z_accuracy_limit=z_accuracy_limit + # load in the METISSE files + _ = read_tracks_for_METISSE( + path_to_tracks = SSEDict['path_to_tracks'], + IBT_Z = initialbinarytable['metallicity'].iloc[0], + z_accuracy_limit = z_accuracy_limit, + is_he = False ) + if (SSEDict['path_to_he_tracks'] != ''): + _ = read_tracks_for_METISSE( + path_to_tracks = SSEDict['path_to_he_tracks'], + IBT_Z = initialbinarytable['metallicity'].iloc[0], + z_accuracy_limit = z_accuracy_limit, + is_he = True + ) elif SSEDict['stellar_engine'] == 'sse': kwargs1 = {'stellar_engine': 'sse'} @@ -345,11 +353,19 @@ def evolve(self, initialbinarytable, pool=None, bpp_columns=None, bcm_columns=No "must be the same if you are using the METISSE stellar engine. ") # load in the METISSE files - _ = set_metisse_interface( - path_to_tracks=initialbinarytable['path_to_tracks'].iloc[0], - path_to_he_tracks=initialbinarytable['path_to_he_tracks'].iloc[0], - IBT_Z=initialbinarytable['metallicity'].iloc[0], - z_accuracy_limit=1e-2 + _ = read_tracks_for_METISSE( + path_to_tracks = initialbinarytable['path_to_tracks'].iloc[0], + IBT_Z = initialbinarytable['metallicity'].iloc[0], + z_accuracy_limit = 1e-2, + is_he = False + ) + + if (initialbinarytable['path_to_he_tracks'].iloc[0] != ''): + _ = read_tracks_for_METISSE( + path_to_tracks = initialbinarytable['path_to_he_tracks'].iloc[0], + IBT_Z = initialbinarytable['metallicity'].iloc[0], + z_accuracy_limit = 1e-2, + is_he = True ) @@ -713,171 +729,150 @@ def _evolve_multi_system(f): print(e) raise +def read_tracks_for_METISSE(path_to_tracks,IBT_Z,z_accuracy_limit,is_he): -def set_metisse_interface(path_to_tracks, path_to_he_tracks, IBT_Z, z_accuracy_limit): """load in the metallicity, format, and eep files Parameters ---------- - path_to_tracks : str or Path + path_to_tracks : str Direct path to where all single star data and metallicty/format files are stored for hydrogen-rich stars - - path_to_tracks : str or Path - Direct path to where all single star data and metallicty/format files are stored - for hydrogen-rich stars - IBT_Z : float Metallicity from the initialbinarytable - + z_accuracy_limit : float + Tolerance for match in metallicity value + is_he : bool, default=False + Indicates whether the tracks are helium-enriched. Returns ------- None """ - # convert to Path - path_to_tracks = Path(path_to_tracks) - path_to_he_tracks = Path(path_to_he_tracks) - # load in the METISSE files - l = utils.get_METISSE_files(path_to_tracks, path_to_he_tracks) - h_eep_tracks, he_eep_tracks, met_files, met_files_he = l - - # loop over the hydrogen metallicity files to find the one that is the closest + met_files = utils.get_METISSE_metallicity_files(path_to_tracks) + + # loop over the hydrogen metallicity files to find the one that is the closest # to the metallicity in the initial binary table met_dict_keep = None fmt_dict_keep = None mets = [] - Z_idx = -1 for i, m in enumerate(met_files): - met_dict, fmt_dict = utils.read_metallicity_and_format(m) - mets.append(met_dict['Z_files']) - if abs(met_dict['Z_files'] - IBT_Z)/min(met_dict['Z_files'], IBT_Z) <= z_accuracy_limit: + met_dict = utils.read_metallicity_file(m) + mets.append(met_dict['z_files']) + if abs(met_dict['z_files'] - IBT_Z)/min(met_dict['z_files'], IBT_Z) <= z_accuracy_limit: met_dict_keep = met_dict - fmt_dict_keep = fmt_dict + fmt_dict_keep = utils.read_format_file(met_dict['format_file']) Z_idx = i - if met_dict_keep is None or fmt_dict_keep is None: - raise ValueError("No metallicity file found that matches the metallicity " - "in the initial binary table. Please check the metallicity " - "and supply one that is in this list: {0}".format(mets)) - - # loop over the helium metallicity files to find the one that is the closest - # to the metallicity in the initial binary table - met_dict_he_keep = None - fmt_dict_he_keep = None - Z_idx_he = -1 - for i, m in enumerate(met_files_he): - met_dict, fmt_dict = utils.read_metallicity_and_format(m) - if abs(met_dict['Z_files'] - IBT_Z)/min(met_dict['Z_files'], IBT_Z) <= z_accuracy_limit: - met_dict_he_keep = met_dict - fmt_dict_he_keep = fmt_dict - Z_idx_he = i - if met_dict_he_keep is None or fmt_dict_he_keep is None: + if met_dict_keep is None: raise ValueError("No metallicity file found that matches the metallicity " "in the initial binary table. Please check the metallicity " "and supply one that is in this list: {0}".format(mets)) - - # Convert Python lists to fixed-length NumPy arrays - h_eep_np = [] - he_eep_np = [] - for ls in h_eep_tracks: - h_eep_np.append(utils.to_f2py_str_array(ls)) - for ls in he_eep_tracks: - he_eep_np.append(utils.to_f2py_str_array(ls)) - met_np = utils.to_f2py_str_array(met_files) - met_he_np = utils.to_f2py_str_array(met_files_he) - z_list_h = utils.to_f2py_str_array(met_dict_keep['Z_files']) - z_list_he = utils.to_f2py_str_array(met_dict_he_keep['Z_files']) - - # Set the metallicity lists in Fortran - _evolvebin.c_m_interface.set_mets(z_list_h, z_list_he) - - # Then pass to Fortran; note that f2py seems to get the number files on its own? - _evolvebin.c_m_interface.set_file_lists( - met_np, # met_files - met_he_np, # met_he_files - h_eep_np[Z_idx], # h_tracks - he_eep_np[Z_idx_he] # he_tracks - ) - assert fmt_dict_keep is not None and fmt_dict_he_keep is not None - # Next pass the format dictionaries: - _evolvebin.c_m_interface.set_format_controls_h( - read_eep=fmt_dict_keep['read_eep_files'], - prems=fmt_dict_keep['PreMS_EEP'], - zams=fmt_dict_keep['ZAMS_EEP'], - iams=fmt_dict_keep['IAMS_EEP'], - tams=fmt_dict_keep['TAMS_EEP'], - bgb=fmt_dict_keep['BGB_EEP'], - cheign=fmt_dict_keep['cHeIgnition_EEP'], - cheburn=fmt_dict_keep['cHeBurn_EEP'], - ta_cheb=fmt_dict_keep['TA_cHeB_EEP'], - tpagb=fmt_dict_keep['TPAGB_EEP'], - ccburn=fmt_dict_keep['cCBurn_EEP'], - postagb=fmt_dict_keep['post_AGB_EEP'], - initeep=fmt_dict_keep['Initial_EEP'], - finaleep=fmt_dict_keep['Final_EEP'], - fixtrack=fmt_dict_keep['fix_track'], - loweep=fmt_dict_keep['low_mass_final_eep'], - higheep=fmt_dict_keep['high_mass_final_eep'], - age_col=fmt_dict_keep['age_colname'], - mass_col=fmt_dict_keep['mass_colname'], - logl_col=fmt_dict_keep['log_L_colname'], - logt_col=fmt_dict_keep['log_T_colname'], - logr_col=fmt_dict_keep['log_R_colname'], - he_mass_col=fmt_dict_keep['he_core_mass'], - co_mass_col=fmt_dict_keep['co_core_mass'], - he_radius_col=fmt_dict_keep['he_core_radius'], - co_radius_col=fmt_dict_keep['co_core_radius'], - mass_env_col=fmt_dict_keep['mass_conv_envelope'], - radius_env_col=fmt_dict_keep['radius_conv_envelope'], - logtc_col=fmt_dict_keep['log_Tc'], - he4_col=fmt_dict_keep['He4_mass_frac'], - c12_col=fmt_dict_keep['c12_mass_frac'], - o16_col=fmt_dict_keep['o16_mass_frac'] - ) + # PA: it's not needed since metisse is not reading files at all - # Next pass the format dictionaries: - _evolvebin.c_m_interface.set_format_controls_he( - read_eep=fmt_dict_he_keep['read_eep_files'], - bgb=fmt_dict_he_keep['BGB_EEP'], - cheburn=fmt_dict_he_keep['cHeBurn_EEP'], - ta_cheb=fmt_dict_he_keep['TA_cHeB_EEP'], - tpagb=fmt_dict_he_keep['TPAGB_EEP'], - ccburn=fmt_dict_he_keep['cCBurn_EEP'], - postagb=fmt_dict_he_keep['post_AGB_EEP'], - initeep=fmt_dict_he_keep['Initial_EEP'], - finaleep=fmt_dict_he_keep['Final_EEP'], - fixtrack=fmt_dict_he_keep['fix_track'], - loweep=fmt_dict_he_keep['low_mass_final_eep'], - higheep=fmt_dict_he_keep['high_mass_final_eep'], - age_col=fmt_dict_he_keep['age_colname'], - mass_col=fmt_dict_he_keep['mass_colname'], - logl_col=fmt_dict_he_keep['log_L_colname'], - logt_col=fmt_dict_he_keep['log_T_colname'], - logr_col=fmt_dict_he_keep['log_R_colname'], - he_mass_col=fmt_dict_he_keep['he_core_mass'], - co_mass_col=fmt_dict_he_keep['co_core_mass'], - he_radius_col=fmt_dict_he_keep['he_core_radius'], - co_radius_col=fmt_dict_he_keep['co_core_radius'], - mass_env_col=fmt_dict_he_keep['mass_conv_envelope'], - radius_env_col=fmt_dict_he_keep['radius_conv_envelope'], - logtc_col=fmt_dict_he_keep['log_Tc'], - he4_col=fmt_dict_he_keep['He4_mass_frac'], - c12_col=fmt_dict_he_keep['c12_mass_frac'], - o16_col=fmt_dict_he_keep['o16_mass_frac'] - ) - - # Finally, load in the EEPs! - tracks_h = utils.read_eep_directory(h_eep_tracks[Z_idx]) - _ = populate_tracks(tracks_h, is_he=False) - - tracks_he = utils.read_eep_directory(he_eep_tracks[Z_idx_he]) - _ = populate_tracks(tracks_he, is_he=True) + # Convert Python lists to fixed-length NumPy arrays + # h_eep_np = [] + # he_eep_np = [] + # for ls in h_eep_tracks: + # h_eep_np.append(utils.to_f2py_str_array(ls)) + # for ls in he_eep_tracks: + # he_eep_np.append(utils.to_f2py_str_array(ls)) + # met_np = utils.to_f2py_str_array(met_files) + # met_he_np = utils.to_f2py_str_array(met_files_he) + # z_list_h = utils.to_f2py_str_array(met_dict_keep['Z_files']) + # z_list_he = utils.to_f2py_str_array(met_dict_he_keep['Z_files']) + + # # Set the metallicity lists in Fortran + # _evolvebin.c_m_interface.set_mets(z_list_h, z_list_he) + + # # Then pass to Fortran; note that f2py seems to get the number files on its own? + # _evolvebin.c_m_interface.set_file_lists( + # met_np, # met_files + # met_he_np, # met_he_files + # h_eep_np[Z_idx], # h_tracks + # he_eep_np[Z_idx_he] # he_tracks + # ) + + assert fmt_dict_keep is not None + + + if is_he: + # Pass the format dictionaries for helium tracks: + _evolvebin.c_m_interface.set_format_controls_he( + read_eep=fmt_dict_keep['read_eep_files'], + bgb=fmt_dict_keep['bgb_eep'], + cheburn=fmt_dict_keep['cheburn_eep'], + ta_cheb=fmt_dict_keep['ta_cheb_eep'], + tpagb=fmt_dict_keep['tpagb_eep'], + ccburn=fmt_dict_keep['ccburn_eep'], + postagb=fmt_dict_keep['post_agb_eep'], + initeep=fmt_dict_keep['initial_eep'], + finaleep=fmt_dict_keep['final_eep'], + fixtrack=fmt_dict_keep['fix_track'], + loweep=fmt_dict_keep['low_mass_final_eep'], + higheep=fmt_dict_keep['high_mass_final_eep'], + age_col=fmt_dict_keep['age_colname'], + mass_col=fmt_dict_keep['mass_colname'], + logl_col=fmt_dict_keep['log_l_colname'], + logt_col=fmt_dict_keep['log_t_colname'], + logr_col=fmt_dict_keep['log_r_colname'], + he_mass_col=fmt_dict_keep['he_core_mass'], + co_mass_col=fmt_dict_keep['co_core_mass'], + he_radius_col=fmt_dict_keep['he_core_radius'], + co_radius_col=fmt_dict_keep['co_core_radius'], + mass_env_col=fmt_dict_keep['mass_conv_envelope'], + radius_env_col=fmt_dict_keep['radius_conv_envelope'], + logtc_col=fmt_dict_keep['log_tc'], + he4_col=fmt_dict_keep['he4_mass_frac'], + c12_col=fmt_dict_keep['c12_mass_frac'], + o16_col=fmt_dict_keep['o16_mass_frac'] + ) + else: + # Pass the format dictionaries: + _evolvebin.c_m_interface.set_format_controls_h( + read_eep=fmt_dict_keep['read_eep_files'], + prems=fmt_dict_keep['prems_eep'], + zams=fmt_dict_keep['zams_eep'], + iams=fmt_dict_keep['iams_eep'], + tams=fmt_dict_keep['tams_eep'], + bgb=fmt_dict_keep['bgb_eep'], + cheign=fmt_dict_keep['cheignition_eep'], + cheburn=fmt_dict_keep['cheburn_eep'], + ta_cheb=fmt_dict_keep['ta_cheb_eep'], + tpagb=fmt_dict_keep['tpagb_eep'], + ccburn=fmt_dict_keep['ccburn_eep'], + postagb=fmt_dict_keep['post_agb_eep'], + initeep=fmt_dict_keep['initial_eep'], + finaleep=fmt_dict_keep['final_eep'], + fixtrack=fmt_dict_keep['fix_track'], + loweep=fmt_dict_keep['low_mass_final_eep'], + higheep=fmt_dict_keep['high_mass_final_eep'], + age_col=fmt_dict_keep['age_colname'], + mass_col=fmt_dict_keep['mass_colname'], + logl_col=fmt_dict_keep['log_l_colname'], + logt_col=fmt_dict_keep['log_t_colname'], + logr_col=fmt_dict_keep['log_r_colname'], + he_mass_col=fmt_dict_keep['he_core_mass'], + co_mass_col=fmt_dict_keep['co_core_mass'], + he_radius_col=fmt_dict_keep['he_core_radius'], + co_radius_col=fmt_dict_keep['co_core_radius'], + mass_env_col=fmt_dict_keep['mass_conv_envelope'], + radius_env_col=fmt_dict_keep['radius_conv_envelope'], + logtc_col=fmt_dict_keep['log_tc'], + he4_col=fmt_dict_keep['he4_mass_frac'], + c12_col=fmt_dict_keep['c12_mass_frac'], + o16_col=fmt_dict_keep['o16_mass_frac'] + ) + + # Finally, load in the EEPs! + track_list = utils.read_eep_directory( + met_dict_keep['eep_tracks_dir'], + fmt_dict_keep) + _ = populate_tracks(track_list,is_he) + return - return None - def populate_tracks(track_list, is_he=False): """ @@ -901,8 +896,6 @@ def populate_tracks(track_list, is_he=False): - 'eep' : array-like of shape (neep,) - 'tr' : array-like of shape (ncol, ntrack) - 'cols' : list of str of length ncol - Optional key: - - 'is_he_track' : bool is_he : bool, default=False Indicates whether the tracks are helium-enriched. @@ -928,7 +921,6 @@ def populate_tracks(track_list, is_he=False): ntrack_arr = np.array([t['ntrack'] for t in track_list], dtype=np.int32) neep_arr = np.array([t['neep'] for t in track_list], dtype=np.int32) ncol_arr = np.array([t['ncol'] for t in track_list], dtype=np.int32) - is_he_arr = np.array([t.get('is_he_track', is_he) for t in track_list], dtype=np.bool_) # Determine max sizes max_neep = max(neep_arr) @@ -936,6 +928,9 @@ def populate_tracks(track_list, is_he=False): max_ntrack = sum(ntrack_arr) # Prepare 2D arrays + + if max_neep<0: + max_neep = 0 eep_data = np.zeros((max_neep, ntracks), dtype=np.int32, order='F') tr_data = np.zeros((max_ncol, max_ntrack), dtype=np.float64, order='F') col_names = np.full((max_ncol, ntracks), b' ' * col_width, dtype=f'S{col_width}', order='F') @@ -943,18 +938,19 @@ def populate_tracks(track_list, is_he=False): # Fill arrays offset = 0 for i, t in enumerate(track_list): - eep_data[:t['neep'], i] = t['eep'] + if max_neep>0: + eep_data[:t['neep'], i] = t['eep'] tr_data[:t['ncol'], offset:offset+t['ntrack']] = t['tr'] + for j, col in enumerate(t['cols']): s = col.encode('ascii')[:col_width] # truncate if too long col_names[j, i] = s.ljust(col_width, b' ') # pad with spaces offset += t['ntrack'] - # Call Fortran _evolvebin.c_m_interface.set_tracks_from_python( filenames, initial_mass, initial_Y, initial_Z, Fe_div_H, alpha_div_Fe, v_div_vcrit, - ntrack_arr, neep_arr, ncol_arr, is_he_arr, + ntrack_arr, neep_arr, ncol_arr, eep_data, tr_data, col_names, is_he ) diff --git a/src/cosmic/sample/sampler/independent.py b/src/cosmic/sample/sampler/independent.py index e37e04396..44498829a 100644 --- a/src/cosmic/sample/sampler/independent.py +++ b/src/cosmic/sample/sampler/independent.py @@ -1178,7 +1178,7 @@ def set_reff(self ,mass, metallicity, zsun=0.02, SSEDict=None, **kwargs): """ from cosmic import _evolvebin - from cosmic.evolve import set_metisse_interface + from cosmic.evolve import read_tracks_for_METISSE max_array_size = 100000 total_length = len(mass) @@ -1203,7 +1203,7 @@ def set_reff(self ,mass, metallicity, zsun=0.02, SSEDict=None, **kwargs): _evolvebin.metissevars.z_match_limit = z_accuracy_limit _evolvebin.metissevars.METISSE_verbose = METISSE_verbose - _ = set_metisse_interface( + _ = read_tracks_for_METISSE( path_to_tracks=SSEDict['path_to_tracks'], path_to_he_tracks=SSEDict['path_to_he_tracks'], IBT_Z=metallicity, diff --git a/src/cosmic/src/METISSE b/src/cosmic/src/METISSE index d58a73ed5..04600eb03 160000 --- a/src/cosmic/src/METISSE +++ b/src/cosmic/src/METISSE @@ -1 +1 @@ -Subproject commit d58a73ed57695ac76fedf024a82c8714b8ba4dc3 +Subproject commit 04600eb03cee99bb51873832fc07d9e053d87444 diff --git a/src/cosmic/utils.py b/src/cosmic/utils.py index 8d32ca170..981cbecb5 100644 --- a/src/cosmic/utils.py +++ b/src/cosmic/utils.py @@ -63,9 +63,11 @@ "get_binfrac_of_Z", "get_porb_norm", "get_met_dep_binfrac", - "get_METISSE_files", - "read_metallicity_and_format", - "read_eep_file", + "get_METISSE_metallicity_files", + "read_metallicity_file", + "read_format_file", + "read_MIST_track", + "read_other_track", "read_eep_directory", "to_f2py_str_array" ] @@ -1128,7 +1130,7 @@ def error_check(BSEDict, SSEDict, filters=None, convergence=None, sampling=None) ) else: path = Path(SSEDict[flag]) - metallicity_file = list(path.glob('*_metallicity.in')) + metallicity_file = list(path.glob('[!.]*_metallicity.in')) if metallicity_file == []: raise ValueError( "No metallicity file found in {0}. Make sure that {1} is valid".format ( @@ -1153,7 +1155,7 @@ def error_check(BSEDict, SSEDict, filters=None, convergence=None, sampling=None) ) else: path = Path(SSEDict[flag]) - metallicity_file = list(path.glob('*_metallicity.in')) + metallicity_file = list(path.glob('[!.]*_metallicity.in')) if metallicity_file == []: raise ValueError( "No metallicity file for helium star tracks found in {0}. Make sure that {1} is valid".format ( @@ -1935,97 +1937,35 @@ def _eval(node): return BSEDict, SSEDict, seed_int, filters, convergence, sampling -def get_METISSE_files(path_to_tracks, path_to_he_tracks): +def get_METISSE_metallicity_files(path_to_tracks): """Returns the path to the METISSE files Parameters ---------- path_to_tracks : str - Path to the directory containing the METISSE tracks. - path_to_he_tracks : str - Path to the directory containing the METISSE He tracks. + Path to the directory containing the METISSE metallicity file(s) for hydrogen/helium tracks Returns ------- - eep_tracks : list - List of paths to the METISSE EEP tracks - he_eep_tracks : list - List of paths to the METISSE helium EEP tracks met_files : list - List of paths to the METISSE metallicity files for hydrogen tracks - met_files_he : list - List of paths to the METISSE He metallicity files for helium trakcs + List of paths to the METISSE metallicity files for hydrogen/helium tracks """ import os - + path_to_tracks = Path(path_to_tracks) - path_to_he_tracks = Path(path_to_he_tracks) - - h_eep_tracks = [] - he_eep_tracks = [] + + # Next also get the Metallicity files met_files = [os.path.join(path_to_tracks, f) for f in os.listdir(path_to_tracks) if f.endswith("metallicity.in")] - met_files_he = [os.path.join(path_to_he_tracks, f) for f in os.listdir(path_to_he_tracks) if f.endswith("metallicity.in")] if len(met_files) == 0: raise ValueError("No METISSE metallicity files found in the specified path: {0}".format(path_to_tracks)) - if len(met_files_he) == 0: - raise ValueError("No METISSE He metallicity files found in the specified path: {0}".format(path_to_he_tracks)) - - for met in met_files: - with open(met, "r") as file: - lines = file.read().splitlines() - eep_path: str | None = None - for l in lines: - if (l.lower().find("eep_tracks_dir") != -1): - eep_path = l.split("=")[-1].strip()[1:-1] - break - if eep_path is None: raise ValueError(f"No eep_tracks_dir found in {met}. Is this a valid metallicity file?") - if eep_path.startswith(os.path.sep): - eep_pattern = os.path.join(eep_path, "*.eep") - else: - eep_pattern = os.path.join(path_to_tracks, eep_path, "*.eep") - eeps = glob.glob(eep_pattern) - if len(eeps) == 0: - raise ValueError(f"No METISSE tracks found in the specified path: {eep_pattern}") - h_eep_tracks.append(eeps.copy()) - for met in met_files_he: - with open(met, "r") as file: - lines = file.read().splitlines() - eep_path: str | None = None - for l in lines: - if (l.lower().find("eep_tracks_dir") != -1): - eep_path = l.split("=")[-1].strip()[1:-1] - break - if eep_path is None: raise ValueError(f"No eep_tracks_dir found in {met}. Is this a valid metallicity file?") - if eep_path.startswith(os.path.sep): - eep_pattern = os.path.join(eep_path, "*.eep") - else: - eep_pattern = os.path.join(path_to_he_tracks, eep_path, "*.eep") - eeps = glob.glob(eep_pattern) - if len(eeps) == 0: - raise ValueError(f"No METISSE tracks found in the specified path: {eep_pattern}") - he_eep_tracks.append(eeps.copy()) - - # first find all the EEPs in the specified directories - #eep_dir = path_to_tracks #/ "eeps/" - #he_eep_dir = path_to_he_tracks #/ "eeps/" - #h_eep_tracks = glob.glob(os.path.join(eep_dir, "*.eep"), recursive=True) #[os.path.join(eep_dir, f) for f in os.listdir(eep_dir) if f.endswith("data.eep")] - #he_eep_tracks = glob.glob(os.path.join(he_eep_dir, "*.eep"), recursive=True) #[os.path.join(he_eep_dir, f) for f in os.listdir(he_eep_dir) if f.endswith("data.eep")] - - if len(h_eep_tracks) == 0: - raise ValueError("No METISSE tracks found in the specified path.") #:{0}".format(eep_dir)) - if len(he_eep_tracks) == 0: - raise ValueError("No METISSE He tracks found in the specified path.")#:{0}".format(he_eep_dir)) - - # Next also get the Metallicity files - - return h_eep_tracks, he_eep_tracks, met_files, met_files_he + return met_files -def read_metallicity_and_format(met_file_path): +def read_metallicity_file(met_file_path): """ - Read a metallicity namelist and its associated format file. + Read a metallicity namelist Parameters ---------- @@ -2037,8 +1977,6 @@ def read_metallicity_and_format(met_file_path): met_dict : dict Dictionary containing metallicity options, e.g., 'eep_tracks_dir', 'Z_files', 'format_file', etc. Paths are converted to Path objects. - fmt_dict : dict - Dictionary containing format file options, e.g., column names, EEP stages, flags. Notes ----- @@ -2050,7 +1988,19 @@ def read_metallicity_and_format(met_file_path): met_file_path = Path(met_file_path) # --- Read metallicity file --- - met_dict = {} + met_dict = { + "eep_tracks_dir": "", + "Z_files": -1.0, + "format_file": "", + "Y_files": -1.0, + "Mhook": -1.0, + "Mhef": -1.0, + "Mfgb": -1.0, + "Mup": -1.0, + "Mec": -1.0, + "Mextra": -1.0 + } + with open(met_file_path, 'r') as f: for line in f: line = line.split('!')[0].strip() # remove comments @@ -2069,15 +2019,95 @@ def read_metallicity_and_format(met_file_path): except ValueError: met_dict[key] = value.strip("'\"") # keep strings - # Convert paths to Path objects relative to metallicity file + # Check if the paths exist if 'eep_tracks_dir' in met_dict: - met_dict['eep_tracks_dir'] = met_file_path.parent / met_dict['eep_tracks_dir'] + if os.path.exists(met_dict['eep_tracks_dir']) is False: + # Otherwise convert paths to Path objects relative to metallicity file + # met_dict['eep_tracks_dir'] = os.path.join(met_file_path.parent,met_dict['eep_tracks_dir']) + met_dict['eep_tracks_dir'] = met_file_path.parent / met_dict['eep_tracks_dir'] + else: + raise ValueError("eep_tracks_dir not found in {0}".format (met_file_path)) if 'format_file' in met_dict: - met_dict['format_file'] = met_file_path.parent / met_dict['format_file'] + if os.path.exists(met_dict['format_file']) is False: + met_dict['format_file'] = met_file_path.parent / met_dict['format_file'] + else: + raise ValueError("format_file not found in {0}".format (met_file_path)) - # --- Read format file --- - fmt_dict = {} - format_file_path = met_dict['format_file'] + met_dict = {k.lower(): v for k, v in met_dict.items()} + + return met_dict + +def read_format_file(format_file_path): + """ + Read the format file associated with the metallicity namelist + + Parameters + ---------- + format_file_path : str or Path + Path to the format file. + + Returns + ------- + fmt_dict : dict + Dictionary containing format file options, e.g., column names, EEP stages, flags. + + Notes + ----- + - Booleans (.true./.false.) are converted to Python True/False. + - Fortran-style scientific notation with 'd' (e.g., 1.23d-04) is converted to float. + - Strings in quotes are stripped of the quotes. + - Stops parsing at the Fortran namelist terminator '/'. + """ + +# --- Read format file --- + fmt_dict = { + "read_eep_files": False, + "file_extension": "", + "header_location": -1, + "extra_char": "", + "column_name_file": "", + "total_cols": -1, + "age_colname": "", + "mass_colname": "", + "log_L_colname": "", + "Lum_colname": "", + "log_R_colname": "", + "Radius_colname": "", + "he_core_mass": "", + "co_core_mass": "", + "binding_energy_colname": "", + "he_core_radius": "", + "co_core_radius": "", + "mass_conv_envelope": "", + "radius_conv_envelope": "", + "log_T_colname": "", + "Teff_colname": "", + "log_Tc": "", + "he4_mass_frac": "", + "c12_mass_frac": "", + "o16_mass_frac": "", + "PreMS_EEP": -1, + "ZAMS_EEP": -1, + "IAMS_EEP": -1, + "TAMS_EEP": -1, + "BGB_EEP": -1, + "cHeIgnition_EEP": -1, + "cHeBurn_EEP": -1, + "TA_cHeB_EEP": -1, + "TPAGB_EEP": -1, + "cCBurn_EEP": -1, + "post_AGB_EEP": -1, + "Initial_EEP": -1, + "Final_EEP": -1, + "Extra_EEP1": -1, + "Extra_EEP2": -1, + "Extra_EEP3": -1, + "low_mass_final_eep": -1, + "high_mass_final_eep": -1, + "fix_track": True, + "lookup_index": 1.0 + } + with open(format_file_path, 'r') as f: for line in f: line = line.split('!')[0].strip() @@ -2109,10 +2139,14 @@ def read_metallicity_and_format(met_file_path): except ValueError: fmt_dict[key] = value # fallback - return met_dict, fmt_dict + # Convert all keys in fmt_dict_keep to lowercase + fmt_dict = {k.lower(): v for k, v in fmt_dict.items()} + + return fmt_dict + -def read_eep_file(eep_path): +def read_MIST_track(eep_path): track = {} track['filename'] = str(eep_path) @@ -2143,14 +2177,14 @@ def read_eep_file(eep_path): info_line = f.readline() track['initial_mass'] = float(info_line[2:18].strip()) track['ntrack'] = int(info_line[18:26].strip()) - track['neep'] = int(info_line[26:34].strip()) track['ncol'] = int(info_line[34:42].strip()) - track['phase_info'] = info_line[42:50].strip() + # track['phase_info'] = info_line[42:50].strip() track['type_label'] = info_line[50:65].strip() # EEP lines eep_line = f.readline() track['eep'] = np.array([int(x) for x in eep_line.split()[2:]], dtype=int) + track['neep'] = len(track['eep']) f.readline() # comment line f.readline() # column numbers line @@ -2160,43 +2194,100 @@ def read_eep_file(eep_path): track['cols'] = cols_line.split()[1:] # list of strings start at 1 to skip # symbol # track data - tr = np.zeros((track['ncol'], track['ntrack']), dtype=float) - for j in range(track['ntrack']): - data_line = f.readline() - values = [float(x) for x in data_line.split()] - tr[:, j] = values[:track['ncol']] - track['tr'] = tr - + # tr = np.zeros((track['ncol'], track['ntrack']), dtype=float) + # for j in range(track['ntrack']): + # data_line = f.readline() + # values = [float(x) for x in data_line.split()] + # tr[:, j] = values[:track['ncol']] + # track['tr'] = tr + # track data + track['tr'] = np.loadtxt(eep_path, skiprows = 11,dtype=float) + track['tr'] = np.transpose(track['tr']) + track['ncol'], track['ntrack'] = track['tr'].shape return track +def read_other_track(eep_path,fmt): + track = {} + track['filename'] = str(eep_path) + header = fmt['header_location'] + + # track data + track['tr'] = np.loadtxt(eep_path, skiprows = header, dtype=float) + track['tr'] = np.transpose(track['tr']) + track['ncol'], track['ntrack'] = track['tr'].shape + # Set the following values to defaults + # they are either not relevant at this point + # or are assigned later within METISSE + track['initial_mass'] = -1.0 + track['initial_Y'] = -1.0 + track['initial_Z'] = -1.0 + track['Fe_div_H'] = -1.0 + track['alpha_div_Fe'] = -1.0 + track['v_div_vcrit'] = -1.0 + track['neep'] = 0 + + with eep_path.open() as f: + # Read lines sequentially to mimic Fortran + if header>0: + for i in range(header-1): + f.readline() + # Column names line + track['cols'] = f.readline().strip().split() + # remove any extra chracter (such as #) if present + track['cols'] = [c for c in track['cols'] if c != fmt['extra_char']] + else: + if os.path.exists(fmt["column_name_file"]): + #read the column name file + with open(fmt["column_name_file"], "r") as f: + track['cols'] = [line.strip() for line in f if line.strip()] + if (len(track['cols']) != track['ncol']): + raise ValueError( + "Total columns {0} in the column_name_file do not match the number of columns {1} in the eep file".format( + len(track['cols']), track['ncol']) + ) + else: + raise ValueError( + "Check if header location {0} and column_name_file {1} are correct".format( + header, fmt["column_name_file"]) + ) + return track -def read_eep_directory(eep_files, pattern="*.eep"): +def read_eep_directory(eep_dir,fmt_dict): """ - Read all EEP files in a directory matching the given pattern and sort by - the leading number in the filename. + Read all EEP files in a directory matching the given pattern Parameters ---------- - eep_files : list - list of all files in the eep directory + eep_dir : str or Path + Directory containing the EEP files. + + fmt_dict : dict + Dictionary containing format file options, e.g., column names, EEP stages, flags. Returns ------- tracks : list of dict - List of track dictionaries, each as returned by `read_eep_file`, - sorted by the leading number in the filename. + List of track dictionaries, each as returned by `read_eep_file` """ - # Convert all to Path objects - eep_files = [Path(f) for f in eep_files] - # Sort files by the leading number in the filename - def extract_mass(f): - # Get the first integer before the first underscore - return int(f.stem.split('_')[0]) + eep_dir = Path(eep_dir) + + + if fmt_dict['read_eep_files']: + pattern="*.eep" + else: + pattern = "*"+fmt_dict['file_extension'] + + eep_files = list(eep_dir.glob(pattern)) - eep_files_sorted = sorted(eep_files, key=extract_mass) - tracks = [read_eep_file(f) for f in eep_files_sorted] + if len(eep_files) == 0: + raise ValueError("No eep tracks found in the specified path: {0}".format(eep_dir)) + + if fmt_dict['read_eep_files']: + tracks = [read_MIST_track(f) for f in eep_files] + else: + tracks = [read_other_track(f,fmt_dict) for f in eep_files] return tracks From 02656bab375d6e7e0f595c03b3c3809e33d17c10 Mon Sep 17 00:00:00 2001 From: Duncan B Maclean <146674933+d-maclean@users.noreply.github.com> Date: Tue, 23 Sep 2025 16:32:58 -0400 Subject: [PATCH 41/46] Update COSMIC-METISSE interface functions in utils / independent sampler (#722) * updated cosmic-metisse interface function call in independent sampler * add handling for 1-line eeps; prevents array bounds error --- src/cosmic/sample/sampler/independent.py | 11 +++++++++-- src/cosmic/utils.py | 4 +++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/cosmic/sample/sampler/independent.py b/src/cosmic/sample/sampler/independent.py index 44498829a..0a1f0ac90 100644 --- a/src/cosmic/sample/sampler/independent.py +++ b/src/cosmic/sample/sampler/independent.py @@ -1205,10 +1205,17 @@ def set_reff(self ,mass, metallicity, zsun=0.02, SSEDict=None, **kwargs): _ = read_tracks_for_METISSE( path_to_tracks=SSEDict['path_to_tracks'], - path_to_he_tracks=SSEDict['path_to_he_tracks'], IBT_Z=metallicity, - z_accuracy_limit=z_accuracy_limit + z_accuracy_limit=z_accuracy_limit, + is_he=False ) + if (SSEDict['path_to_he_tracks'] != ''): + _ = read_tracks_for_METISSE( + path_to_tracks=SSEDict['path_to_he_tracks'], + IBT_Z=metallicity, + z_accuracy_limit=z_accuracy_limit, + is_he=True + ) else: raise ValueError("Use either 'sse' or 'metisse' as stellar engine") diff --git a/src/cosmic/utils.py b/src/cosmic/utils.py index 981cbecb5..b7237eda6 100644 --- a/src/cosmic/utils.py +++ b/src/cosmic/utils.py @@ -2202,7 +2202,9 @@ def read_MIST_track(eep_path): # track['tr'] = tr # track data track['tr'] = np.loadtxt(eep_path, skiprows = 11,dtype=float) - track['tr'] = np.transpose(track['tr']) + track['tr'] = np.transpose(track['tr']) + if len(track['tr'].shape) < 2: + track['tr'] = track['tr'].reshape((-1, 1)) track['ncol'], track['ntrack'] = track['tr'].shape return track From 2d6363c90fdec80e359475a62bcb4ee685ff0259 Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Fri, 31 Oct 2025 12:25:02 -0400 Subject: [PATCH 42/46] version bump --- meson.build | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 6604bd6c1..53cd4a421 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('cosmic', 'c', 'fortran', - version : '3.6.1', + version : '4.0.0', default_options: ['warning_level=0', 'optimization=3'], ) diff --git a/pyproject.toml b/pyproject.toml index 7b747791b..8ace17fb1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ authors = [ { name="Tom Wagg" }, ] readme = "README.md" -version = "3.6.1" +version = "4.0.0" requires-python = ">=3.9" license = { text = "MIT License" } classifiers = [ From b885ce530cdb937207da1d3364eb6a355006c39f Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Fri, 31 Oct 2025 12:25:23 -0400 Subject: [PATCH 43/46] update to latest metisse --- src/cosmic/src/METISSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cosmic/src/METISSE b/src/cosmic/src/METISSE index 04600eb03..dc3fa6c2d 160000 --- a/src/cosmic/src/METISSE +++ b/src/cosmic/src/METISSE @@ -1 +1 @@ -Subproject commit 04600eb03cee99bb51873832fc07d9e053d87444 +Subproject commit dc3fa6c2d639df8fc01331b3690ff62e09626638 From f5da869008dca9c8c14f91381a17dfec149b5c65 Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Fri, 31 Oct 2025 13:42:00 -0400 Subject: [PATCH 44/46] update docs and version --- docs/cosmic-settings.json | 30 +++++++++------- docs/pages/about.rst | 8 ++++- docs/pages/cite.rst | 3 ++ docs/pages/evolve/evolve_sample.rst | 12 ++++--- docs/pages/evolve/grid.rst | 14 ++++---- docs/pages/evolve/multiple.rst | 12 ++++--- docs/pages/evolve/resolution.rst | 12 ++++--- docs/pages/evolve/restart.rst | 12 ++++--- docs/pages/evolve/single.rst | 53 ++++++++++++++++++++++------- src/cosmic/_version.py | 2 +- 10 files changed, 105 insertions(+), 53 deletions(-) diff --git a/docs/cosmic-settings.json b/docs/cosmic-settings.json index ae888c78f..4046321ad 100644 --- a/docs/cosmic-settings.json +++ b/docs/cosmic-settings.json @@ -664,15 +664,15 @@ "settings-section-description": "Note: there are cases where a common envelope is forced regardless of the critical mass ratio for unstable mass transfer. In the following cases, a common envelope occurs regardless of the choices below:
  • contact: the stellar radii go into contact (common for similar ZAMS systems)
  • periapse contact: the periapse distance is smaller than either of the stellar radii (common for highly eccentric systems)
  • core Roche overflow: either of the stellar radii overflow their component's Roche radius (in this case, mass transfer from the convective core is always dynamically unstable)
", "name": "alpha1", "description": "Common-envelope efficiency parameter which scales the efficiency of transferring orbital energy to the envelope. See Hurley+2002, Eq. 71.", - "type": "number", - "options-preface": "This value is equivalent to \\(\\alpha\\) in Hurley+2002, Eq. 71.", + "type": "string", + "options-preface": "This value is equivalent to \\(\\alpha\\) in Hurley+2002, Eq. 71. A list is supplied such that the primary and secondary can be assigned different values for \\(\\alpha\\).", "options": [ { "name": "positive values", - "description": "Sets the common-envelope efficiency parameter, \\(\\alpha\\)" + "description": "Sets the common-envelope efficiency parameter, \\(\\alpha\\), for each binary component" }, { - "name": 1.0, + "name": "[1.0, 1.0]", "description": "Default value", "default": true } @@ -681,7 +681,7 @@ { "name": "lambdaf", "description": "Binding energy factor for common envelope evolution. The initial binding energy of the stellar envelope is proportional to \\(1 / \\lambda\\). See Hurley+2002, Eq. 69.", - "type": "number", + "type": "string", "options-preface": "", "options": [ { @@ -1298,30 +1298,34 @@ }, { "name": "acc_lim", - "description": "Limits the amount of mass accreted during Roche-lobe overflow", - "type": "number", + "description": "Limits the amount of mass accreted during Roche-lobe overflow where each binary component must have its own limit specified in a list", + "type": "string", "options-preface": "", "options": [ { - "name": -1, - "description": "limited to 10x the thermal rate of the accretor for MS/HG/CHeB and unlimited for GB/EAGB/AGB stars", - "default": true + "name": "-1", + "description": "limited to 10x the thermal rate of the accretor for MS/HG/CHeB and unlimited for GB/EAGB/AGB stars" }, { - "name": -2, + "name": "-2", "description": "limited to 1x the thermal rate of the accretor for MS/HG/CHeB and unlimited for GB/EAGB/AGB stars" }, { - "name": -3, + "name": "-3", "description": "limited to 10x the thermal rate of the accretor for all stars" }, { - "name": -4, + "name": "-4", "description": "limited to 1x the thermal rate of the accretor for all stars" }, { "name": ">= 0", "description": "sets overall fraction of donor material that is accreted, with the rest being lost from the system (acc_lim = 0.5 assumes 50% accretion efficiency as in Belczynski+2008)" + }, + { + "name": "[-1, -1]", + "description": "Default choice", + "default": true } ] }, diff --git a/docs/pages/about.rst b/docs/pages/about.rst index f161dc409..8bdf2ae9b 100644 --- a/docs/pages/about.rst +++ b/docs/pages/about.rst @@ -5,7 +5,13 @@ About ##### COSMIC (Compact Object Synthesis and Monte Carlo Investigation Code) is a rapid binary population synthesis suite with a special focus of generating compact binary populations. -COSMIC currently implements stellar evolution using SSE (`Hurley, Pols, and Tout 2000 `_) and binary interactions using BSE (`Hurley, Tout, and Pols 2002 `_). Several modifications have been applied to BSE to account for recent updates to binary evolution especially important to compact binary formation (e.g. metallicity-dependent stellar winds or black hole natal kick strengths). For a detailed discussion of these modifications, see `Breivik et al. 2020 `_. +COSMIC implements stellar evolution using the fitting formulae described in +SSE (`Hurley, Pols, and Tout 2000 `_) +or METISSE which uses pre-computed detailed single star grids that follow the MIST-style equivalent +evolutionary phase (EEP) format. For more details on METISSE see the `METISSE documentation `_. + +Binary interactions are implemented based on the BSE algorithm (`Hurley, Tout, and Pols 2002 `_). +Several modifications have been applied to BSE to account for recent updates to binary evolution especially important to compact binary formation (e.g. metallicity-dependent stellar winds or black hole natal kick strengths). For a detailed discussion of these modifications, see `Breivik et al. 2020 `_. ************ Using COSMIC diff --git a/docs/pages/cite.rst b/docs/pages/cite.rst index 47a67efb3..f90c9afd0 100644 --- a/docs/pages/cite.rst +++ b/docs/pages/cite.rst @@ -6,6 +6,9 @@ If you use COSMIC in your work, please cite both: - The COSMIC release paper: `Breivik et al. 2020 `_ - The specific Zenodo DOI associated with version of COSMIC you used +- The METISSE stellar evolution package: JOSS citation TBA + +If you used pre-supplied stellar tracks from METISSE, please also cite the relevant papers for those tracks as listed in the `METISSE documentation `_. We recommend using the `Software Citation Station `_ to generate a citation for COSMIC (and any other software you use in your work!) - it's a great way to ensure you're citing software correctly and diff --git a/docs/pages/evolve/evolve_sample.rst b/docs/pages/evolve/evolve_sample.rst index c169885e4..ee104d78d 100644 --- a/docs/pages/evolve/evolve_sample.rst +++ b/docs/pages/evolve/evolve_sample.rst @@ -37,11 +37,13 @@ guides: .. ipython:: :okwarning: - In [5]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': 1.0, 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1, 'zsun' : 0.019, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : -1, 'rtmsflag' : 0, 'wd_mass_lim' : 1} + In [5]: SSEDict = {'stellar_engine': 'sse'} - In [6]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=InitialBinaries, - ...: BSEDict=BSEDict) + In [6]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': [1.0, 1.0], 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1, 'zsun' : 0.019, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : [-1, -1], 'rtmsflag' : 0, 'wd_mass_lim' : 1} - In [7]: print(bcm.iloc[:10]) + In [7]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=InitialBinaries, + ...: BSEDict=BSEDict, SSEDict=SSEDict) - In [8]: print(bpp) \ No newline at end of file + In [8]: print(bcm.iloc[:10]) + + In [9]: print(bpp) \ No newline at end of file diff --git a/docs/pages/evolve/grid.rst b/docs/pages/evolve/grid.rst index 260eb93ad..05abbbe2a 100644 --- a/docs/pages/evolve/grid.rst +++ b/docs/pages/evolve/grid.rst @@ -29,7 +29,9 @@ periods spaced evenly in log space. ...: kstar2=np.ones(n_grid), ...: metallicity=np.ones(n_grid)*0.005) - In [5]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': 1.0, + In [6]: SSEDict = {'stellar_engine': 'sse'} + + In [7]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': [1.0, 1.0], ...: 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, ...: 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, ...: 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, @@ -42,13 +44,13 @@ periods spaced evenly in log space. ...: 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], ...: 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, ...: 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1, - ...: 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : -1, 'rtmsflag' : 0, + ...: 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : [-1, -1], 'rtmsflag' : 0, ...: 'wd_mass_lim': 1} - In [6]: print(binary_grid) + In [8]: print(binary_grid) - In [7]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=binary_grid, BSEDict=BSEDict) + In [9]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=binary_grid, BSEDict=BSEDict, SSEDict=SSEDict) - In [8]: print(bpp) + In [10]: print(bpp) - In [9]: print(bcm) \ No newline at end of file + In [11]: print(bcm) \ No newline at end of file diff --git a/docs/pages/evolve/multiple.rst b/docs/pages/evolve/multiple.rst index 9ec2975e9..d7888fe73 100644 --- a/docs/pages/evolve/multiple.rst +++ b/docs/pages/evolve/multiple.rst @@ -12,11 +12,13 @@ Let's start by importing the necessary modules: In [2]: from cosmic.evolve import Evolve -And use the same BSE dict as before: +And use the same SSE and BSE dictionaries as before: .. ipython:: - In [3]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': 1.0, 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1, 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : -1, 'rtmsflag' : 0, 'wd_mass_lim': 1} + In [3]: SSEDict = {'stellar_engine': 'sse'} + + In [3]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': [1.0, 1.0], 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1, 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : [-1, -1], 'rtmsflag' : 0, 'wd_mass_lim': 1} Below is an example for systems that could form GW150914 and GW170817 - like binaries. @@ -36,7 +38,7 @@ Below is an example for systems that could form GW150914 and GW170817 - like bin In [6]: np.random.seed(5) - In [7]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=binary_set, BSEDict=BSEDict) + In [7]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=binary_set, BSEDict=BSEDict, SSEDict=SSEDict) As before, bpp, bcm, and initC are returned as pandas DataFrames which assign an index to each binary system we evolve. We can access each binary as follows: @@ -59,7 +61,7 @@ progenitor, we expect most of the evolution to take place in the first ~60 Myr. :okwarning: :okexcept: - In [12]: fig = evolve_and_plot(binary_set, t_min=None, t_max=[6.0, 60.0], BSEDict=BSEDict, sys_obs={}) + In [12]: fig = evolve_and_plot(binary_set, t_min=None, t_max=[6.0, 60.0], BSEDict=BSEDict, SSEDict=SSEDict, sys_obs={}) .. plot:: @@ -70,5 +72,5 @@ progenitor, we expect most of the evolution to take place in the first ~60 Myr. np.random.seed(5) BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': 1.0, 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1, 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : -1, 'rtmsflag' : 0, 'wd_mass_lim': 1} binary_set = InitialBinaryTable.InitialBinaries(m1=[85.543645, 11.171469], m2=[84.99784, 9.67305], porb=[446.795757, 370.758343], ecc=[0.448872, 0.370], tphysf=[13700.0, 13700.0], kstar1=[1, 1], kstar2=[1, 1], metallicity=[0.002, 0.02]) - fig = evolve_and_plot(binary_set, t_min=None, t_max=[6.0, 60.0], BSEDict=BSEDict, sys_obs={}) + fig = evolve_and_plot(binary_set, t_min=None, t_max=[6.0, 60.0], BSEDict=BSEDict, SSEDict=SSEDict, sys_obs={}) diff --git a/docs/pages/evolve/resolution.rst b/docs/pages/evolve/resolution.rst index 2267bcc28..3fc39a149 100644 --- a/docs/pages/evolve/resolution.rst +++ b/docs/pages/evolve/resolution.rst @@ -38,13 +38,15 @@ First, print all time steps during mass transfer In [3]: single_binary = InitialBinaryTable.InitialBinaries(m1=7.806106, m2=5.381412, porb=2858.942021, ...: ecc=0.601408, tphysf=13700.0, kstar1=1, kstar2=1, metallicity=0.02) - In [4]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': 1.0, 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1, 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : -1, 'rtmsflag' : 0, 'wd_mass_lim': 1} + In [4]: SSEDict = {'stellar_engine': 'sse'} + + In [4]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': [1.0, 1.0], 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1, 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : [-1, -1], 'rtmsflag' : 0, 'wd_mass_lim': 1} In [5]: # Define the condition for the time step ...: timestep_conditions = [['RRLO_1>=1', 'dtp=0.0'], ['RRLO_2>=1', 'dtp=0.0']] In [6]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=single_binary, BSEDict=BSEDict, - ...: timestep_conditions=timestep_conditions) + ...: SSEDict=SSEDict, timestep_conditions=timestep_conditions) In [7]: print(bcm[['tphys', 'kstar_1', 'kstar_2', 'mass_1', 'mass_2', 'RRLO_1', 'RRLO_2']]) @@ -59,7 +61,7 @@ Second, pick a certain resolution for the bcm array until the system merges or i In [8]: timestep_conditions = [['binstate=0', 'dtp=1.0']] In [9]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=single_binary, BSEDict=BSEDict, - ...: timestep_conditions=timestep_conditions) + ...: SSEDict=SSEDict, timestep_conditions=timestep_conditions) In [10]: print(bcm[['tphys', 'kstar_1', 'kstar_2', 'mass_1', 'mass_2', 'bin_state']]) @@ -75,11 +77,11 @@ Finally, we show how to print a fine resolution only during the HMXB stage of th ....: ecc=0.448872, tphysf=13700.0, ....: kstar1=1, kstar2=1, metallicity=0.002) - In [12]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': 1.0, 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1, 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : -1, 'rtmsflag' : 0, 'wd_mass_lim': 1} + In [12]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': [1.0, 1.0], 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1, 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : [-1, -1], 'rtmsflag' : 0, 'wd_mass_lim': 1} In [13]: timestep_conditions = [['kstar_1=14', 'kstar_2<10','dtp=0.1'], ['kstar_2=14', 'kstar_1<10','dtp=0.1']] In [14]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=single_binary, BSEDict=BSEDict, - ....: timestep_conditions=timestep_conditions) + ....: SSEDict=SSEDict, timestep_conditions=timestep_conditions) In [15]: print(bcm[['tphys', 'kstar_1', 'kstar_2', 'mass_1', 'mass_2', 'bin_state']]) diff --git a/docs/pages/evolve/restart.rst b/docs/pages/evolve/restart.rst index edc58c4f1..358885a07 100644 --- a/docs/pages/evolve/restart.rst +++ b/docs/pages/evolve/restart.rst @@ -22,13 +22,15 @@ started from the beginning and three different points in the evolution: In [3]: single_binary = InitialBinaryTable.InitialBinaries(m1=25.543645, m2=20.99784, porb=446.795757, ecc=0.448872, tphysf=13700.0, kstar1=1, kstar2=1, metallicity=0.002) - In [4]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': 5.0, 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'remnantflag': 3, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.5, 'ecsn_mlow' : 1.4, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 0, 'bdecayfac' : 1, 'randomseed' : -1235453, 'grflag' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1, 'zsun' : 0.014, 'grflag' : 1, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : -1, 'rtmsflag' : 0, 'wd_mass_lim': 1} + In [3]: SSEDict = {'stellar_engine': 'sse'} + + In [4]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': [5.0, 1.0], 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'remnantflag': 3, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.5, 'ecsn_mlow' : 1.4, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 0, 'bdecayfac' : 1, 'randomseed' : -1235453, 'grflag' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1, 'zsun' : 0.014, 'grflag' : 1, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : [-1, -1], 'rtmsflag' : 0, 'wd_mass_lim': 1} In [5]: for i in [3, 7, 11]: - ...: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=single_binary, BSEDict=BSEDict) + ...: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=single_binary, BSEDict=BSEDict, SSEDict=SSEDict) ...: for column in bpp.columns: ...: initC = initC.assign(**{column:bpp.iloc[i][column]}) - ...: bpp_mid, bcm_mid, initC_mid, kick_info = Evolve.evolve(initialbinarytable=initC, BSEDict={}) + ...: bpp_mid, bcm_mid, initC_mid, kick_info = Evolve.evolve(initialbinarytable=initC, BSEDict={}, SSEDict={}) ...: if i == 3: ...: print("From beginning") ...: print(bpp) @@ -56,7 +58,7 @@ restart the evolution after the mass transfer would occur. We can do this by usi In [7]: single_binary = InitialBinaryTable.InitialBinaries(m1=65.0, m2=0.93, porb=4500, ecc=0.448872, ...: tphysf=13700.0, kstar1=1, kstar2=1, metallicity=0.014*0.6) - In [8]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=single_binary, BSEDict=BSEDict) + In [8]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=single_binary, BSEDict=BSEDict, SSEDict=SSEDict) In [9]: for column in bpp.columns: ...: initC = initC.assign(**{column:bpp.iloc[6][column]}) @@ -70,7 +72,7 @@ restart the evolution after the mass transfer would occur. We can do this by usi ....: initC['sep'] = utils.a_from_p(p=initC.porb.values, m1=initC.mass_1.values, m2=initC.mass_2.values) ....: initC['bin_num'] = np.linspace(0, 1000, 1000) - In [11]: bpp_restart, bcm_restart, initC_restart, kick_info_restart = Evolve.evolve(initialbinarytable=initC, BSEDict={}) + In [11]: bpp_restart, bcm_restart, initC_restart, kick_info_restart = Evolve.evolve(initialbinarytable=initC, BSEDict={}, SSEDict={}) In [12]: bpp_BH = bpp_restart.loc[(bpp_restart.kstar_1 == 14) & (bpp_restart.kstar_2 == 1) & (bpp_restart.porb > 0)].groupby('bin_num', as_index=False).first() diff --git a/docs/pages/evolve/single.rst b/docs/pages/evolve/single.rst index c353b8569..b6199afe3 100644 --- a/docs/pages/evolve/single.rst +++ b/docs/pages/evolve/single.rst @@ -42,18 +42,45 @@ InitialBinaryTable class. Each initialized binary requires the following paramet In [4]: print(single_binary) +There are two available methods for evaluating the evolution of each star in the binary: + +* SSE - the single star evolution fitting formulae from `Hurley+2000 `_ + +* METISSE - a new stellar evolution package that uses interpolation of detailed stellar models supplied by the user. + +You can learn more these choices by consulting the `METISSE documentation `_. + +If you have a grid of detailed stellar models and want to use METISSE, you can specify the +SSEDict as follows: + +.. ipython:: + + In [3]: SSEDict = {'stellar_engine': 'metisse', + ...: 'path_to_tracks': 'path/to/your/hydrogen/rich/stellar/models/', + ...: 'path_to_he_tracks': 'path/to/your/helium/stellar/models/'} + + +For now, we will use the default SSE method for evolving single stars in binaries. +To do this, we specify the SSEDict which tells COSMIC to use the Hurley fitting formulae. + +.. ipython:: + + In [3]: SSEDict = {'stellar_engine': 'sse'} + + The flags for the various binary evolution prescriptions used in BSE also need to be set. Each flag is saved in the BSEDict dictionary. Note that the BSEDict only needs to be specified the first time a binary is evolved with COSMIC or if you need to change the binary evolution prescriptions. -If you are unfamiliar with these prescriptions, it is highly -advised to either run the defaults from the COSMIC install which are consistent -with `Breivik+2020 `_ +If you are unfamiliar with these prescriptions, it is +advised to run the defaults from the COSMIC install which are consistent +with `Breivik+2020 `_, +though we don't promise that these are the most up-to-date prescriptions. .. ipython:: - In [5]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': 1.0, 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1, 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : -1, 'rtmsflag' : 0, 'wd_mass_lim': 1} + In [5]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': [1.0, 1.0], 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1, 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : [-1, -1], 'rtmsflag' : 0, 'wd_mass_lim': 1} Once the binary is initialized and the BSE model is set, the system is evolved with the @@ -62,7 +89,7 @@ the Evolve class, which calls the evolv2.f subroutine in the BSE source code. .. ipython:: :okwarning: - In [6]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=single_binary, BSEDict=BSEDict) + In [6]: bpp, bcm, initC, kick_info = Evolve.evolve(initialbinarytable=single_binary, BSEDict=BSEDict, SSEDict=SSEDict) For every evolved binary system, BSE generates two arrays, which are stored as pandas DataFrames in COSMIC: @@ -119,17 +146,18 @@ You can also use the built-in plotting function to see how the system evolves: ....: ecc=0.448872, tphysf=13700.0, ....: kstar1=1, kstar2=1, metallicity=0.002) - In [15]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': 1.0, 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1, 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : -1, 'rtmsflag' : 0, 'wd_mass_lim': 1} + In [15]: BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': [1.0, 1.0], 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1, 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : [-1, -1], 'rtmsflag' : 0, 'wd_mass_lim': 1} - In [16]: fig = evolve_and_plot(single_binary, t_min=None, t_max=None, BSEDict=BSEDict, sys_obs={}) + In [16]: fig = evolve_and_plot(single_binary, t_min=None, t_max=None, BSEDict=BSEDict, SSEDict=SSEDict, sys_obs={}) .. plot:: from cosmic.sample.initialbinarytable import InitialBinaryTable from cosmic.plotting import evolve_and_plot single_binary = InitialBinaryTable.InitialBinaries(m1=85.543645, m2=84.99784, porb=446.795757, ecc=0.448872, tphysf=13700.0, kstar1=1, kstar2=1, metallicity=0.002) - BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': 1.0, 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1, 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : -1, 'rtmsflag' : 0, 'wd_mass_lim': 1} - fig = evolve_and_plot(single_binary, t_min=None, t_max=None, BSEDict=BSEDict, sys_obs={}) + SSEDict = {'stellar_engine': 'sse'} + BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': [1.0, 1.0], 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1, 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : [-1, -1], 'rtmsflag' : 0, 'wd_mass_lim': 1} + fig = evolve_and_plot(single_binary, t_min=None, t_max=None, BSEDict=BSEDict, SSEDict=SSEDict, sys_obs={}) In this case, all the action happens in the first few Myr, so let's specify a t_max: @@ -137,12 +165,13 @@ In this case, all the action happens in the first few Myr, so let's specify a t_ .. ipython:: :okwarning: - In [17]: fig = evolve_and_plot(initC, t_min=None, t_max=6.0, BSEDict={}, sys_obs={}) + In [17]: fig = evolve_and_plot(initC, t_min=None, t_max=6.0, BSEDict={}, SSEDict=SSEDict, sys_obs={}) .. plot:: from cosmic.sample.initialbinarytable import InitialBinaryTable from cosmic.plotting import evolve_and_plot single_binary = InitialBinaryTable.InitialBinaries(m1=85.543645, m2=84.99784, porb=446.795757, ecc=0.448872, tphysf=13700.0, kstar1=1, kstar2=1, metallicity=0.002) - BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': 1.0, 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1, 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : -1, 'rtmsflag' : 0, 'wd_mass_lim': 1} - fig = evolve_and_plot(single_binary, t_min=None, t_max=6.0, BSEDict=BSEDict, sys_obs={}) \ No newline at end of file + SSEDict = {'stellar_engine': 'sse'} + BSEDict = {'xi': 1.0, 'bhflag': 1, 'neta': 0.5, 'windflag': 3, 'wdflag': 1, 'alpha1': [1.0, 1.0], 'pts1': 0.001, 'pts3': 0.02, 'pts2': 0.01, 'epsnov': 0.001, 'hewind': 0.5, 'ck': 1000, 'bwind': 0.0, 'lambdaf': 0.0, 'mxns': 3.0, 'beta': -1.0, 'tflag': 1, 'acc2': 1.5, 'grflag' : 1, 'remnantflag': 4, 'ceflag': 0, 'eddfac': 1.0, 'ifflag': 0, 'bconst': 3000, 'sigma': 265.0, 'gamma': -2.0, 'pisn': 45.0, 'natal_kick_array' : [[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]], 'bhsigmafrac' : 1.0, 'polar_kick_angle' : 90, 'qcrit_array' : [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0], 'cekickflag' : 2, 'cehestarflag' : 0, 'cemergeflag' : 0, 'ecsn' : 2.25, 'ecsn_mlow' : 1.6, 'aic' : 1, 'ussn' : 0, 'sigmadiv' :-20.0, 'qcflag' : 1, 'eddlimflag' : 0, 'fprimc_array' : [2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0,2.0/21.0], 'bhspinflag' : 0, 'bhspinmag' : 0.0, 'rejuv_fac' : 1.0, 'rejuvflag' : 0, 'htpmb' : 1, 'ST_cr' : 1, 'ST_tide' : 1, 'bdecayfac' : 1, 'rembar_massloss' : 0.5, 'kickflag' : 1, 'zsun' : 0.014, 'bhms_coll_flag' : 0, 'don_lim' : -1, 'acc_lim' : [-1, -1], 'rtmsflag' : 0, 'wd_mass_lim': 1} + fig = evolve_and_plot(single_binary, t_min=None, t_max=6.0, BSEDict=BSEDict, SSEDict=SSEDict, sys_obs={}) \ No newline at end of file diff --git a/src/cosmic/_version.py b/src/cosmic/_version.py index b202327a8..ce1305bf4 100644 --- a/src/cosmic/_version.py +++ b/src/cosmic/_version.py @@ -1 +1 @@ -__version__ = "3.6.1" +__version__ = "4.0.0" From 4950a4e6a82e2dc8249665a51b91ff822aeb5537 Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Mon, 3 Nov 2025 08:56:57 -0500 Subject: [PATCH 45/46] add in the necessary html page and a note for installation from source with a git clone and submodule language --- docs/pages/config/config_insert_bse.html | 24 ++++++++++++------------ docs/pages/install.rst | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/docs/pages/config/config_insert_bse.html b/docs/pages/config/config_insert_bse.html index f47ce4f5a..0f2491a41 100644 --- a/docs/pages/config/config_insert_bse.html +++ b/docs/pages/config/config_insert_bse.html @@ -177,14 +177,14 @@

acc2

alpha1

Common-envelope efficiency parameter which scales the efficiency of transferring orbital energy to the envelope. See Hurley+2002, Eq. 71.

-

Default: 1.0

+

Default: [1.0, 1.0]

-
+
Option details
-

This value is equivalent to \(\alpha\) in Hurley+2002, Eq. 71.

-
  • positive values: Sets the common-envelope efficiency parameter, \(\alpha\)
  • 1.0: Default value
+

This value is equivalent to \(\alpha\) in Hurley+2002, Eq. 71. A list is supplied such that the primary and secondary can be assigned different values for \(\alpha\).

+
  • positive values: Sets the common-envelope efficiency parameter, \(\alpha\), for each binary component
  • [1.0, 1.0]: Default value
@@ -193,7 +193,7 @@

lambdaf

Binding energy factor for common envelope evolution. The initial binding energy of the stellar envelope is proportional to \(1 / \lambda\). See Hurley+2002, Eq. 69.

Default: 0.0

-
+
Option details
@@ -404,12 +404,12 @@

kickflag

Sets the particular natal kick prescription to use. Note that sigmadiv, bhflag, bhsigmafrac, aic, and ussn, which are described below, are only used when abs(kickflag)=1. Positive values use the Pfahl+2002 prescription for handling natal kicks.

Default: 1

-
+
Option details

-
  • 1: The standard COSMIC kick prescription, where kicks are drawn from a bimodal distribution with standard FeCCSN getting a kick drawn from a Maxwellian distribution with dispersion parameter sigma and ECSN/USSN are drawn according to sigmadiv. This setting has additional possible options for bhflag, bhsigmafrac, aic and ussn.
  • 2: Natal kicks are drawn according to sigma and scaled by the ejecta mass and remnant mass following Eq. 1 of Giacobbo & Mapelli 2020 with their default parameters (\(m_{\rm NS = 1.2 {\rm M_\odot}\), \(m_{\rm ej = 9 {\rm M_\odot}\))
  • 3: Natal kicks are drawn according to sigma and scaled by just the ejecta mass following Eq. 2 of Giacobbo & Mapelli 2020, which does not scale the kick by (\(m_{\rm NS\)
  • 4: Natal kicks are drawn according to Eq. 1 of Bray & Eldridge 2016, with their default parameters (\(\alpha=70 \, {\rm km/s}, \beta = 120 \, {\rm km/s)}
  • negative values: Same as above settings but using the old Kiel & Hurley 2009 prescription for changing the orbital configuration of the binary, available for reproducibility purposes but not recommended for new work
+
  • 1: The standard COSMIC kick prescription, where kicks are drawn from a bimodal distribution with standard FeCCSN getting a kick drawn from a Maxwellian distribution with dispersion parameter sigma and ECSN/USSN are drawn according to sigmadiv. This setting has additional possible options for bhflag, bhsigmafrac, aic and ussn.
  • 2: Natal kicks are drawn according to sigma and scaled by the ejecta mass and remnant mass following Eq. 1 of Giacobbo & Mapelli 2020 with their default parameters (\(m_{\rm NS = 1.2 {\rm M_\odot}\), \(m_{\rm ej = 9 {\rm M_\odot}\))
  • 3: Natal kicks are drawn according to sigma and scaled by just the ejecta mass following Eq. 2 of Giacobbo & Mapelli 2020, which does not scale the kick by (\(m_{\rm NS\)
  • 4: Natal kicks are drawn according to Eq. 1 of Bray & Eldridge 2016, with their default parameters (\(\alpha=70 \, {\rm km/s}, \beta = 120 \, {\rm km/s)}
  • 5: Follows the same prescription as 1, but uses the kick prescription described in Disberg & Mandel 2025 for CCSN.
  • negative values: Same as above settings but using the old Kiel & Hurley 2009 prescription for changing the orbital configuration of the binary, available for reproducibility purposes but not recommended for new work. kickflag=-5 is NOT implemented.
@@ -484,7 +484,7 @@

ecsn

-

ecsn_low

+

ecsn_mlow

Sets the low end of the ECSN mass range

Default: 1.6

@@ -709,15 +709,15 @@

don_lim

acc_lim

-

Limits the amount of mass accreted during Roche-lobe overflow

-

Default: -1

+

Limits the amount of mass accreted during Roche-lobe overflow where each binary component must have its own limit specified in a list

+

Default: [-1, -1]

-
+
Option details

-
  • -1: limited to 10x the thermal rate of the accretor for MS/HG/CHeB and unlimited for GB/EAGB/AGB stars
  • -2: limited to 1x the thermal rate of the accretor for MS/HG/CHeB and unlimited for GB/EAGB/AGB stars
  • -3: limited to 10x the thermal rate of the accretor for all stars
  • -4: limited to 1x the thermal rate of the accretor for all stars
  • >= 0: sets overall fraction of donor material that is accreted, with the rest being lost from the system (acc_lim = 0.5 assumes 50% accretion efficiency as in Belczynski+2008)
+
  • -1: limited to 10x the thermal rate of the accretor for MS/HG/CHeB and unlimited for GB/EAGB/AGB stars
  • -2: limited to 1x the thermal rate of the accretor for MS/HG/CHeB and unlimited for GB/EAGB/AGB stars
  • -3: limited to 10x the thermal rate of the accretor for all stars
  • -4: limited to 1x the thermal rate of the accretor for all stars
  • >= 0: sets overall fraction of donor material that is accreted, with the rest being lost from the system (acc_lim = 0.5 assumes 50% accretion efficiency as in Belczynski+2008)
  • [-1, -1]: Default choice

Tides


diff --git a/docs/pages/install.rst b/docs/pages/install.rst index 495d24da7..1d8f21932 100644 --- a/docs/pages/install.rst +++ b/docs/pages/install.rst @@ -113,3 +113,22 @@ PLEASE explicitly install both into the COSMIC environment: pip install jupyter ipython +Installing from source with GitHub +---------------------------------- + +If you wish to install COSMIC from source, you can clone the repository from GitHub and install it locally using pip. If you decide to go this route, we recommend `creating your own fork `_ of the repository to keep your development work separate from the main repository. + +Once you have your own fork, you can clone it as: + +.. code-block:: bash + + git clone --recurse-submodules /link/to/your/forked/repo + +The `--recurse-submodules` flag is important as it ensures that the METISSE submodule is also cloned. Once cloned, navigate to the COSMIC directory and install it using pip: + +.. code-block:: bash + + cd COSMIC + pip install . + +Now that COSMIC is installed, you can simulate binary populations as described in the :ref:`examples` and :ref:`runpop` pages. \ No newline at end of file From 73e8e56ca5e35ba5cb1813039baf91ab1fc2fe8d Mon Sep 17 00:00:00 2001 From: Katie Breivik Date: Mon, 3 Nov 2025 13:44:54 -0500 Subject: [PATCH 46/46] properly set up metisse submodule --- .github/workflows/build_wheels_and_publish.yml | 5 +++++ .github/workflows/python-package.yml | 10 +++------- .gitmodules | 1 + 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_wheels_and_publish.yml b/.github/workflows/build_wheels_and_publish.yml index 5e3d74847..2b6156ccf 100644 --- a/.github/workflows/build_wheels_and_publish.yml +++ b/.github/workflows/build_wheels_and_publish.yml @@ -28,6 +28,11 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + submodules: recursive + - name: Switch METISSE submodule to track develop branch + run: | + git submodule set-branch --branch develop src/cosmic/src/METISSE + git submodule update --remote src/cosmic/src/METISSE - uses: actions/setup-python@v5 name: Install Python with: diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index d4196efe9..f461fe61b 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -20,14 +20,10 @@ jobs: with: submodules: recursive fetch-depth: 0 # needed for full submodule history - - name: Switch METISSE submodule to develop branch + - name: Switch METISSE submodule to track develop branch run: | - cd src/cosmic/src/METISSE - git remote set-url origin https://github.com/TeamMETISSE/METISSE - git fetch origin develop - git checkout develop - git pull origin develop - cd $GITHUB_WORKSPACE + git submodule set-branch --branch develop src/cosmic/src/METISSE + git submodule update --remote src/cosmic/src/METISSE - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: diff --git a/.gitmodules b/.gitmodules index 87f8c6029..ce5fc68dd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "src/cosmic/src/METISSE"] path = src/cosmic/src/METISSE url = https://github.com/TeamMETISSE/METISSE.git + branch = develop