init_ga_stringkeyvaluepair Subroutine

private subroutine init_ga_stringkeyvaluepair(me, length)

Arguments

Type IntentOptional AttributesName
type(grw_stringkeyvaluepairarray_type), intent(out) :: me
integer, intent(in), optional :: length

Called by

proc~~init_ga_stringkeyvaluepair~~CalledByGraph proc~init_ga_stringkeyvaluepair init_ga_stringkeyvaluepair interface~init~8 init interface~init~8->proc~init_ga_stringkeyvaluepair

Contents


Source Code

  subroutine init_ga_stringkeyvaluepair(me, length)
    type(grw_stringkeyvaluepairarray_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_stringkeyvaluepair