Fortraneries/BloubWorld/genbloubs.f90

43 lines
902 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
write (0, '(A,I6,A)') &
"*** generating ", nbbloubs, " bloubs to "//trim(filename)
! print *, "generating ", nbbloubs, "bloubs to ", filename
2022-02-08 13:25:56 +01:00
open(newunit=idu, file=trim(filename), form='unformatted', &
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-06 23:45:08 +01:00
bloub%nick = 'noname '
bloub%alive = .TRUE.
call random_pv(bloub)
2022-02-08 13:25:56 +01:00
bloub%radius = 0.030
2022-02-06 23:45:08 +01:00
bloub%seq = 0
write(idu) bloub ! no error control ?
end do
close(unit=idu)
end program