Fortraneries/BloubWorld/genbloubs.f90

44 lines
966 B
Fortran
Raw Normal View History

2022-02-06 23:45:08 +01:00
program genbloubs
use bloubspace
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
2022-02-06 23:45:08 +01:00
call random_pv(bloub)
2022-03-18 12:21:40 +01:00
bloub%radius = 0.035 + (0.03*rand())
2022-02-06 23:45:08 +01:00
write(idu) bloub ! no error control ?
end do
close(unit=idu)
end program