Report a few (possible) bugs in the July 2011 version of CAMB & cosmomc

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Zhiqi Huang
Posts: 12
Joined: April 22 2006
Affiliation: Sun Yat-Sen University
Contact:

Report a few (possible) bugs in the July 2011 version of CAM

Post by Zhiqi Huang » September 28 2011

The July 2011 version of CAMB & cosmomc:

1). (~10% difference in tensor C_l for l>200)
camb/equations.f90
Line #2643
In the tight coupling case only pig is set, forgot to set T(2) and E(2) (so when tight coupling is switched off the initial T(2) will be zero)?
I tested the output C_l^TT(tensor) with outputs from CLASS and from my own Boltzmann code in Newtonian gauge (a completely independent calculation in different gauge). For l>200 camb output is ~10% lower than the latter two.

2) (conceptually a possible bug, practically irrelevant)
camb/modules.f90
line#2182:
In the tight coupling case this is an inaccurate algorithm (multiplying a tiny number by a huge number) to compute d ln T_b/d ln a. Depending on the machine precision this can give c_s^2 of baryon totally wrong at very high redshift. But actually c_s^2 of baryon is irrelevantly at z>10^4, so this is just a conceptually possible bug...no impact on C_l or transfer functions (tested with a few diff machines).


3). (~0.5% difference)
source/CMB_Cls_Simple.f90
Line #57
P%Num_Nu_Massless = CMB%nnu - 3.046 !assume three massive

Should it be
P%Num_Nu_Massless = CMB%nnu - 3
?
I am not 100% sure about this. I think in the standard case cosmomc is passing effective N_nu = 3 to CAMB, shouldn't it be 3.046 (accounting for the departure from equilibrium in early U.?). This will slightly change a_eq.

Zhiqi Huang
Posts: 12
Joined: April 22 2006
Affiliation: Sun Yat-Sen University
Contact:

Report a few (possible) bugs in the July 2011 version of CAM

Post by Zhiqi Huang » September 29 2011

following up a bit to let people know what the problem might be.

(1) is not there.

The initialization of T(2) and E(2) is done below line 404 when tight coupling is switched off (pointed out by Antony, thanks:)). The discrepancy is due to neutrino tensor perturbations. I switched off DoTensorNeutrino in params.ini, but it is automatically switched on when HighAccuracyDefault is set to be True. See inidriver.F90 line 263:
DoTensorNeutrinos = DoTensorNeutrinos .or. HighAccuracyDefault
In other words I was comparing camb C_l with neutrino tensor perturbations against C_l without neutrino tensor perturbations from CLASS and my code.

(2) irrelevant we don't care

(3) confirmed by Antony, thanks:)

Post Reply