58 TYPE(t_region
),
POINTER :: regions(:)
63 INTEGER :: ilev, ipatch
66 CHARACTER(CHRLEN) :: rcsidentstring
68 INTEGER :: bctype, errorflag, iregsrc, lbound, n1, n2, ncont, &
69 npatchsize, nbuffsizetot
71 TYPE(t_patch),
POINTER :: ppatch
77 rcsidentstring =
'$RCSfile: PLAG_DeallocateDataBuffers.F90,v $ $Revision: 1.4 $'
79 global => regions(ireg)%global
82 'PLAG_DeallocateDataBuffers.F90' )
86 nbuffsizetot = regions(ireg)%plagInput%nPclsBuffTot
90 DO ilev=1,regions(ireg)%nGridLevels
91 DO ipatch=1,regions(ireg)%nPatches
93 ppatch => regions(ireg)%levels(ilev)%patches(ipatch)
94 bctype = ppatch%bcType
95 lbound = ppatch%lbound
96 iregsrc = ppatch%srcRegion
98 n1 = abs(ppatch%l1end -ppatch%l1beg ) + 1
99 n2 = abs(ppatch%l2end -ppatch%l2beg ) + 1
102 IF ((bctype>=bc_regionconf .AND. bctype<=bc_regionconf+bc_range) .OR. &
103 (bctype>=bc_tra_peri .AND. bctype<=bc_tra_peri +bc_range) .OR. &
104 (bctype>=bc_rot_peri .AND. bctype<=bc_rot_peri +bc_range))
THEN
106 pbuffplag => ppatch%bufferPlag
108 pbuffplag%nBuffSizeTot = nbuffsizetot
112 IF (regions(iregsrc)%procid == global%myProcid)
THEN
113 DEALLOCATE( pbuffplag%aiv,stat=errorflag )
114 global%error = errorflag
115 IF (global%error /= err_none)
THEN
116 CALL
errorstop( global, err_deallocate,__line__,
'pBuffPlag%aiv' )
119 DEALLOCATE( pbuffplag%arv,stat=errorflag )
120 global%error = errorflag
121 IF (global%error /= err_none)
THEN
122 CALL
errorstop( global, err_deallocate,__line__,
'pBuffPlag%arv' )
125 DEALLOCATE( pbuffplag%cv,stat=errorflag )
126 global%error = errorflag
127 IF (global%error /= err_none)
THEN
128 CALL
errorstop( global, err_deallocate,__line__,
'pBuffPlag%cv' )
131 DEALLOCATE( pbuffplag%dv,stat=errorflag )
132 global%error = errorflag
133 IF (global%error /= err_none)
THEN
134 CALL
errorstop( global, err_deallocate,__line__,
'pBuffPlag%dv' )
137 DEALLOCATE( pbuffplag%tv,stat=errorflag )
138 global%error = errorflag
139 IF (global%error /= err_none)
THEN
140 CALL
errorstop( global, err_deallocate,__line__,
'pBuffPlag%tv' )
143 DEALLOCATE( pbuffplag%aivOld,stat=errorflag )
144 global%error = errorflag
145 IF (global%error /= err_none)
THEN
146 CALL
errorstop( global, err_deallocate,__line__,
'pBuffPlag%aivOld' )
149 DEALLOCATE( pbuffplag%arvOld,stat=errorflag )
150 global%error = errorflag
151 IF (global%error /= err_none)
THEN
152 CALL
errorstop( global, err_deallocate,__line__,
'pBuffPlag%arvOld' )
155 DEALLOCATE( pbuffplag%cvOld,stat=errorflag )
156 global%error = errorflag
157 IF (global%error /= err_none)
THEN
158 CALL
errorstop( global, err_deallocate,__line__,
'pBuffPlag%cvOld' )
160 DEALLOCATE( pbuffplag%rhs,stat=errorflag )
161 global%error = errorflag
162 IF (global%error /= err_none)
THEN
163 CALL
errorstop( global, err_deallocate,__line__,
'pBuffPlag%rhs' )
166 DEALLOCATE( pbuffplag%rhsSum,stat=errorflag )
167 global%error = errorflag
168 IF (global%error /= err_none)
THEN
169 CALL
errorstop( global, err_deallocate,__line__,
'pBuffPlag%rhsSum' )
176 IF (regions(iregsrc)%procid /= global%myProcid)
THEN
178 DEALLOCATE( pbuffplag%sendBuffR,stat=errorflag )
179 global%error = errorflag
180 IF (global%error /= err_none)
THEN
181 CALL
errorstop( global, err_deallocate,__line__,
'pBuffPlag%sendBuffR' )
184 DEALLOCATE( pbuffplag%recvBuffR,stat=errorflag )
185 global%error = errorflag
186 IF (global%error /= err_none)
THEN
187 CALL
errorstop( global, err_deallocate,__line__,
'pBuffPlag%recvBuffR' )
190 DEALLOCATE( pbuffplag%sendBuffI,stat=errorflag )
191 global%error = errorflag
192 IF (global%error /= err_none)
THEN
193 CALL
errorstop( global, err_deallocate,__line__,
'pBuffPlag%sendBuffI' )
196 DEALLOCATE( pbuffplag%recvBuffI,stat=errorflag )
197 global%error = errorflag
198 IF (global%error /= err_none)
THEN
199 CALL
errorstop( global, err_deallocate,__line__,
'pBuffPlag%recvBuffI' )
204 ELSE IF ((bctype>=bc_regionint .AND. bctype<=bc_regionint +bc_range) .OR. &
205 (bctype>=bc_regnonconf .AND. bctype<=bc_regnonconf+bc_range))
THEN
206 CALL
errorstop( global,err_unknown_bc,__line__ )
subroutine registerfunction(global, funName, fileName)
subroutine plag_deallocatedatabuffers(regions, iReg)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)