alloc_attributes Subroutine

private elemental subroutine alloc_attributes(self, Na)

Arguments

Type IntentOptional AttributesName
class(xml_tag), intent(inout) :: self

XML tag.

integer(kind=I4P), intent(in) :: Na

Number of attributes.

Description

Allocate (prepare for filling) dynamic memory of attributes.


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