From f9a93bf6f4da931699eb7bfeae97fa9508b4f5fc Mon Sep 17 00:00:00 2001 From: tTh Date: Mon, 29 Jan 2024 10:54:45 +0100 Subject: [PATCH] bloubworld: cleaning --- BloubWorld/bloubspace.f90 | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/BloubWorld/bloubspace.f90 b/BloubWorld/bloubspace.f90 index 0e39606..2616e80 100644 --- a/BloubWorld/bloubspace.f90 +++ b/BloubWorld/bloubspace.f90 @@ -107,8 +107,8 @@ module bloubspace integer :: errcode, output, foo, spitted character(200) :: chaine - write (0, '(" spitting", (I6), " bloubs to ", (A), " file")') & - towrite, trim(fname) + ! write (0, '(" spitting", (I6), " bloubs to ", (A), " file")') & + ! towrite, trim(fname) open( newunit=output, & file=trim(fname), form='unformatted', & @@ -131,7 +131,8 @@ module bloubspace enddo close(output) - write(0, '(1X, "spitted ", I0, " bloubs.")') spitted + write(0, '(1X, "spitted ", I0, " bloubs to .", A)') & + spitted, trim(fname) end subroutine spit_bloubs_to_file ! ---------------------------------------------------------------- @@ -233,40 +234,47 @@ module bloubspace real, parameter :: SH = 6.0 real, parameter :: SV = 4.0 + logical :: flag + + flag = .FALSE. + ! X axis if ((blb%px + blb%radius) .GT. SH) then blb%vx = -1.0 * blb%vx blb%px = SH - blb%radius - blb%age = blb%age + 1 endif if ((blb%px - blb%radius) .LT. -SH) then blb%vx = -1.0 * blb%vx blb%px = -SH + blb%radius - blb%age = blb%age + 1 + flag = .TRUE. endif ! vertical axe Y if ((blb%py - blb%radius) .LT. -SV) then blb%vy = -1.0 * blb%vy blb%py = -SV + blb%radius - blb%age = blb%age + 1 + flag = .TRUE. endif if ((blb%py + blb%radius) .GT. SV) then ! overshoot ? blb%vy = -1.0 * blb%vy - blb%age = blb%age + 1 blb%py = SV - blb%radius + flag = .TRUE. endif ! Z axis if ((blb%pz + blb%radius) .GT. SH) then blb%vz = -1.0 * blb%vz - blb%age = blb%age + 1 blb%pz = SH - blb%radius + flag = .TRUE. endif if ((blb%pz + blb%radius) .LT. -SH) then blb%vz = -1.0 * blb%vz - blb%age = blb%age + 1 blb%pz = -SH + blb%radius + flag = .TRUE. + endif + + if (flag) then + blb%age = blb%age + 1 endif end subroutine