subroutine gen_cum_list_real_hub_2(csf_i, orb_i, cum_arr)
type(CSF_Info_t), intent(in) :: csf_i
integer, intent(in) :: orb_i
real(dp), intent(out) :: cum_arr(nSpatOrbs)
real(dp) :: cum_sum
integer :: i, lower, upper
! similar to the case above except the switch restrictrion..
call find_switches(csf_i, orb_i, lower, upper)
cum_sum = 0.0_dp
do i = 1, lower - 1
if (csf_i%stepvector(i) == 3) then
cum_arr(i) = cum_sum
else
cum_sum = cum_sum + abs(GetTMatEl(2 * orb_i, 2 * i))
cum_arr(i) = cum_sum
end if
end do
do i = lower, upper
! here d = 2 and d = 3 are excluded!
if (csf_i%stepvector(i) > 1) then
cum_arr(i) = cum_sum
else
cum_sum = cum_sum + abs(GetTMatEl(2 * orb_i, 2 * i))
cum_arr(i) = cum_sum
end if
end do
do i = upper + 1, nSpatOrbs
if (csf_i%stepvector(i) == 3) then
cum_arr(i) = cum_sum
else
cum_sum = cum_sum + abs(GetTMatEl(2 * orb_i, 2 * i))
cum_arr(i) = cum_sum
end if
end do
end subroutine gen_cum_list_real_hub_2