init_ga_int Subroutine

public subroutine init_ga_int(me, length)

Arguments

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

Called by

proc~~init_ga_int~~CalledByGraph proc~init_ga_int init_ga_int interface~init~13 init interface~init~13->proc~init_ga_int

Contents

Source Code


Source Code

  subroutine init_ga_int(me, length)
    type(grw_intarray_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_int