add_ecpint Subroutine

public subroutine add_ecpint(basis, coord, hcore)

Arguments

Type IntentOptional Attributes Name
type(basis_set), intent(in) :: basis
real(kind=real64), intent(in), contiguous :: coord(:,:)
real(kind=real64), intent(inout), contiguous :: hcore(:)

Calls

proc~~add_ecpint~~CallsGraph proc~add_ecpint add_ecpint interface~compute_integrals compute_integrals proc~add_ecpint->interface~compute_integrals interface~free_integrator free_integrator proc~add_ecpint->interface~free_integrator interface~free_result free_result proc~add_ecpint->interface~free_result interface~init_integrator init_integrator proc~add_ecpint->interface~init_integrator interface~init_integrator_instance init_integrator_instance proc~add_ecpint->interface~init_integrator_instance interface~set_ecp_basis set_ecp_basis proc~add_ecpint->interface~set_ecp_basis none~bf_to_shell basis_set%bf_to_shell proc~add_ecpint->none~bf_to_shell

Called by

proc~~add_ecpint~~CalledByGraph proc~add_ecpint add_ecpint proc~omp_hst omp_hst proc~omp_hst->proc~add_ecpint proc~int1e int1e proc~int1e->proc~omp_hst

Source Code

    subroutine add_ecpint(basis, coord, hcore)
        real(real64), contiguous, intent(in) :: coord(:,:)
        type(basis_set), intent(in) :: basis
        real(real64), contiguous, intent(inout) :: hcore(:)
        type(c_ptr) :: integrator
        type(ecp_result) :: result_ptr
        real(c_double), pointer :: libecp_res(:)
        integer :: i, j, c
        integer(c_int) :: driv_order

        if (.not.(basis%ecp_params%is_ecp)) then
            return
        end if
        driv_order = 0

        call set_integrator(integrator, basis, coord, driv_order)

        result_ptr = compute_integrals(integrator)
        call c_f_pointer(result_ptr%data, libecp_res, [result_ptr%size])


        call transform_matrix(basis, libecp_res)

        c = 0
        do i = 1, basis%nbf
            do j = 1, i
                c = c + 1
                hcore(c) = libecp_res((i - 1) * basis%nbf + j) + hcore(c)
            end do
        end do

        result_ptr%data = c_null_ptr
        result_ptr%size = 0
        nullify(libecp_res)

        call free_integrator(integrator)
        call free_result(result_ptr)

    end subroutine add_ecpint