scatter_add_d Subroutine

public subroutine scatter_add_d(dest, source, dest_index)

Arguments

Type IntentOptional AttributesName
real(kind=DP), intent(out), DIMENSION(:):: dest
real(kind=DP), intent(in), DIMENSION(:):: source
integer(kind=I4B), intent(in), DIMENSION(:):: dest_index

Calls

proc~~scatter_add_d~~CallsGraph proc~scatter_add_d scatter_add_d proc~assert_eq2 assert_eq2 proc~scatter_add_d->proc~assert_eq2

Called by

proc~~scatter_add_d~~CalledByGraph proc~scatter_add_d scatter_add_d interface~scatter_add scatter_add interface~scatter_add->proc~scatter_add_d

Contents

Source Code


Source Code

	SUBROUTINE scatter_add_d(dest,source,dest_index)
	REAL(DP), DIMENSION(:), INTENT(OUT) :: dest
	REAL(DP), DIMENSION(:), INTENT(IN) :: source
	INTEGER(I4B), DIMENSION(:), INTENT(IN) :: dest_index
	INTEGER(I4B) :: m,n,j,i
	n=assert_eq2(size(source),size(dest_index),'scatter_add_d')
	m=size(dest)
	do j=1,n
		i=dest_index(j)
		if (i > 0 .and. i <= m) dest(i)=dest(i)+source(j)
	end do
	END SUBROUTINE scatter_add_d