创建备份
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(particle_type), | intent(in) | :: | particle |
particle |
||
type(backup_type), | intent(out) | :: | backup |
backup |
||
integer, | intent(in) | :: | istart |
start and end index |
||
integer, | intent(in) | :: | iend |
start and end index |
pure subroutine create_backup(particle, backup, istart, iend)
class(particle_type), intent(in) :: particle !! particle
type(backup_type), intent(out) :: backup !! backup
integer, intent(in) :: istart, iend !! start and end index
allocate(backup%loc, source=particle%loc(:, istart:iend))
allocate(backup%vel, source=particle%vel(:, istart:iend))
allocate(backup%rho, source=particle%rho(istart:iend))
allocate(backup%p, source=particle%p(istart:iend))
end subroutine create_backup