Fortraneries/BloubWorld/exportbloubs.f90

47 lines
1.1 KiB
Fortran
Raw Normal View History

2022-12-04 17:49:49 +01:00
program exportbloubs
2022-02-06 23:45:08 +01:00
use bloubspace
implicit none
character(200) :: filename
integer, parameter :: idu = 33
integer :: i, compte, errcode
type(t_bloubs) :: bloub
! parsing command line
i = IARGC()
if (1 .ne. i) then
2022-12-04 17:49:49 +01:00
STOP ' : BAD COMMAND LINE'
2022-02-06 23:45:08 +01:00
endif
call getarg(1, filename)
2022-03-25 07:53:14 +01:00
write (0, '(A, A)') "### exporting from ", trim(filename)
2022-02-06 23:45:08 +01:00
open(unit=idu, file=trim(filename), form='unformatted', &
iostat=errcode, &
action='read', status='old')
if (0 .ne. errcode) then
! print *, 'errcode ', errcode
STOP " : CAN'T OPEN FILE " // trim(filename)
endif
compte=0
do
read (unit=idu, iostat=errcode) bloub
if (0 .ne. errcode) then
exit
endif
2022-03-25 07:53:14 +01:00
if (bloub%alive) then
print *, bloub%px, bloub%py, bloub%pz, bloub%radius, &
bloub%age, bloub%state
compte = compte + 1
endif
2022-02-06 23:45:08 +01:00
enddo
2024-01-25 21:44:49 +01:00
write(0, '(1X, I0, A)') compte, " bloubs exported"
2022-02-08 02:53:49 +01:00
2022-02-06 23:45:08 +01:00
close(idu)
end program