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)
Code: Select all
InitialPower.f90
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)