3 #include "sll_assert.h"
4 #include "sll_memory.h"
5 #include "sll_working_precision.h"
14 use sll_m_remapper,
only: &
15 sll_o_get_layout_collective, &
16 sll_o_get_layout_i_max, &
17 sll_o_get_layout_i_min, &
18 sll_o_get_layout_j_max, &
19 sll_o_get_layout_j_min, &
20 sll_o_get_layout_k_max, &
21 sll_o_get_layout_k_min, &
22 sll_o_get_layout_l_max, &
23 sll_o_get_layout_l_min, &
62 sll_real64 :: v_thermal
63 type(sll_t_layout_4d),
pointer :: data_layout
72 sll_int32 :: num_cells1
73 sll_int32 :: num_cells2
74 sll_int32 :: num_cells3
75 sll_int32 :: num_cells4
84 sll_real64 :: delta_x1
85 sll_real64 :: delta_x2
86 sll_real64 :: delta_x3
87 sll_real64 :: delta_x4
107 sll_int32,
intent(in) :: num_cells1
108 sll_int32,
intent(in) :: num_cells2
109 sll_int32,
intent(in) :: num_cells3
110 sll_int32,
intent(in) :: num_cells4
111 sll_real64,
intent(in) :: x1_min
112 sll_real64,
intent(in) :: x1_max
113 sll_real64,
intent(in) :: x2_min
114 sll_real64,
intent(in) :: x2_max
115 sll_real64,
intent(in) :: x3_min
116 sll_real64,
intent(in) :: x3_max
117 sll_real64,
intent(in) :: x4_min
118 sll_real64,
intent(in) :: x4_max
143 sll_deallocate(mesh, ierr)
154 sll_int32 :: data_position
155 sll_real64,
intent(in) :: v_thermal
156 type(sll_t_layout_4d),
pointer :: layout
159 if (.not.
associated(layout))
then
160 print *,
'initialize_test_4d(): ERROR, passed layout is not initialized'
164 if (.not.
associated(mesh_4d))
then
165 print *,
'initialize_test_4d(): ERROR, passed 4d mesh is not initialized'
169 init_obj%data_position = data_position
170 init_obj%mesh_4d => mesh_4d
171 init_obj%v_thermal = v_thermal
172 init_obj%data_layout => layout
177 sll_real64,
dimension(:, :, :, :),
intent(out) :: data_out
178 type(sll_t_layout_4d),
pointer :: layout
192 sll_int32 :: num_pts1
193 sll_int32 :: num_pts2
194 sll_int32 :: num_pts3
195 sll_int32 :: num_pts4
196 sll_int32,
dimension(1:4) :: gi
205 sll_real64 :: v_thermal
211 sll_real64 :: factor, factor2
216 layout => init_obj%data_layout
217 col => sll_o_get_layout_collective(layout)
219 i_min = sll_o_get_layout_i_min(layout, myrank)
220 i_max = sll_o_get_layout_i_max(layout, myrank)
221 j_min = sll_o_get_layout_j_min(layout, myrank)
222 j_max = sll_o_get_layout_j_max(layout, myrank)
223 k_min = sll_o_get_layout_k_min(layout, myrank)
224 k_max = sll_o_get_layout_k_max(layout, myrank)
225 l_min = sll_o_get_layout_l_min(layout, myrank)
226 l_max = sll_o_get_layout_l_max(layout, myrank)
227 num_pts1 = i_max - i_min + 1
228 num_pts2 = j_max - j_min + 1
229 num_pts3 = k_max - k_min + 1
230 num_pts4 = l_max - l_min + 1
231 delta1 = init_obj%mesh_4d%delta_x1
232 delta2 = init_obj%mesh_4d%delta_x2
233 delta3 = init_obj%mesh_4d%delta_x3
234 delta4 = init_obj%mesh_4d%delta_x4
236 vx_min = init_obj%mesh_4d%x3_min
237 vx_max = init_obj%mesh_4d%x3_max
238 vy_min = init_obj%mesh_4d%x4_min
239 vy_max = init_obj%mesh_4d%x4_max
240 v_thermal = init_obj%v_thermal
241 factor =
sll_p_pi/(8.0_f64*v_thermal**2)
242 factor2 = 0.5_f64/v_thermal**2
244 sll_assert(
size(data_out, 1) .ge. num_pts1)
245 sll_assert(
size(data_out, 2) .ge. num_pts2)
246 sll_assert(
size(data_out, 3) .ge. num_pts3)
247 sll_assert(
size(data_out, 4) .ge. num_pts4)
257 gi(:) = sll_o_local_to_global(layout, (/i, j, k, l/))
260 vx = vx_min + gi(3)*delta3
261 vy = vy_min + gi(4)*delta4
265 exp(-(vx**2 + vy**2)*factor2)
integer(kind=i32) function, public sll_f_get_collective_rank(col)
Determines the rank of the calling process in the communicator.
Fortran module where set some physical and mathematical constants.
real(kind=f64), parameter, public sll_p_pi
type(sll_t_simple_cartesian_4d_mesh) function, pointer, public sll_f_new_cartesian_4d_mesh(num_cells1, num_cells2, num_cells3, num_cells4, x1_min, x1_max, x2_min, x2_max, x3_min, x3_max, x4_min, x4_max)
subroutine compact_4d_field(init_obj, data_out)
subroutine delete_cartesian_4d_mesh(mesh)
subroutine, public sll_s_load_test_4d_initializer(init_obj, data_position, mesh_4d, v_thermal, layout)
Wrapper around the communicator.