## CosmoMC and CMB normalization

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Hiranya Peiris
Posts: 54
Joined: September 28 2004
Affiliation: University College London

### CosmoMC and CMB normalization

Hi,

I have modified CAMB to directly integrate an inflation model, which provides the correct normalization for the curvature perturbation. I've also modified CosmoMC to have additional InitialPower parameters, and (I think) correctly modified params.ini to use them, in the following way, e.g.:

from params.ini, for five additional parameters:

#new param1
param8 = blah blah blah blah blah
#new param2
param9 = blah blah blah blah blah
#new param3
param10 = blah blah blah blah blah
#new param4
param11 = blah blah blah blah blah
#new param5
param12 = blah blah blah blah blah

#params below are unused by the new version:
#log[10^10 A_s]
param13 = 742.562 742.562 742.562 0 0
#amp_ratio
param14 = 0 0 0 0 0
#unused fast parameter
param15 = 0 0 0 0 0

My reasoning for setting param13 was that since the primodial spectrum is supplied to CAMB in proper dimensionless units, I just need As to be (T_cmb)^2 to convert it into \mu K^2 (i.e. this is the number I would normally put in CMB_outputscale in CAMB's params.ini).

Then in settings.f90 I have asked for 5 InitialPower parameters, and in params_CMB.f90 I've modified for example:

!HVP
else if (Power_Name == 'infl_model') then
P%InitPower%ScalarPowerAmp(in)=cl_norm*CMB%norm(norm_As)
P%InitPower%infl_1 = CMB%InitPower(1)
P%InitPower%infl_2 = CMB%InitPower(2)
P%InitPower%infl_3 = CMB%InitPower(3)
P%InitPower%infl_4 = CMB%InitPower(4)
P%InitPower%infl_5 = CMB%InitPower(5)
!END HVP

Unfortunately CAMB does not seem to be called properly with these modifications and exits with an error from the primordial PS calculation. CAMB works fine for this modification when invoked directly rather than from CosmoMC.

Could someone please let me know if I have made an incorrect modification, or whether there is something else I need to add?

Thanks a lot,
Hiranya

Antony Lewis
Posts: 1522
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

### Re: CosmoMC and CMB normalization

CosmoMC puts in the T_cmb^2 factor, so probably you just want to fix the amplitude to 1.

If you are including tensors might want to check compute_tensors setting, and how you're fixing the ratio.

Also check you are using "make clean" before recompiling after making modifications.

Other than that, I'm not sure what the problem could be.

Hiranya Peiris
Posts: 54
Joined: September 28 2004
Affiliation: University College London

### CosmoMC and CMB normalization

Hi Antony,

Thanks for a quick response. I'll set the amplitude to 1. I've tracked down the problem to the fact that when CAMB is called from within CosmoMC, it does not know about parameters specified in an internal f90 module for my initial power spectrum code. I.e. it knows the parameters exist, but somehow their values are not initialized to the values specified in the module file.

Since this problem does not happen when I run CAMB, I assume something is going wrong in linking CosmoMC and CAMB.

My new code lives in a subdirectory in the CAMB directory. I have added all the .o files from this subdirectory to the library archive being created by the CosmoMC CAMB Makefile. Is that insufficient? Is CosmoMC restricting access to CAMB modules somewhere (so that if I added a new one it would not know about it?).

I'm extremely puzzled!

Thanks a lot,
Hiranya

Antony Lewis
Posts: 1522
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

### Re: CosmoMC and CMB normalization

If you are using implicit none (like cosmomc) you should get a compiler error if it can't find a declaration.

You may also need to link to the module files in analogy to -I../camb in the Makefile (but again should get compiler warning if it can't find modules).

SetCAMBInitPower can see most of CAMB, though you can see at the top of CMB_Cls_simple what has been made accessible in that code.

Quite hard to debug this sort of thing remotely!