Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_writer_ascii_local), | intent(inout) | :: | self | |||
character, | intent(in) | :: | data_name | |||
integer(kind=I1P), | intent(in) | :: | x(1:,1:,1:,1:) | |||
logical, | intent(in), | optional | :: | one_component | ||
logical, | intent(in), | optional | :: | is_tuples |
function write_dataarray1_rank4_I1P(self, data_name, x, one_component, is_tuples) result(error)
!< Write `<DataArray... NumberOfComponents="n"...>...</DataArray>` tag (I1P).
class(xml_writer_ascii_local), intent(inout) :: self !< Writer.
character(*), intent(in) :: data_name !< Data name.
integer(I1P), intent(in) :: x(1:,1:,1:,1:) !< Data variable.
logical, intent(in), optional :: one_component !< Force one component.
logical, intent(in), optional :: is_tuples !< Use "NumberOfTuples" instead of "NumberOfComponents".
integer(I4P) :: error !< Error status.
character(len=:), allocatable :: data_type !< Data type.
integer(I4P) :: n_components !< Number of components.
character(len=:), allocatable :: code !< Data variable encoded, ascii or Base64 codec.
data_type = 'Int8'
n_components = size(x, dim=1)
if (present(one_component)) then
if (one_component) n_components = 1
endif
code = encode_ascii_dataarray(x=x)
call self%write_dataarray_tag(data_type=data_type, number_of_components=n_components, data_name=data_name, data_content=code, &
is_tuples=is_tuples)
error = self%error
endfunction write_dataarray1_rank4_I1P