more enginiering

This commit is contained in:
tth
2022-04-05 05:46:51 +02:00
parent 15cb51c6bc
commit 0d79c3d7c7
5 changed files with 81 additions and 24 deletions

View File

@@ -10,7 +10,7 @@ program voxelize
integer, parameter :: DIM = 100
integer, dimension(:,:,:), allocatable :: cube
type(t_point3d), dimension(:), allocatable :: points
integer :: errcode, foo, maxi
integer :: errcode, foo
integer :: ix, iy, iz
double precision, dimension(4) :: coefs
double precision :: dval
@@ -23,14 +23,14 @@ program voxelize
STOP " : NO ENOUGH MEMORY FOR CUBE"
endif
nbr_points = 3500000
nbr_points = 3100000
allocate(points(nbr_points), stat=errcode)
if (0 .NE. errcode) then
STOP " : NO ENOUGH MEMORY FOR POINTS"
endif
coefs(1) = 2.24 ; coefs(2) = 0.43
coefs(3) = -0.65 ; coefs(4) = -2.43
coefs(1) = 2.23 ; coefs(2) = 0.42
coefs(3) = -0.64 ; coefs(4) = -2.42
call compute_pickover(points, coefs)
call clear_cube(cube)
@@ -46,7 +46,6 @@ program voxelize
enddo
dval = DBLE(MAXVAL(cube))
write(0, *) "--- cube maximum = ", dval
do foo=1, nbr_points
@@ -78,7 +77,6 @@ subroutine fcoor2icoor(in, out)
end subroutine
!-----------------------------------------------------
subroutine clear_cube(cube)
type(integer), dimension(:,:,:), intent(out) :: cube
@@ -92,6 +90,24 @@ subroutine clear_cube(cube)
enddo
enddo
end subroutine
!-----------------------------------------------------
subroutine spit_cube_as_union(fname, datas, notused)
character(*) :: fname
type(integer), dimension(:,:,:), intent(in) :: datas
integer :: notused
integer :: fd, errcode, foo
open (newunit=fd, file='WS/k-pick.txt', &
status='unknown', position='append', &
action='write', iostat=errcode)
if (0 .NE. errcode) then
STOP ' : SPITUNION : FAIL OPEN OUTPUT FILE'
endif
close(fd)
end subroutine
!-----------------------------------------------------
end program voxelize