calculate_residual_norm Subroutine

public subroutine calculate_residual_norm(this)

Arguments

Type IntentOptional Attributes Name
type(DavidsonCalcType), intent(inout) :: this

Contents


Source Code

    subroutine calculate_residual_norm(this)

        type(DavidsonCalcType), intent(inout) :: this
        ! This subroutine calculates the Euclidean norm of the reisudal vector, r:
        ! residual_norm^2 = \sum_i r_i^2
        if (iProcIndex == root) then
            this%residual_norm = sqrt(dot_product(this%residual, this%residual))
        end if

        if (this%super%hamil_type == parallel_sparse_hamil_type) call MPIBCast(this%residual_norm)

    end subroutine calculate_residual_norm