isProperCSF_nI Function

public function isProperCSF_nI(nI) result(flag)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nEl)

Return Value logical


Contents

Source Code


Source Code

    function isProperCSF_nI(nI) result(flag)
        ! function to check if provided CSF in nI(nEl) format is a proper CSF
        integer, intent(in) :: nI(nEl)
        logical :: flag

        real(dp) :: bVector(nEl)
        integer :: calcS

        flag = .true.

        bVector = calcB_vector_nI(nI)

        ! check if the b value drops below zero
        if (any(bVector < 0.0_dp)) flag = .false.

        ! check if total spin is same as input
        calcS = abs(sum(get_spin_pn(nI(:))))

        if (calcS /= STOT) flag = .false.

    end function isProperCSF_nI