19 end interface pack_dbuf
36 use discretelement
, only: ighost_updated
46 use discretelement
, only: dg_pijkprv
48 use discretelement
, only: iglobal_id
50 use discretelement
, only: des_pos_new
52 use discretelement
, only: des_vel_new
54 use discretelement
, only: omega_new
58 use discretelement
, only: des_radius
60 use discretelement
, only: pijk
62 use discretelement
, only: max_pip
64 use discretelement
, only: des_usr_var, des_usr_var_size
80 use discretelement
, only: dimn
82 use functions, only: is_ghost, is_entering_ghost, is_exiting_ghost
89 INTEGER,
INTENT(IN) :: PFACE
93 integer :: lijk,lindx,ltot_ind,lpicloc,lpar_cnt,lcurpar
99 do lindx = 2,ltot_ind+1
101 do lpicloc =1,
dg_pic(lijk)%isize
102 lbuf = lpar_cnt*ighostpacketsize + ibufoffset
103 lcurpar =
dg_pic(lijk)%p(lpicloc)
107 if((is_ghost(lcurpar) .or. &
108 is_entering_ghost(lcurpar) .or. &
109 is_exiting_ghost(lcurpar)) .and. &
110 .not.ighost_updated(lcurpar)) cycle
113 call pack_dbuf(lbuf,iglobal_id(lcurpar),pface)
116 ineighproc(pface)),pface)
118 call pack_dbuf(lbuf,
dg_ijkconv(dg_pijkprv(lcurpar),pface, &
119 ineighproc(pface)),pface)
121 call pack_dbuf(lbuf,des_radius(lcurpar),pface)
123 call pack_dbuf(lbuf,pijk(lcurpar,5),pface)
125 call pack_dbuf(lbuf,des_pos_new(lcurpar,:)+ &
126 dcycl_offset(pface,:),pface)
128 call pack_dbuf(lbuf,des_vel_new(lcurpar,:),pface)
130 call pack_dbuf(lbuf,omega_new(lcurpar,:),pface)
132 call pack_dbuf(lbuf,merge(1,0,is_exiting(lcurpar).or.is_exiting_ghost
135 call pack_dbuf(lbuf,
des_t_s(lcurpar),pface)
137 IF(des_usr_var_size > 0) &
138 call pack_dbuf(lbuf,des_usr_var(:,lcurpar),pface)
140 lpar_cnt = lpar_cnt + 1
143 dsendbuf(1+mod(pface,2))%facebuf(1)=lpar_cnt
144 isendcnt(pface) = lpar_cnt*ighostpacketsize + ibufoffset
169 use discretelement
, only: dg_pijkprv
175 use discretelement
, only: iglobal_id
177 use discretelement
, only: des_pos_new, des_pos_old
179 use discretelement
, only: des_vel_new, des_vel_old
181 use discretelement
, only: omega_new, omega_old
183 use discretelement
, only: particle_orientation,orientation
185 use discretelement
, only: des_radius, pvol, ro_sol, pmass
187 use discretelement
, only: des_acc_old, rot_acc_old
193 use discretelement
, only: fc, tow
195 use discretelement
, only: omoi
197 use discretelement
, only: pijk
199 use discretelement
, only: do_old
201 use discretelement
, only: pip, max_pip
203 use discretelement
, only: ighost_cnt
205 use discretelement
, only: des_usr_var, des_usr_var_size
207 use discretelement
, only: neighbors, neighbor_index, neigh_num
209 use discretelement
, only: pft_neighbor
211 use discretelement
, only: dimn
213 use discretelement
, only: des_explicitly_coupled
215 use discretelement
, only: drag_fc
234 INTEGER,
INTENT(IN) :: PFACE
238 integer :: li, lj, lk
239 integer :: ltot_ind,lindx,cc
240 integer :: lneigh,lijk,&
241 lpicloc,lparcnt,lcurpar
242 integer :: lbuf,num_neighborlists_to_send
244 logical,
allocatable,
dimension(:) :: going_to_send
247 integer :: num_neighborlists_send_buf_loc
251 ltot_ind = irecvindices(1,pface)
254 allocate(going_to_send(max_pip))
255 going_to_send(:) = .false.
257 do lindx = 2,ltot_ind+1
258 lijk = irecvindices(lindx,pface)
259 do lpicloc = 1,
dg_pic(lijk)%isize
260 lcurpar =
dg_pic(lijk)%p(lpicloc)
263 if(is_ghost(lcurpar) .or. &
264 is_entering_ghost(lcurpar) .or. &
265 is_exiting_ghost(lcurpar)) cycle
267 going_to_send(lcurpar) = .true.
268 lbuf = lparcnt*iparticlepacketsize + ibufoffset
271 call pack_dbuf(lbuf,iglobal_id(lcurpar),pface)
274 ineighproc(pface)),pface)
276 call pack_dbuf(lbuf,
dg_ijkconv(dg_pijkprv(lcurpar),pface, &
277 ineighproc(pface)),pface)
279 call pack_dbuf(lbuf,des_radius(lcurpar),pface)
282 call pack_dbuf(lbuf,li,pface)
285 call pack_dbuf(lbuf,lj,pface)
288 call pack_dbuf(lbuf,lk,pface)
290 call pack_dbuf(lbuf,funijk_proc(li,lj,lk, &
291 ineighproc(pface)),pface)
293 call pack_dbuf(lbuf,pijk(lcurpar,5),pface)
295 call pack_dbuf(lbuf, is_entering(lcurpar).or.is_entering_ghost
297 call pack_dbuf(lbuf, is_exiting(lcurpar).or.is_exiting_ghost
299 call pack_dbuf(lbuf,ro_sol(lcurpar),pface)
301 call pack_dbuf(lbuf,pvol(lcurpar),pface)
303 call pack_dbuf(lbuf,pmass(lcurpar),pface)
305 call pack_dbuf(lbuf,omoi(lcurpar),pface)
307 call pack_dbuf(lbuf,des_pos_new(lcurpar,:) + &
308 dcycl_offset(pface,:),pface)
310 call pack_dbuf(lbuf,des_vel_new(lcurpar,:),pface)
312 call pack_dbuf(lbuf,omega_new(lcurpar,:),pface)
314 call pack_dbuf(lbuf,fc(lcurpar,:),pface)
316 call pack_dbuf(lbuf,tow(lcurpar,:),pface)
319 call pack_dbuf(lbuf,des_t_s(lcurpar),pface)
321 call pack_dbuf(lbuf,
des_x_s(lcurpar,:),pface)
324 IF(des_usr_var_size > 0) &
325 call pack_dbuf(lbuf, des_usr_var(:,lcurpar),pface)
327 IF(particle_orientation) &
328 call pack_dbuf(lbuf,orientation(:,lcurpar),pface)
333 call pack_dbuf(lbuf,des_pos_old(lcurpar,:) + &
334 dcycl_offset(pface,:),pface)
336 call pack_dbuf(lbuf,des_vel_old(lcurpar,:),pface)
338 call pack_dbuf(lbuf,omega_old(lcurpar,:),pface)
340 call pack_dbuf(lbuf,des_acc_old(lcurpar,:),pface)
342 call pack_dbuf(lbuf,rot_acc_old(lcurpar,:),pface)
345 IF(des_explicitly_coupled)
THEN 347 call pack_dbuf(lbuf, drag_fc(lcurpar,:),pface)
349 IF(energy_eq)
call pack_dbuf(lbuf,
conv_qs(lcurpar),pface)
359 call set_nonexistent(lcurpar)
365 if (is_entering(lcurpar))
then 366 call set_entering_ghost(lcurpar)
367 elseif (is_exiting(lcurpar))
then 368 call set_exiting_ghost(lcurpar)
370 call set_ghost(lcurpar)
372 ighost_cnt = ighost_cnt + 1
377 lparcnt = lparcnt + 1
384 lbuf = lparcnt*iparticlepacketsize + ibufoffset
385 num_neighborlists_send_buf_loc = lbuf
388 num_neighborlists_to_send = 0
391 IF (0 .eq. neighbors(cc))
EXIT 393 IF (cc.eq.neighbor_index(lcurpar))
THEN 394 lcurpar = lcurpar + 1
398 if (.not. going_to_send(lcurpar)) cycle
402 lneigh = neighbors(lcurpar)
403 if(is_nonexistent(lneigh)) cycle
404 if(is_exiting(lneigh)) cycle
407 call pack_dbuf(lbuf,iglobal_id(lcurpar),pface)
409 call pack_dbuf(lbuf,
dg_ijkconv(dg_pijkprv(lcurpar),pface, &
410 ineighproc(pface)),pface)
412 call pack_dbuf(lbuf,iglobal_id(lneigh),pface)
414 call pack_dbuf(lbuf,
dg_ijkconv(dg_pijkprv(lneigh),pface, &
415 ineighproc(pface)),pface)
417 call pack_dbuf(lbuf,pft_neighbor(:,cc),pface)
419 num_neighborlists_to_send = num_neighborlists_to_send + 1
425 lbuf = num_neighborlists_send_buf_loc
427 call pack_dbuf(lbuf,num_neighborlists_to_send,pface)
429 dsendbuf(1+mod(pface,2))%facebuf(1) = lparcnt
430 isendcnt(pface) = lparcnt*iparticlepacketsize + &
433 deallocate(going_to_send)
441 subroutine pack_db0(lbuf,idata,pface)
443 integer,
intent(inout) :: lbuf
444 integer,
intent(in) :: pface
445 double precision,
intent(in) :: idata
447 dsendbuf(1+mod(pface,2))%facebuf(lbuf) = idata
456 subroutine pack_db1(lbuf,idata,pface)
458 integer,
intent(inout) :: lbuf
459 integer,
intent(in) :: pface
460 double precision,
intent(in) :: idata(:)
466 dsendbuf(1+mod(pface,2))%facebuf(lbuf:lbuf+lsize-1) = idata
475 subroutine pack_i0(lbuf,idata,pface)
477 integer,
intent(inout) :: lbuf
478 integer,
intent(in) :: pface
479 integer,
intent(in) :: idata
481 dsendbuf(1+mod(pface,2))%facebuf(lbuf) = idata
490 subroutine pack_i1(lbuf,idata,pface)
492 integer,
intent(inout) :: lbuf
493 integer,
intent(in) :: pface
494 integer,
intent(in) :: idata(:)
500 dsendbuf(1+mod(pface,2))%facebuf(lbuf:lbuf+lsize-1) = idata
509 subroutine pack_l0(lbuf,ldata,pface)
512 integer,
intent(inout) :: lbuf
513 integer,
intent(in) :: pface
514 logical,
intent(in) :: ldata
516 dsendbuf(1+mod(pface,2))%facebuf(lbuf) = merge(1.0, 0.0, ldata)
double precision, dimension(:), allocatable des_t_s
integer function dg_ijkconv(fijk, fface, fto_proc)
integer iparticlepacketsize
integer, dimension(:,:), allocatable icycoffset
subroutine, public desmpi_pack_parcross(PFACE)
subroutine pack_db1(lbuf, idata, pface)
type(iap2), dimension(:), allocatable dg_pic
subroutine pack_i1(lbuf, idata, pface)
subroutine, public desmpi_pack_ghostpar(PFACE)
type(array), dimension(:), allocatable dsendbuf
integer, dimension(:,:), allocatable isendindices
subroutine pack_l0(lbuf, ldata, pface)
subroutine pack_i0(lbuf, idata, pface)
double precision, dimension(:,:), allocatable des_x_s
double precision, dimension(:), allocatable conv_qs
integer, parameter ibufoffset
double precision, dimension(:,:), allocatable dcycl_offset
integer, dimension(:), allocatable ineighproc
integer, dimension(:,:), allocatable irecvindices
integer, dimension(:), allocatable isendcnt
double precision, dimension(:), allocatable rxns_qs
double precision, parameter pi
double precision, dimension(:), allocatable des_stat_wt
subroutine pack_db0(lbuf, idata, pface)