using "newunit"

This commit is contained in:
tth 2022-02-08 13:25:56 +01:00
parent c8d490b8be
commit 6094e29efd
1 changed files with 4 additions and 4 deletions

View File

@ -7,8 +7,7 @@ program genbloubs
character(200) :: filename
character(30) :: str
type(t_bloubs) :: bloub
integer, parameter :: idu = 33
integer :: idu
i = IARGC()
if (i .ne. 2) then
@ -24,14 +23,15 @@ program genbloubs
! print *, "generating ", nbbloubs, "bloubs to ", filename
open(unit=idu, file=trim(filename), form='unformatted', &
open(newunit=idu, file=trim(filename), form='unformatted', &
action='write', status='replace')
do i = 1, nbbloubs
bloub%nick = 'noname '
bloub%alive = .TRUE.
call random_pv(bloub)
bloub%radius = 0.028
bloub%radius = 0.030
bloub%seq = 0
write(idu) bloub ! no error control ?