#Parameters for CAMB
#Here, best-fit parameters from the baseline Planck 2018 LCDM model
#using base_plikHM_TTTEEE_lowl_lowE_lensing
#
#Accuracy settings are default for Planck, i.e. not accurate for lensing at high L
#For high accuracy to high L see planck_2018_base_plikHM_TTTEEE_lowl_lowE_lensing_lmax10000.ini

#output_root is prefixed to output file names
output_root = planck_2018

#What to do
get_scalar_cls = T
get_vector_cls = F
get_tensor_cls = F
get_transfer   = T

#if do_lensing then lens_potential_output_file contains the unlensed CMB and lensing potential power spectra
#and lensed CMB Cls (without tensors) are in lensed_output_file, total in lensed_total_output_file.
do_lensing     = T

# 0: linear, 1: non-linear matter power (HALOFIT), 2: non-linear CMB lensing (HALOFIT),
# 3: both non-linear matter power and CMB lensing (HALOFIT)
do_nonlinear = 3

#Maximum multipole and k*eta.
#  Note that C_ls near l_max are inaccurate (about 5%), go to 50 more than you need
#  Lensed power spectra are computed to l_max_scalar-100
#  To get accurate lensed BB need to have l_max_scalar>2000, k_eta_max_scalar > 10000
#  To get accurate lensing potential you also need k_eta_max_scalar > 10000
#  Otherwise k_eta_max_scalar=2*l_max_scalar usually suffices, or don't set to use default
l_max_scalar      = 2700
k_eta_max_scalar  = 18000

#  Tensor settings should be less than or equal to the above
l_max_tensor      = 1500
k_eta_max_tensor  = 3000

#Main cosmological parameters
#Set physical densities in baryons, CDM and neutrinos + Omega_k
ombh2          = 0.0223828
omch2          = 0.1201075
omnuh2         = 0.6451439E-03
omk            = 0
hubble         = 67.32117

#Dark energy can be "fluid" (constant w), or "PPF" (allowing wa, and w=-1 crossing)
dark_energy_model  = ppf

#effective equation of state parameter for dark energy
w              = -1
#constant comoving sound speed of the dark energy (1=quintessence), for fluid model
cs2_lam        = 1

#For PPF model can set these instead:
#wa             = 0
##if use_tabulated_w read (a,w) from the following user-supplied file instead of above
#use_tabulated_w = T
#wafile = wa.dat

temp_cmb           = 2.7255
helium_fraction    = 0.2454006

#for share_delta_neff = T, the fractional part of massless_neutrinos gives the change in the effective number
#(for QED + non-instantaneous decoupling)  i.e. the increase in neutrino temperature,
#so Neff = massless_neutrinos + sum(massive_neutrinos)
#For full neutrino parameter details see https://cosmologist.info/notes/CAMB.pdf
massless_neutrinos = 2.046

#number of distinct mass eigenstates
nu_mass_eigenstates = 1
#array of the integer number of physical neutrinos per eigenstate, e.g. massive_neutrinos = 2 1
massive_neutrinos  = 1
#specify whether all neutrinos should have the same temperature, specified from fractional part of massless_neutrinos
share_delta_neff = T
#nu_mass_fractions specifies how Omeganu_h2 is shared between the eigenstates
#i.e. to indirectly specify the mass of each state; e.g. nu_mass_factions= 0.75 0.25
nu_mass_fractions = 1
#if share_delta_neff = F, specify explicitly the degeneracy for each state (e.g. for sterile with different temperature to active)
#(massless_neutrinos must be set to degeneracy for massless, i.e. massless_neutrinos does then not include Deleta_Neff from massive)
#if share_delta_neff=T then degeneracies is not given and set internally
#e.g. for massive_neutrinos = 2 1, this gives equal temperature to 4 neutrinos: nu_mass_degeneracies = 2.030 1.015, massless_neutrinos = 1.015
nu_mass_degeneracies =

#Initial power spectrum, amplitude, spectral index and running. Pivot k in Mpc^{-1}.
initial_power_num         = 1
pivot_scalar              = 0.05
pivot_tensor              = 0.05
scalar_amp                = 2.100549e-9
scalar_spectral_index     = 0.9660499
scalar_nrun               = 0
scalar_nrunrun            = 0
tensor_spectral_index     = 0
tensor_nrun               = 0
#Three parameterizations (1,2,3) for tensors, see https://cosmologist.info/notes/CAMB.pdf
tensor_parameterization   = 1
#ratio is that of the initial tens/scal power spectrum amplitudes, depending on parameterization
#for tensor_parameterization == 1, P_T = initial_ratio*scalar_amp*(k/pivot_tensor)^tensor_spectral_index
#for tensor_parameterization == 2, P_T = initial_ratio*P_s(pivot_tensor)*(k/pivot_tensor)^tensor_spectral_index
#Note that for general pivot scales and indices, tensor_parameterization==2 has P_T depending on n_s
initial_ratio             = 1
#tensor_amp is used instead if tensor_parameterization == 3, P_T = tensor_amp *(k/pivot_tensor)^tensor_spectral_index
#tensor_amp               = 4e-10

#note vector modes use the scalar settings above


#Reionization, ignored unless reionization = T, re_redshift measures where x_e=0.5
reionization         = T

re_use_optical_depth = T
re_optical_depth     = 0.05430842
#If re_use_optical_depth = F then use following, otherwise ignored
re_redshift          = 11
#width of reionization transition. CMBFAST model was similar to re_delta_redshift~0.5.
re_delta_redshift    = 0.5
#re_ionization_frac=-1 sets it to become fully ionized using Yhe to get helium contribution
#Otherwise x_e varies from 0 to re_ionization_frac
re_ionization_frac   = -1

#Parameters for second reionization of helium
re_helium_redshift = 3.5
re_helium_delta_redshift = 0.5

#Can compile with HyRec and/or CosmoRec support as well; Recfast is default
recombination_model = Recfast
#RECFAST 1.5.x recombination parameters;
RECFAST_fudge = 1.14
RECFAST_fudge_He = 0.86
RECFAST_Heswitch = 6
RECFAST_Hswitch  = T

# compile with RECOMBINATION_FILES including cosmorec
#
# cosmorec_runmode== 0: with diffusion
#                    1: without diffusion
#                    2: RECFAST++ run (equivalent of the original RECFAST version)
#                    3: RECFAST++ run with correction function of Calumba & Thomas, 2010
#
# For 'cosmorec_accuracy' and 'cosmorec_fdm' see CosmoMC for explanation
#---------------------------------------------------------------------------------------
#cosmorec_runmode        = 0
#cosmorec_accuracy       = 0
#cosmorec_fdm            = 0

#Initial scalar perturbation mode (adiabatic=1, CDM iso=2, Baryon iso=3,
# neutrino density iso =4, neutrino velocity iso = 5)
initial_condition   = 1
#If above is zero, use modes in the following (totally correlated) proportions
#Note: we assume all modes have the same initial power spectrum
initial_vector = -1 0 0 0 0

#For vector modes: 0 for regular (neutrino vorticity mode), 1 for magnetic
vector_mode = 0

#Normalization
COBE_normalize = F
##CMB_outputscale scales the output Culs
#To get MuK^2 set realistic initial amplitude (e.g. scalar_amp(1) = 2.3e-9 above) and
#otherwise for dimensionless transfer functions set scalar_amp(1)=1 and use
#CMB_outputscale = 1
CMB_outputscale = 7.42835025e12

#Transfer function settings, transfer_kmax=0.5 is enough for sigma_8
#transfer_k_per_logint=0 sets sensible non-even sampling;
#transfer_k_per_logint=5 samples fixed spacing in log-k
#transfer_interp_matterpower =T produces matter power in regular interpolated grid in log k;
# use transfer_interp_matterpower =F to output calculated values (e.g. for later interpolation)
transfer_high_precision = T
transfer_kmax           = 2
transfer_k_per_logint   = 0
transfer_num_redshifts  = 1
transfer_interp_matterpower = T
transfer_redshift(1)    = 0
transfer_filename(1)    = transfer_out.dat
#Matter power spectrum output against k/h in units of h^{-3} Mpc^3
transfer_matterpower(1) = matterpower.dat

#which variable to use for defining the matter power spectrum and sigma8
#main choices are 2: CDM, 7: CDM+baryon+neutrino, 8: CDM+baryon, 9: CDM+baryon+neutrino+de perts
transfer_power_var = 7

#Output files not produced if blank. make camb_fits to use the FITS setting.
scalar_output_file = scalCls.dat
vector_output_file = vecCls.dat
tensor_output_file = tensCls.dat
total_output_file  = totCls.dat
lensed_output_file = lensedCls.dat
lensed_total_output_file  =lensedtotCls.dat
lens_potential_output_file = lenspotentialCls.dat
FITS_filename      = scalCls.fits

#Bispectrum parameters if required; primordial is currently only local model (fnl=1)
#lensing is fairly quick, primordial takes several minutes on quad core
do_lensing_bispectrum = F
do_primordial_bispectrum = F

#1 for just temperature, 2 with E
bispectrum_nfields = 1
#set slice non-zero to output slice b_{bispectrum_slice_base_L L L+delta}
bispectrum_slice_base_L = 0
bispectrum_ndelta=3
bispectrum_delta(1)=0
bispectrum_delta(2)=2
bispectrum_delta(3)=4
#bispectrum_do_fisher estimates errors and correlations between bispectra
#note you need to compile with LAPACK and FISHER defined to use get the Fisher info
bispectrum_do_fisher= F
#Noise is in muK^2, e.g. 2e-4 roughly for Planck temperature
bispectrum_fisher_noise=0
bispectrum_fisher_noise_pol=0
bispectrum_fisher_fwhm_arcmin=7
#Filename if you want to write full reduced bispectrum (at sampled values of l_1)
bispectrum_full_output_file=
bispectrum_full_output_sparse=F
#Export alpha_l(r), beta_l(r) for local non-Gaussianity
bispectrum_export_alpha_beta=F

##Optional parameters to control the computation speed,accuracy and feedback

#If feedback_level > 0 print out useful information computed about the model
feedback_level = 1

#whether to start output files with comment describing columns
output_file_headers = T

#write out various derived parameters
derived_parameters = T

# 1: curved correlation function, 2: flat correlation function, 3: inaccurate harmonic method
lensing_method = 1
accurate_BB = F


#massive_nu_approx: 0 - integrate distribution function
#                   1 - switch to series in velocity weight once non-relativistic
massive_nu_approx = 1

#Whether you are bothered about polarization.
accurate_polarization   = T

#Whether you are bothered about percent accuracy on EE from reionization
accurate_reionization   = T

#whether or not to include neutrinos in the tensor evolution equations
do_tensor_neutrinos     = T

#whether you care about accuracy of the neutrino transfers themselves
accurate_massive_neutrino_transfers = F

#Whether to turn off small-scale late time radiation hierarchies (save time,v. accurate)
do_late_rad_truncation   = T

#Which version of Halofit approximation to use (default currently Takahashi):
#1. Original Smith et al. (2003; arXiv:astro-ph/0207664) HALOFIT
#2. Bird et al. (arXiv:1109.4416) updated HALOFIT
#3. Original plus fudge from http://www.roe.ac.uk/~jap/haloes/,
#4. Takahashi (2012; arXiv:1208.2701) HALOFIT update
#5. HMcode (Mead et al. 2016; arXiv 1602.02154)
#6. A standard (inaccurate) halo model power spectrum calcultion
#7. PKequal (Casarini et al. arXiv:0810.0190, arXiv:1601.07230)
#8. HMcode (Mead et al. 2015; arXiv 1505.07833)
halofit_version= 5

#Computation parameters
#if number_of_threads=0 assigned automatically
number_of_threads       = 0

#The default target accuracy is 0.1% at L>600 (with boost parameter=1 below)
#Try accuracy_boost=2, l_accuracy_boost=2 if you want to check stability/even higher accuracy
#Note increasing accuracy_boost parameters is very inefficient if you want higher accuracy,

#Increase accuracy_boost to decrease time steps, use more k values, etc.
#Decrease to speed up at cost of worse accuracy. Suggest 0.8 to 3.
accuracy_boost          = 1

#Larger to keep more terms in the hierarchy evolution.
l_accuracy_boost        = 1

#Increase to use more C_l values for interpolation.
#Increasing a bit will improve the polarization accuracy at l up to 200 -
#interpolation errors may be up to 3%
#Decrease to speed up non-flat models a bit
l_sample_boost          = 1
