CosmoMC: Accessing Cl_Scalar from within CAMB_GetResults

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Post Reply
Simon Muya Kasanda
Posts: 5
Joined: January 16 2007
Affiliation: UKZN

CosmoMC: Accessing Cl_Scalar from within CAMB_GetResults

Post by Simon Muya Kasanda » October 14 2016

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 ?

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

Re: CosmoMC: Accessing Cl_Scalar from within CAMB_GetResults

Post by Antony Lewis » October 14 2016

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.

Simon Muya Kasanda
Posts: 5
Joined: January 16 2007
Affiliation: UKZN

CosmoMC: Accessing Cl_Scalar from within CAMB_GetResults

Post by Simon Muya Kasanda » October 17 2016

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,

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

Re: CosmoMC: Accessing Cl_Scalar from within CAMB_GetResults

Post by Antony Lewis » October 17 2016

Are you sure you're using the right module (probably need "camb").

Simon Muya Kasanda
Posts: 5
Joined: January 16 2007
Affiliation: UKZN

CosmoMC: Accessing Cl_Scalar from within CAMB_GetResults

Post by Simon Muya Kasanda » October 20 2016

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

Simon Muya Kasanda
Posts: 5
Joined: January 16 2007
Affiliation: UKZN

CosmoMC: Accessing Cl_Scalar from within CAMB_GetResults

Post by Simon Muya Kasanda » October 25 2016

Oops! P%OnlyTransfers was .true. Changing it to .false. solved the problem. Thanks

Post Reply