58 TYPE (t_region
),
INTENT(INOUT) :: region
61 INTEGER :: iinrt,iedge,inod,iplag,ipeul,ipeuloutedge
64 CHARACTER(CHRLEN) :: rcsidentstring
66 LOGICAL :: errorflag,maxconedgesfound,maxdisedgesfound
68 INTEGER :: nplag,npeul,nnodes,nusednodes,npeuloutedges,npeuloxedges
69 INTEGER :: ind,indmixt,indplag0,indpeul0,indintl,indplagjoint,indpeulox
70 INTEGER :: indplagvapor,loclactdiff,maxconedges,maxdisedges,globactdiff
73 REAL(RFREAL) :: outmass,coef
82 rcsidentstring =
'$RCSfile: INRT_CheckUserInput.F90,v $ $Revision: 1.5 $'
84 global => region%global
87 'INRT_CheckUserInput.F90' )
91 IF (inrt_perm_pmass - inrt_perm_block /= 1 .OR. &
92 inrt_perm_pmome - inrt_perm_pmass /= 1 .OR. &
93 inrt_perm_pall - inrt_perm_pmome /= 1) &
94 CALL
errorstop( global,err_inrt_parameter,__line__ )
96 input => region%inrtInput
98 IF (.NOT.
input%defaultRead) &
99 CALL
errorstop( global,err_inrt_defunread,__line__ )
103 nnodes =
input%nNodes
105 indmixt =
input%indMixt
106 indplag0 =
input%indPlag0
107 indpeul0 =
input%indPeul0
108 indintl =
input%indIntl
110 indplagjoint =
input%indPlagJoint
111 indplagvapor =
input%indPlagVapor
113 maxconedges =
input%maxConEdges
114 maxdisedges =
input%maxDisEdges
115 maxconedgesfound = .false.
116 maxdisedgesfound = .false.
124 IF (
ASSOCIATED(
input%globActiveness))
THEN
125 IF (ubound(
input%globActiveness,1) /= nnodes) errorflag = .true.
127 IF (nnodes /= 0) errorflag = .true.
130 IF (
ASSOCIATED(
input%globPermission))
THEN
131 IF (ubound(
input%globPermission,1) /= nnodes) errorflag = .true.
133 IF (nnodes /= 0) errorflag = .true.
136 IF (
ASSOCIATED(
input%inrts))
THEN
137 IF (ubound(
input%inrts,1) /= inrt_type_total) errorflag = .true.
139 IF (inrt_type_total /= 0) errorflag = .true.
142 IF (errorflag) CALL
errorstop( global,err_inrt_allocrange,__line__ )
146 DO ind = indpeul0+1,indpeul0+npeul
147 IF (
input%globActiveness(ind) == inrt_act_active)
THEN
148 CALL
errorstop( global,err_inrt_badactv,__line__, &
149 'Active smoke not implemented for Rocflo' )
156 DO ind = indpeul0+1,indpeul0+npeul
157 IF (
input%globActiveness(ind) == inrt_act_active)
THEN
158 CALL
errorstop( global,err_inrt_badactv,__line__, &
159 'Active species not implemented for Rocflu' )
168 IF (indplagjoint < indplag0+1 .OR. indplagjoint > indplag0+nplag) &
169 CALL
errorstop( global,err_inrt_indexrange,__line__ )
175 IF (indplagvapor /= indplag0+nplag+1) &
176 CALL
errorstop( global,err_inrt_indexrange,__line__ )
178 DO iinrt = 1,inrt_type_total
180 inrt =>
input%inrts(iinrt)
182 IF (
ASSOCIATED(inrt%switches))
THEN
183 IF (ubound(inrt%switches,1) /= inrt%nSwitches) errorflag = .true.
185 IF (inrt%nSwitches /= 0) errorflag = .true.
188 IF (
ASSOCIATED(inrt%data))
THEN
189 IF (ubound(inrt%data,1) /= inrt%nData) errorflag = .true.
191 IF (inrt%nData /= 0) errorflag = .true.
194 IF (
ASSOCIATED(inrt%activeness))
THEN
195 IF (ubound(inrt%activeness,1) /= nnodes) errorflag = .true.
197 IF (nnodes /= 0) errorflag = .true.
200 IF (
ASSOCIATED(inrt%permission))
THEN
201 IF (ubound(inrt%permission,1) /= nnodes) errorflag = .true.
203 IF (nnodes /= 0) errorflag = .true.
206 IF (
ASSOCIATED(inrt%edges))
THEN
207 IF (ubound(inrt%edges,1) /= inrt%nEdges) errorflag = .true.
209 IF (inrt%nEdges /= 0) errorflag = .true.
212 IF (errorflag) CALL
errorstop( global,err_inrt_allocrange,__line__ )
214 IF (.NOT. inrt%used) cycle
218 IF (inrt%pclsUsed)
THEN
219 IF (inrt%nEdges > maxdisedges)
THEN
220 CALL
errorstop( global,err_illegal_value,__line__, &
221 'Number of Edges more than maximal number of Edges')
222 ELSE IF (inrt%nEdges == maxdisedges)
THEN
223 maxdisedgesfound = .true.
226 IF (inrt%nEdges > maxconedges)
THEN
227 CALL
errorstop( global,err_illegal_value,__line__, &
228 'Number of Edges more than maximal number of Edges')
229 ELSE IF (inrt%nEdges == maxconedges)
THEN
230 maxconedgesfound = .true.
236 IF (inrt%nIntl < 0 .OR. inrt%nIntl > 1) &
237 CALL
errorstop( global,err_inrt_nintl,__line__ )
241 IF (inrt%nIntl == 1)
THEN
245 IF (inrt%permission(indintl) /= inrt_perm_pall) &
246 CALL
errorstop( global,err_inrt_permlevintl,__line__ )
250 IF (inrt%nInputEdges <= 0 .OR. inrt%nInputEdges >= inrt%nEdges) &
251 CALL
errorstop( global,err_inrt_ninputedges,__line__ )
253 DO iedge = 1,inrt%nInputEdges
255 edge => inrt%edges(iedge)
259 IF (edge%iNode(1) == indintl .OR. edge%iNode(2) /= indintl) &
260 CALL
errorstop( global,err_inrt_connectintl,__line__ )
264 IF (edge%tEdge == inrt_edge_mome_dum .OR. &
265 edge%tEdge == inrt_edge_mass_gho)
THEN
267 IF (edge%token(2) /= inrt_perm_block) &
268 CALL
errorstop( global,err_inrt_permintl,__line__ )
272 IF (edge%token(2) /= inrt_perm_pall) &
273 CALL
errorstop( global,err_inrt_permintl,__line__ )
279 DO iedge = inrt%nInputEdges+1,inrt%nEdges
281 edge => inrt%edges(iedge)
285 IF (edge%iNode(1) /= indintl .OR. edge%iNode(2) == indintl) &
286 CALL
errorstop( global,err_inrt_connectintl,__line__ )
290 IF (edge%token(1) /= inrt_perm_block) &
291 CALL
errorstop( global,err_inrt_permintl,__line__ )
297 nusednodes = nnodes - 1 + inrt%nIntl
299 DO inod = 1,nusednodes
303 IF (inrt%activeness(inod) > inrt_act_active) &
304 CALL
errorstop( global,err_inrt_badactv,__line__ )
309 IF ( inod /= indintl .AND. &
310 (inod <= indplag0+1 .OR. inod > indplag0+nplag+1) )
THEN
312 IF (inrt%activeness(inod) == inrt_act_active .NEQV. &
313 input%globActiveness(inod) == inrt_act_active)
THEN
315 IF (
input%globActiveness(inod) == inrt_act_active)
THEN
316 IF (global%myProcid==masterproc .AND. iwrite==1) &
317 WRITE(stdout,1030) solver_name//
'### INRT_WARNING: Node has '// &
318 'been changed from active to passive for '//trim(inrt%name)
320 IF (global%myProcid==masterproc .AND. iwrite==1) &
321 WRITE(stdout,1030) solver_name//
'### INRT_WARNING: Node has '// &
322 'been changed from passive to active for '//trim(inrt%name)
325 IF (global%myProcid==masterproc .AND. iwrite==1) &
326 WRITE(stdout,1040) solver_name//
'### INRT_WARNING: '// &
329 IF (
input%consistent)
THEN
330 IF (global%myProcid==masterproc .AND. iwrite==1) &
332 solver_name//
'### INRT_WARNING: *** Consistency ruined! ***'
334 input%consistent = .false.
343 IF (inrt%permission(inod) < inrt_perm_block .OR. &
344 inrt%permission(inod) > inrt_perm_pall) &
345 CALL
errorstop( global,err_inrt_badperm,__line__ )
349 IF (inrt%activeness(inod) == inrt_act_active .AND. &
350 inrt%permission(inod) /= inrt_perm_pall)
THEN
352 IF (global%myProcid==masterproc .AND. iwrite==1 ) &
353 WRITE(stdout,1030) solver_name//
'### INRT_WARNING: Permission '// &
354 'restricted for '//trim(inrt%name)
355 IF (global%myProcid==masterproc .AND. iwrite==1 ) &
356 WRITE(stdout,1040) solver_name//
'### INRT_WARNING: on (active) '// &
359 IF (
input%consistent)
THEN
360 IF (global%myProcid==masterproc .AND. iwrite==1 ) &
362 solver_name//
'### INRT_WARNING: *** Consistency ruined! ***'
364 input%consistent = .false.
375 IF (inrt%activeness(indplag0+iplag) /= inrt%activeness(indplag0+1)) &
376 CALL
errorstop( global,err_inrt_actvplag,__line__ )
384 CASE (inrt_type_burning)
387 IF (inrt%switches(inrt_swi_burning_oxused) /= 0)
THEN
393 indpeulox = inrt%edges(inrt_burning_s_mass_x0 + npeuloxedges)%iNode(1)
397 IF (indpeulox < indpeul0 + 1 .OR. indpeulox > indpeul0 + npeul) &
398 CALL
errorstop( global,err_inrt_indexrange,__line__ )
402 IF (
input%globActiveness(indpeulox) >=
input%globActiveness(indmixt)) &
403 CALL
errorstop( global,err_inrt_ox_actv,__line__ )
407 IF (inrt%activeness(indintl) == inrt_act_active)
THEN
411 IF (inrt%activeness(indmixt) /= inrt_act_active .OR. &
412 inrt%activeness(indplag0+1) /= inrt_act_active) &
413 CALL
errorstop( global,err_inrt_burning1,__line__ )
418 npeuloutedges = inrt%nEdges - npeuloxedges - inrt_burning_nedges0
420 DO ipeuloutedge = 1,npeuloutedges
422 iedge = inrt_burning_x_mass_s0 + npeuloxedges + ipeuloutedge
424 ipeul = inrt%edges(iedge)%iNode(2) - indpeul0
426 IF (ipeul < 1 .OR. ipeul > npeul) &
427 CALL
errorstop( global,err_inrt_indexrange,__line__ )
429 IF (inrt%activeness(indpeul0+ipeul) == inrt_act_active)
THEN
431 ind = inrt_dat_burning_mfrc_peul0 + ipeuloutedge
433 outmass = outmass + inrt%data(ind)
439 coef = inrt%data(inrt_dat_burning_mfrc_plag)
440 outmass = coef + (1._rfreal - coef)*outmass
444 IF (global%myProcid==masterproc .AND. iwrite==1) &
445 WRITE(stdout,1030) solver_name//
'### INRT_WARNING: active output '// &
446 'mass for '//trim(inrt%name)
447 IF (global%myProcid==masterproc .AND. iwrite==1) &
448 WRITE(stdout,1050) solver_name//
'### INRT_WARNING: sums not '// &
449 'to 1, but to',outmass
451 IF (
input%consistent)
THEN
452 IF (global%myProcid==masterproc .AND. iwrite==1) &
454 solver_name//
'### INRT_WARNING: *** Consistency ruined! ***'
456 input%consistent = .false.
468 IF (maxconedges > 0 .AND. .NOT.maxconedgesfound)
THEN
469 CALL
errorstop( global,err_illegal_value,__line__, &
470 'Inconsistency in maximal number of Edges')
473 IF (maxdisedges > 0 .AND. .NOT.maxdisedgesfound)
THEN
474 CALL
errorstop( global,err_illegal_value,__line__, &
475 'Inconsistency in maximal number of Edges')
484 1050
FORMAT(
a,es14.6)
subroutine registerfunction(global, funName, fileName)
subroutine input(X, NNODE, NDC, NCELL, NFCE, NBPTS, NBFACE, ITYP, NPROP, XBNDY, XFAR, YFAR, ZFAR)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)