Skip to content

Commit b989fa4

Browse files
committed
Update visu to detect the time step for the first snapshot
1 parent 77ae9fb commit b989fa4

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/visu.f90

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ module visu
2424
integer, save :: output2D
2525
integer, save :: ioxdmf
2626
integer, save :: ioxml
27+
! Used for vtk.xml to detect the first snapshot
28+
integer, save :: itime_first_snapshot
2729
character(len=9) :: ifilenameformat = '(I3.3)'
2830
real, save :: tstart, tend
2931

@@ -89,6 +91,7 @@ subroutine visu_init()
8991
endif
9092

9193
! Use vtk.xml instead of xdmf when ADIOS2 is available
94+
itime_first_snapshot = ilast
9295
#ifdef ADIOS2
9396
use_xdmf = .false.
9497
use_vtkxml = .true.
@@ -628,9 +631,11 @@ subroutine write_field(f1, pathname, filename, num, skip_ibm, flush)
628631
endif
629632
endif
630633

634+
! Add the field to vtk.xml if first snapshot
631635
if (use_vtkxml) then
632-
if (nrank.eq.0 .and. num.eq.0) then
636+
if (nrank.eq.0 .and. itime.le.itime_first_snapshot) then
633637
write (ioxml, *) ' <DataArray Name="'//filename//'" />'
638+
itime_first_snapshot = itime
634639
end if
635640
end if
636641

0 commit comments

Comments
 (0)