Transfer reduction results to array chunk
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_reduction_spatial_type), | intent(in) | :: | me(:) | |||
real(kind=rk), | intent(inout) | :: | chunk(:) | |||
integer, | intent(out) | :: | nChunkElems |
Number of element after spatial reduction = 1 |
subroutine tem_reduction_spatial_toChunk( me, chunk, nChunkElems )
! ---------------------------------------------------------------------------
!>
type(tem_reduction_spatial_type), intent(in) :: me(:)
!>
real(kind=rk), intent(inout) :: chunk(:)
!> Number of element after spatial reduction = 1
integer, intent(out) :: nChunkElems
! ---------------------------------------------------------------------------
integer :: iReduce, iPos, iComp
! ---------------------------------------------------------------------------
nChunkElems = 1
iPos = 0
do iReduce = 1, size( me )
do iComp = 1, me(iReduce)%nComponents
chunk( iPos+iComp ) = me(iReduce)%val( iComp )
enddo
iPos = iPos + me(iReduce)%nComponents
enddo
end subroutine tem_reduction_spatial_toChunk