Fortraneries/BloubWorld/genbloubs.f90

45 lines
1000 B
Fortran
Raw Normal View History

2022-02-07 09:45:08 +11:00
program genbloubs
use bloubspace
2024-01-07 15:58:05 +11:00
use mathstuff2
2022-02-07 09:45:08 +11:00
integer :: nbbloubs
integer :: i
character(200) :: filename
character(30) :: str
type(t_bloubs) :: bloub
2022-02-08 23:25:56 +11:00
integer :: idu
2022-02-07 09:45:08 +11: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 22:21:40 +11:00
write (0, '(A,I8,A)') &
2022-02-07 09:45:08 +11:00
"*** generating ", nbbloubs, " bloubs to "//trim(filename)
2022-03-23 02:21:36 +11:00
call init_random_seed()
2022-03-18 22:21:40 +11:00
open(newunit=idu, file=trim(filename), &
form='unformatted', &
access="sequential", &
2022-02-07 09:45:08 +11:00
action='write', status='replace')
do i = 1, nbbloubs
2022-02-08 23:25:56 +11:00
2022-02-17 01:59:42 +11:00
bloub%nick = 'noname '
bloub%num = i + 41
2024-02-07 03:03:00 +11:00
call make_a_random_bloub(bloub, 11.80)
bloub%radius = 0.010 + (0.12*rand())
2022-02-07 09:45:08 +11:00
write(idu) bloub ! no error control ?
end do
close(unit=idu)
end program