64 TYPE(t_region
),
POINTER :: regions(:)
66 INTEGER,
INTENT(IN) :: ireg
72 INTEGER :: ibuff,
icell, iregdes, ilev, icoff, ijcoff
74 INTEGER :: ncornbuffsize, nedgebuffsize
75 INTEGER :: ncorners,
nedges
76 INTEGER :: npclsdes, npclsend, npclsprev, npclssrc, npclsstart
77 INTEGER :: icornerbuffloaded, iedgebuffloaded
78 INTEGER :: errorflag,iccmax, iecmax
80 INTEGER,
POINTER,
DIMENSION(:,:) :: paivbuff, paivoldbuff
81 INTEGER,
POINTER,
DIMENSION(:,:) :: paivdes, paivolddes
82 INTEGER,
ALLOCATABLE,
DIMENSION(:,:) :: corncellcounter, edgecellcounter
84 REAL(RFREAL),
POINTER,
DIMENSION(:,:) :: parvbuff, parvoldbuff, &
85 pcvbuff, pcvoldbuff, pdvbuff, &
86 ptvbuff, prhsbuff, prhssumbuff
88 REAL(RFREAL),
POINTER,
DIMENSION(:,:) :: parvdes, parvolddes, &
89 pcvdes, pcvolddes, pdvdes, &
90 ptvdes, prhsdes, prhssumdes
92 TYPE(t_region
),
POINTER :: pregion, pregiondes
93 TYPE(t_level
),
POINTER :: plevel
94 TYPE(t_buffer_plag),
POINTER :: pcorncellsxbuff, pedgecellsxbuff
95 TYPE(t_plag),
POINTER :: pplagdes
100 global => regions(ireg)%global
103 'PLAG_CECellsExchange.F90' )
107 ilev = regions(ireg)%currLevel
124 icornerbuffloaded = 0
129 pregion => regions(ireg)
130 plevel => regions(ireg)%levels(ilev)
132 npclssrc = plevel%plag%nPcls
138 IF( plevel%cornerCells(
icorner)%interact ) &
139 iccmax =
max(iccmax,ubound(plevel%cornerCells(
icorner)%cells,1))
142 ALLOCATE( corncellcounter(ncorners,iccmax),stat=errorflag )
143 global%error = errorflag
144 IF (global%error /= err_none) &
145 CALL
errorstop( global,err_allocate,__line__ )
149 #ifdef PLAG_CECELLS_DEBUG
150 print*,
'PLAG_CECellsExchange: iReg,iCCMax = ', ireg, iccmax
157 IF( plevel%edgeCells(iedge)%interact ) &
158 iecmax =
max(iecmax,ubound(plevel%edgeCells(iedge)%cells,1))
161 ALLOCATE( edgecellcounter(
nedges,iecmax),stat=errorflag )
162 global%error = errorflag
163 IF (global%error /= err_none) &
164 CALL
errorstop( global,err_allocate,__line__ )
168 #ifdef PLAG_CECELLS_DEBUG
169 print*,
'PLAG_CECellsExchange: iReg,iECMax = ', ireg, iecmax
178 IF( .NOT. plevel%cornerCells(
icorner)%interact ) goto 1999
182 IF( plevel%cornerCells(
icorner)%degenrt /= degenerat_none ) goto 1999
190 icornerbuffloaded = 0
198 pcorncellsxbuff => plevel%cornerCells(
icorner)%cells(ijk)%bufferExchPlag
200 paivbuff => pcorncellsxbuff%aiv
201 parvbuff => pcorncellsxbuff%arv
202 pcvbuff => pcorncellsxbuff%cv
203 pdvbuff => pcorncellsxbuff%dv
204 ptvbuff => pcorncellsxbuff%tv
205 prhsbuff => pcorncellsxbuff%rhs
206 prhssumbuff => pcorncellsxbuff%rhsSum
208 paivoldbuff => pcorncellsxbuff%aivOld
209 parvoldbuff => pcorncellsxbuff%arvOld
210 pcvoldbuff => pcorncellsxbuff%cvOld
215 iregdes = plevel%cornerCells(
icorner)%cells(ijk)%srcRegion
217 IF ( iregdes > 0 )
THEN
218 pregiondes => regions(iregdes)
219 pplagdes => pregiondes%levels(ilev)%plag
223 ncornbuffsize = pcorncellsxbuff%nBuffSize
224 IF ( corncellcounter(
icorner,ijk) >= ncornbuffsize ) cycle
231 IF ( pregiondes%procid == global%myProcid .AND. &
232 ncornbuffsize > 0 )
THEN
234 #ifdef PLAG_CECELLS_DEBUG
235 WRITE(stdout,
'(A,1PE12.5,3(2X,I5),6(3X,I4))') &
236 ' PLAG_CECellsExchange: time, iReg, iRegDes, iCorner, nCornBuffSize,iCornerBuffLoaded, ijk, i ,j, k = ',&
237 global%currentTime+global%dtMin,ireg, iregdes,
icorner, ncornbuffsize,icornerbuffloaded, ijk,
i ,
j,
k
242 paivdes => pplagdes%aiv
244 parvdes => pplagdes%arv
245 pcvdes => pplagdes%cv
246 pdvdes => pplagdes%dv
247 ptvdes => pplagdes%tv
248 prhsdes => pplagdes%rhs
249 prhssumdes => pplagdes%rhsSum
251 paivolddes => pplagdes%aivOld
252 parvolddes => pplagdes%arvOld
253 pcvolddes => pplagdes%cvOld
257 npclsdes = pplagdes%nPcls
260 npclsstart = npclsdes+1
261 npclsend = npclsstart + (ncornbuffsize-1)
265 DO ipcls = npclsstart,npclsend
266 ibuff = ipcls-npclsstart+1
268 icornerbuffloaded = corncellcounter(
icorner,ijk)
270 paivdes(:,ipcls) = paivbuff(:,ibuff)
271 parvdes(:,ipcls) = parvbuff(:,ibuff)
272 pcvdes(:,ipcls) = pcvbuff( :,ibuff)
273 pdvdes(:,ipcls) = pdvbuff( :,ibuff)
274 ptvdes(:,ipcls) = ptvbuff( :,ibuff)
275 prhsdes(:,ipcls) = prhsbuff(:,ibuff)
276 prhssumdes(:,ipcls) = prhssumbuff(:,ibuff)
278 paivolddes(:,ipcls) = paivoldbuff(:,ibuff)
279 parvolddes(:,ipcls) = parvoldbuff(:,ibuff)
280 pcvolddes(:,ipcls) = pcvoldbuff( :,ibuff)
285 npclsdes = npclsdes+ncornbuffsize
286 pplagdes%nPcls = npclsdes
288 #ifdef PLAG_CECELLS_DEBUG
289 WRITE(stdout,
'(A,A,2X,1PE15.7,2X,3(I3,2X),3(I4,3X))') &
290 ' PLAG_CECellsExchange: time, iReg, iRegDes, iCorner, nPclsDes, nPclsSrc,iCornerBuffLoaded, ',&
291 ' pAivDes(PIdini,Regini,RegC,ICells,IndexIJK,)', &
292 global%currentTime+global%dtMin,ireg, iregdes,
icorner, pplagdes%nPcls, npclssrc,icornerbuffloaded
293 DO ipcls = 1, pplagdes%nPcls
294 WRITE(stdout,
'(9(I4,3X),8(1PE12.5,3X))') &
296 paivdes(aiv_plag_pidini,ipcls),&
297 paivdes(aiv_plag_regini,ipcls),&
298 paivdes(aiv_plag_regcrt,ipcls),&
299 paivdes(aiv_plag_icells,ipcls),&
300 paivdes(aiv_plag_indexi,ipcls),&
301 paivdes(aiv_plag_indexj,ipcls),&
302 paivdes(aiv_plag_indexk,ipcls),&
303 paivdes(aiv_plag_burnstat,ipcls),&
304 pcvdes(cv_plag_xpos:cv_plag_zpos,ipcls),&
305 pcvdes(cv_plag_xmom:cv_plag_ener,ipcls),&
306 pcvdes(cv_plag_enervapor,ipcls)
317 #ifdef PLAG_CECELLS_DEBUG
318 IF ( ncornbuffsize > 0 )
THEN
320 WRITE(stdout,
'(A,A,2X,1PE15.7,2X,3(I3,2X),5(I4,3X))') &
321 ' PLAG_CECellsExchange-iReg: iReg, iCorner, iRegDes, nCornBuffSize, ',&
322 ' nPclsSrc,nPclsDesPrev,nPclsDes,nPclsStart,nPclsEnd = ',&
323 global%currentTime+global%dtMin,ireg,
icorner,iregdes, &
324 ncornbuffsize,npclssrc,npclsprev,npclsdes,npclsstart,npclsend
333 IF ( pregiondes%procid == global%myProcid )
THEN
334 DO ijk = 1, ubound(plevel%cornerCells(
icorner)%cells,1)
335 plevel%cornerCells(
icorner)%cells(ijk)%bufferExchPlag%nBuffSize = 0
349 IF( .NOT. plevel%edgeCells(iedge)%interact ) goto 2999
353 IF( plevel%edgeCells(iedge)%degenrt /= degenerat_none ) goto 2999
369 pedgecellsxbuff => plevel%edgeCells(iedge)%cells(ijk)%bufferExchPlag
371 paivbuff => pedgecellsxbuff%aiv
372 parvbuff => pedgecellsxbuff%arv
373 pcvbuff => pedgecellsxbuff%cv
374 pdvbuff => pedgecellsxbuff%dv
375 ptvbuff => pedgecellsxbuff%tv
376 prhsbuff => pedgecellsxbuff%rhs
377 prhssumbuff => pedgecellsxbuff%rhsSum
379 paivoldbuff => pedgecellsxbuff%aivOld
380 parvoldbuff => pedgecellsxbuff%arvOld
381 pcvoldbuff => pedgecellsxbuff%cvOld
385 icell = plevel%edgeCells(iedge)%cells(ijk)%srcCell
386 iregdes = plevel%edgeCells(iedge)%cells(ijk)%srcRegion
388 IF ( iregdes > 0 )
THEN
389 pregiondes => regions(iregdes)
390 pplagdes => pregiondes%levels(ilev)%plag
394 nedgebuffsize = pedgecellsxbuff%nBuffSize
395 IF ( edgecellcounter(iedge,ijk) >= nedgebuffsize ) cycle
402 IF ( pregiondes%procid == global%myProcid .AND. &
403 nedgebuffsize > 0 )
THEN
405 #ifdef PLAG_CECELLS_DEBUG
406 WRITE(stdout,
'(A,1PE12.5,3(2X,I3),5(3X,I4))') &
407 ' PLAG_CECellsExchange: time, iReg, iRegDes, iEdge, nEdgeBuffSize,iEdgeBuffLoaded, ijk, i ,j, k = ',&
408 global%currentTime+global%dtMin,ireg, iregdes,iedge, nedgebuffsize, iedgebuffloaded ,ijk,
i ,
j,
k
413 paivdes => pplagdes%aiv
415 parvdes => pplagdes%arv
416 pcvdes => pplagdes%cv
417 pdvdes => pplagdes%dv
418 ptvdes => pplagdes%tv
419 prhsdes => pplagdes%rhs
420 prhssumdes => pplagdes%rhsSum
422 paivolddes => pplagdes%aivOld
423 parvolddes => pplagdes%arvOld
424 pcvolddes => pplagdes%cvOld
428 npclsdes = pplagdes%nPcls
431 npclsstart = npclsdes+1
432 npclsend = npclsstart + (nedgebuffsize-1)
436 DO ipcls = npclsstart,npclsend
437 ibuff = ipcls-npclsstart+1
438 edgecellcounter(iedge,ijk) = edgecellcounter(iedge,ijk)+1
439 iedgebuffloaded = edgecellcounter(iedge,ijk)
441 paivdes(:,ipcls) = paivbuff(:,ibuff)
442 parvdes(:,ipcls) = parvbuff(:,ibuff)
443 pcvdes(:,ipcls) = pcvbuff( :,ibuff)
444 pdvdes(:,ipcls) = pdvbuff( :,ibuff)
445 ptvdes(:,ipcls) = ptvbuff( :,ibuff)
446 prhsdes(:,ipcls) = prhsbuff(:,ibuff)
447 prhssumdes(:,ipcls) = prhssumbuff(:,ibuff)
449 paivolddes(:,ipcls) = paivoldbuff(:,ibuff)
450 parvolddes(:,ipcls) = parvoldbuff(:,ibuff)
451 pcvolddes(:,ipcls) = pcvoldbuff( :,ibuff)
456 npclsdes = npclsdes+nedgebuffsize
457 pplagdes%nPcls = npclsdes
459 #ifdef PLAG_CECELLS_DEBUG
460 WRITE(stdout,
'(A,A,2X,1PE15.7,2X,3(I3,2X),3(I4,3X))') &
461 ' PLAG_CECellsExchange: time, iReg, iRegDes, iEdge, nPclsDes, nPclsSrc,iEdgeBuffLoaded, ',&
462 ' pAivDes(PIdini,Regini,RegC,ICells,IndexIJK,)', &
463 global%currentTime+global%dtMin,ireg, iregdes, iedge, pplagdes%nPcls, npclssrc,iedgebuffloaded
464 DO ipcls = 1, pplagdes%nPcls
465 WRITE(stdout,
'(9(I4,3X),8(1PE12.5,3X))') &
467 paivdes(aiv_plag_pidini,ipcls),&
468 paivdes(aiv_plag_regini,ipcls),&
469 paivdes(aiv_plag_regcrt,ipcls),&
470 paivdes(aiv_plag_icells,ipcls),&
471 paivdes(aiv_plag_indexi,ipcls),&
472 paivdes(aiv_plag_indexj,ipcls),&
473 paivdes(aiv_plag_indexk,ipcls),&
474 paivdes(aiv_plag_burnstat,ipcls),&
475 pcvdes(cv_plag_xpos:cv_plag_zpos,ipcls),&
476 pcvdes(cv_plag_xmom:cv_plag_ener,ipcls),&
477 pcvdes(cv_plag_enervapor,ipcls)
488 #ifdef PLAG_CECELLS_DEBUG
489 IF ( nedgebuffsize > 0 )
THEN
491 WRITE(stdout,
'(A,A,2X,1PE15.7,2X,3(I3,2X),5(I4,3X))') &
492 ' PLAG_CECellsExchange-iReg: iReg, iEdge, iRegDes, nEdgeBuffSize, ',&
493 ' nPclsSrc,nPclsDesPrev,nPclsDes,nPclsStart,nPclsEnd = ',&
494 global%currentTime+global%dtMin,ireg,iedge,iregdes, &
495 nedgebuffsize,npclssrc,npclsprev,npclsdes,npclsstart,npclsend
504 IF ( pregiondes%procid == global%myProcid )
THEN
505 DO ijk = 1, ubound(plevel%edgeCells(iedge)%cells,1)
506 plevel%edgeCells(iedge)%cells(ijk)%bufferExchPlag%nBuffSize = 0
subroutine rflo_getedgecellsindices(region, iLev, iedge, iebeg, ieend, jebeg, jeend, kebeg, keend)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE ibeg
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
subroutine registerfunction(global, funName, fileName)
subroutine plag_cecellsexchange(regions, iReg)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE knode iend
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE icorner
subroutine rflo_getcornercellsindices(region, iLev, icorner, icbeg, icend, jcbeg, jcend, kcbeg, kcend)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE icell
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE knode jend
subroutine errorstop(global, errorCode, errorLine, addMessage)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE knode jbeg
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE knode kbeg
subroutine deregisterfunction(global)