2022-03-08 20:36:32 +11:00
|
|
|
module points3d
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
!-----------------------------------------------------
|
|
|
|
type t_point3d
|
|
|
|
double precision :: x, y, z
|
|
|
|
integer :: seq
|
|
|
|
end type t_point3d
|
|
|
|
|
|
|
|
!-----------------------------------------------------
|
|
|
|
contains
|
|
|
|
|
|
|
|
|
|
|
|
subroutine list_points3d(array, start, length)
|
|
|
|
type(t_point3d), dimension(:), intent(in) :: array
|
|
|
|
integer, intent(in) :: start, length
|
|
|
|
integer :: sz, i
|
|
|
|
|
|
|
|
sz = ubound(array, 1)
|
|
|
|
if ((start+length) .GT. sz) then
|
|
|
|
STOP ' : OUT OF BOUND'
|
|
|
|
endif
|
|
|
|
|
|
|
|
! send oi to stdout.
|
2022-03-19 12:45:54 +11:00
|
|
|
do i = start, start+length-1
|
2022-03-08 20:36:32 +11:00
|
|
|
print *, array(i)%x, array(i)%y, array(i)%z, array(i)%seq
|
|
|
|
enddo
|
|
|
|
|
|
|
|
end subroutine list_points3d
|
|
|
|
|
|
|
|
!-----------------------------------------------------
|
|
|
|
|
|
|
|
end module points3d
|