70 TYPE(t_region
),
POINTER :: regions(:)
72 INTEGER,
INTENT(IN) :: ireg
78 CHARACTER(CHRLEN) :: rcsidentstring
81 INTEGER :: statusplag(mpi_status_size)
84 INTEGER :: iaiv,iarv,iarvold,ibuff,ibuffsendi,ibuffsendr,icont,icv, &
85 icvmass,icvold,ilev,ipcl,ipclbeg,ipclend,ir,irhs,irhssum,&
87 INTEGER :: narv,naiv,nbuffsizerecv,ncont,ncv,ndimi,ndimr,npcls,npclsprev, &
89 INTEGER,
POINTER,
DIMENSION(:) :: pcvplagmass, precvbuffi
91 INTEGER,
POINTER,
DIMENSION(:,:) :: paiv, paivold
93 REAL(RFREAL),
POINTER,
DIMENSION(:) :: precvbuffr
95 REAL(RFREAL),
POINTER,
DIMENSION(:,:) :: parv,parvold,pcv,pcvold ,&
98 TYPE(t_dcelltransf
),
POINTER :: precveccell
100 TYPE(t_level
),
POINTER :: plevel
101 TYPE(t_plag),
POINTER :: pplag
102 TYPE(t_region
),
POINTER :: pregion
108 rcsidentstring =
'$RCSfile: PLAG_CECellsRecvData.F90,v $ $Revision: 1.5 $'
110 global => regions(ireg)%global
113 'PLAG_CECellsRecvData.F90' )
119 ilev = regions(ireg)%currLevel
121 pregion => regions(ireg)
122 plevel => regions(ireg)%levels(ilev)
125 pcvplagmass => pplag%cvPlagMass
132 prhssum => pplag%rhsSum
134 paivold => pplag%aivOld
135 parvold => pplag%arvOld
136 pcvold => pplag%cvOld
142 ncont = regions(ireg)%plagInput%nCont
149 ndimr = 2*narv +4*ncv
155 DO ir=1,global%nRegions
156 IF (regions(ir)%procid == global%myProcid) goto 999
158 IF (plevel%recvEcCells(ir)%nCells > 0)
THEN
159 precveccell => plevel%recvEcCells(ir)
160 precvbuffi => precveccell%buffplagI
161 precvbuffr => precveccell%buffplagR
167 nbuffsizerecv = precveccell%nBuffSizePlag
169 IF ( nbuffsizerecv == 0 ) goto 1999
175 nrecvbuffi = ndimi * nbuffsizerecv
176 nrecvbuffr = ndimr * nbuffsizerecv
181 source = regions(ir)%procid
187 tagi = regions(ireg)%localNumber +plag_tag_shift +mpi_patchoff +2000
188 IF(tagi .gt. global%mpiTagMax) tagi = mod(tagi,global%mpiTagMax)
190 CALL mpi_recv( precvbuffi,nrecvbuffi,mpi_integer, &
191 source,tagi,global%mpiComm,statusplag,global%mpierr )
192 IF ( global%mpierr /= err_none ) &
193 CALL
errorstop( global,err_mpi_trouble,__line__ )
195 #ifdef PLAG_CECELLS_MPI_DEBUG
196 WRITE(stdout,
'(A,6(2X,I5))') &
197 ' PLAG_CECellsRecvData-INT: iRegDes, iRegSrc, procSrc, tagSrc, nBuffSizeRecv, nRecvBuffI = ',&
198 ireg, ir,
source,tagi,nbuffsizerecv,nrecvbuffi
205 tagr = regions(ireg)%localNumber +plag_tag_shift +mpi_patchoff +3000
207 IF(tagr .gt. global%mpiTagMax) tagr = mod(tagr,global%mpiTagMax)
209 CALL mpi_recv( precvbuffr,nrecvbuffr,mpi_rfreal, &
210 source,tagr,global%mpiComm,statusplag,global%mpierr )
211 IF ( global%mpierr /= err_none ) &
212 CALL
errorstop( global,err_mpi_trouble,__line__ )
214 #ifdef PLAG_CECELLS_MPI_DEBUG
215 WRITE(stdout,
'(A,6(2X,I5))') &
216 ' PLAG_CECellsRecvSize-REAL: iRegDes, iRegSrc, procSrc, tagSrc, nBuffSizeRecv, nRecvBuffR = ',&
217 ireg, ir,
source,tagr,nbuffsizerecv,nrecvbuffr
221 #ifdef PLAG_CECELLS_MPI_DEBUG
222 IF ( nbuffsizerecv > 0 )
THEN
223 DO ibuff=1,nbuffsizerecv
224 ibuffsendi = ndimi*(ibuff-1) +1
227 print*,
'iBuff,iBuffSendI,iAiv,pRecvBuffI = ',&
228 ibuff,ibuffsendi,iaiv,&
229 precvbuffi(iaiv ),precvbuffi(iaiv+1),precvbuffi(iaiv+2),&
230 precvbuffi(iaiv+3),precvbuffi(iaiv+4),precvbuffi(iaiv+5),&
231 precvbuffi(iaiv+6),precvbuffi(iaiv+7)
233 ibuffsendr = ndimr*(ibuff-1) +1
235 irhs = ibuffsendr +ncv
236 irhssum = ibuffsendr +2*ncv
237 icvold = ibuffsendr +3*ncv
238 iarv = ibuffsendr +4*ncv
239 iarvold = ibuffsendr +4*ncv +narv
241 print*,
'iBuff,iBuffSendR,iCv,pRecvBuffR = ',&
243 precvbuffr(icv ),precvbuffr(icv+1),precvbuffr(icv+2),&
244 precvbuffr(icv+3),precvbuffr(icv+4),precvbuffr(icv+5),&
245 precvbuffr(icv+6),precvbuffr(icv+7),precvbuffr(icv+(cv_plag_last-1)+1:icv+(cv_plag_last-1)+ncont)
263 ipclend = ipclbeg +(nbuffsizerecv-1)
272 DO ipcl = ipclbeg,ipclend
273 ibuff = ipcl-ipclbeg+1
280 ibuffsendi = ndimi*(ibuff-1) +1
285 paiv(aiv_plag_pidini,ipcl) = precvbuffi(iaiv )
286 paiv(aiv_plag_regini,ipcl) = precvbuffi(iaiv+1)
287 paiv(aiv_plag_regcrt,ipcl) = precvbuffi(iaiv+2)
288 paiv(aiv_plag_icells,ipcl) = precvbuffi(iaiv+3)
289 paiv(aiv_plag_indexi,ipcl) = precvbuffi(iaiv+4)
290 paiv(aiv_plag_indexj,ipcl) = precvbuffi(iaiv+5)
291 paiv(aiv_plag_indexk,ipcl) = precvbuffi(iaiv+6)
292 paiv(aiv_plag_burnstat,ipcl) = precvbuffi(iaiv+7)
293 paiv(aiv_plag_status,ipcl) = precvbuffi(iaiv+8)
295 paivold(1:naiv,ipcl) = paiv(1:naiv,ipcl)
302 ibuffsendr = ndimr*(ibuff-1) +1
304 irhs = ibuffsendr +ncv
305 irhssum = ibuffsendr +2*ncv
306 icvold = ibuffsendr +3*ncv
307 iarv = ibuffsendr +4*ncv
308 iarvold = ibuffsendr +4*ncv +narv
314 pcv(cv_plag_xmom,ipcl) = precvbuffr(icv )
315 pcv(cv_plag_ymom,ipcl) = precvbuffr(icv+1)
316 pcv(cv_plag_zmom,ipcl) = precvbuffr(icv+2)
317 pcv(cv_plag_ener,ipcl) = precvbuffr(icv+3)
318 pcv(cv_plag_xpos,ipcl) = precvbuffr(icv+4)
319 pcv(cv_plag_ypos,ipcl) = precvbuffr(icv+5)
320 pcv(cv_plag_zpos,ipcl) = precvbuffr(icv+6)
321 pcv(cv_plag_enervapor,ipcl) = precvbuffr(icv+7)
323 icvmass = pcvplagmass(icont)
324 pcv(icvmass,ipcl) = precvbuffr(icv+(cv_plag_last-1)+icont)
331 prhs(cv_plag_xmom,ipcl) = precvbuffr(irhs )
332 prhs(cv_plag_ymom,ipcl) = precvbuffr(irhs+1)
333 prhs(cv_plag_zmom,ipcl) = precvbuffr(irhs+2)
334 prhs(cv_plag_ener,ipcl) = precvbuffr(irhs+3)
335 prhs(cv_plag_xpos,ipcl) = precvbuffr(irhs+4)
336 prhs(cv_plag_ypos,ipcl) = precvbuffr(irhs+5)
337 prhs(cv_plag_zpos,ipcl) = precvbuffr(irhs+6)
338 prhs(cv_plag_enervapor,ipcl)= precvbuffr(irhs+7)
340 icvmass = pcvplagmass(icont)
341 prhs(icvmass,ipcl) = precvbuffr(irhs+(cv_plag_last-1)+icont)
348 prhssum(cv_plag_xmom,ipcl) = precvbuffr(irhssum )
349 prhssum(cv_plag_ymom,ipcl) = precvbuffr(irhssum+1)
350 prhssum(cv_plag_zmom,ipcl) = precvbuffr(irhssum+2)
351 prhssum(cv_plag_ener,ipcl) = precvbuffr(irhssum+3)
352 prhssum(cv_plag_xpos,ipcl) = precvbuffr(irhssum+4)
353 prhssum(cv_plag_ypos,ipcl) = precvbuffr(irhssum+5)
354 prhssum(cv_plag_zpos,ipcl) = precvbuffr(irhssum+6)
355 prhssum(cv_plag_enervapor,ipcl) = precvbuffr(irhssum+7)
357 icvmass = pcvplagmass(icont)
358 prhssum(icvmass,ipcl) = precvbuffr(irhssum+(cv_plag_last-1)+icont)
365 pcvold(cv_plag_xmom,ipcl) = precvbuffr(icvold )
366 pcvold(cv_plag_ymom,ipcl) = precvbuffr(icvold+1)
367 pcvold(cv_plag_zmom,ipcl) = precvbuffr(icvold+2)
368 pcvold(cv_plag_ener,ipcl) = precvbuffr(icvold+3)
369 pcvold(cv_plag_xpos,ipcl) = precvbuffr(icvold+4)
370 pcvold(cv_plag_ypos,ipcl) = precvbuffr(icvold+5)
371 pcvold(cv_plag_zpos,ipcl) = precvbuffr(icvold+6)
372 pcvold(cv_plag_enervapor,ipcl) = precvbuffr(icvold+7)
374 icvmass = pcvplagmass(icont)
375 pcvold(icvmass,ipcl) = precvbuffr(icvold+(cv_plag_last-1)+icont)
382 parv(arv_plag_spload,ipcl) = precvbuffr(iarv)
383 parvold(arv_plag_spload,ipcl) = precvbuffr(iarvold)
390 npcls = npcls +nbuffsizerecv
393 #ifdef PLAG_CECELLS_MPI_DEBUG
394 IF ( nbuffsizerecv > 0 )
THEN
395 WRITE(stdout,
'(A,A,2X,1PE15.7,2X,3(I3,2X),5(I4,3X))') &
396 ' PLAG_CECellsRecvData: time, procId,iReg, nBuffSizeRecv, ',&
397 ' nPcls,nPclsPrev,iPclBeg,iPclEnd = ',&
398 global%currentTime+global%dtMin,ireg,global%myProcid, &
399 nbuffsizerecv,npcls,npclsprev,ipclbeg,ipclend
401 print*,
'iPcl,aiv = ',&
403 paiv(aiv_plag_pidini,ipcl),&
404 paiv(aiv_plag_regini,ipcl),&
405 paiv(aiv_plag_regcrt,ipcl),&
406 paiv(aiv_plag_icells,ipcl),&
407 paiv(aiv_plag_indexi,ipcl),&
408 paiv(aiv_plag_indexj,ipcl),&
409 paiv(aiv_plag_indexk,ipcl),&
410 paiv(aiv_plag_burnstat,ipcl),&
411 paiv(aiv_plag_status,ipcl)
414 print*,
'iPcl,cv = ',&
416 pcv(cv_plag_xmom,ipcl),&
417 pcv(cv_plag_ymom,ipcl),&
418 pcv(cv_plag_zmom,ipcl),&
419 pcv(cv_plag_ener,ipcl),&
420 pcv(cv_plag_xpos,ipcl),&
421 pcv(cv_plag_ypos,ipcl),&
422 pcv(cv_plag_zpos,ipcl),&
423 pcv(cv_plag_enervapor,ipcl),&
424 pcv(cv_plag_last+1:cv_plag_last+ncont,ipcl)
subroutine registerfunction(global, funName, fileName)
subroutine plag_cecellsrecvdata(regions, iReg)
CGAL::Point_2< R > source() const
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)