saturday night fever is now commited

This commit is contained in:
tTh
2022-12-03 20:42:29 +01:00
parent 3c3d1c8906
commit 4853779493
11 changed files with 134 additions and 33 deletions

View File

@@ -13,8 +13,8 @@ module realfield
!-
type massbody
real :: posx, posy
real :: heading = 33.21
real :: speed = 1.007
real :: heading = 0.21
real :: speed = 1.017
real :: mass = 1.0
integer :: serial = 666
end type
@@ -39,7 +39,7 @@ subroutine barycentre_bodies(astres)
enddo
cx = cx / real(ubound(astres, 1))
cy = cy / real(ubound(astres, 1))
print *, cx, cy
print *, 'barycentre:', cx, cy
end subroutine
!-----------------------------------------------------------------------
@@ -57,16 +57,21 @@ subroutine create_some_planets(planets, coef, sx, sy)
fmt = "(I4, ' | ', 2(F10.2, ' '), ' | ', 2F9.3, ' ', e12.3, I7)"
do foo=1, ubound(planets, 1)
!-
! the first planet is the home of Johnny Root
!-
if (foo .EQ. 1) then
planets(1)%posx = 10
planets(1)%posy = 10
planets(1)%mass = 7e8
planets(1)%posx = sx / 2
planets(1)%posy = sy / 2
planets(1)%mass = 37e8
planets(1)%serial = 1337
else
planets(foo)%posx = rand() * real(sx-1)
planets(foo)%posy = rand() * real(sy-1)
planets(foo)%mass = 7e6 + coef*foo
planets(foo)%serial = foo
planets(foo)%heading = 3.14159 * rand()
if (rand() .LT. 0.01) planets(foo)%speed = 2.718
planets(foo)%serial = foo*2 + 120
endif
write (*, fmt) foo, planets(foo)
enddo