pic_sum Interface

public interface pic_sum

pic_sum provides a threaded alternative to the sum(array) Fortran intrinsic which will be too slow for large sizes of vectors and matrices. Note that this provides the total sum. As opposed to the blas alternative XASUM which does the absolute sum

pic_sum is implemented for (int32, int64, sp, dp) 1 and 2d arrays

Usage: result = pic_sum(array, [optional] threaded)

This subroutine is threaded for performance purposes if threaded is set to true

Calls

interface~~pic_sum~~CallsGraph interface~pic_sum pic_sum proc~sum_3d_tensor_dp sum_3d_tensor_dp interface~pic_sum->proc~sum_3d_tensor_dp proc~sum_3d_tensor_int32 sum_3d_tensor_int32 interface~pic_sum->proc~sum_3d_tensor_int32 proc~sum_3d_tensor_int64 sum_3d_tensor_int64 interface~pic_sum->proc~sum_3d_tensor_int64 proc~sum_3d_tensor_sp sum_3d_tensor_sp interface~pic_sum->proc~sum_3d_tensor_sp proc~sum_matrix_dp sum_matrix_dp interface~pic_sum->proc~sum_matrix_dp proc~sum_matrix_int32 sum_matrix_int32 interface~pic_sum->proc~sum_matrix_int32 proc~sum_matrix_int64 sum_matrix_int64 interface~pic_sum->proc~sum_matrix_int64 proc~sum_matrix_sp sum_matrix_sp interface~pic_sum->proc~sum_matrix_sp proc~sum_vector_dp sum_vector_dp interface~pic_sum->proc~sum_vector_dp proc~sum_vector_int32 sum_vector_int32 interface~pic_sum->proc~sum_vector_int32 proc~sum_vector_int64 sum_vector_int64 interface~pic_sum->proc~sum_vector_int64 proc~sum_vector_sp sum_vector_sp interface~pic_sum->proc~sum_vector_sp interface~pic_optional pic_optional proc~sum_3d_tensor_dp->interface~pic_optional proc~sum_3d_tensor_int32->interface~pic_optional proc~sum_3d_tensor_int64->interface~pic_optional proc~sum_3d_tensor_sp->interface~pic_optional proc~sum_matrix_dp->interface~pic_optional proc~sum_matrix_int32->interface~pic_optional proc~sum_matrix_int64->interface~pic_optional proc~sum_matrix_sp->interface~pic_optional proc~sum_vector_dp->interface~pic_optional proc~sum_vector_int32->interface~pic_optional proc~sum_vector_int64->interface~pic_optional proc~sum_vector_sp->interface~pic_optional proc~optional_char optional_char interface~pic_optional->proc~optional_char proc~optional_dp optional_dp interface~pic_optional->proc~optional_dp proc~optional_int32 optional_int32 interface~pic_optional->proc~optional_int32 proc~optional_int64 optional_int64 interface~pic_optional->proc~optional_int64 proc~optional_logical optional_logical interface~pic_optional->proc~optional_logical proc~optional_sp optional_sp interface~pic_optional->proc~optional_sp

Module Procedures

private function sum_vector_int32(vector, threaded) result(res)

perform the total sum of all components of type int32 in a vector

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: vector(:)
logical, intent(in), optional :: threaded

Return Value integer(kind=int32)

private function sum_vector_int64(vector, threaded) result(res)

perform the total sum of all components of type int64 in a vector

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: vector(:)
logical, intent(in), optional :: threaded

Return Value integer(kind=int64)

private function sum_vector_sp(vector, threaded) result(res)

perform the total sum of all components of type sp in a vector

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: vector(:)
logical, intent(in), optional :: threaded

Return Value real(kind=sp)

private function sum_vector_dp(vector, threaded) result(res)

perform the total sum of all components of type dp in a vector

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: vector(:)
logical, intent(in), optional :: threaded

Return Value real(kind=dp)

private function sum_matrix_int32(matrix, threaded) result(res)

perform the total sum of all components of type int32 in a matrix

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: matrix(:,:)
logical, intent(in), optional :: threaded

Return Value integer(kind=int32)

private function sum_matrix_int64(matrix, threaded) result(res)

perform the total sum of all components of type int64 in a matrix

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: matrix(:,:)
logical, intent(in), optional :: threaded

Return Value integer(kind=int64)

private function sum_matrix_sp(matrix, threaded) result(res)

perform the total sum of all components of type sp in a matrix

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: matrix(:,:)
logical, intent(in), optional :: threaded

Return Value real(kind=sp)

private function sum_matrix_dp(matrix, threaded) result(res)

perform the total sum of all components of type dp in a matrix

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: matrix(:,:)
logical, intent(in), optional :: threaded

Return Value real(kind=dp)

private function sum_3d_tensor_int32(tensor, threaded) result(res)

perform the total sum of all components of type int32 in a 3d tensor

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: tensor(:,:,:)
logical, intent(in), optional :: threaded

Return Value integer(kind=int32)

private function sum_3d_tensor_int64(tensor, threaded) result(res)

perform the total sum of all components of type int64 in a 3d tensor

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: tensor(:,:,:)
logical, intent(in), optional :: threaded

Return Value integer(kind=int64)

private function sum_3d_tensor_sp(tensor, threaded) result(res)

perform the total sum of all components of type sp in a 3d tensor

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: tensor(:,:,:)
logical, intent(in), optional :: threaded

Return Value real(kind=sp)

private function sum_3d_tensor_dp(tensor, threaded) result(res)

perform the total sum of all components of type dp in a 3d tensor

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: tensor(:,:,:)
logical, intent(in), optional :: threaded

Return Value real(kind=dp)