; COSMIC INI file
[filters]
; select_final_state will retain only the final entry of the bcm arry if set to True
; default=True
select_final_state = True

; binary_state determines which types of binaries endstates to retain
; 0 alive today, 1 merged, 2 disrupted
; default=[0,1,2]
binary_state = [0,1,2]

[sampling]
; Specify if you woud like to sample initial conditions via
; the independent method (indepedent) or would like to sample
; initial conditions follow Moe & Di Stefano (2017) (multidim)
sampling_method=multidim

; Sets the time in the past when star formation initiates in Myr
SF_start = 13700.0

; Sets the duration of constant star formation in Myr
SF_duration = 0.0

; Metallicity of the population of initial binaries
metallicity = 0.02

[convergence]
; A list of parameters you would like to verify have converged
; to a single distribution shape.
; Options include mass_1, mass_2, sep, porb, ecc, massc_1, massc_2
; rad_1, rad_2
convergence_params = [mass_1,mass_2,porb,ecc]

; convergence_limits is a dictionary that can contain limits for convergence params
; convergence_limits = {"mass_1" : [0, 20], "sep" : [0,5000]}
convergence_limits = {}

; formation computes convergence on binary properties
; at formation with user-specified final kstars

; 1_SN computes convergence on binary properties
; just before the first supernova for the population with
; user-specified final kstars

; 2_SN computes convergence on binary properties
; just before the second supernova for the population with
; user-specified final kstars

; disruption computes convergence on binary properties
; just before disruption of the population with
; user-specified final kstars

; final_state computes convergence on binary properties
; after the full evolution specified by the user-supplied evolution time
; and with the user specified final kstars

; XRB_form computes convergence on binary properties
; at the start of RLO following the first supernova on the population with
; user-specified final kstars
pop_select = formation

; match provides the tolerance for the convergence calculation
; and is calculated as match = log10(1-convergence)
; default = -5.0
match = -5.0

; bcm_bpp_initCond_filter filters the bcm/bpp/initCond
; arrays to only the binaries that are in the conv array if true
bcm_bpp_initCond_filter = False


[rand_seed]
; random seed int
seed = 42


[bse]

;;;;;;;;;;;;;;;;;;;;;;
;;; SAMPLING FLAGS ;;;
;;;;;;;;;;;;;;;;;;;;;;

; dtp is the timestep (in Myr) for outputting to the bcm array
; if dtp=0, will print every timestep (not recommended)
; if not set, it will automatically set to dtp=tphsyf (default)
;dtp = 1.0

; pts1,pts2,pts3 determine the timesteps chosen in each
; evolution phase as decimal fractions of the time taken in that phase:
;                 pts1 - MS                  (default=0.001, see Banerjee+ 2019)
pts1=0.05
;                 pts2 - GB, CHeB, AGB, HeGB (default=0.01)
pts2=0.01
;                 pts3 - HG, HeMS            (default=0.02)
pts3=0.02


;;;;;;;;;;;;;;;;;;;;;;;;;
;;; METALLICITY FLAGS ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;
; specify the value for Solar metallicity, which primarily affects
; winds in BSE
zsun = 0.02


;;;;;;;;;;;;;;;;;;
;;; WIND FLAGS ;;;
;;;;;;;;;;;;;;;;;;

; windflag sets the wind prescription
; windflag=0: stock BSE; windflag=1: StarTrack 2008
; windflag=2: Vink+2001; windflag=3: Vink+2005 (Vink plus LBV winds)
; default=3
windflag=3

; eddlimflag turns on metallicity dependence on winds, affecting the
; mass-loss rate of low-metallicity stars near the Eddington limit
; (see Grafener et al. 2011, Giacobbo et al. 2018)
; default=0
eddlimflag = 0

; neta is the Reimers mass-loss coefficent
; for more information, see Kudritzki & Reimers 1978, A&A 70, 227
; default=0.5
neta = 0.5

; bwind is the binary enhanced mass loss parameter
; bwind it is always inactive for single stars
; default=0.0
bwind = 0.0

; hewind is a helium star mass loss factor, between 0 and 1
; only applies if windflag=0, otherwise it is overwritten
; default=1.0
hewind = 1.0

; beta is wind velocity factor: proportional to vwind^2
; beta<0: follows StarTrack 2008; beta=0.125: stock BSE
; default=-1.0
beta=-1.0

; xi is the 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
; default=0.5
xi=0.5

; acc2 sets the Bondi-Hoyle wind accretion factor onto companion
; default=1.5
acc2=1.5



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; COMMON ENVELOPE FLAGS ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; alpha1 is the common-envelope efficiency parameter
; default=1.0
alpha1 = 1.0

; lambdaf is the binding energy factor for common envelope evolution
; lambdaf>0.0 uses variable lambda prescription written by Onno Pols
;     Note that f>=1 averages two values for lambda together in unpredictable
;     ways
; lambdaf<0 uses fixes lambda to a value of -1.0*lambdaf
; default=0.5
lambdaf = 0.5

; ceflag=1 used the method from de Kool 1990 for setting the initial orbital energy
; ceflag=0 does not use this method (uses the core mass to calculate initial orbital energy)
; default=0
ceflag=0

; cekickflag determined the prescription for calling kick.f in comenv.f
; 0: default BSE
; 1: uses pre-CE mass and sep values
; 2: uses post-CE mass and sep
; default=2
cekickflag=2

; cemergeflag determines whether stars without a core-envelope boundary automatically lead to merger in CE
; cemergeflag=1 turns this on (causes these systems to merge)
; default=0
cemergeflag=0

; cehestarflag uses fitting formulae from TLP, 2015, MNRAS, 451 for evolving RLO systems with a helium star donor and compact object accretor
; this flag will override choice made by cekickflag if set
; 0: off
; 1: fits for final period only
; 2: fits for both final mass and final period
; default=0
cehestarflag=0

; qcflag is an integer flag that sets the model to determine which critical mass ratios to use for the onset of unstable mass transfer and/or a common envelope. NOTE: this is overridden by qcrit_array if any of the values are non-zero.
; 0: standard BSE
; 1: BSE but with Hjellming & Webbink, 1987, ApJ, 318, 794 GB/AGB stars
; 2: following binary_c from Claeys+2014 Table 2
; 3: following binary_c from Claeys+2014 Table 2 but with Hjellming & Webbink, 1987, ApJ, 318, 794 GB/AGB stars
; default=2
qcflag=3

; qcrit_array is a 16-length array for 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 prescription of the qcflag for that kstar
; default: [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
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]



;;;;;;;;;;;;;;;;;;
;;; KICK FLAGS ;;;
;;;;;;;;;;;;;;;;;;

; kickflag sets the particular kick prescription to use
; 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=2 uses the prescription from Giacobbo & Mapelli 2020 (Eq. 1)
; with their default parameters (<m_ns>=1.2 Msun, <m_ej>=9 Msun)
; kickflag=3 uses the prescription from Giacobbo & Mapelli 2020 (Eq. 2),
; which does not scale the kick by <m_ns>
; kickflag=4 uses the prescription from Bray & Eldridge 2016 (Eq. 1)
; with their default parameters (alpha=70 km/s, beta=120 km/s)
; 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
sigma=265.0

; bhflag != 0 allows velocity kick at BH formation
; bhflag=0: no BH kicks; bhflag=1: fallback-modulated kicks
; bhflag=2: mass-weighted (proportional) kicks; bhflag=3: full NS kicks
; default=1
bhflag=1

; ecsn>0 turns on ECSN and also sets the maximum ECSN mass range (at the time of the SN)
; stock BSE and StarTrack: ecsn=2.25; Podsiadlowski+2004: ecsn=2.5)
; default=2.5
ecsn=2.5

; ecsn_mlow sets the low end of the ECSN mass range
; stock BSE:1.6; StarTrack:1.85; Podsiadlowski+2004:1.4)
; default=1.4
ecsn_mlow=1.4

; sigmadiv sets the modified ECSN kick
; negative values sets the ECSN sigma value, positive values divide sigma above by sigmadiv
; default=-20.0
sigmadiv=-20.0

; aic=1 turns on low kicks for accretion induced collapse
; works even if ecsn=0
; default=1
aic=1

; ussn=1 uses reduced kicks (drawn from the sigmadiv distritbuion) for ultra-stripped supernovae
; these happen whenever a He-star undergoes a CE with a compact companion
; default=0
ussn=1

; pisn>0 allows for (pulsational) pair instability supernovae
; and sets the maximum mass of the remnant
; pisn=-1 uses the formulae from Spera+Mapelli 2017 for the mass
; pisn=-2 uses a polynomial fit to Table 1 Marchant 2018
; pisn=-3 uses a polynomial fit to Table 5 in Woosley 2019
; pisn=0 turns off (pulsational) pair instability supernovae
; default=45
pisn=45.0

; bhsigmafrac sets the fractional modification used for scaling down the sigma for BHs
; this works in addition to whatever is chosen for bhflag, and is applied to the sigma beforehand these prescriptions are implemented
; default=1.0
bhsigmafrac = 1.0

; polar_kick_angle sets the opening angle of the kick relative to the pole of the exploding star
; this can range from 0 (strictly polar kicks) to 90 (fully isotropic kicks)
; default=90.0
polar_kick_angle = 90.0

; natal_kick_array is a [2,5] array for user-input values for the SN natal kick
; with the first row corresponding to the first star (kw=1) and the second row
; corresponding to the second star (kw=2)
; columns are [vk, phi, theta, eccentric_anomaly, rand_seed] with vk is valid on
; the range [0, inf], phi are the co-lateral polar angles valid from [-pi/2, pi/2], and theta are azimuthal angles [0, 2*pi]
; any number outside of these ranges will be sampled in the standard way in kick.f
; default=[[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]]
natal_kick_array=[[-100.0,-100.0,-100.0,-100.0,0.0], [-100.0,-100.0,-100.0,-100.0,0.0]]



;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; REMNANT MASS FLAGS ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;

; remnantflag determines the remnant mass prescription used
; remnantflag=0: default BSE; remnantflag=1: Belczynski et al. 2002, ApJ, 572, 407
; remnantflag=2: Belczynski et al. 2008; remnantflag=3: rapid prescription (Fryer+ 2012)
; remnantflag=4: delayed prescription (Fryer+ 2012)
; default=4
remnantflag=3

; mxns sets the maximum NS mass
; default=3.0
mxns=3.0

; rembar_massloss determines the mass conversion from baryonic to
; gravitational mass
; rembar_massloss >= 0: sets the maximum amount of mass loss
; -1 < rembar_massloss < 0: uses the prescription from Fryer et al. 2012,
; assuming for BHs Mrem = (1+rembar_massloss)*Mrem,bar for negative rembar_massloss
; default=0.5
rembar_massloss=0.5

; wd_mass_lim determines if the maximum white dwarf mass is limited to
; the chandraekhar mass during mic. 1 implements the limit.
; default = 1
wd_mass_lim = 1

;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; REMNANT SPIN FLAGS ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;

; bhspinflag uses different prescriptions for BH spin after formation
; bhspinflag=0; sets all BH spins to bhspinmag
; bhspinflag=1; draws a random BH spin between 0 and bhspinmag for every BH
; bhspinflag=2; core-mass dependent BH spin (based on Belczynski+2017; 1706.07053, v1)
; default=0
bhspinflag = 0

; bhspinmag sets either the spin of all BHs or the upper limit of the uniform
; distribution for BH spins
; default=0.0
bhspinmag=0.0


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; GR ORBITAL DECAY FLAG ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; grflag turns on or off orbital decay due to gravitational wave radiation
; grflag=0; no orbital decay due to GR
; grflag=1; orbital decay due to GR is included
grflag = 1


;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; MASS TRANSFER FLAGS ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;

; eddfac is Eddington limit factor for mass transfer
; default=1.0
eddfac=1.0

; gamma is the angular momentum factor for mass lost during RLO
; 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
; default=-2
gamma=-2.0

; don_lim is a flag which determines how much mass is lost during thermal timescale MT
; don_lim = -1: assumes standard BSE choice as outlined in Hurley+2002
; don_lim = -2: Follows Claeys+2014
don_lim = -1

; acc_lim is a flag which determines how much mass is accreted from the donor
; if acc_lim >= 0: this provides the fraction of mass accreted
; acc_lim = -1: assumes standard BSE choice as outlined in Hurley+2002 which limits to 10*tkh_acc for MS/CHeB
; 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

;;;;;;;;;;;;;;;;;;;
;;; TIDES FLAGS ;;;
;;;;;;;;;;;;;;;;;;;

; tflag=1 activates tidal circularisation
; default=1
tflag=1

; ST_tide sets which tidal method to use. 0=Hurley+2002, 1=StarTrack: Belczynski+2008
; Note, here 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=1
ST_tide=0

; fprimc_array controls the scaling factor for convective tides
; each item is set individually for its associated kstar
; The releveant equation is Equation 21 from the BSE paper
; The default is to send the same coefficient (2/21) as is in the equation
; for every kstar
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]

;;;;;;;;;;;;;;;;;;;;;;;;;
;;; WHITE DWARF FLAGS ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;

; ifflag > 0 uses WD IFMR of HPE, 1995, MNRAS, 272, 800
; default=0
ifflag=0

; wdflag > 0 uses modified-Mestel cooling for WDs
; default=0
wdflag=0

; epsnov is the fraction of accreted matter retained in nova eruptions
; default=0.001
epsnov=0.001

;;;;;;;;;;;;;;;;;;;
;; PULSAR FLAGS ;;;
;;;;;;;;;;;;;;;;;;;
; bdecayfac determines which accretion induced field decay method to
; use from Kiel+2008: 0=exp, 1=inverse
; default=1
bdecayfac=1

; bconst is related to magnetic field evolution of pulsars, see Kiel+2008
; default=-3000
bconst=3000

; ck is related to magnetic field evolution of pulsars, see Kiel+2008
; default=-1000
ck=1000

;;;;;;;;;;;;;;;;;;;;;;;
;; MIXING VARIABLES ;;;
;;;;;;;;;;;;;;;;;;;;;;;

; rejuv_fac allows different mixing factors in Equation 80 from the BSE
; paper. This was originally hard coded to 0.1, which leads massive
; stars to potentially have extended main sequence lifetimes.
rejuv_fac=1.0

; rejuvflag toggles between the original BSE prescription for MS mixing and
; lifetimes of stars (equation 80) and a more correct version that uses only the
; MS lifetime of stars (flag 1)
; default=1
rejuvflag=1

; bhms_coll_flag 
; If set to 1 then if BH+star collision and if Mstar > Mbh, do not destroy the star
; default = 0
bhms_coll_flag=0

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; MAGNETIC BRAKING FLAGS ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; htpmb allows for different magnetic braking models.
; 0=follows BSE paper Section 2.4
; 1=follows Ivanova & Taam 2003 method which kicks in later than the standard
; default=1
htpmb=1

;;;;;;;;;;;;;;;;;
;; MISC FLAGS ;;;
;;;;;;;;;;;;;;;;;

; ST_cr sets which convective/radiative boundary to use
; 0=follows BSE paper
; 1=follows StarTrack (Belcyznski+2008)
; default=1
ST_cr=1

;rtmsflag
;rtmsflag = 0 (Cosmic with the M200 fix for z < 0.0008)
;rtmsflag = 1 (For BOOST data)
;rtmsflag = 2 (For BPASS data)
;default = 0
rtmsflag = 0
