fine tuning

This commit is contained in:
tTh 2022-12-11 09:25:23 +01:00
parent 0abf66fad5
commit 7a6e5f1e27

View File

@ -12,13 +12,13 @@ program animation
! some configuration constants ! some configuration constants
integer, parameter :: S_WIDTH = 1024 integer, parameter :: S_WIDTH = 1024
integer, parameter :: S_HEIGHT = 1024 integer, parameter :: S_HEIGHT = 1024
integer, parameter :: NB_BODY = 82 integer, parameter :: NB_BODY = 70
!!! WARNING : global variables !!! !!! WARNING : global variable !!!
type(massbody) :: planets(NB_BODY) type(massbody) :: planets(NB_BODY)
call init_random() call init_random()
call create_some_planets(planets, 1337e3, S_WIDTH , S_HEIGHT) call create_some_planets(planets, 1664e3, S_WIDTH , S_HEIGHT)
call print_barycentre_bodies(planets) call print_barycentre_bodies(planets)
! STOP 'BEFORE CRASH' ! STOP 'BEFORE CRASH'
@ -47,6 +47,10 @@ subroutine la_grande_boucle(start, nbre, moons)
write (filename, "(a, i5.5, a)") 'WS/nanim/', pass, '.pgm' write (filename, "(a, i5.5, a)") 'WS/nanim/', pass, '.pgm'
write(0, '(3I5, " * ", a20)') start, nbre, pass, filename write(0, '(3I5, " * ", a20)') start, nbre, pass, filename
call build_and_write_a_field(S_WIDTH, S_HEIGHT, moons, filename) call build_and_write_a_field(S_WIDTH, S_HEIGHT, moons, filename)
write (filename, "(a, i5.5, a)") 'WS/data/', pass, '.txt'
call save_bodies_to_txt_file (planets, filename)
enddo enddo
call print_barycentre_bodies(moons) call print_barycentre_bodies(moons)
@ -96,7 +100,7 @@ subroutine deplace_les_planetes(moons, clipit)
if (moons(foo)%posy .LT. EE) moons(foo)%posy = SH if (moons(foo)%posy .LT. EE) moons(foo)%posy = SH
endif endif
moons(foo)%heading = moons(foo)%heading + (0.25*(rand()-0.499999)) moons(foo)%heading = moons(foo)%heading + (0.71*(rand()-0.50))
if (moons(foo)%heading .GT. 6.2831853) moons(foo)%heading = 0.0 if (moons(foo)%heading .GT. 6.2831853) moons(foo)%heading = 0.0
if (moons(foo)%heading .LT. 0.0000001) moons(foo)%heading = 0.0 if (moons(foo)%heading .LT. 0.0000001) moons(foo)%heading = 0.0