写入
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(pif_h5part_type), | intent(inout) | :: | self | |||
| real(kind=rk), | intent(in) | :: | t |
subroutine write (self, t)
class(pif_h5part_type), intent(inout) :: self
real(rk), intent(in) :: t
integer(8) :: istat
pif_obj%ptc%acc(:, pif_obj%nreal + 1:) = 0.0_rk ! 边界粒子加速度清零输出, TOCHECK: 是否需要为浮体粒子加速度清零
self%istep = self%istep + 1_8
istat = h5pt_setstep(self%fid, self%istep)
istat = h5pt_writestepattrib(self%fid, "RealTime", [t], 1_8)
istat = h5pt_writedata(self%fid, "X", self%ptc%loc(1, :))
istat = h5pt_writedata(self%fid, "Y", self%ptc%loc(2, :))
istat = h5pt_writedata(self%fid, "Z", self%z)
istat = h5pt_writedata(self%fid, "Vx", self%ptc%vel(1, :))
istat = h5pt_writedata(self%fid, "Vy", self%ptc%vel(2, :))
istat = h5pt_writedata(self%fid, "Fx", self%ptc%acc(1, :))
istat = h5pt_writedata(self%fid, "Fy", self%ptc%acc(2, :))
istat = h5pt_writedata(self%fid, "Rho", self%ptc%rho)
istat = h5pt_writedata(self%fid, "P", self%ptc%p)
istat = h5pt_writedata(self%fid, "Mass", self%ptc%mass)
istat = h5pt_writedata(self%fid, "Itype", self%ptc%itype)
write (self%fid_stat, "(*(ES10.3,:,','))") t, stat%loc_min, stat%loc_max
if (pif_obj%numbers(5) /= 0) then
write (self%fid_float, "(*(ES10.3,:,','))") t, float_obj(1)%loc, &
float_obj(1)%acc, float_obj(1)%ang_acc
end if
end subroutine write