FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in), | dimension (0:,0:) | :: | gjk | ||
real, | intent(in), | dimension (:,0:) | :: | legdre | ||
real, | intent(in), | dimension (:,0:) | :: | chebyshv1 | ||
real, | intent(in), | dimension (:,0:) | :: | chebyshv2 | ||
real, | intent(in), | dimension (:) | :: | x | ||
real, | intent(in) | :: | xmax | |||
real, | intent(out), | dimension (:,:) | :: | dH |
subroutine get_dHdE (gjk, legdre, chebyshv1, chebyshv2, x, xmax, dH)
implicit none
real, dimension (0:,0:), intent (in) :: gjk
real, dimension (:,0:), intent (in) :: legdre
real, dimension (:), intent (in) :: x
real, intent (in) :: xmax
real, dimension (:,0:), intent (in) :: chebyshv1, chebyshv2
real, dimension (:,:), intent (out) :: dH
integer :: ij, ik, ix
real :: cfac
dH = 0.0
! dH/dE at fixed xi is sum_{j,k} c_{j,k}*P_j(xi)*d(T_{n}(z))/dz / sqrt(E*EMAX)
! z=2*sqrt(E/EMAX)-1
! note that d(T_{k})/dz = k*U_{k-1}, where U_k is the Chebyshev polynomial of the 2nd kind
do ix = 1, size(x)
do ik = 0, size(gjk,2)-1
if (ik==0) then
! cfac nonzero here if hneo = F_1 instead of F_1/F_0
! cfac = -chebyshv1(ix,ik)
cfac = 0.0
else
! extra chebyshv1 term not needed since hneo = F_1/F_0 instead of F_1
! cfac = ik/sqrt(xmax*x(ix))*chebyshv2(ix,ik-1)-chebyshv1(ix,ik)
cfac = ik/sqrt(xmax*x(ix))*chebyshv2(ix,ik-1)
end if
do ij = 0, size(gjk,1)-1
dH(:,ix) = dH(:,ix) + (legdre(:,ij)*cfac*gjk(ij,ik))
end do
end do
end do
end subroutine get_dHdE