anchor.diff:    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.
  -  !---------------------------------------------------------------------------------------------------------------------------------
     endfunction write_dataarray1_rank4_R4P_interface
   
     function write_dataarray1_rank4_I8P_interface(self, data_name, x, one_component, is_tuples) result(error)
  -  !---------------------------------------------------------------------------------------------------------------------------------
     !< Write `<DataArray... NumberOfComponents="n"...>...</DataArray>` tag (I8P).
  -  !---------------------------------------------------------------------------------------------------------------------------------
     import :: xml_writer_abstract, I4P, I8P
     class(xml_writer_abstract), intent(inout)        :: self           !< Writer.
     character(*),               intent(in)           :: data_name      !< Data name.
  
positive.code:   integer(I4P),               intent(in)           :: z(1:)        !< Z component of data variable.
    logical,                    intent(in), optional :: is_tuples    !< Use "NumberOfTuples" instead of "NumberOfComponents".
    integer(I4P)                                     :: error        !< Error status.
    !---------------------------------------------------------------------------------------------------------------------------------
    endfunction write_dataarray3_rank1_I4P_interface
  
    function write_dataarray3_rank1_I2P_interface(self, data_name, x, y, z, is_tuples) result(error)
    !---------------------------------------------------------------------------------------------------------------------------------
    !< Write `<DataArray... NumberOfComponents="3"...>...</DataArray>` tag (I2P).
    !---------------------------------------------------------------------------------------------------------------------------------
    import :: xml_writer_abstract, I2P, I4P
    class(xml_writer_abstract), intent(inout)        :: self         !< Writer.
    character(*),               intent(in)           :: data_name    !< Data name.
  
negative.code:   integer(I4P),               intent(in)    :: nz2            !< Final node of z axis.
    integer(I4P)                              :: error          !< Error status.
    type(string)                              :: tag_attributes !< Tag attributes.
  
    tag_attributes = 'Extent="'//trim(str(n=nx1))//' '//trim(str(n=nx2))//' '// &
                                 trim(str(n=ny1))//' '//trim(str(n=ny2))//' '// &
                                 trim(str(n=nz1))//' '//trim(str(n=nz2))//'"'
    call self%write_start_tag(name='Piece', attributes=tag_attributes%chars())
    error = self%error
    endfunction write_piece_start_tag
  
    function write_piece_start_tag_unst(self, np, nc) result(error)
    !< Write `<Piece ...>` start tag for unstructured topology.
    class(xml_writer_abstract), intent(inout) :: self           !< Writer.
    integer(I4P),               intent(in)    :: np             !< Number of points.
    integer(I4P),               intent(in)    :: nc             !< Number of cells.
    integer(I4P)                              :: error          !< Error status.
    type(string)                              :: tag_attributes !< Tag attributes.
  
    tag_attributes = 'NumberOfPoints="'//trim(str(n=np))//'" NumberOfCells="'//trim(str(n=nc))//'"'
    call self%write_start_tag(name='Piece', attributes=tag_attributes%chars())
    error = self%error
    endfunction write_piece_start_tag_unst
  
    function write_piece_end_tag(self) result(error)
    !< Write `</Piece>` end tag.
    class(xml_writer_abstract), intent(inout) :: self  !< Writer.
    integer(I4P)                              :: error !< Error status.
  
    call self%write_end_tag(name='Piece')
    error = self%error
    endfunction write_piece_end_tag
  
    ! write_geo_rect methods
    function write_geo_rect_data3_rank1_R8P(self, x, y, z) result(error)
    !< Write mesh with **RectilinearGrid** topology (data 3, rank 1, R8P).
    class(xml_writer_abstract), intent(inout) :: self  !< Writer.
    real(R8P),                  intent(in)    :: x(1:) !< X coordinates.
    real(R8P),                  intent(in)    :: y(1:) !< Y coordinates.
    real(R8P),                  intent(in)    :: z(1:) !< Z coordinates.
    integer(I4P)                              :: error !< Error status.
  
    call self%write_start_tag(name='Coordinates')
    error = self%write_dataarray(data_name='X', x=x)
    error = self%write_dataarray(data_name='Y', x=y)
    error = self%write_dataarray(data_name='Z', x=z)
    call self%write_end_tag(name='Coordinates')
    error = self%error
    endfunction write_geo_rect_data3_rank1_R8P
  
    function write_geo_rect_data3_rank1_R4P(self, x, y, z) result(error)
    !< Write mesh with **RectilinearGrid** topology (data 3, rank 1, R4P).
    class(xml_writer_abstract), intent(inout) :: self  !< Writer.
    real(R4P),                  intent(in)    :: x(1:) !< X coordinates.
    real(R4P),                  intent(in)    :: y(1:) !< Y coordinates.
    real(R4P),                  intent(in)    :: z(1:) !< Z coordinates.
    integer(I4P)                              :: error !< Error status.
  
    call self%write_start_tag(name='Coordinates')
    error = self%write_dataarray(data_name='X', x=x)
    error = self%write_dataarray(data_name='Y', x=y)
    error = self%write_dataarray(data_name='Z', x=z)
    call self%write_end_tag(name='Coordinates')
    error = self%error
    endfunction write_geo_rect_data3_rank1_R4P
  
    ! write_geo_strg methods
    function write_geo_strg_data1_rank2_R8P(self, xyz) result(error)
    !< Write mesh with **StructuredGrid** topology (data 1, rank 2, R8P).
    class(xml_writer_abstract), intent(inout) :: self       !< Writer.
    real(R8P),                  intent(in)    :: xyz(1:,1:) !< X, y, z coordinates [1:3,1:n].
    integer(I4P)                              :: error      !< Error status.
  
    call self%write_start_tag(name='Points')
    error = self%write_dataarray(data_name='Points', x=xyz)
    call self%write_end_tag(name='Points')
    error = self%error
    endfunction write_geo_strg_data1_rank2_R8P
  
    function write_geo_strg_data1_rank2_R4P(self, xyz) result(error)
    !< Write mesh with **StructuredGrid** topology (data 1, rank 2, R4P).
    class(xml_writer_abstract), intent(inout) :: self       !< Writer.
    real(R4P),                  intent(in)    :: xyz(1:,1:) !< X, y, z coordinates [1:3,:].
    integer(I4P)                              :: error      !< Error status.
  
    call self%write_start_tag(name='Points')
    error = self%write_dataarray(data_name='Points', x=xyz)
    call self%write_end_tag(name='Points')
    error = self%error
    endfunction write_geo_strg_data1_rank2_R4P
  
    function write_geo_strg_data1_rank4_R8P(self, xyz) result(error)
    !< Write mesh with **StructuredGrid** topology (data 1, rank 4, R8P).
    class(xml_writer_abstract), intent(inout) :: self             !< Writer.
    real(R8P),                  intent(in)    :: xyz(1:,1:,1:,1:) !< X, y, z coordinates [1:3,:,:,:].
    integer(I4P)                              :: error            !< Error status.
  
    call self%write_start_tag(name='Points')
    error = self%write_dataarray(data_name='Points', x=xyz)
    call self%write_end_tag(name='Points')
    error = self%error
    endfunction write_geo_strg_data1_rank4_R8P
  
    function write_geo_strg_data1_rank4_R4P(self, xyz) result(error)
    !< Write mesh with **StructuredGrid** topology (data 1, rank 4, R4P).
    class(xml_writer_abstract), intent(inout) :: self             !< Writer.
    real(R4P),                  intent(in)    :: xyz(1:,1:,1:,1:) !< X, y, z coordinates [1:3,:,:,:].
    integer(I4P)                              :: error            !< Error status.
  
    call self%write_start_tag(name='Points')
    error = self%write_dataarray(data_name='Points', x=xyz)
    call self%write_end_tag(name='Points')
    error = self%error
    endfunction write_geo_strg_data1_rank4_R4P
  
    function write_geo_strg_data3_rank1_R8P(self, n, x, y, z) result(error)
    !< Write mesh with **StructuredGrid** topology (data 3, rank 1, R8P).
    class(xml_writer_abstract), intent(inout) :: self  !< Writer.
    integer(I4P),               intent(in)    :: n     !< Number of nodes.
    real(R8P),                  intent(in)    :: x(1:) !< X coordinates.
    real(R8P),                  intent(in)    :: y(1:) !< Y coordinates.
    real(R8P),                  intent(in)    :: z(1:) !< Z coordinates.
    integer(I4P)                              :: error !< Error status.
  
    if ((n/=size(x, dim=1)).or.(n/=size(y, dim=1)).or.(n/=size(z, dim=1))) then
      self%error = 1
      return
  