20 #include "sll_memory.h"
21 #include "sll_working_precision.h"
32 omp_get_num_threads, &
49 sll_int32 :: number_particles
50 sll_int32 :: active_particles
51 sll_int32 :: guard_list_size
54 sll_int32,
dimension(:),
pointer :: num_postprocess_particles
70 particle_array_size, &
76 sll_int32,
intent(in) :: num_particles
77 sll_int32,
intent(in) :: particle_array_size
78 sll_int32,
intent(in) :: guard_list_size
79 sll_real64,
intent(in) :: qoverm
84 sll_int32 :: thread_id
87 if (num_particles > particle_array_size)
then
88 print *,
'sll_f_new_particle_4d_group(): ERROR, num_particles should not ', &
89 'be greater than the memory size requested, particle_array_size.'
93 res%number_particles = num_particles
94 res%active_particles = num_particles
95 res%guard_list_size = guard_list_size
98 sll_allocate(res%p_list(particle_array_size), ierr)
105 thread_id = omp_get_thread_num()
106 if (thread_id == 0)
then
107 n_thread = omp_get_num_threads()
112 nn = guard_list_size/n_thread
113 sll_allocate(res%p_guard(1:n_thread), ierr)
114 sll_allocate(res%num_postprocess_particles(1:n_thread), ierr)
118 thread_id = omp_get_thread_num()
120 sll_allocate(res%p_guard(thread_id + 1)%g_list(1:nn), ierr)
129 particle_array_size, &
135 sll_int32,
intent(in) :: num_particles
136 sll_int32,
intent(in) :: particle_array_size
137 sll_int32,
intent(in) :: guard_list_size
138 sll_real64,
intent(in) :: qoverm
142 sll_allocate(res, ierr)
147 particle_array_size, &
157 sll_int32 :: thread_id
159 if (.not.
associated(p_group))
then
160 print *,
'delete_particle_group_2d(): ERROR, passed group was not ', &
166 thread_id = omp_get_thread_num()
168 sll_deallocate(p_group%num_postprocess_particles, ierr)
169 sll_deallocate(p_group%p_guard(thread_id + 1)%g_list, ierr)
170 sll_deallocate(p_group%p_list, ierr)
171 sll_deallocate(p_group%p_guard, ierr)
172 sll_deallocate(p_group, ierr)
Cartesian mesh basic types.
type(sll_t_particle_group_4d) function, pointer, public sll_f_new_particle_4d_group(num_particles, particle_array_size, guard_list_size, qoverm, mesh)
subroutine, public sll_s_particle_4d_group_free(p_group)
subroutine, public sll_s_particle_4d_group_init(res, num_particles, particle_array_size, guard_list_size, qoverm, mesh)