SUBROUTINE CreateSpinInvBRR() ! Create an SpinInvBRR containing spin orbitals, ! unlike 'createInvBRR' which only has spatial orbitals. ! This is used for the FixCASshift option in establishing whether or not ! a determinant is in the complete active space. ! In: ! BRR(i)=j: orbital i is the j-th lowest in energy. ! nBasis: size of basis ! SpinInvBRR is the inverse of BRR. SpinInvBRR(j)=i: the j-th lowest energy ! orbital corresponds to the i-th orbital in the original basis. ! i.e the position in SpinInvBRR now corresponds to the orbital number and ! the value to the relative energy of this orbital. IMPLICIT NONE INTEGER :: I, t, ierr CHARACTER(len=*), PARAMETER :: this_routine = 'CreateSpinInvBrr' IF (ALLOCATED(SpinInvBRR)) return allocate(SpinInvBRR(NBASIS), STAT=ierr) CALL LogMemAlloc('SpinInvBRR', NBASIS, 4, this_routine, SpinInvBRRTag, ierr) SpinInvBRR(:) = 0 t = 0 do I = 1, NBASIS t = t + 1 SpinInvBRR(BRR(I)) = t end do return END SUBROUTINE CreateSpinInvBRR