CosmoMC: Accessing Cl_Scalar from within CAMB_GetResults
-
- Posts: 5
- Joined: January 16 2007
- Affiliation: UKZN
CosmoMC: Accessing Cl_Scalar from within CAMB_GetResults
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 ?
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 ?
-
- Posts: 1959
- Joined: September 23 2004
- Affiliation: University of Sussex
- Contact:
Re: CosmoMC: Accessing Cl_Scalar from within CAMB_GetResults
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.
-
- Posts: 5
- Joined: January 16 2007
- Affiliation: UKZN
CosmoMC: Accessing Cl_Scalar from within CAMB_GetResults
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,
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,
-
- Posts: 1959
- Joined: September 23 2004
- Affiliation: University of Sussex
- Contact:
Re: CosmoMC: Accessing Cl_Scalar from within CAMB_GetResults
Are you sure you're using the right module (probably need "camb").
-
- Posts: 5
- Joined: January 16 2007
- Affiliation: UKZN
CosmoMC: Accessing Cl_Scalar from within CAMB_GetResults
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
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
-
- Posts: 5
- Joined: January 16 2007
- Affiliation: UKZN
CosmoMC: Accessing Cl_Scalar from within CAMB_GetResults
Oops! P%OnlyTransfers was .true. Changing it to .false. solved the problem. Thanks