49#include "implicit_f.inc"
58 integer,
intent(inout) :: nb_cell_x
59 integer,
intent(inout) :: nb_cell_y
60 integer,
intent(inout) :: nb_cell_z
61 my_real,
dimension(6),
intent(inout) :: box_limit
65 INTEGER :: LEADING_DIMENSION
67 my_real :: ratio,size_cell,dist_max
76 dx_box = abs(box_limit(1) - box_limit(4))
77 dy_box = abs(box_limit(2) - box_limit(5))
78 dz_box = abs(box_limit(3) - box_limit(6))
80 dist_max =
max(dx_box,dy_box,dz_box)
81 IF(dist_max==dx_box) leading_dimension = 1
82 IF(dist_max==dy_box) leading_dimension = 2
83 IF(dist_max==dz_box) leading_dimension = 3
87 ratio = sqrt( numnodg / (dx_box*dy_box+dx_box
88 IF(leading_dimension==1)
THEN
89 nb_cell_x = nint( ratio * dx_box )
91 nb_cell_x = nb_cell_x - modulo(nb_cell_x,4)
95 size_cell = dx_box / nb_cell_x
97 nb_cell_y = nint( dy_box / size_cell )
99 nb_cell_y = nb_cell_y - modulo(nb_cell_y,4)
103 nb_cell_z = nint( dz_box / size_cell )
105 nb_cell_z = nb_cell_z - modulo(nb_cell_z,4)
108 ELSEIF(leading_dimension==2)
THEN
109 nb_cell_y = nint( ratio * dy_box )
111 nb_cell_y = nb_cell_y - modulo(nb_cell_y,4)
115 size_cell = dy_box / nb_cell_y
117 nb_cell_x = nint( dx_box / size_cell )
119 nb_cell_x = nb_cell_x - modulo(nb_cell_x,4)
123 nb_cell_z = nint( dz_box / size_cell )
125 nb_cell_z = nb_cell_z - modulo(nb_cell_z,4)
128 ELSEIF(leading_dimension==3)
THEN
129 nb_cell_z = nint( ratio * dz_box )
131 nb_cell_z = nb_cell_z - modulo(nb_cell_z,4)
135 size_cell = dz_box / nb_cell_z
137 nb_cell_y = nint( dy_box / size_cell )
139 nb_cell_y = nb_cell_y - modulo(nb_cell_y,4)
143 nb_cell_x = nint( dx_box / size_cell )
145 nb_cell_x = nb_cell_x - modulo(nb_cell_x,4)