Guide to EFTCosmoMC_May14
There might exist some typos in this guide, please check it carefully with our original source codes.
If you encounter any problems during your modifications, please contact us.
----------------------------------------------------------------------------------------------------------------------------
Add:
EFT_params.ini(In the root folder)
----------------------------------------------------------------------------------------------------------------------------
Modify:
params_CMB.paramnames(In the root folder)
Add: After "fdm \epsilon_0 f_d #CosmoRec dark matter annihilation parameter, 0910.3663"
EFTw0 w_0^{\rm EFT} # EFTCOSMOMC: EFTCAMB parameter (num 16)
EFTwa w_a^{\rm EFT} # EFTCOSMOMC: EFTCAMB parameter (num 17)
EFTOmega0 \Omega_0^{\rm EFT} # EFTCOSMOMC: EFTCAMB parameter (num 18)
EFTOmegaExp n^{\rm EFT} # EFTCOSMOMC: EFTCAMB parameter (num 19)
EFTAlpha10 \alpha_0^{(1) {\rm EFT}} # EFTCOSMOMC: EFTCAMB parameter (num 20)
EFTAlpha1Exp \alpha_{\rm exp}^{(1) {\rm EFT}} # EFTCOSMOMC: EFTCAMB parameter (num 21)
EFTAlpha20 \alpha_0^{(2) {\rm EFT}} # EFTCOSMOMC: EFTCAMB parameter (num 22)
EFTAlpha2Exp \alpha_{\rm exp}^{(2) {\rm EFT}} # EFTCOSMOMC: EFTCAMB parameter (num 23)
EFTAlpha30 \alpha_0^{(3) {\rm EFT}} # EFTCOSMOMC: EFTCAMB parameter (num 24)
EFTAlpha3Exp \alpha_{\rm exp}^{(3) {\rm EFT}} # EFTCOSMOMC: EFTCAMB parameter (num 25)
EFTAlpha40 \alpha_0^{(4) {\rm EFT}} # EFTCOSMOMC: EFTCAMB parameter (num 26)
EFTAlpha4Exp \alpha_{\rm exp}^{(4) {\rm EFT}} # EFTCOSMOMC: EFTCAMB parameter (num 27)
EFTAlpha50 \alpha_0^{(5) {\rm EFT}} # EFTCOSMOMC: EFTCAMB parameter (num 28)
EFTAlpha5Exp \alpha_{\rm exp}^{(5) {\rm EFT}} # EFTCOSMOMC: EFTCAMB parameter (num 29)
EFTAlpha60 \alpha_0^{(6) {\rm EFT}} # EFTCOSMOMC: EFTCAMB parameter (num 30)
EFTAlpha6Exp \alpha_{\rm exp}^{(6) {\rm EFT}} # EFTCOSMOMC: EFTCAMB parameter (num 31)
EFTLogB0 {\rm Log}_{10}(B_0) # EFTCOSMOMC: EFTCAMB parameter (num 32)
----------------------------------------------------------------------------------------------------------------------------
Add:
params_CMB_EFT.ini(In the root/batch1 folder)
----------------------------------------------------------------------------------------------------------------------------
Add:
common_batch1_EFT.ini(In the root/batch1 folder)
----------------------------------------------------------------------------------------------------------------------------
Modify:
Makefile(In the root/source folder)
Replace:
#If you want to use the ppf module, change equations_ppf to equations
#and halofit_ppf to halofit also comment out wa_ppf in CMB_Cls_simple.f90
# EFTCOSMOMC MOD START: make COSMOMC recognize the EFT equation file.
camb:
cd ../camb && \
$(MAKE) --file=Makefile_main libcamb_$(RECOMBINATION).a \
RECOMBINATION=$(RECOMBINATION) EQUATIONS=equations_EFT NONLINEAR=halofit
# RECOMBINATION=$(RECOMBINATION) EQUATIONS=equations_ppf NONLINEAR=halofit_ppf !EFTcosmomc MOD: Original code
# EFTCOSMOMC MOD END.
----------------------------------------------------------------------------------------------------------------------------
Modify:
settings.f90(In the root/source folder)
Replace: After "integer, parameter :: max_data_params = 100"
! EFTCOSMOMC MOD START: increase the number of theory parameters
!integer, parameter :: max_theory_params = 30 !Original code
integer, parameter :: max_theory_params = 47
! EFTCOSMOMC MOD END.
----------------------------------------------------------------------------------------------------------------------------
Modify:
params_CMB.f90(In the root/source folder)
::::: subroutine TP_Init(this, Ini, Names) :::::
Replace: After "character(LEN=Ini_max_string_len) prior"
! EFTCOSMOMC MOD START:
! call SetTheoryParameterNumbers(15,6) !Original code
call SetTheoryParameterNumbers(32,6)
! EFTCOSMOMC MOD END.
::::: subroutine SetForH(Params,CMB,H0, firsttime,error) :::::
Add: Before "CMB%h = CMB%H0/100"
! EFTCOSMOMC MOD START:
CMB%EFTw0 = Params(16)
CMB%EFTwa = Params(17)
CMB%EFTOmega0 = Params(18)
CMB%EFTOmegaExp = Params(19)
CMB%EFTAlpha10 = Params(20)
CMB%EFTAlpha1Exp = Params(21)
CMB%EFTAlpha20 = Params(22)
CMB%EFTAlpha2Exp = Params(23)
CMB%EFTAlpha30 = Params(24)
CMB%EFTAlpha3Exp = Params(25)
CMB%EFTAlpha40 = Params(26)
CMB%EFTAlpha4Exp = Params(27)
CMB%EFTAlpha50 = Params(28)
CMB%EFTAlpha5Exp = Params(29)
CMB%EFTAlpha60 = Params(30)
CMB%EFTAlpha6Exp = Params(31)
CMB%EFTB0 = 10**Params(32)
! EFTCOSMOMC MOD END.
----------------------------------------------------------------------------------------------------------------------------
Modify:
cmbtypes.f90(In the root/source folder)
::::: module cmbtypes :::::
Add: After "logical :: bbn_consistency = .true. !JH"
! EFTCOSMOMC MOD START: store the values of the EFT model selection flags.
integer :: EFTflag
integer :: EFTwDE
integer :: PureEFTmodelOmega
integer :: PureEFTmodelAlpha1, PureEFTmodelAlpha2, PureEFTmodelAlpha3
integer :: PureEFTmodelAlpha4, PureEFTmodelAlpha5, PureEFTmodelAlpha6
integer :: DesignerEFTmodel
integer :: MatchingEFTmodel
! EFTCOSMOMC MOD END.
::::: Type, extends(TTheoryParams) :: CMBParams :::::
Add: After "real(mcp) reserved(5)"
! EFTCOSMOMC MOD START: add EFTCAMB parameters to CMBParams
real(mcp) :: EFTw0, EFTwa
real(mcp) :: EFTOmega0, EFTOmegaExp
real(mcp) :: EFTAlpha10, EFTAlpha1Exp, EFTAlpha20, EFTAlpha2Exp
real(mcp) :: EFTAlpha30, EFTAlpha3Exp, EFTAlpha40, EFTAlpha4Exp
real(mcp) :: EFTAlpha50, EFTAlpha5Exp, EFTAlpha60, EFTAlpha6Exp
real(mcp) :: EFTB0
! EFTCOSMOMC MOD END.
----------------------------------------------------------------------------------------------------------------------------
Modify:
calclike.f90(In the root/source folder)
::::: function GetLogLike(Params) :::::
Add: After "function GetLogLike(Params) !Get -Ln(Likelihood) for chains"
! EFTCOSMOMC MOD START: use the EFT modules
use EFTstability
use EFTreturntoGR
use EFTDesigner
! EFTCOSMOMC MOD END.
Add: After " Type(LikeCalculator) :: Calc"
! EFTCOSMOMC MOD START: define stuff
integer :: EFTstabilityResult
logical :: DesignerSucces
Type(CAMBParams) :: EFT_CP_Temp
! EFTCOSMOMC MOD END.
Add: After "Calc%changeMask(1:num_params) = Params%Info%lastParamArray(1:num_params)/=Params%P(1:num_params)"
! EFTCOSMOMC MOD START: run the stability check for the choosen parameter.
call CMBToCAMB(CMB,EFT_CP_Temp)
call CAMBParams_Set(EFT_CP_Temp)
! 1) Call designer codes.
!print*, CMB%EFTw0, CMB%EFTwa, CMB%H0, CMB%omb*(CMB%h)**2, CMB%omc*(CMB%h)**2, CMB%omv
if (EFTflag==2.and.DesignerEFTmodel==1) then
write(*,*) 'EFTCAMB: Calling f(R) background designer code'
call Designer_fR_Background(DesignerSucces)
if (.not.DesignerSucces) then
GetLogLike=LogZero
return
end if
end if
! 2) Check for the stability of the theory.
if (EFTflag/=0) then
write(*,*) 'EFTCAMB: Checking the stability of the theory.'
call EFTCheck_Stability(EFTstabilityResult)
if (EFTstabilityResult==0) then
GetLogLike=LogZero
return
end if
end if
! 3) Checks the return to GR of the theory.
if (EFTflag/=0) then
call EFTCheckReturnToGR
end if
! EFTCOSMOMC MOD END.
----------------------------------------------------------------------------------------------------------------------------
Modify:
driver.F90(In the root/source folder)
Add: After "use DefineParameterization"
!EFTCOSMOMC MOD START: use EFT modules
use EFTdef
!EFTCOSMOMC MOD END.
Add: After "stop_on_error = Ini_Read_logical('stop_on_error',stop_on_error)" Before "Ini_fail_on_not_found = .true."
! EFTCOSMOMC MOD START: read here EFT model selection flags and store them inside cmbtypes
EFTflag = Ini_Read_Int('EFTflag',0)
EFTwDE = Ini_Read_Int('EFTwDE',0)
PureEFTmodelOmega = Ini_Read_Int('PureEFTmodelOmega',0)
PureEFTmodelAlpha1 = Ini_Read_Int('PureEFTmodelAlpha1',0)
PureEFTmodelAlpha2 = Ini_Read_Int('PureEFTmodelAlpha2',0)
PureEFTmodelAlpha3 = Ini_Read_Int('PureEFTmodelAlpha3',0)
PureEFTmodelAlpha4 = Ini_Read_Int('PureEFTmodelAlpha4',0)
PureEFTmodelAlpha5 = Ini_Read_Int('PureEFTmodelAlpha5',0)
PureEFTmodelAlpha6 = Ini_Read_Int('PureEFTmodelAlpha6',0)
DesignerEFTmodel = Ini_Read_Int('DesignerEFTmodel',0)
MatchingEFTmodel = Ini_Read_Int('MatchingEFTmodel',0)
EFTCAMBuseinCOSMOMC = 0
! EFTCOSMOMC MOD END.
----------------------------------------------------------------------------------------------------------------------------
Modify:
CMB_Cls_simple.f90(In the root/source folder)
::::: module CMB_Cls :::::
Remove: ppf modules
! EFTCOSMOMC MOD START: remove ppf
AccuracyBoost, Cl_scalar, Cl_tensor, Cl_lensed, outNone, w_lam,&
!AccuracyBoost, Cl_scalar, Cl_tensor, Cl_lensed, outNone, w_lam, wa_ppf,& ! Original code
! EFTCOSMOMC MOD END.
::::: subroutine CMBToCAMB(CMB,P) :::::
Remove: After "w_lam = CMB%w"
! EFTCOSMOMC MOD START: remove ppf
!wa_ppf = CMB%wa ! Original code
! EFTCOSMOMC MOD END:
Add: After "P%Num_Nu_Massless = CMB%nnu"
! EFTCOSMOMC MOD START: pass to camb the EFT parameters
! Background parameters:
P%EFTw0 = CMB%EFTw0
P%EFTwa = CMB%EFTwa
! Pure EFT:
P%EFTOmega0 = CMB%EFTOmega0
P%EFTOmegaExp = CMB%EFTOmegaExp
P%EFTAlpha10 = CMB%EFTAlpha10
P%EFTAlpha1Exp= CMB%EFTAlpha1Exp
P%EFTAlpha20 = CMB%EFTAlpha20
P%EFTAlpha2Exp= CMB%EFTAlpha2Exp
P%EFTAlpha30 = CMB%EFTAlpha30
P%EFTAlpha3Exp= CMB%EFTAlpha3Exp
P%EFTAlpha40 = CMB%EFTAlpha40
P%EFTAlpha4Exp= CMB%EFTAlpha4Exp
P%EFTAlpha50 = CMB%EFTAlpha50
P%EFTAlpha5Exp= CMB%EFTAlpha5Exp
P%EFTAlpha60 = CMB%EFTAlpha60
P%EFTAlpha6Exp= CMB%EFTAlpha6Exp
! Matching EFT:
P%EFTB0 = CMB%EFTB0
! EFTCOSMOMC MOD END.
::::: subroutine InitCAMBParams(P) :::::
Remove: After "w_lam = -1"
! EFTCOSMOMC MOD START: remove ppf
!wa_ppf = 0._dl ! Original code
! EFTCOSMOMC MOD END.
Add: After "P%Transfer%k_per_logint=0"
! EFTCOSMOMC MOD START: pass model selection flag to the camb
P%EFTflag = Ini_Read_Int('EFTflag',0)
P%EFTwDE = Ini_Read_Int('EFTwDE',0)
P%PureEFTmodelOmega = Ini_Read_Int('PureEFTmodelOmega',0)
P%PureEFTmodelAlpha1 = Ini_Read_Int('PureEFTmodelAlpha1',0)
P%PureEFTmodelAlpha2 = Ini_Read_Int('PureEFTmodelAlpha2',0)
P%PureEFTmodelAlpha3 = Ini_Read_Int('PureEFTmodelAlpha3',0)
P%PureEFTmodelAlpha4 = Ini_Read_Int('PureEFTmodelAlpha4',0)
P%PureEFTmodelAlpha5 = Ini_Read_Int('PureEFTmodelAlpha5',0)
P%PureEFTmodelAlpha6 = Ini_Read_Int('PureEFTmodelAlpha6',0)
P%DesignerEFTmodel = Ini_Read_Int('DesignerEFTmodel',1)
P%MatchingEFTmodel = Ini_Read_Int('MatchingEFTmodel',1)
! EFTCOSMOMC MOD END.
Re-compile and Make it.