clear_one_rdms Subroutine

public pure subroutine clear_one_rdms(one_rdms)

Arguments

Type IntentOptional Attributes Name
type(one_rdm_t), intent(inout) :: one_rdms(:)

Contents

Source Code


Source Code

    pure subroutine clear_one_rdms(one_rdms)

        ! Clear all the arrays for the one_rdm_t objects passed in (except for
        ! sym_list arrays, which we'd expect to be constant throughout a
        ! simulation, except for special cases like basis rotations).

        type(one_rdm_t), intent(inout) :: one_rdms(:)

        integer :: irdm

        do irdm = 1, size(one_rdms)
            if (allocated(one_rdms(irdm)%matrix)) one_rdms(irdm)%matrix = 0.0_dp
            if (allocated(one_rdms(irdm)%evalues)) one_rdms(irdm)%evalues = 0.0_dp
            if (allocated(one_rdms(irdm)%rho_ii)) one_rdms(irdm)%rho_ii = 0.0_dp
            if (allocated(one_rdms(irdm)%lagrangian)) one_rdms(irdm)%lagrangian = 0.0_dp
        end do

    end subroutine clear_one_rdms