Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_file), | intent(inout) | :: | self | XML file. |
||
type(xml_tag), | intent(in) | :: | tag | XML tag. |
Add tag to XML file.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(xml_tag), | public, | allocatable | :: | tag_new(:) | New (extended) tags array. |
elemental subroutine add_tag(self, tag)
!---------------------------------------------------------------------------------------------------------------------------------
!< Add tag to XML file.
!---------------------------------------------------------------------------------------------------------------------------------
class(xml_file), intent(inout) :: self !< XML file.
type(xml_tag), intent(in) :: tag !< XML tag.
type(xml_tag), allocatable :: tag_new(:) !< New (extended) tags array.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
if (self%Nt>0_I4P) then
allocate(tag_new(1:self%Nt + 1))
tag_new(1:self%Nt) = self%tag(1:self%Nt)
tag_new(self%Nt + 1) = tag
else
allocate(tag_new(1:1))
tag_new(1) = tag
endif
call move_alloc(from=tag_new, to=self%tag)
self%Nt = self%Nt + 1
!---------------------------------------------------------------------------------------------------------------------------------
endsubroutine add_tag