Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_writer_abstract), | intent(inout) | :: | self | |||
character, | intent(in) | :: | data_type | |||
integer(kind=I4P), | intent(in) | :: | number_of_components | |||
character, | intent(in) | :: | data_name | |||
character, | intent(in), | optional | :: | data_content | ||
logical, | intent(in), | optional | :: | is_tuples |
subroutine write_dataarray_tag(self, data_type, number_of_components, data_name, data_content, is_tuples)
!< Write `<DataArray...>...</DataArray>` tag.
class(xml_writer_abstract), intent(inout) :: self !< Writer.
character(*), intent(in) :: data_type !< Type of dataarray.
integer(I4P), intent(in) :: number_of_components !< Number of dataarray components.
character(*), intent(in) :: data_name !< Data name.
character(*), intent(in), optional :: data_content !< Data content.
logical, intent(in), optional :: is_tuples !< Use "NumberOfTuples".
type(string) :: tag_attributes !< Tag attributes.
logical :: is_tuples_ !< Use "NumberOfTuples".
is_tuples_ = .false.
if (present(is_tuples)) is_tuples_ = is_tuples
if (is_tuples_) then
tag_attributes = 'type="'//trim(adjustl(data_type))// &
'" NumberOfTuples="'//trim(str(number_of_components, .true.))// &
'" Name="'//trim(adjustl(data_name))// &
'" format="'//self%format_ch//'"'
else
tag_attributes = 'type="'//trim(adjustl(data_type))// &
'" NumberOfComponents="'//trim(str(number_of_components, .true.))// &
'" Name="'//trim(adjustl(data_name))// &
'" format="'//self%format_ch//'"'
endif
call self%write_tag(name='DataArray', attributes=tag_attributes%chars(), content=data_content)
endsubroutine write_dataarray_tag