alloc_attributes Subroutine

private elemental subroutine alloc_attributes(self, Na)

Arguments

TypeIntentOptionalAttributesName
class(xml_tag), intent(inout) :: self
integer(kind=I4P), intent(in) :: Na

Contents

Source Code


Source Code

  elemental subroutine alloc_attributes(self, Na)
  !< Allocate (prepare for filling) dynamic memory of attributes.
  class(xml_tag),    intent(inout) :: self     !< XML tag.
  integer(I4P),      intent(in)    :: Na       !< Number of attributes.

  if (allocated(self%attribute)) then
    call self%attribute%free
    deallocate(self%attribute)
  endif
  allocate(self%attribute(1:2, 1:Na))
  self%attributes_number = Na
  endsubroutine alloc_attributes