Fortraneries/BloubWorld/genbloubs.f90

45 lines
999 B
Fortran
Raw Normal View History

2022-02-06 23:45:08 +01:00
program genbloubs
use bloubspace
2024-01-07 05:58:05 +01:00
use mathstuff2
2022-02-06 23:45:08 +01:00
integer :: nbbloubs
integer :: i
character(200) :: filename
character(30) :: str
type(t_bloubs) :: bloub
2022-02-08 13:25:56 +01:00
integer :: idu
2022-02-06 23:45:08 +01:00
i = IARGC()
if (i .ne. 2) then
STOP ": BAD ARGS ON COMMAND LINE"
endif
call getarg(1, filename)
call getarg(2, str)
read(str,*) nbbloubs
2022-03-18 12:21:40 +01:00
write (0, '(A,I8,A)') &
2022-02-06 23:45:08 +01:00
"*** generating ", nbbloubs, " bloubs to "//trim(filename)
2022-03-22 16:21:36 +01:00
call init_random_seed()
2022-03-18 12:21:40 +01:00
open(newunit=idu, file=trim(filename), &
form='unformatted', &
access="sequential", &
2022-02-06 23:45:08 +01:00
action='write', status='replace')
do i = 1, nbbloubs
2022-02-08 13:25:56 +01:00
2022-02-16 15:59:42 +01:00
bloub%nick = 'noname '
bloub%num = i + 41
call make_a_random_bloub(bloub, 8.25)
bloub%radius = 0.015 + (0.08*rand())
2022-02-06 23:45:08 +01:00
write(idu) bloub ! no error control ?
end do
close(unit=idu)
end program