PROGRAM Compute_LinearPk USE linearpk ! A sample program for interpolating the numerical table of ! the linear matter power spectrum. ! - k is in units of h Mpc^-1 ! - P(k) is in units of h^-3 Mpc^3 ! May 22, 2010: E.Komatsu IMPLICIT none integer :: j double precision :: ak,linear_pk,dlnk,lnk character(len=128) :: filename integer :: n external linear_pk ! read in and tabulate P(k) filename='wmap5baosn_max_likelihood_matterpower.dat' n=896 ! # of lines in the file CALL open_linearpk(filename,n) ! now output P(k) as a function of k open(1,file='wavenumber_pk.txt') ak=4d-3 dlnk=1d-2 do while (ak<0.45d0) write(1,'(2E18.8)')ak,linear_pk(ak) lnk=dlog(ak)+dlnk ak=dexp(lnk) enddo dlnk=1d-1 do while (ak<15d0) write(1,'(2E18.8)')ak,linear_pk(ak) lnk=dlog(ak)+dlnk ak=dexp(lnk) enddo close(1) CALL close_linearpk END PROGRAM Compute_LinearPk