add some garbage

This commit is contained in:
tTh
2024-02-06 17:03:00 +01:00
parent ca899f5e90
commit ab23dc9897
14 changed files with 127 additions and 51 deletions

View File

@@ -5,6 +5,7 @@ program mergebloubs
!-------------------------------------------!
use bloubspace
use mathstuff2
implicit none
integer, parameter :: NB_MAX_BLOUBS = 250000
@@ -24,9 +25,11 @@ program mergebloubs
call getarg(1, infile)
call getarg(2, outfile)
write(0, '(A, 2A15, I8)') "### mergebloubs ", &
write(0, '(A, A, 1X, A, 1X, I6)') "### mergebloubs ", &
trim(infile), trim(outfile), NB_MAX_BLOUBS
call init_random_seed()
allocate (bloubs(NB_MAX_BLOUBS), stat=errcode)
if (0 .NE. errcode) then
STOP " : NO ENOUGH MEMORY"
@@ -52,6 +55,8 @@ program mergebloubs
write(0, *) " *** merged ", ia, " and ", ib, &
" new r = ", merged%radius
! call display_bloub (bloubs(ia), "juste merged")
endif
enddo
@@ -70,6 +75,7 @@ program mergebloubs
contains
subroutine merge_two_bloubs(bla, blb, blr)
implicit none
type(t_bloubs), intent(in) :: bla, blb
type(t_bloubs), intent(out) :: blr
@@ -91,8 +97,13 @@ contains
blr%vx = (bla%vx + blb%vx) / 2.0
blr%vy = (bla%vy + blb%vy) / 2.0
blr%vz = (bla%vz + blb%vz) / 2.0
if (0.001 .GT. rand()) then
blr%vx = blr%vx * 1.04
blr%vy = blr%vy * 1.04
blr%vz = blr%vz * 1.04
endif
blr%radius = (va + vb) ** 0.33333333333
blr%radius = (va + vb) ** 0.33335
blr%age = min(bla%age, blb%age)
! bring it to life !