GETCACHEINDEXSTATES Subroutine

public subroutine GETCACHEINDEXSTATES(IND, I, J)

Arguments

Type IntentOptional Attributes Name
integer :: IND
integer :: I
integer :: J

Contents

Source Code


Source Code

    SUBROUTINE GETCACHEINDEXSTATES(IND, I, J)
        ! In:
        !   Ind: Cache index.
        ! Out:
        !   I,J (I<=J): states corresponding to cache index.
        ! Reverse of GetCacheIndex.
        INTEGER I, J, IND
        J = int(SQRT(2.0d0 * IND))
        IF (J * (J + 1) / 2 < IND) J = J + 1
        I = IND - J * (J - 1) / 2
    END SUBROUTINE GetCacheIndexStates