mimic_compute_tensors Subroutine

public subroutine mimic_compute_tensors(subsystems, quantum_fragment, tensors, tensor_sums, atom_start, atom_end)

compute folded tensors for long-range electrostatics

Arguments

TypeIntentOptionalAttributesName
type(subsystem_type), intent(inout), dimension(:):: subsystems

array of subsystems associated with client codes

type(quantum_fragment_type), intent(inout) :: quantum_fragment

quantum subsystem

real(kind=dp), intent(out), dimension(:,:), allocatable:: tensors

array with tensors

real(kind=dp), intent(out), dimension(:,:), allocatable:: tensor_sums

array with tensor sums

integer, intent(in), dimension(:):: atom_start

first atom id in the chunk

integer, intent(in), dimension(:):: atom_end

last atom id in the chunk


Contents

Source Code


Source Code

subroutine mimic_compute_tensors(subsystems, &
                               quantum_fragment, &
                               tensors, &
                               tensor_sums, &
                               atom_start, &
                               atom_end)

    !> array of subsystems associated with client codes
    type(subsystem_type), dimension(:), intent(inout) :: subsystems
    !> quantum subsystem
    type(quantum_fragment_type), intent(inout) :: quantum_fragment
    !> array with tensors
    real(dp), dimension(:,:), allocatable, intent(out) :: tensors
    !> array with tensor sums
    real(dp), dimension(:,:), allocatable, intent(out) :: tensor_sums
    !> first atom id in the chunk
    integer, dimension(:), intent(in) :: atom_start
    !> last atom id in the chunk
    integer, dimension(:), intent(in) :: atom_end

    real(dp), dimension(3) :: multipole_origin
    integer :: multipole_order
    integer :: i

    call timer_start("mimic_compute_tensors")

    multipole_origin = quantum_fragment%nuclear_multipoles%origin
    multipole_order = quantum_fragment%nuclear_multipoles%order

    allocate(tensors(size(quantum_fragment%nuclear_multipoles%values), &
                          size(subsystems)))
    allocate(tensor_sums(size(quantum_fragment%nuclear_multipoles%values), &
                          size(subsystems)))

    do i = 1, size(subsystems)
        call compute_folded_tensors(tensors(:,i), tensor_sums(:,i), &
                                    multipole_origin, multipole_order, &
                                    subsystems(i)%lr_atoms(atom_start(i):atom_end(i)))
    end do

    call timer_stop

end subroutine mimic_compute_tensors