2022-02-06 23:45:08 +01:00
|
|
|
!
|
|
|
|
! fonctions de base de gestion des bloubs
|
|
|
|
!
|
|
|
|
|
|
|
|
module bloubspace
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
! ----------------------------------------------------------------
|
|
|
|
|
|
|
|
type t_bloubs
|
|
|
|
character(8) :: nick
|
|
|
|
logical :: alive
|
|
|
|
integer :: num
|
|
|
|
real :: px, py, pz
|
|
|
|
real :: vx, vy, vz
|
|
|
|
real :: radius
|
|
|
|
integer :: seq
|
|
|
|
end type t_bloubs
|
|
|
|
|
|
|
|
contains ! -----------------------------------------
|
|
|
|
|
|
|
|
subroutine random_pv (blb)
|
|
|
|
|
|
|
|
type(t_bloubs), intent (inout) :: blb
|
|
|
|
|
|
|
|
blb%px = rand() - 0.50
|
|
|
|
blb%py = rand() * 0.25
|
|
|
|
blb%pz = rand() - 0.50
|
|
|
|
|
2022-02-07 02:08:17 +01:00
|
|
|
blb%vx = (rand() - 0.5) / 4.000
|
|
|
|
blb%vy = (rand() - 0.5) / 4.000
|
|
|
|
blb%vz = (rand() - 0.5) / 4.000
|
2022-02-06 23:45:08 +01:00
|
|
|
|
|
|
|
end subroutine
|
|
|
|
|
|
|
|
! ----------------------------------------------------------------
|
|
|
|
|
|
|
|
subroutine move_bloub (blb, coef)
|
|
|
|
type(t_bloubs), intent (inout) :: blb
|
|
|
|
real, intent (in) :: coef
|
2022-02-07 02:08:17 +01:00
|
|
|
|
|
|
|
! we must check that this bloub is alive ?
|
|
|
|
|
2022-02-06 23:45:08 +01:00
|
|
|
blb%px = blb%px + (blb%vx * coef)
|
|
|
|
blb%py = blb%py + (blb%vy * coef)
|
|
|
|
blb%pz = blb%pz + (blb%vz * coef)
|
|
|
|
blb%seq = blb%seq + 1
|
|
|
|
|
|
|
|
end subroutine
|
|
|
|
! ----------------------------------------------------------------
|
|
|
|
|
|
|
|
end module
|
|
|
|
|
|
|
|
|
|
|
|
|