bloubworld: tweaking merge function

This commit is contained in:
tTh 2024-01-29 14:10:18 +01:00
parent f9a93bf6f4
commit 5153e8437c
1 changed files with 10 additions and 2 deletions

View File

@ -73,9 +73,17 @@ contains
type(t_bloubs), intent(in) :: bla, blb
type(t_bloubs), intent(out) :: blr
real :: va, vbb
!-
! XXX please insert here a static counter for the 'num' id
!-
blr%nick = "merged "
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%py = (bla%py + blb%py) / 2.0
blr%pz = (bla%pz + blb%pz) / 2.0
@ -84,8 +92,8 @@ contains
blr%vy = (bla%vy + blb%vy) / 2.0
blr%vz = (bla%vz + blb%vz) / 2.0
blr%radius = (bla%radius + blb%radius)
blr%age = max(bla%age, blb%age)
blr%radius = (va + vb) ** 0.33333333333
blr%age = min(bla%age, blb%age)
! bring it to life !
blr%alive = .TRUE.