66 TYPE(t_region
),
POINTER :: regions(:)
71 INTEGER :: ilev, ipatch
74 CHARACTER(CHRLEN) :: rcsidentstring
76 INTEGER :: bctype, errorflag, iregdes, lbound, n1, n2, naiv, narv, &
77 nbuffi, nbuffr,nbuffsizei, nbuffsizer, nbuffsizetot, &
78 ncont, ncv, ndv, npatchsize, ntv
80 TYPE(t_patch),
POINTER :: ppatch
82 TYPE(t_plag),
POINTER :: pplag
87 rcsidentstring =
'$RCSfile: PLAG_AllocateDataBuffers.F90,v $ $Revision: 1.5 $'
89 global => regions(ireg)%global
92 'PLAG_AllocateDataBuffers.F90' )
94 IF ( global%myProcid == masterproc .AND. &
95 global%verbLevel > verbose_none )
THEN
96 WRITE(stdout,
'(A,3X,A)') solver_name,
'Allocating Data Buffers for PLAG...'
101 ncont = regions(ireg)%plagInput%nCont
102 nbuffsizetot = regions(ireg)%plagInput%nPclsBuffTot
106 DO ilev=1,regions(ireg)%nGridLevels
108 pplag => regions(ireg)%levels(ilev)%plag
119 nbuffr = 2*narv +4*ncv +ndv +ntv
121 DO ipatch=1,regions(ireg)%nPatches
123 ppatch => regions(ireg)%levels(ilev)%patches(ipatch)
124 bctype = ppatch%bcType
125 lbound = ppatch%lbound
126 iregdes = ppatch%srcRegion
128 n1 = abs(ppatch%l1end -ppatch%l1beg ) + 1
129 n2 = abs(ppatch%l2end -ppatch%l2beg ) + 1
132 pbuffplag => ppatch%bufferPlag
134 IF ( (bctype>=bc_regionconf .AND. bctype<=bc_regionconf+bc_range) .OR. &
135 (bctype>=bc_tra_peri .AND. bctype<=bc_tra_peri +bc_range) .OR. &
136 (bctype>=bc_rot_peri .AND. bctype<=bc_rot_peri +bc_range) )
THEN
138 pbuffplag%nBuffSizeTot = nbuffsizetot
142 ALLOCATE( pbuffplag%aiv(naiv,nbuffsizetot),stat=errorflag )
143 global%error = errorflag
144 IF (global%error /= err_none)
THEN
145 CALL
errorstop( global, err_allocate,__line__,
'pBuffPlag%aiv' )
148 ALLOCATE( pbuffplag%arv(narv,nbuffsizetot),stat=errorflag )
149 global%error = errorflag
150 IF (global%error /= err_none)
THEN
151 CALL
errorstop( global, err_allocate,__line__,
'pBuffPlag%arv' )
154 ALLOCATE( pbuffplag%cv(ncv,nbuffsizetot),stat=errorflag )
155 global%error = errorflag
156 IF (global%error /= err_none)
THEN
157 CALL
errorstop( global, err_allocate,__line__,
'pBuffPlag%cv' )
160 ALLOCATE( pbuffplag%dv(ndv,nbuffsizetot),stat=errorflag )
161 global%error = errorflag
162 IF (global%error /= err_none)
THEN
163 CALL
errorstop( global, err_allocate,__line__,
'pBuffPlag%dv' )
166 ALLOCATE( pbuffplag%tv(ntv,nbuffsizetot),stat=errorflag )
167 global%error = errorflag
168 IF (global%error /= err_none)
THEN
169 CALL
errorstop( global, err_allocate,__line__,
'pBuffPlag%tv' )
172 ALLOCATE( pbuffplag%aivOld(naiv,nbuffsizetot),stat=errorflag )
173 global%error = errorflag
174 IF (global%error /= err_none)
THEN
175 CALL
errorstop( global, err_allocate,__line__,
'pBuffPlag%aivOld' )
178 ALLOCATE( pbuffplag%arvOld(narv,nbuffsizetot),stat=errorflag )
179 global%error = errorflag
180 IF (global%error /= err_none)
THEN
181 CALL
errorstop( global, err_allocate,__line__,
'pBuffPlag%arvOld' )
184 ALLOCATE( pbuffplag%cvOld(ncv,nbuffsizetot),stat=errorflag )
185 global%error = errorflag
186 IF (global%error /= err_none)
THEN
187 CALL
errorstop( global, err_allocate,__line__,
'pBuffPlag%cvOld' )
190 ALLOCATE( pbuffplag%rhs(ncv,nbuffsizetot),stat=errorflag )
191 global%error = errorflag
192 IF (global%error /= err_none)
THEN
193 CALL
errorstop( global, err_allocate,__line__,
'pBuffPlag%rhs' )
196 ALLOCATE( pbuffplag%rhsSum(ncv,nbuffsizetot),stat=errorflag )
197 global%error = errorflag
198 IF (global%error /= err_none)
THEN
199 CALL
errorstop( global, err_allocate,__line__,
'pBuffPlag%rhsSum' )
204 pbuffplag%nBuffSize = 0
205 pbuffplag%nBuffSizeDes = 0
208 pbuffplag%arv = 0.0_rfreal
209 pbuffplag%cv = 0.0_rfreal
210 pbuffplag%dv = 0.0_rfreal
211 pbuffplag%tv = 0.0_rfreal
213 pbuffplag%aivOld = 0.0_rfreal
214 pbuffplag%arvOld = 0.0_rfreal
215 pbuffplag%cvOld = 0.0_rfreal
217 pbuffplag%rhs = 0.0_rfreal
218 pbuffplag%rhsSum = 0.0_rfreal
222 IF (regions(iregdes)%procid /= global%myProcid)
THEN
223 nbuffsizei = nbuffi *nbuffsizetot
224 nbuffsizer = nbuffr *nbuffsizetot
226 pbuffplag%nSendBuffTotI = nbuffsizei
227 pbuffplag%nSendBuffTotR = nbuffsizer
229 pbuffplag%nRecvBuffTotI = nbuffsizei
230 pbuffplag%nRecvBuffTotR = nbuffsizer
232 ALLOCATE( pbuffplag%sendBuffR(nbuffsizer),stat=errorflag )
233 global%error = errorflag
234 IF (global%error /= err_none)
THEN
235 CALL
errorstop( global, err_allocate,__line__,
'pBuffPlag%sendBuffR' )
238 ALLOCATE( pbuffplag%recvBuffR(nbuffsizer),stat=errorflag )
239 global%error = errorflag
240 IF (global%error /= err_none)
THEN
241 CALL
errorstop( global, err_allocate,__line__,
'pBuffPlag%recvBuffR' )
244 ALLOCATE( pbuffplag%sendBuffI(nbuffsizei),stat=errorflag )
245 global%error = errorflag
246 IF (global%error /= err_none)
THEN
247 CALL
errorstop( global, err_allocate,__line__,
'pBuffPlag%sendBuffI' )
250 ALLOCATE( pbuffplag%recvBuffI(nbuffsizei),stat=errorflag )
251 global%error = errorflag
252 IF (global%error /= err_none)
THEN
253 CALL
errorstop( global, err_allocate,__line__,
'pBuffPlag%recvBuffI' )
258 pbuffplag%sendBuffI = 0
259 pbuffplag%sendBuffR = 0.0_rfreal
261 pbuffplag%recvBuffI = 0
262 pbuffplag%recvBuffR = 0.0_rfreal
266 pplag%nRequests = pplag%nRequests + 1
267 pbuffplag%iRequest = pplag%nRequests
271 ELSE IF ((bctype>=bc_regionint .AND. bctype<=bc_regionint +bc_range) .OR. &
272 (bctype>=bc_regnonconf .AND. bctype<=bc_regnonconf+bc_range))
THEN
273 CALL
errorstop( global,err_unknown_bc,__line__ )
276 nullify(pbuffplag%aiv)
277 nullify(pbuffplag%arv)
278 nullify(pbuffplag%cv)
279 nullify(pbuffplag%dv)
280 nullify(pbuffplag%tv)
281 nullify(pbuffplag%rhs)
282 nullify(pbuffplag%rhsSum)
283 nullify(pbuffplag%aivOld)
284 nullify(pbuffplag%arvOld)
285 nullify(pbuffplag%cvOld)
286 nullify(pbuffplag%sendBuffR)
287 nullify(pbuffplag%sendBuffI)
288 nullify(pbuffplag%recvBuffR)
289 nullify(pbuffplag%recvBuffI)
301 ALLOCATE( pplag%requests(pplag%nRequests),stat=errorflag )
302 global%error = errorflag
303 IF (global%error /= err_none)
THEN
304 CALL
errorstop( global, err_allocate,__line__,
'pPlag%requests' )
309 ALLOCATE( pplag%requestsI(pplag%nRequests),stat=errorflag )
310 global%error = errorflag
311 IF (global%error /= err_none)
THEN
312 CALL
errorstop( global, err_allocate,__line__,
'pPlag%requestsI' )
317 ALLOCATE( pplag%requestsR(pplag%nRequests),stat=errorflag )
318 global%error = errorflag
319 IF (global%error /= err_none)
THEN
320 CALL
errorstop( global, err_allocate,__line__,
'pPlag%requestsR' )
subroutine plag_cecellsallocatedata(regions, iReg)
subroutine registerfunction(global, funName, fileName)
subroutine, public plag_rflo_createstatbuff(regions, iReg)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine plag_allocatedatabuffers(regions, iReg)
subroutine deregisterfunction(global)