CosmoMC: use nrun to parametrize something different

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
alessandro tronconi
Posts: 6
Joined: February 14 2009
Affiliation: Bologna University

CosmoMC: use nrun to parametrize something different

Post by alessandro tronconi » July 01 2014

Since i'm not an expert and in order to modify the expression for the primordial scalar spectrum without having to introduce a new parameter and having to modify various sections of the code i just eliminated the dependence on n_run from the standard expression of the ScalarPower in power_tilt.f90 and used it to parametrize a cut-off leading to a loss of power in the small k region. Now, when i run cosmomc and let n_run vary in some interval specified in params_CMB_defaults.ini everything seems to be running smoothly and i get a reasonable output both for bestfit_cl and for n_run.
Can someone confirm this is a oversimplified but still correct way to proceed?

BTW: i downloaded the latest version of cosmomc and tried to follow the instructions i found on this forum to add a new parameter. However the code seems a bit different form what i expected by reading such instructions... am i missing something or maybe the code is changed in the latest versions?

Thanks

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

Re: CosmoMC: use nrun to parametrize something different

Post by Antony Lewis » July 01 2014

Sounds fine.

Steps for more general parameter additions are in the FAQ:
http://cosmologist.info/cosmomc/readme.html#FAQ

These did change this year after restructuring.

alessandro tronconi
Posts: 6
Joined: February 14 2009
Affiliation: Bologna University

CosmoMC: use nrun to parametrize something different

Post by alessandro tronconi » July 09 2014

Thank you very much for the reply. Still, however, i have problems when i try to figure out how to add a new parameter to parametrize other features of ScalarPower in power_tilt.f90. I need only to modify the primordial spectra.

I tried to follow you instructions but got lost soon... can i find somewhere a more detailed example? Sorry for my poor expertise...

PS: i also tried to use n_runrun to parametrize what i needed but no success...

alessandro tronconi
Posts: 6
Joined: February 14 2009
Affiliation: Bologna University

CosmoMC: use nrun to parametrize something different

Post by alessandro tronconi » September 15 2014

With the latest version of CosmoMC i'm using nrun, nrunrun and ntrun to parametrize the primordial spectra in an original way. I guess nrunrun works just like nrun, but as far as ntrun is concerned i needed to eliminate the check point n Calculator_CAMB.f90 which stops cosmomc when nt and ntrun are different from zero while calculating tensors with the consistency relation verified.

Then that ntrun enters some other code in Calculator_CAMB.f90. I don't want it enters the consistency relation as i now use it for something different. These are the lines of the code now:

Code: Select all

        if (P%InitPower%rat(ix)>0 .and. .not. CosmoSettings%compute_tensors) &
        call MpiStop('computing r>0 but compute_tensors=F')
        P%InitPower%n_run(ix) = CMB%InitPower(nrun_index)
        P%InitPower%n_runrun(ix) = CMB%InitPower(nrunrun_index)
        P%InitPower%nt_run(ix) = CMB%InitPower(ntrun_index)

        if (CosmoSettings%inflation_consistency) then
            if (CMB%InitPower(nt_index)/=0) &
!            if (CMB%InitPower(nt_index)/=0 .or. CMB%InitPower(ntrun_index)/=0) &
            & call MpiStop('Error: inflation_consistency but n_t not set to zero')
            ! first-order consistency relation
            !P%InitPower%ant(ix) = - CMB%InitPower(amp_ratio_index)/8
            !next order consistency relation
            P%InitPower%ant(ix) = - CMB%InitPower(amp_ratio_index)/8*(2-CMB%InitPower(ns_index) - CMB%InitPower(amp_ratio_index)/8)
!            P%InitPower%nt_run(ix) = CMB%InitPower(amp_ratio_index)/8* &
 !           & (CMB%InitPower(amp_ratio_index)/8 + CMB%InitPower(ns_index) - 1)
            !note input n_T, nt run is ignored, so should be fixed
        else
            P%InitPower%ant(ix) = CMB%InitPower(nt_index)
!            P%InitPower%nt_run(ix) = CMB%InitPower(ntrun_index)
        end if
Could someone confirm it is safe?

Post Reply