# Define the system of units to use internally.
InternalUnitSystem:
  UnitMass_in_cgs:     1.9891E43   # 10^10 solar masses 
  UnitLength_in_cgs:   3.08567758E21   # 1 kpc 
  UnitVelocity_in_cgs: 1E5   # km/s
  UnitCurrent_in_cgs:  1   # Amperes
  UnitTemp_in_cgs:     1   # Kelvin

# Parameters for the self-gravity scheme
Gravity:
  eta:                         0.025     # Constant dimensionless multiplier for time integration.
  MAC:                         geometric # Use the geometric opening angle condition
  theta_cr:                    0.7       # Opening angle (Multipole acceptance criterion)
  use_tree_below_softening:    1
  max_physical_baryon_softening: 0.2    # Maximal Plummer-equivalent softening length in physical coordinates for baryon particles (in internal units).

# Parameters governing the time integration (Set dt_min and dt_max to the same value for a fixed time-step run.)
TimeIntegration:
  time_begin:        0.     # The starting time of the simulation (in internal units).
  time_end:          3.069 # The end time of the simulation (in internal units).
  dt_min:            1e-16  # The minimal time-step size of the simulation (in internal units).
  dt_max:            1e-2   # The maximal time-step size of the simulation (in internal units).

# Parameters governing the snapshots
Snapshots:
  basename:   output      # Common part of the name of output files
  time_first: 0.          # (Optional) Time of the first output if non-cosmological time-integration (in internal units)
  delta_time: 0.001023     # Time difference between consecutive outputs (in internal units) 0.01023 TU = 10 Myr
  compression: 4           # Compress the snapshots
  recording_triggers_part: [-1, -1]   # Not recording as we have many snapshots
  recording_triggers_bpart: [-1, -1]  # Not recording as we have many snapshots 

Scheduler:
  max_top_level_cells: 16
  
# Parameters governing the conserved quantities statistics
Statistics:
  delta_time:           1e-2     # Time between statistics output
  time_first:             0.     # (Optional) Time of the first stats output if non-cosmological time-integration (in internal units)

# Parameters related to the initial conditions
InitialConditions:
  file_name:               elliptical_IC.hdf5 # The file to read
  periodic:                0        # Are we running with periodic ICs?
  stars_smoothing_length:  0.5
  
# Parameters for the hydrodynamics scheme
SPH:
  minimal_temperature:   10.      # Minimum allowed gas temperature
  resolution_eta:        1.2348   # Target smoothing length in units of the mean inter-particle separation (1.2348 == 48Ngbs with the cubic spline kernel).
  CFL_condition:         0.2      # Courant-Friedrich-Levy condition for time integration.
  h_min_ratio:           1e-8     # Minimal smoothing in units of softening.
  h_max:                 50.0
  H_mass_fraction:       0.756

# Standard COLIBRE cooling options
COLIBRECooling:
  dir_name:                ./cooling_files # Location of the cooling tables
  filebase_cool:           UVB_dust1_CR1_G1_shield1_v1
  H_reion_z:               11.5              # Redshift of Hydrogen re-ionization
  H_reion_eV_p_H:          2.0
  He_reion_z_centre:       3.5               # Redshift of the centre of the Helium re-ionization Gaussian
  He_reion_z_sigma:        0.5               # Spread in redshift of the  Helium re-ionization Gaussian
  He_reion_eV_p_H:         2.0               # Energy inject by Helium re-ionization in electron-volt per Hydrogen atom
  delta_logTEOS_subgrid_properties: 0.3      # delta log T above the EOS below which the subgrid properties use Teq assumption
  rapid_cooling_threshold:          0.333333 # Switch to rapid cooling regime for dt / t_cool above this threshold.

# CHIMES cooling parameters
CHIMESCooling:
  data_path:                  chimes-data         # Path to chimes-data repository
  EqmAbundanceTable:          colibre_HHe         # Path to equilibrium abundance tables
  PhotoIonTable_UVB:          SP20_cross_sections # Path to cross-sections tables; UVB 
  PhotoIonTable_ISRF:         cross_sections_B87.hdf5      # Path to cross-sections tables; ISRF
  UV_field:             COLIBRE           # Flag specifying radiation field model 
  Shielding_model:      COLIBRE           # Flag specifying local shielding model 
  UVB_z_dependence:     COLIBRE           # Flag to switch on redshift-dependent UVB 
  shielding_length_factor:    0.5         # Multiplicative factor to scale shielding length
  max_shielding_length_kpc:   100.0       # Max shielding length
  rad_field_norm_factor:      0.01        # Multiplicative factor to scale ISRF
  init_abundance_mode:     read           # Flag to specify how to set initial CHIMES abundances
  colibre_metal_depletion:    0           # Flag to specify metal depletion model
  turbulent_velocity_dispersion_km_p_s:  6.0   # 1D velocity dispersion, in km/s.
  colibre_use_turbulent_jeans_length:  1       # Integer flag, 0 - use only thermal Jeans length, 1 - use maximum of thermal or turbulent Jeans length.
  colibre_saturate_radiation_field:    1       # Integer flag, 0 - no max rad field, 1 - impose max rad field.
  colibre_col_dens_saturate_rad:  1.3e22       # Column density at which the Colibre rad field saturates, in cm^-2. 
  colibre_saturate_cr_rate:   1                # Integer flag, 0 - no max CR rate, 1 - impose max CR rate.
  colibre_col_dens_saturate_cr:  3.63e20       # Column density at which the CR rate saturates, in cm^-2. 
  colibre_cr_plaw_index:      1.0              # Power law index of the scaling between CR rate and column density. 
  relativeTolerance:          1e-3        # Relative tolerance for CHIMES intergration
  absoluteTolerance:          1e-10       # Absolute tolerance for CHIMES chemistry integration
  explicitTolerance:          0.1         # Tolerance below which we use the explicit solution in CHIMES
  scale_metal_tolerances:     1           # Flag to scale absolute tolerances by element abundance
  Tmol_K:                     1.0e5       # Maximum temperature for the molecular network
  ChemistryEqmMode:           0           # Flag to use pre-computed equilibrium abundances throughout
  ThermEvolOn:                1           # Flag to switch on thermal evolution in CHIMES
  chimes_debug:               0           # Flag to include extra debug outputs in CHIMES
  cosmic_ray_rate_cgs:        1.8e-16     # HI ionisation rate from cosmic rays in units of HI per second.
  delta_logTEOS_subgrid_properties:  0.3  # delta logT above the EOS below which set CHIMES to eqm and use subgrid properties
  use_colibre_subgrid_EOS:    1           # Flag to set subgrid rho and T to thermal and pressure eqm on the EOS
  set_FB_particles_to_eqm:    1           # Flag to set particles to eqm if they have been heated by feedback
  destroy_FB_heated_dust:     1           # Destroy dust in the cooling step if particle directly heated, representing supernova destruction 
  use_hybrid_cooling:         1           # Use hybrid cooling, to read in eqm cooling rates from metals not included in CHIMES
  rapid_cooling_threshold:    0.333333    # Threshold in dt / t_cool to switch between rapid- and slow-cooling modes
  colibre_table_path:         ./cooling_files  # Path to COLIBRE cooling tables
  colibre_table_filebase:     cooling_rates   # Filebase of COLIBRE cooling tables split in redshift
  UVB_cutoff_z:               127.0            # Redshift above which the UVB is switched off 
  ISRF_low_dens_cutoff_z:     7.5              # Redshift above which the ISRF is cut off at low densities (UV_field_flag == 2 only)
  S_over_Si_in_solar:         1.0         # S / Si relative to Solar 
  Ca_over_Si_in_solar:        1.0         # Ca / Si relative to Solar 
  IncludeCarbon:              0           # Include Carbon in the CHIMES network
  IncludeNitrogen:            0           # Include Nitrogen in the CHIMES network
  IncludeOxygen:              0           # Include Oxygen in the CHIMES network
  IncludeNeon:                0           # Include Neon in the CHIMES network
  IncludeMagnesium:           0           # Include Magnesium in the CHIMES network
  IncludeSilicon:             0           # Include Silicon in the CHIMES network
  IncludeSulphur:             0           # Include Sulphur in the CHIMES network
  IncludeCalcium:             0           # Include Calcium in the CHIMES network
  IncludeIron:                0           # Include Iron in the CHIMES network
  max_dust_boost_factor:      100.0            # Max boost factor applied to all reactions on dust grains
  dust_boost_nH_min_cgs:      1.0              # Density below which the dust boost factor is equal to unity, in units of cm^-3
  dust_boost_nH_max_cgs:      100.0            # Density below which the dust boost factor is equal to unity, in units of cm^-3

# Solar abundances
COLIBREChemistry:
  init_abundance_metal:     0.004457    # Inital fraction of particle mass in *all* metals 
  init_abundance_Hydrogen:  0.749796    # Inital fraction of particle mass in Hydrogen
  init_abundance_Helium:    0.245747    # Inital fraction of particle mass in Helium
  init_abundance_Carbon:    0.000788    # Inital fraction of particle mass in Carbon
  init_abundance_Nitrogen:  0.000231    # Inital fraction of particle mass in Nitrogen
  init_abundance_Oxygen:    0.001911    # Inital fraction of particle mass in Oxygen
  init_abundance_Neon:      0.000419    # Inital fraction of particle mass in Neon
  init_abundance_Magnesium: 0.000236    # Inital fraction of particle mass in Magnesium
  init_abundance_Silicon:   0.000222    # Inital fraction of particle mass in Silicon
  init_abundance_Iron:      0.000431    # Inital fraction of particle mass in Iron
  init_abundance_Europium:  0.0         # Inital fraction of particle mass in Europium
  init_abundance_Strontium: 0.0         #Initial fraction of particle mass in Strontium
  init_abundance_Barium:    0.0         #Initial fraction of particle mass in Barium
  metal_diffusion_constant:         0.01           # Metal diffusion constant (Smagorinsky constant)
  metal_diffusion_timestep_mult:    0.2            # Run-time parameter to control the time-step condition based on the diffusion rate.

# All dust parameters are optional, with defaults as set below
DustEvolution:
  pair_to_cooling: 		    0			# (Optional) Whether to override implicit dust depletion in cooling with the modelled dust depletion (default 0)
  clumping_factor_mode              chimes_synced   # clumping factor mode: 'constant' (single clumping factor), 'variable' (density dependent clumping) or 'chimes_synced (follow CHIMES dust boost)' 
  use_subgrid_props:		    1          		# (Optional) Whether to use subgrid density/temperature or hydro (default 1)
  use_sputtering:	            1          		# (Optional) Include destructive effects of sputtering on dust grains (default 1)
  use_SNII_destruction:             0          		# (Optional) Include destructive effects of SNII on dust grains (default 0)
  use_accretion:	            1          		# (Optional) Include grain growth by accretion of metals (default 1)
  clumping_factor: 		    30.         		# (Optional) Boost factor applied to accretion rate (default 1.)
  diffusion_boost_factor:	    1.         		# (Optional) Boost factor applied to diffusion rate for dust (default 1.)
  dust_yields_path:		    ./dust_yields	# (Optional) T20 dust only: Path to where AGB dust yield tables are located (default ./dust_yields)
  silicate_molecule_subscript_oxygen:		    6 # subscript for oxygen in the effective silicate molecule e.g. FeMgSi2O6 (default 6)
  silicate_molecule_subscript_magnesium:	    1 # subscript for magnesium in the effective silicate molecule e.g. FeMgSi2O6 (default 1)
  silicate_molecule_subscript_silicon:		    2 # subscript for silicon in the effective silicate molecule e.g. FeMgSi2O6 (default 2)
  silicate_molecule_subscript_iron:		    1 # subscript for iron in the effective silicate molecule e.g. FeMgSi2O6 (default 1)
  limit_depletion:		    1		   # whether to limit the depleted fraction of metals into dust grains to prevent complete depletion of elements
  undepleted_min_reduction_factor:  0.423345	   # The diffuse element limit, represented by a reduction factor to the default saturated diffuse fractions, and chosen to maintain a realistic resevoir of diffuse CO (Fuente et al 2019)
  initial_abundance_silicate:	    0.         		# (Optional) T20 dust only: Initial abundance of silicate dust (default 0.)
  initial_abundance_graphite:	    0.         		# (Optional) T20 dust only: Initial abundance of graphite dust (default 0.)
  initial_abundance_depletedC:	    0.         		# (Optional) M16 dust only: Initial abundance of dust-phase carbon (default 0.)
  initial_abundance_depletedO:	    0.         		# (Optional) M16 dust only: Initial abundance of dust-phase oxygen (default 0.)
  initial_abundance_depletedMg:	    0.         		# (Optional) M16 dust only: Initial abundance of dust-phase magnesiun (default 0.)
  initial_abundance_depletedSi:	    0.         		# (Optional) M16 dust only: Initial abundance of dust-phase silicon (default 0.)
  initial_abundance_depletedFe:	    0.         		# (Optional) M16 dust only: Initial abundance of dust-phase iron (default 0.)

# COLIBRE star formation model (Following a density Schmidt law with virial criterion)
COLIBREStarFormation:
  min_over_density:                  57.7           # Minimum over density above which star formation is allowed
  alpha_virial:                      1.             # set the alpha virial for star forming gas.
  temperature_threshold_K:           0.             # set the subgrid temperature threshold to zero, so no temperature threshold
  SF_model:                          SchmidtLaw     # star formation model to use (SchmidtLaw or PressureLaw)
  star_formation_efficiency:         0.01           # Star formation efficiency (SFE) of the Schmidt law, \rho_\star = SFE * \rho / t_ff
  KS_exponent:                       1.4            # Kennicutt-Schmidt slope for the pressure law.
  KS_normalisation_Msun_p_yr_p_kpc2: 1.515e-4       # Normalization of the Kennicutt-Schmidt slope for the pressure law.
  gas_fraction:                      1.0            # (Optional) gas fraction for pressure law, default to 1.0

Stars:
  birth_time:           -9.1       # (Optional) Initial birth times of *all* the stars to be used if we are overwriting them. (-1 means the stars remain inactive feedback-wise througout the run).
  overwrite_birth_time:  1       # (Optional) Do we want to overwrite the birth time of the stars read from the ICs? (default: 0).
  resolution_eta:        1.1642
  h_tolerance:           1e-2
  timestep_age_threshold_unlimited_Myr: 40 # Stars don't employ a stellar property related time-step when they are > 40Myr old.
  max_timestep_young_Myr: 1.               # Stars below an age of 40Myr use a time-step length of 1Myr at most.
  luminosity_filename:    ./photometry

# COLIBRE feedback model
COLIBREFeedback:
  use_SNII_feedback:                1               # Global switch for SNII thermal (stochastic) feedback.
  use_SNIa_feedback:                1               # Global switch for SNIa thermal (continuous) feedback.
  use_AGB_enrichment:               1               # Global switch for enrichment from AGB stars.
  use_SNII_enrichment:              1               # Global switch for enrichment from SNII stars.
  use_SNIa_enrichment:              1               # Global switch for enrichment from SNIa stars.
  with_r_process_enrichment:        1               # Global switch for r process enrichment from neutron star mergers and rare core-collapse SN (collapsars and common envelop jets SN).
  with_RadiationPressure:           1
  filename:                         ./yieldtables/  # Path to the directory containing the EAGLE yield tables.
  IMF_min_mass_Msun:                0.1             # Minimal stellar mass considered for the Chabrier IMF in solar masses.
  IMF_max_mass_Msun:              100.0             # Maximal stellar mass considered for the Chabrier IMF in solar masses.
  SNII_min_mass_Msun:               8.0             # Minimal mass considered for SNII feedback (not SNII enrichment!) in solar masses.
  SNII_max_mass_Msun:             100.0             # Maximal mass considered for SNII feedback (not SNII enrichment!) in solar masses.
  SNII_wind_delay_Gyr:              -1.0            # Time in Gyr between a star's birth and the SNII thermal feedback event. (< 0. for continuous SNe)
  SNII_delay_thermal_feedback_Gyr:  0.02            # Time in Gyr between a star's birth and the earliest possible SNII thermal feedback event. If SNe occur at earlier times, these events are postponed.
  SNII_delta_T_n_0_H_p_cm3:         0.3             # Pivot (physical) density in SNII variable-dT thermal feedback in H/cm3.
  SNII_delta_T_K_pivot:             3.16228e6       # Pivot temperature in SNII variable-dT thermal feedback in Kelvin. 
  SNII_delta_T_slope:               0.666666666     # Slope in SNII variable-dT thermal feedback.
  SNII_delta_T_K_min:               3.16228e6       # Minimal change in temperature to apply to the gas particle in an SNII thermal feedback event in Kelvin.
  SNII_delta_T_K_max:               1e8             # Maximal change in temperature to apply to the gas particle in na SNII thermal feedback event in Kelvin.
  SNII_energy_erg:                  3.0e51          # Energy of one SNII explosion in ergs.
  SNII_delta_v_km_p_s:              50.0            # Change in the gas-particle velocity that is kicked in a SNII kinetic feedback event
  SNII_f_kinetic:                   0.333333333     # Fraction of SNII energy injected into the gas in kinetic form (the remaining fraction is injected in thermal form)
  SNII_energy_fraction_min:         1.0             # Minimal fraction of energy applied in a SNII feedback event.
  SNII_energy_fraction_max:         1.0             # Maximal fraction of energy applied in a SNII feedback event.
  SNII_energy_fraction_Z_0:         0.0012663729    # Pivot point for the metallicity dependance of the SNII energy fraction (metal mass fraction).
  SNII_energy_fraction_n_0_H_p_cm3: 0.67            # Pivot point for the birth density dependance of the SNII energy fraction in cm^-3.
  SNII_energy_fraction_P_0_K_p_cm3: 3.16228e3            # Pivot point for the birth pressure dependance of the SNII energy fraction in cm^-3.
  SNII_energy_fraction_n_Z:         0.8686          # Power-law for the metallicity dependance of the SNII energy fraction.
  SNII_energy_fraction_n_n:         0.8686          # Power-law for the birth density dependance of the SNII energy fraction.
  SNII_energy_fraction_sigma_P: 0.3          # Width of the birth pressure dependance of the SNII energy fraction (relates to the power-law as n_P = -1/(sigma_P * ln(10))).
  SNIa_energy_erg:                 1.0e51           # Energy of one SNIa explosion in ergs.
  SNIa_delta_T_n_0_H_p_cm3:         0.3             # Pivot (physical) density in SNIa variable-dT thermal feedback in H/cm3.
  SNIa_delta_T_K_pivot:             3.16228e6       # Pivot temperature in SNIa variable-dT thermal feedback in Kelvin. 
  SNIa_delta_T_slope:               0.666666666     # Slope in SNIa variable-dT thermal feedback.
  SNIa_delta_T_K_min:               3.16228e6       # Minimal change in temperature to apply to the gas particle in an SNIa thermal feedback event in Kelvin.
  SNIa_delta_T_K_max:               1e8             # Maximal change in temperature to apply to the gas particle in na SNIa thermal feedback event in Kelvin.
  SNIa_energy_fraction:             1.0             # Fraction of energy applied in a SNIa feedback event.
  AGB_ejecta_velocity_km_p_s:      10.0             # Velocity of the AGB ejectas in km/s.
  SNII_enrichment_min_mass_Msun:    8.0             # Minimal mass considered for SNII enrichment (not SNII feedback!) in solar masses.
  SNII_enrichment_max_mass_Msun:    40.0     
  SNII_yield_factor_Hydrogen:       1.0             # (Optional) Correction factor to apply to the Hydrogen yield from the SNII channel.
  SNII_yield_factor_Helium:         1.0             # (Optional) Correction factor to apply to the Helium yield from the SNII channel.
  SNII_yield_factor_Carbon:         3.0             # (Optional) Correction factor to apply to the Carbon yield from the SNII channel.
  SNII_yield_factor_Nitrogen:       0.8             # (Optional) Correction factor to apply to the Nitrogen yield from the SNII channel.
  SNII_yield_factor_Oxygen:         1.0             # (Optional) Correction factor to apply to the Oxygen yield from the SNII channel.
  SNII_yield_factor_Neon:           1.0             # (Optional) Correction factor to apply to the Neon yield from the SNII channel.
  SNII_yield_factor_Magnesium:      1.0             # (Optional) Correction factor to apply to the Magnesium yield from the SNII channel.
  SNII_yield_factor_Silicon:        0.8             # (Optional) Correction factor to apply to the Silicon yield from the SNII channel.
  SNII_yield_factor_Iron:           2.0             # (Optional) Correction factor to apply to the Iron yield from the SNII channel.
  with_HIIRegions:                  1               # Switch for early feedback (HII regions).
  with_StellarWinds:                1               # Switch for early feedback (Stellar winds).
  Momentum_desired_delta_v:         50.0            # Desired kick in km/s (Done stochastically given the amount of momentum available - v<0 for the code to decide the kick - )
  HIIregion_ionization_fraction:    1.0             # Ionization fraction for gas particles tagged as HII regions (between 0.5 and 1.)
  HIIregion_temperature_K:          1.e4            # Temperature of gas particles tagged as HII regions
  HIIregion_rebuild_dt_Myr:         2.0             # Time between rebuilding the HII region in Myr
  earlyfb_filename:                 ./Early_stellar_feedback.hdf5 # Location of file for early feedback, no needed if stellarwind_maxage_Myr = HIIregion_maxage_Myr = 0.
  stellar_evolution_age_cut_Gyr:       0.1          # Stellar age in Gyr above which the enrichment is down-sampled.
  stellar_evolution_sampling_age_fraction: 0.05     # Time-step of the stars in units of the star's current age when the star is older than the age cut.
  num_of_NSM_per_Msun:              1.3e-5         # Number of neutron star mergers per Msolar.
  yield_Eu_from_NSM_event_Msun:     1e-5          # Amount of europium (in units of Msolar) released by NSM.
  num_of_CEJSN_per_Msun:            1.22e-5         # Number of rare core-collapse SN (CEJSN) per Msolar.
  yield_Eu_from_CEJSN_event_Msun:   2e-5            # Amount of europium (in units of Msolar) released by CEJSN(=Common envelop jet SN).
  num_of_collapsar_per_Msun:        2.6e-5          # Number of rare core-collapse SN (collapsars) per Msolar.
  yield_Eu_from_collapsar_event_Msun: 1e-6          # Amount of europium (in units of Msolar) released by collapsars.
  collapsar_min_mass_Msun:          10.0            # Minimal mass considered for r-process enrichment from collapsars in solar masses.
  collapsar_max_mass_Msun:          100.0           # Maximal mass considered for r-process enrichment from collapsars in solar masses.

# Hernquist potential parameters
HernquistPotential:
  useabspos:       0        # 0 -> positions based on centre, 1 -> absolute positions 
  position:        [0.,0.,0.]    # Location of centre of isothermal potential with respect to centre of the box (if 0) otherwise absolute (if 1) (internal units)
  idealizeddisk:   1        # Run with an idealized galaxy disk
  M200:            1000.0   # M200 of the galaxy disk
  h:               0.704    # reduced Hubble constant (value does not specify the used units!)
  concentration:   9.0      # concentration of the Halo
  diskfraction:    0.000  # Disk mass fraction
  bulgefraction:   0.01  # Bulge mass fraction
  timestep_mult:   0.01     # Dimensionless pre-factor for the time-step condition, basically determines the fraction of the orbital time we use to do the time integration
  epsilon:         0.2      # Softening size (internal units)

# Parameters for the COLIBRE "equation of state"
COLIBREEntropyFloor:
  Jeans_density_norm_H_p_cm3: 0.1        # Physical density above which the COLIBRE Jeans limiter entropy floor kicks in expressed in Hydrogen atoms per cm^3.
  Jeans_temperature_norm_K:   10.        # Temperature of the COLIBRE Jeans limiter entropy floor at the density normalisation expressed in Kelvin.
  Jeans_gamma_effective:      1.3333333  # Slope the of the COLIBRE Jeans limiter entropy floor
  Cool_density_norm_H_p_cm3:  1e-5       # Physical density above which the COLIBRE Cool limiter entropy floor kicks in expressed in Hydrogen atoms per cm^3.
  Cool_temperature_norm_K:    -1.        # Temperature of the COLIBRE Cool limiter entropy floor at the density normalisation expressed in Kelvin.
  Cool_gamma_effective:       1.         # Slope the of the COLIBRE Cool limiter entropy floor

# The SNIa DTD properties in the COLIBRE feedback
SNIaDTD:
  SNIa_efficiency_p_Msun:     0.002      # Normalisation of the SNIa rates in inverse solar masses, used when there is only one functional form in the DTD.
  SNIa_timescale_Gyr:         2.         # Time-scale of the SNIa delay time distribution
  SNIa_delay_time_Gyr:        0.04       # Delay time before the DTD kicks in.

Event_logger:
  delta_time_SNIa_Myr:        10
  delta_time_SNII_Myr:        10
  delta_time_r_processes_Myr: 10

# Parameters for the Friends-Of-Friends algorithm
FOF:
  basename:                        fof_output  # Filename for the FOF outputs.
  min_group_size:                  256         # The minimum no. of particles required for a group.
  linking_length_ratio:            0.2         # Linking length in units of the main inter-particle separation.
  black_hole_seed_halo_mass_Msun:  1.5e10      # Minimal halo mass in which to seed a black hole (in solar masses).
  scale_factor_first:              0.05        # Scale-factor of first FoF black hole seeding calls.
  delta_time:                      1.00751     # Scale-factor ratio between consecutive FoF black hole seeding calls.

# COLIBRE AGN model
COLIBREAGN:
  subgrid_seed_mass_Msun:             1e4        # Black hole subgrid mass at creation time in solar masses.
  use_multi_phase_bondi:              0          # Compute Bondi rates per neighbour particle [1] or for the smoothed ambient gas around the black hole [0]?
  use_subgrid_gas_properties:         1          # Use subgrid density [1] or dynamical density [0] to calculate BH accretion rates?
  use_krumholz:                       1          # Use Krumholz et al. (2006) [1] or standard Bondi-Hoyle-Lyttleton formula [0] for black hole accretion rates? Only used if multi_phase_bondi is 0.
  with_krumholz_vorticity:            1          # Include the vorticity term in Krumholz et al. formula? Only used if use_multi_phase_bondi is 0.
  with_angmom_limiter:                0          # Are we applying the Rosas-Guevara (2015) viscous time-scale reduction term?
  radiative_efficiency:               0.1        # Fraction of the accreted mass that gets radiated.
  max_eddington_fraction:             1.         # Maximal allowed accretion rate in units of the Eddington rate.
  eddington_fraction_for_recording:   0.1        # Record the last time BHs reached an Eddington ratio above this threshold.
  use_nibbling:                       1          # Continuously transfer small amounts of mass from all gas neighbours to a black hole [1] or stochastically swallow whole gas particles [0]?
  min_gas_mass_for_nibbling_Msun:     5e4        # Minimum mass for a gas particle to be nibbled from [M_Sun]. Only used if use_nibbling is 1.
  coupling_efficiency:                0.10       # Fraction of the radiated energy that couples to the gas in feedback events.
  AGN_delta_T_K:                      1e9        # Change in temperature to apply to the gas particle in an AGN feedback event in Kelvin.
  AGN_num_ngb_to_heat:                1.         # Target number of gas neighbours to heat in an AGN feedback event.
  max_reposition_mass_Msun:           2e20       # Maximal BH mass considered for BH repositioning in solar masses.
  max_reposition_distance_ratio:      3.0        # Maximal distance a BH can be repositioned, in units of the softening length.
  with_reposition_velocity_threshold: 0          # Should we only reposition to particles that move slowly w.r.t. the black hole?
  set_reposition_speed:               0          # Should we reposition black holes with (at most) a prescribed speed towards the potential minimum?
  threshold_major_merger:             0.333      # Mass ratio threshold to consider a BH merger as 'major'
  threshold_minor_merger:             0.1        # Mass ratio threshold to consider a BH merger as 'minor'
  merger_threshold_type:              DynamicalEscapeVelocity          # Type of velocity threshold for BH mergers (0: v_circ at kernel edge, 1: v_esc at actual distance, with softening, 2: v_esc at actual distance, no softening).
  merger_max_distance_ratio:          1.0        # Maximal distance over which two BHs can merge, in units of the softening length.
  AGN_use_deterministic_feedback:     1          # Deterministic (1) or stochastic (0) AGN feedback model
  AGN_feedback_model:                 Isotropic  # AGN feedback model (Isotropic or MinimumDistance)
  minimum_timestep_yr:                10000.0    # Minimum time-step of black-hole particles
  with_boost_factor:                  1          # Are we using the model from Booth, Schaye (2009)?
  boost_alpha:                        0.2        # Lowest value for the accretion effeciency for the Booth, Schaye 2009 accretion model.
  boost_beta:                         1.         # Slope of the power law for the Booth, Schaye 2009 model, set beta to zero for constant alpha models.
  boost_n_h_star_cm3:                 1e10       # Normalization of the power law for the Booth Schaye 2009 model in cgs (cm^-3).

# Spin evolution and jet AGN model
SPINJETAGN:
  subgrid_seed_mass_Msun:             1e4        # Black hole subgrid mass at creation time in solar masses.
  use_multi_phase_bondi:              0          # Compute Bondi rates per neighbour particle [1] or for the smoothed ambient gas around the black hole [0]?
  use_subgrid_gas_properties:         1          # Use subgrid density [1] or dynamical density [0] to calculate BH accretion rates?
  use_krumholz:                       1          # Use Krumholz et al. (2006) [1] or standard Bondi-Hoyle-Lyttleton formula [0] for black hole accretion rates? Only used if multi_phase_bondi is 0.
  with_krumholz_vorticity:            1          # Include the vorticity term in Krumholz et al. formula? Only used if use_multi_phase_bondi is 0.
  with_angmom_limiter:                0          # Are we applying the Rosas-Guevara (2015) viscous time-scale reduction term?
  radiative_efficiency:               0.1        # Fraction of the accreted mass that gets radiated.
  max_eddington_fraction:             1.         # Maximal allowed accretion rate in units of the Eddington rate.
  eddington_fraction_for_recording:   0.1        # Record the last time BHs reached an Eddington ratio above this threshold.
  use_nibbling:                       1          # Continuously transfer small amounts of mass from all gas neighbours to a black hole [1] or stochastically swallow whole gas particles [0]?
  min_gas_mass_for_nibbling_Msun:     5e4        # Minimum mass for a gas particle to be nibbled from [M_Sun]. Only used if use_nibbling is 1.
  coupling_efficiency:                0.10       # Fraction of the radiated energy that couples to the gas in feedback events.
  AGN_delta_T_K:                      1e9        # Change in temperature to apply to the gas particle in an AGN feedback event in Kelvin.
  AGN_num_ngb_to_heat:                1.         # Target number of gas neighbours to heat in an AGN feedback event.
  max_reposition_mass_Msun:           2e20       # Maximal BH mass considered for BH repositioning in solar masses.
  max_reposition_distance_ratio:      3.0        # Maximal distance a BH can be repositioned, in units of the softening length.
  with_reposition_velocity_threshold: 0          # Should we only reposition to particles that move slowly w.r.t. the black hole?
  set_reposition_speed:               0          # Should we reposition black holes with (at most) a prescribed speed towards the potential minimum?
  with_potential_correction:          1          # Should the BH's own contribution to the potential be removed from the neighbour's potentials when looking for repositioning targets.
  threshold_major_merger:             0.333      # Mass ratio threshold to consider a BH merger as 'major'
  threshold_minor_merger:             0.1        # Mass ratio threshold to consider a BH merger as 'minor'
  merger_threshold_type:              DynamicalEscapeVelocity          # Type of velocity threshold for BH mergers (0: v_circ at kernel edge, 1: v_esc at actual distance, with softening, 2: v_esc at actual distance, no softening).
  merger_max_distance_ratio:          1.0        # Maximal distance over which two BHs can merge, in units of the softening length.
  AGN_use_deterministic_feedback:     1          # Deterministic (1) or stochastic (0) AGN feedback model
  AGN_feedback_model:                 Isotropic  # AGN feedback model (Isotropic or MinimumDistance)
  minimum_timestep_yr:                10000.0    # Minimum time-step of black-hole particles
  with_boost_factor:                  1          # Are we using the model from Booth, Schaye (2009)?
  boost_alpha:                        0.2        # Lowest value for the accretion effeciency for the Booth, Schaye 2009 accretion model.
  boost_beta:                         1.         # Slope of the power law for the Booth, Schaye 2009 model, set beta to zero for constant alpha models.
  boost_n_h_star_cm3:                 1e10       # Normalization of the power law for the Booth Schaye 2009 model in cgs (cm^-3).
  include_jets:                       1          # Global switch whether to include jet feedback [1] or not [0].
  turn_off_radiative_feedback:        0          # Global switch whether to turn off radiative (thermal) feedback [1] or not [0]. This should only be used if 'include_jets' is set to 1, since we want feedback in some form or another.
  alpha_acc:                          0.2        # Viscous alpha of the subgrid accretion disks. Likely to be within the 0.1-0.3 range. The main effect is that it sets the transition accretion rate between thin and thick disk, as dot(m) = 0.1 * alpha^2 + 0.035 * alpha.
  AGN_jet_velocity_model:             BlackHoleMass          # How AGN jet velocities are calculated. If 'Constant', a single value is used. If 'BlackHoleMass', then an empirical relation between halo mass and black hole mass is used to calculate jet velocities. 'HaloMass' is currently not supported. 
  v_jet_km_p_s:                       10000.     # Jet velocity to use if 'AGN_jet_velocity_model' is 'Constant'. Units are km/s.
  v_jet_cs_ratio:                     10.        # This sets the jet velocity to v_jet_cs_ratio times the sound speed of the hot gas of the parent halo the black hole is in. This is used if 'AGN_jet_velocity_model' is 'BlackHoleMass'.
  v_jet_BH_mass_scaling_reference_mass_Msun: 3.4e3 # The reference mass used in the relation between halo mass and BH mass used to calculate jet velocities. Only used if 'AGN_jet_velocity_model' is 'BlackHoleMass'.
  v_jet_BH_mass_scaling_slope:        0.65       # The slope of the relation between halo mass and BH mass used to calculate jet velocities. Only used if 'AGN_jet_velocity_model' is 'BlackHoleMass'.
  v_jet_min_km_p_s:                   500        # The minimal jet velocity. Only used if 'AGN_jet_velocity_model' is 'BlackHoleMass'.
  opening_angle_in_degrees:           10       # The half-opening angle of the jet in degrees. Should use values < 15 unless for tests.
  N_jet:                              2          # Target number of particles to kick as part of a single jet feedback event. Should be a multiple of 2 to ensure approximate momentum conservation (we always kick particles in pairs, one from each 'side' of the BH, relative to the spin vector).
  AGN_jet_feedback_model:             SpinAxis   # Which particles to kick from the black hole smoothing kernels. Should be 'SpinAxis', 'MinimumDistance', 'MaximumDistance' or 'MinimumDensity'
  eps_f_jet:                          1.         # Coupling efficiency for jet feedback. No reason to expect this to be less than 1.
  fix_jet_efficiency:                 0          # Global switch whether to fix jet efficiency to a particular value [1], or use a spin-dependant formula [0]. If used, jets will be launched exclusively along the z axis. Should be set to 1 only for tests.
  jet_efficiency:                     0.1        # The constant jet efficiency used if 'fix_jet_efficiency' is set to 1.
  fix_radiative_efficiency:           0          # Global switch whether to fix the radiative efficiency to a particular value [1], or use a spin-dependant formula [0]. 
  TD_region:                          B          # How to treat the subgrid accretion disk if it is thin, according to the Shakura & Sunyaev (1973) model. If set to B, region b will be used. If set to C, region c will be used.
  include_GRMHD_spindown:             1          # Whether to include high jet spindown rates from GRMHD simulations [1], or use an analytical formula that assumes extraction of energy from the rotational mass/energy of the BH.
  include_ADIOS_suppression:          0          # Whether to suppress the accretion rate in the fully thick disc regime [1] (Eddington rate below 0.2alpha^2) by the amount expected to be taken away by isotropic kinetic disk winds.
  ADIOS_R_in:                         30.        # If include_ADIOS_accr_suppression is set to 1, this parameter controls the inner radius within which winds are not important.
  ADIOS_s:                            0.4        # Slope of the accretion rate - radius relationship if include_ADIOS_accr_suppression is set to 1.
  turn_off_secondary_feedback:        1          # If set to 1, there will be only radiative (thermal) feedback in the thin disk mode, and only jets in the thick disk mode.
  jet_h_r_slope:                      1.         # The slope of the dependence of jet efficiency on aspect ratio of the subgrid accretion disk, H/R. Default value is 1, and another reasonable value is 0 (same jet efficiency for all disks). Reality could be anything in between. 
  delta_ADAF:                         0.2        # Electron heating parameter, which controls the strength of radiative feedback in thick disks. Should be between 0.1 and 0.5. This parameter is only used if turn_off_secondary_feedback is set to 0.
  include_slim_disk:                  0          # Global switch whether to include super-Eddington accretion, modeled as the slim disk. If set to 0, disks will be considered thin even at very large accretion rates.
  TD_SD_eps_r_threshold:              0.75       # Parameter controlling the transition from thin to slim disk. Accretion disk will be slim if radiative efficiency satisfies eps_slim < TD_SD_eps_r_threshold * eps_thin. This parameter is only used if include_slim_disk is set to 1.
  
XrayEmissivity:
  xray_table_path:    ./X_Ray_tables.hdf5   # Path to the X-ray emissivity tables
