encode_string Subroutine

public subroutine encode_string(string, ilut)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: string(tot_nelec)
integer(kind=n_int), intent(out) :: ilut(0:NIfD)

Contents

Source Code


Source Code

    subroutine encode_string(string, ilut)

        ! Encode an alpha or beta string as an ilut.

        integer, intent(in) :: string(tot_nelec)
        integer(n_int), intent(out) :: ilut(0:NIfD)
        integer :: i, pos

        ilut = 0

        do i = 1, tot_nelec
            pos = (string(i) - 1) / bits_n_int
            ilut(pos) = ibset(ilut(pos), mod(string(i) - 1, bits_n_int))
        end do

    end subroutine encode_string