Code: Select all

`outpower = (transfer_var1* transfer_var2)*2*pi*2*h^3/k^3*InitPower`

Code: Select all

```
atransfer=MTrans%TransferData(s1,ik,itf)*MTrans%TransferData(s2,ik,itf)
matpower(ik) = log(atransfer*k*const_pi*const_twopi*h**3)
```

Code: Select all

```
do il=1, npoints
xi=logmink + dlnkh*(il-1)
if (xi < kvals(1)) then
outpower(il)=-30.
cycle
end if
do while ((xi > kvals(llo+1)).and.(llo < MTrans%num_q_trans))
llo=llo+1
if (llo >= MTrans%num_q_trans) exit
end do
if (llo == MTrans%num_q_trans) then
lastix = il
exit
end if
lhi=llo+1
ho=kvals(lhi)-kvals(llo)
a0=(kvals(lhi)-xi)/ho
b0=(xi-kvals(llo))/ho
outpower(il) = a0*matpower(llo)+ b0*matpower(lhi)+((a0**3-a0)* ddmat(llo) &
+(b0**3-b0)*ddmat(lhi))*ho**2/6
end do
do while (lastix <= npoints)
!Do linear extrapolation in the log
!Obviouly inaccurate, non-linear etc, but OK if only using in tails of window functions
outpower(lastix) = 2*outpower(lastix-1) - outpower(lastix-2)
lastix = lastix+1
end do
```