From 5153e8437c5e3805c4fe11a8005d40c6731da7ff Mon Sep 17 00:00:00 2001 From: tTh Date: Mon, 29 Jan 2024 14:10:18 +0100 Subject: [PATCH] bloubworld: tweaking merge function --- BloubWorld/mergebloubs.f90 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/BloubWorld/mergebloubs.f90 b/BloubWorld/mergebloubs.f90 index 4a63fa7..c230695 100644 --- a/BloubWorld/mergebloubs.f90 +++ b/BloubWorld/mergebloubs.f90 @@ -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.