63 CHARACTER(CHRLEN) :: &
64 RCSIdentString =
'$RCSfile: PLAG_ModCheckVars.F90,v $ $Revision: 1.7 $'
105 TYPE(t_region
),
POINTER :: pregion
111 CHARACTER(CHRLEN) :: rcsidentstring
113 INTEGER,
PARAMETER :: max_negative_locs = 10
114 INTEGER :: icg,idini,ipcl,nlocs,npcls,regini,stat
118 INTEGER :: loc(max_negative_locs,min_val:max_val)
119 INTEGER,
DIMENSION(:,:),
POINTER :: paiv
121 REAL(RFREAL) :: diam,ener,mass,temp,xpos,ypos,zpos
122 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: pcv,pdv
125 TYPE(t_plag),
POINTER :: pplag
131 global => pregion%global
134 'PLAG_ModCheckVars.F90')
141 ilev = pregion%currLevel
142 pplag => pregion%levels(ilev)%plag
146 pplag => pregion%plag
161 mass =
sum( pcv(pplag%cvPlagMass(:),ipcl) )
162 ener = pcv(cv_plag_ener,ipcl)
163 diam = pdv(dv_plag_diam,ipcl)
164 temp = pdv(dv_plag_temp,ipcl)
165 xpos = pcv(cv_plag_xpos,ipcl)
166 ypos = pcv(cv_plag_ypos,ipcl)
167 zpos = pcv(cv_plag_zpos,ipcl)
169 icg = paiv(aiv_plag_icells,ipcl)
170 idini = paiv(aiv_plag_pidini,ipcl)
171 regini = paiv(aiv_plag_regini,ipcl)
172 stat = paiv(aiv_plag_status,ipcl)
174 IF ( stat /= plag_status_keep) cycle
176 IF ( (mass <= 0.0_rfreal) .OR. (ener <= 0.0_rfreal) )
THEN
179 IF ( nlocs == 1 )
THEN
180 WRITE(stdout,
'(A,1X,A)') solver_name, &
181 'Negative positive-definite variables detected!'
182 WRITE(stdout,
'(A,3X,A)') solver_name,
'Module: Lagrangian Particle (PLAG).'
184 WRITE(stdout,
'(A,3X,A,1X,1PE12.5)') solver_name,
'Current time:', &
187 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
188 pregion%iRegionGlobal
189 WRITE(stdout,
'(A,6X,A,11(1X,A))') solver_name,
'#', &
202 IF ( nlocs <= max_negative_locs )
THEN
203 WRITE(stdout,
'(A,4X,4(1X,I8),6(1X,E13.6))') solver_name,ipcl, &
205 mass,xpos,ypos,zpos, &
207 loc(nlocs,min_val:max_val) = ipcl
216 IF ( nlocs > 0 )
THEN
217 IF ( nlocs > max_negative_locs )
THEN
218 WRITE(stdout,
'(A,3X,A,1X,I3,1X,A,1X,I9,1X,A)') solver_name, &
219 'Only wrote the first',max_negative_locs,
'of',nlocs, &
220 'particles with negative positive-definite variables.'
223 CALL
errorstop(global,err_negative_posdef,__line__)
267 TYPE(t_region
),
POINTER :: pregion
273 CHARACTER(CHRLEN) :: rcsidentstring
274 INTEGER,
PARAMETER :: max_invalid_locs = 10
275 INTEGER :: icg,idini,ipcl,nlocs,npcls,regini,stat
279 INTEGER :: loc(max_invalid_locs,min_val:max_val)
280 INTEGER,
DIMENSION(:,:),
POINTER :: paiv
282 REAL(RFREAL) :: diam,ener,mass,temp,xmom,xpos,ymom,ypos,zmom,zpos
283 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: pcv,pdv
286 TYPE(t_plag),
POINTER :: pplag
292 global => pregion%global
295 'PLAG_ModCheckVars.F90')
302 ilev = pregion%currLevel
303 pplag => pregion%levels(ilev)%plag
307 pplag => pregion%plag
322 mass =
sum( pcv(pplag%cvPlagMass(:),ipcl) )
323 xmom = pcv(cv_plag_xmom,ipcl)
324 ymom = pcv(cv_plag_ymom,ipcl)
325 zmom = pcv(cv_plag_zmom,ipcl)
326 ener = pcv(cv_plag_ener,ipcl)
327 diam = pdv(dv_plag_diam,ipcl)
328 temp = pdv(dv_plag_temp,ipcl)
329 xpos = pcv(cv_plag_xpos,ipcl)
330 ypos = pcv(cv_plag_ypos,ipcl)
331 zpos = pcv(cv_plag_zpos,ipcl)
333 icg = paiv(aiv_plag_icells,ipcl)
334 idini = paiv(aiv_plag_pidini,ipcl)
335 regini = paiv(aiv_plag_regini,ipcl)
336 stat = paiv(aiv_plag_status,ipcl)
338 IF ( stat /= plag_status_keep) cycle
340 IF ( (
isnan(mass) .EQV. .true.) .OR. &
341 (
isnan(xmom) .EQV. .true.) .OR. &
342 (
isnan(ymom) .EQV. .true.) .OR. &
343 (
isnan(zmom) .EQV. .true.) .OR. &
344 (
isnan(ener) .EQV. .true.) .OR. &
345 (
isnan(xpos) .EQV. .true.) .OR. &
346 (
isnan(ypos) .EQV. .true.) .OR. &
347 (
isnan(zpos) .EQV. .true.) .OR. &
348 (
isnan(diam) .EQV. .true.) .OR. &
349 (
isnan(temp) .EQV. .true.) )
THEN
352 IF ( nlocs == 1 )
THEN
353 WRITE(stdout,
'(A,1X,A,1X,I9)') solver_name, &
354 'Invalid variables detected!'
355 WRITE(stdout,
'(A,3X,A)') solver_name,
'Module: Lagrangian Particle (PLAG).'
356 WRITE(stdout,
'(A,3X,A,1X,1PE12.5)') solver_name,
'Current time:', &
359 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
360 pregion%iRegionGlobal
361 WRITE(stdout,
'(A,6X,A,11(1X,A))') solver_name,
'#', &
374 IF ( nlocs <= max_invalid_locs )
THEN
375 WRITE(stdout,
'(A,4X,4(1X,I8),6(1X,E13.6))') solver_name,ipcl, &
377 mass,xpos,ypos,zpos, &
379 loc(nlocs,min_val:max_val) = ipcl
388 IF ( nlocs > 0 )
THEN
389 IF ( nlocs > max_invalid_locs )
THEN
390 WRITE(stdout,
'(A,3X,A,1X,I3,1X,A,1X,I9,1X,A)') solver_name, &
391 'Only wrote the first',max_invalid_locs,
'of',nlocs, &
392 'particles with invalid variables.'
395 CALL
errorstop(global,err_invalid_value,__line__)
Tfloat sum() const
Return the sum of all the pixel values in an image.
subroutine registerfunction(global, funName, fileName)
subroutine, public plag_checkpositivity(pRegion)
subroutine, public plag_checkvalidity(pRegion)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)