init_ga_dynlong Subroutine

public subroutine init_ga_dynlong(me, length)

Arguments

Type IntentOptional Attributes Name
type(grw_dynlongarray_type), intent(out) :: me
integer, intent(in), optional :: length

Called by

proc~~init_ga_dynlong~~CalledByGraph proc~init_ga_dynlong init_ga_dynlong interface~init~11 init interface~init~11->proc~init_ga_dynlong proc~tem_halo_init tem_halo_init proc~tem_halo_init->interface~init~11 proc~identify_lists identify_lists proc~identify_lists->proc~tem_halo_init proc~communicate_elements communicate_elements proc~communicate_elements->proc~identify_lists proc~tem_find_allelements tem_find_allElements proc~tem_find_allelements->proc~identify_lists

Source Code

  subroutine init_ga_dynlong(me, length)
    type(grw_dynlongarray_type), intent(out) :: me !< dynamic array to init
    integer, intent(in), optional :: length !< initial length of the container

    if (present(length)) then
      me%containersize = length
    else
      me%containersize = zerolength
    end if
    ! deallocate ...
    if( allocated( me%val ))     &
      deallocate(me%val)
    ! ... and reallocate
    allocate(me%val(me%containersize))
    me%nvals = 0

  end subroutine init_ga_dynlong