print_populations_kp Subroutine

public subroutine print_populations_kp()

Arguments

None

Contents

Source Code


Source Code

    subroutine print_populations_kp()

        ! A useful test routine which will output the total walker population on both
        ! replicas, for each Krylov vector.

        integer :: ihash
        integer(n_int) :: int_sign(lenof_all_signs)
        real(dp) :: real_sign(lenof_all_signs), total_pop(lenof_all_signs)
        type(ll_node), pointer :: temp_node

        int_sign = 0_n_int
        total_pop = 0.0_dp
        real_sign = 0.0_dp

        do ihash = 1, nhashes_kp
            temp_node => krylov_vecs_ht(ihash)
            if (temp_node%ind /= 0) then
                do while (associated(temp_node))
                    int_sign = krylov_vecs(IlutBits%ind_pop:IlutBits%ind_pop + lenof_all_signs - 1, temp_node%ind)
                    real_sign = transfer(int_sign, real_sign)
                    total_pop = total_pop + abs(real_sign)
                    temp_node => temp_node%next
                end do
            end if
        end do

        nullify (temp_node)

        write(stdout, *) "krylov_vecs populations:", total_pop

    end subroutine print_populations_kp