Page 1 of 1

CosmoMC: Accessing Cl_Scalar from within CAMB_GetResults

Posted: October 14 2016
by Simon Muya Kasanda
I have added new parameters to CosmoMC to account for partial correlation of isocurvature and adiabatic modes. However, I need, in 'CAMB_GetResults', to be able to access the Cl_Scalar, Cl_lensed and Cl_tensor from within the subroutine. This works for CAMB alone, but when compiled with Cosmomc, somehow these output are not accessible.

A simple check can be done by adding the following, just before 'end subroutine CAMB_GetResults'

do i=2,500
write(10,*)i,Cl_Scalar(i,1,1)
enddo

This works in CAMB, but not with Cosmomc. What can I do to access these Cls from inside CAMB_GetResults ?

Re: CosmoMC: Accessing Cl_Scalar from within CAMB_GetResults

Posted: October 14 2016
by Antony Lewis
Cosmomc first calls CAMB to get the transfer functions, and then separately to get the power spectrum from them. So it probably isn't calling CAMB_GetResults.

CosmoMC: Accessing Cl_Scalar from within CAMB_GetResults

Posted: October 17 2016
by Simon Muya Kasanda
Thank you for your response. Yes CosmoMc calls CAMB to get the transfer functions. But what I do not understand is that even when modifying CosmoMC to call CAMB_GetResults(P,error), I still cannot access cl_scalar!

For instance, in "CAMBCalc_GetNewTransferData", I add "use Modeldata" and call CAMB_GetResults(P,error) just before the "CAMB_GetTransfers(P, Info%Transfers, error)".
I have made sure that
P%WantCls=1
P%WantScalars=1

Is there any particular setting in CosmoMC that forbids accessing these?

Regards,

Re: CosmoMC: Accessing Cl_Scalar from within CAMB_GetResults

Posted: October 17 2016
by Antony Lewis
Are you sure you're using the right module (probably need "camb").

CosmoMC: Accessing Cl_Scalar from within CAMB_GetResults

Posted: October 20 2016
by Simon Muya Kasanda
Yes. Just for testing purposes, I have modified 'Calculator_CAMB.f90' by using camb module instead on the restrictions that were then (use camb, only: ....). With this, I commented all lines containing 'MpiStop', 'concat' and 'Feedback' to avoid same names from different module. Then, in 'CAMBCalc_GetNewTransferData', I have added:

call CAMB_GetResults(P, error)
do i=2,500
write(10,*)i,Cl_scalar(i,1,1)
enddo

just before
call CAMB_GetTransfers(P, Info%Transfers, error)


Executing the code, goes well until it reaches the line to write the Cl_scalar in to file, where these are not be accessible. If this can be sorted out, then I am set to go. Many thanks

CosmoMC: Accessing Cl_Scalar from within CAMB_GetResults

Posted: October 25 2016
by Simon Muya Kasanda
Oops! P%OnlyTransfers was .true. Changing it to .false. solved the problem. Thanks