write_vts Subroutine

subroutine write_vts(part, filename)

Arguments

TypeIntentOptionalAttributesName
integer(kind=I4P), intent(in) :: part
character, intent(in) :: filename

Called by

proc~~write_vts~~CalledByGraph proc~write_vts write_vts program~vtk_fortran_write_pvts vtk_fortran_write_pvts program~vtk_fortran_write_pvts->proc~write_vts

Contents

Source Code


Source Code

   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