Allocate tem_communication_type and its variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_communication_type), | intent(inout) | :: | me | |||
integer, | intent(in) | :: | nProcs |
subroutine tem_comm_init( me, nProcs )
! -------------------------------------------------------------------- !
type( tem_communication_type ), intent(inout) :: me
integer, intent(in) :: nProcs
! -------------------------------------------------------------------- !
if ( allocated(me%proc) ) deallocate( me%proc )
if ( allocated(me%nElemsProc) ) deallocate( me%nElemsProc )
if ( allocated(me%elemPos) ) deallocate( me%elemPos )
if ( allocated(me%rqHandle) ) deallocate( me%rqHandle )
if ( allocated(me%buf_long) ) deallocate( me%buf_long )
if ( allocated(me%buf_int) ) deallocate( me%buf_int )
if ( allocated(me%buf_real) ) deallocate( me%buf_real )
me%nProcs = nProcs
allocate( me%proc ( nProcs ) )
allocate( me%nElemsProc( nProcs ) )
allocate( me%elemPos ( nProcs ) )
allocate( me%rqHandle ( nProcs ) )
allocate( me%buf_long ( nProcs ) )
allocate( me%buf_int ( nProcs ) )
allocate( me%buf_real ( nProcs ) )
end subroutine tem_comm_init