bloubworld: tweaking merge function
This commit is contained in:
parent
f9a93bf6f4
commit
5153e8437c
@ -73,9 +73,17 @@ contains
|
|||||||
type(t_bloubs), intent(in) :: bla, blb
|
type(t_bloubs), intent(in) :: bla, blb
|
||||||
type(t_bloubs), intent(out) :: blr
|
type(t_bloubs), intent(out) :: blr
|
||||||
|
|
||||||
|
real :: va, vbb
|
||||||
|
!-
|
||||||
|
! XXX please insert here a static counter for the 'num' id
|
||||||
|
!-
|
||||||
|
|
||||||
blr%nick = "merged "
|
blr%nick = "merged "
|
||||||
blr%num = 0 ! ???
|
blr%num = 0 ! ???
|
||||||
|
|
||||||
|
va = bla%radius * bla%radius * bla%radius
|
||||||
|
vb = blb%radius * blb%radius * blb%radius
|
||||||
|
|
||||||
blr%px = (bla%px + blb%px) / 2.0
|
blr%px = (bla%px + blb%px) / 2.0
|
||||||
blr%py = (bla%py + blb%py) / 2.0
|
blr%py = (bla%py + blb%py) / 2.0
|
||||||
blr%pz = (bla%pz + blb%pz) / 2.0
|
blr%pz = (bla%pz + blb%pz) / 2.0
|
||||||
@ -84,8 +92,8 @@ contains
|
|||||||
blr%vy = (bla%vy + blb%vy) / 2.0
|
blr%vy = (bla%vy + blb%vy) / 2.0
|
||||||
blr%vz = (bla%vz + blb%vz) / 2.0
|
blr%vz = (bla%vz + blb%vz) / 2.0
|
||||||
|
|
||||||
blr%radius = (bla%radius + blb%radius)
|
blr%radius = (va + vb) ** 0.33333333333
|
||||||
blr%age = max(bla%age, blb%age)
|
blr%age = min(bla%age, blb%age)
|
||||||
|
|
||||||
! bring it to life !
|
! bring it to life !
|
||||||
blr%alive = .TRUE.
|
blr%alive = .TRUE.
|
||||||
|
Loading…
Reference in New Issue
Block a user