External primordial power spectrum in CAMB

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Post Reply
Hossein Moshafi 110
Posts: 2
Joined: November 03 2020
Affiliation: School of Astronomy, IPM

External primordial power spectrum in CAMB

Post by Hossein Moshafi 110 » November 03 2020

Hi,

I want to run CAMB with an external file as a primordial power spectrum, i.e. I don't use CAMB's ScalarPower function and I have two columned file (k, P(k)) and I want to run CAMB for this file.

How I can feed an external primordial power spectrum to CAMB?

I tried to write a piece of code in

Code: Select all

 function TInitialPowerLaw_ScalarPower(this, k) 
in the

Code: Select all

 InitialPower.f90
file like as follows but it doesn't return reliable answer:

Code: Select all

      open(unit=10,file="mypower.dat",status='old')

        nw_ppf=0
        do i=1,nwmax+1
            read(10,*,end=100)myk(i),mypk(i)

            nw_ppf=nw_ppf+1

        !        k=myk(i)
                TInitialPowerLaw_ScalarPower=mypk(i)

        enddo

        100     close(10)


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

Re: External primordial power spectrum in CAMB

Post by Antony Lewis » November 04 2020


Hossein Moshafi 110
Posts: 2
Joined: November 03 2020
Affiliation: School of Astronomy, IPM

Re: External primordial power spectrum in CAMB

Post by Hossein Moshafi 110 » November 04 2020

Hi Antony,

Thanks for your reply. I'll check this.

Post Reply