nasty bug added
This commit is contained in:
@@ -9,6 +9,7 @@ program movebloubs
|
||||
integer :: inu, outu, errcode, i
|
||||
type(t_bloubs) :: bloub
|
||||
double precision :: bx, by, bz
|
||||
logical :: add_new_bloub = .FALSE.
|
||||
|
||||
i = IARGC()
|
||||
if (i .ne. 2) then
|
||||
@@ -33,7 +34,7 @@ program movebloubs
|
||||
iostat=errcode, &
|
||||
action='write', status='replace')
|
||||
if (0 .ne. errcode) then
|
||||
STOP " : CAN'T WRITE TO " // trim(outfile)
|
||||
STOP " : CAN'T OPEN " // trim(outfile) // "FOR WRITE"
|
||||
endif
|
||||
|
||||
bx = 0.0; by = 0.0; bz = 0.0
|
||||
@@ -44,28 +45,39 @@ program movebloubs
|
||||
exit
|
||||
endif
|
||||
|
||||
call move_bloub (bloub, 1.10)
|
||||
! moving and boundingboxing
|
||||
call move_bloub (bloub, 0.11)
|
||||
call bound_a_blob(bloub)
|
||||
|
||||
! calcul du barycentre
|
||||
bx = bx + bloub%px
|
||||
by = by + bloub%py
|
||||
bz = bz + bloub%pz
|
||||
|
||||
! boundingbox action
|
||||
if (0.0 .gt. bloub%py) then
|
||||
bloub%vy = -1.0 * bloub%vy
|
||||
bloub%py = 0.0
|
||||
write(outu, iostat=errcode) bloub ! no error control ?
|
||||
if (0 .ne. errcode) then
|
||||
STOP " : WRITE ERROR TO " // trim(outfile)
|
||||
endif
|
||||
if (3.0 .lt. bloub%py) then
|
||||
bloub%vy = -1.0 * bloub%vy
|
||||
bloub%py = 3.0
|
||||
endif
|
||||
|
||||
write(outu) bloub ! no error control ?
|
||||
|
||||
|
||||
enddo
|
||||
|
||||
if (add_new_bloub) then
|
||||
! and now, we inject a new bloub in the universe
|
||||
bloub%nick = 'newbie '
|
||||
bloub%alive = .TRUE.
|
||||
call random_pv(bloub)
|
||||
bloub%radius = 0.042
|
||||
bloub%seq = 0
|
||||
!
|
||||
! where is the bug ?
|
||||
!
|
||||
call display_bloub (bloub, "new bloub")
|
||||
write(outu) bloub ! no error control ?
|
||||
endif
|
||||
|
||||
! ther was some strange bias in this data
|
||||
! may be a random not symetric around 0.0 ?
|
||||
write (0, '(A,3(F11.3,3X))') "barycentre : ", bx, by, bz
|
||||
|
||||
close(inu) ; close(outu)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user