subroutine write_vts(part, filename)
!< Write VTS parts.
integer(I4P), intent(in) :: part !< Part to be saved [1,2].
character(*), intent(in) :: filename !< Output file name.
type(vtk_file) :: a_vtk_file !< A VTK file.
integer(I4P) :: error !< Status error.
error = a_vtk_file%initialize(format='binary', filename=filename, mesh_topology='StructuredGrid', &
nx1=nx1_p(part), nx2=nx2_p(part), ny1=ny1, ny2=ny2, nz1=nz1, nz2=nz2)
error = a_vtk_file%xml_writer%write_piece(nx1=nx1_p(part), nx2=nx2_p(part), ny1=ny1, ny2=ny2, nz1=nz1, nz2=nz2)
error = a_vtk_file%xml_writer%write_geo(n=nn_p(part), x=x(nx1_p(part):nx2_p(part),:,:), &
y=y(nx1_p(part):nx2_p(part),:,:), &
z=z(nx1_p(part):nx2_p(part),:,:))
error = a_vtk_file%xml_writer%write_dataarray(location='node', action='open')
error = a_vtk_file%xml_writer%write_dataarray(data_name='int32_scalar', x=v(nx1_p(part):nx2_p(part),:,:), &
one_component=.true.)
error = a_vtk_file%xml_writer%write_dataarray(location='node', action='close')
error = a_vtk_file%xml_writer%write_piece()
error = a_vtk_file%finalize()
endsubroutine write_vts