58 TYPE(t_region
),
POINTER :: regions(:)
60 INTEGER,
INTENT(IN) :: ireg
63 INTEGER :: ipatch, ilev, ir
66 CHARACTER(CHRLEN) :: rcsidentstring
68 INTEGER :: bctype, iregsrc, n1, n2, n1src, n2src, ncv, neqs, neqssrc
69 INTEGER :: ndc, ndcsrc, ndim, ndimsrc, errorflag
72 TYPE(t_level
),
POINTER :: level
73 TYPE(t_patch),
POINTER :: ppatch
75 TYPE(t_peul),
POINTER :: ppeul
76 TYPE(t_dcelltransf
),
POINTER :: sendeccell, recveccell
77 TYPE(t_dcelltransf
),
POINTER :: sndpeuleccell, rcvpeuleccell
81 rcsidentstring =
'$RCSfile: PEUL_AllocateDataBuffers.F90,v $ $Revision: 1.3 $'
83 global => regions(ireg)%global
86 'PEUL_AllocateDataBuffers.F90' )
90 DO ilev=1,regions(ireg)%nGridLevels
92 ppeul => regions(ireg)%levels(ilev)%peul
97 DO ipatch=1,regions(ireg)%nPatches
99 ppatch => regions(ireg)%levels(ilev)%patches(ipatch)
100 bctype = ppatch%bcType
102 pbuffpeul => ppatch%bufferPeul
104 IF ((bctype>=bc_regionconf .AND. bctype<=bc_regionconf+bc_range) .OR. &
105 (bctype>=bc_tra_peri .AND. bctype<=bc_tra_peri +bc_range) .OR. &
106 (bctype>=bc_rot_peri .AND. bctype<=bc_rot_peri +bc_range))
THEN
107 iregsrc = ppatch%srcRegion
108 IF (regions(iregsrc)%procid /= global%myProcid)
THEN
109 n1 = abs(ppatch%l1end -ppatch%l1beg ) + 2
110 n2 = abs(ppatch%l2end -ppatch%l2beg ) + 2
111 n1src = abs(ppatch%srcL1end-ppatch%srcL1beg) + 2
112 n2src = abs(ppatch%srcL2end-ppatch%srcL2beg) + 2
115 ndc = regions(ireg )%nDumCells
116 ndcsrc = regions(iregsrc)%nDumCells
117 ndim = n1*n2*neqs*ndc
118 ndimsrc = n1src*n2src*neqssrc*ndcsrc
120 ALLOCATE( pbuffpeul%sendBuff(ndimsrc),stat=errorflag )
121 global%error = errorflag
122 IF (global%error /= err_none) &
123 CALL
errorstop( global,err_allocate,__line__ )
125 ALLOCATE( pbuffpeul%recvBuff(ndim ),stat=errorflag )
126 global%error = errorflag
127 IF (global%error /= err_none) &
128 CALL
errorstop( global,err_allocate,__line__ )
130 pbuffpeul%nSendBuff = ndimsrc
131 pbuffpeul%nRecvBuff = ndim
132 ppeul%nRequests = ppeul%nRequests + 1
133 pbuffpeul%iRequest = ppeul%nRequests
135 ELSE IF ((bctype>=bc_regionint .AND. bctype<=bc_regionint +bc_range) .OR. &
136 (bctype>=bc_regnonconf .AND. bctype<=bc_regnonconf+bc_range))
THEN
137 CALL
errorstop( global,err_unknown_bc,__line__ )
145 ALLOCATE( ppeul%requests(ppeul%nRequests),stat=errorflag )
146 global%error = errorflag
147 IF (global%error /= err_none)
THEN
148 CALL
errorstop( global, err_allocate,__line__,
'pPeul%requests' )
156 IF (global%nProcAlloc > 1)
THEN
158 DO ilev=1,regions(ireg)%nGridLevels
162 level => regions(ireg)%levels(ilev)
165 ALLOCATE( level%sndPeulEcCells(global%nRegions),stat=errorflag )
166 ALLOCATE( level%rcvPeulEcCells(global%nRegions),stat=errorflag )
167 global%error = errorflag
168 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
170 DO ir=1,global%nRegions
171 sendeccell => regions(ireg)%levels(ilev)%sendEcCells(ir)
172 recveccell => regions(ireg)%levels(ilev)%recvEcCells(ir)
173 sndpeuleccell => regions(ireg)%levels(ilev)%sndPeulEcCells(ir)
174 rcvpeuleccell => regions(ireg)%levels(ilev)%rcvPeulEcCells(ir)
175 sndpeuleccell%nCells = sendeccell%nCells
176 rcvpeuleccell%nCells = recveccell%nCells
178 IF (sndpeuleccell%nCells > 0)
THEN
179 global%nRequests = global%nRequests + 1
180 sndpeuleccell%iRequest = global%nRequests
181 ALLOCATE( sndpeuleccell%buff(sndpeuleccell%nCells*ncv), &
183 global%error = errorflag
184 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
186 IF (rcvpeuleccell%nCells > 0)
THEN
187 rcvpeuleccell%iRequest = -999999
188 ALLOCATE( rcvpeuleccell%buff(rcvpeuleccell%nCells*ncv), &
190 global%error = errorflag
191 IF (global%error /= 0) CALL
errorstop( global,err_allocate,__line__ )
subroutine registerfunction(global, funName, fileName)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)
subroutine peul_allocatedatabuffers(regions, iReg)