Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
INRT_PrintUserInput.F90
Go to the documentation of this file.
1 ! *********************************************************************
2 ! * Rocstar Simulation Suite *
3 ! * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4 ! * *
5 ! * Illinois Rocstar LLC *
6 ! * Champaign, IL *
7 ! * www.illinoisrocstar.com *
8 ! * sales@illinoisrocstar.com *
9 ! * *
10 ! * License: See LICENSE file in top level of distribution package or *
11 ! * http://opensource.org/licenses/NCSA *
12 ! *********************************************************************
13 ! *********************************************************************
14 ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15 ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16 ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17 ! * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18 ! * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19 ! * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20 ! * Arising FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21 ! * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22 ! *********************************************************************
23 !******************************************************************************
24 !
25 ! Purpose: write out user input for interactions for checking purposes.
26 !
27 ! Description: none.
28 !
29 ! Input: regions = user input.
30 !
31 ! Output: to standard output.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: INRT_PrintUserInput.F90,v 1.3 2008/12/06 08:44:31 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2003 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE inrt_printuserinput( region ) ! PUBLIC
44 
45  USE moddatatypes
46  USE moddatastruct, ONLY : t_region
47  USE modglobal, ONLY : t_global
48  USE modinteract
49  USE moderror
50  USE modparameters
52 
54  IMPLICIT NONE
55 
56 ! ... parameters
57  TYPE(t_region), INTENT(IN) :: region
58 
59 ! ... loop variables
60  INTEGER :: iinrt,inod,ipeul,iswi,idat,iedge
61 
62 ! ... local variables
63  CHARACTER(CHRLEN) :: rcsidentstring
64  CHARACTER(10) :: peulstr(100),plagstr(100),tempstr
65  CHARACTER(256) :: edgestr
66 
67  INTEGER :: nnodes,nplag,npeul,ninrt,indmixt,indplag0,indpeul0,indintl
68  INTEGER :: indplagvapor,maxconedges,maxdisedges
69 
70  TYPE(t_inrt_input), POINTER :: input
71  TYPE(t_inrt_interact), POINTER :: inrt
72  TYPE(t_inrt_edge), POINTER :: edge
73  TYPE(t_global), POINTER :: global
74 
75 !******************************************************************************
76 
77  rcsidentstring = '$RCSfile: INRT_PrintUserInput.F90,v $ $Revision: 1.3 $'
78 
79  global => region%global
80 
81  CALL registerfunction( global,'INRT_PrintUserInput',&
82  'INRT_PrintUserInput.F90' )
83 
84 ! begin -----------------------------------------------------------------------
85 
86  input => region%inrtInput
87 
88  nnodes = input%nNodes
89  nplag = input%nPlag
90  npeul = input%nPeul
91  indmixt = input%indMixt
92  indplag0 = input%indPlag0
93  indpeul0 = input%indPeul0
94  indintl = input%indIntl
95  indplagvapor = input%indPlagVapor
96  maxconedges = input%maxConEdges
97  maxdisedges = input%maxDisEdges
98 
99 ! Determine total number of interactions used
100 
101  ninrt = 0
102  DO iinrt = 1,inrt_type_total
103  IF (input%inrts(iinrt)%used) ninrt = ninrt + 1
104  END DO ! iInrt
105 
106 ! Make auxillary strings (used in the internal function nodeStr)
107 
108  CALL makenumberedkeys(plagstr,1,'L',1,nplag,1)
109  CALL makenumberedkeys(peulstr,1,'S',1,npeul,1)
110 
111  IF (ninrt > 0) WRITE(stdout,*)
112  WRITE(stdout,1010) solver_name//' Number of interactions',ninrt
113 
114  IF (ninrt > 0) THEN
115 
116  WRITE(stdout,*)
117  WRITE(stdout,1030) solver_name//' *** Indexing ***'
118  WRITE(stdout,1010) solver_name//' nNodes ', nnodes
119  WRITE(stdout,1010) solver_name//' nPlag ', nplag
120  WRITE(stdout,1010) solver_name//' nPeul ', npeul
121  WRITE(stdout,1010) solver_name//' indMixt ', indmixt
122  WRITE(stdout,1010) solver_name//' indPlag0 ', indplag0
123  WRITE(stdout,1010) solver_name//' indPeul0 ', indpeul0
124  WRITE(stdout,1010) solver_name//' indIntl ', indintl
125  WRITE(stdout,1010) solver_name//' indPlagJoint', input%indPlagJoint
126  WRITE(stdout,1010) solver_name//' indPlagVapor', indplagvapor
127  WRITE(stdout,1010) solver_name//' maxConEdges ', maxconedges
128  WRITE(stdout,1010) solver_name//' maxDisEdges ', maxdisedges
129  WRITE(stdout,*)
130 
131  IF (input%consistent) THEN
132  WRITE(stdout,1030) solver_name//' *** Active Phases '// &
133  'Consistent ***'
134  ELSE
135  WRITE(stdout,1030) solver_name//' *** WARNING: Active Phases '// &
136  'Inconsistent ***'
137  END IF ! input%consistent
138  WRITE(stdout,*)
139 
140  WRITE(stdout,1030) solver_name//' *** Global Activeness ***'
141 
142  DO inod = 1,nnodes-1
143  WRITE(stdout,3010) solver_name//' '//trim(nodestr(inod)), &
144  input%globActiveness(inod),' '// &
145  trim(fullactvstr(input%globActiveness(inod)))
146  END DO ! iNod
147  WRITE(stdout,*)
148 
149  WRITE(stdout,1030) solver_name//' *** Global Permission levels ***'
150 
151  DO inod = 1,nnodes-1
152  WRITE(stdout,3010) solver_name//' '//trim(nodestr(inod)), &
153  input%globPermission(inod),' '// &
154  trim(fullpermstr(input%globPermission(inod)))
155  END DO ! iNod
156  WRITE(stdout,*)
157 
158  END IF ! nInrt
159 
160  DO iinrt = 1,inrt_type_total
161 
162  inrt => input%inrts(iinrt)
163  IF (.NOT. inrt%used) cycle
164 
165  WRITE(stdout,1010) solver_name//' *** Interaction',iinrt
166 
167  WRITE(stdout,1030) solver_name//' name = '//trim(inrt%name)
168  WRITE(stdout,1025) solver_name//' pclsUsed ',inrt%pclsUsed
169  WRITE(stdout,1015) solver_name//' order ',inrt%order
170  WRITE(stdout,1010) solver_name//' nIntl ',inrt%nIntl
171  WRITE(stdout,1010) solver_name//' nInputEdges ',inrt%nInputEdges
172  WRITE(stdout,1010) solver_name//' nSwitches ',inrt%nSwitches
173  WRITE(stdout,1010) solver_name//' nData ',inrt%nData
174  WRITE(stdout,1010) solver_name//' nEdges ',inrt%nEdges
175 
176  DO iswi = 1,inrt%nSwitches
177  WRITE(stdout,2010) solver_name//' Switch',iswi, &
178  inrt%switches(iswi)
179  END DO ! iSwi
180 
181  DO idat = 1,inrt%nData
182  WRITE(stdout,2020) solver_name//' Data ',idat,inrt%data(idat)
183  END DO ! iDat
184 
185  DO inod = 1,nnodes-1
186 
187  IF (inrt%activeness(inod) /= input%globActiveness(inod)) THEN
188  WRITE(stdout,3010) solver_name//' Activeness override: '// &
189  trim(nodestr(inod)), inrt%activeness(inod),' '// &
190  trim(fullactvstr(inrt%activeness(inod)))
191  END IF ! inrt%activeness(iNod)
192 
193  IF (inrt%permission(inod) /= input%globPermission(inod)) THEN
194  WRITE(stdout,3010) solver_name//' Permission override: '// &
195  trim(nodestr(inod)), inrt%permission(inod),' '// &
196  trim(fullpermstr(inrt%permission(inod)))
197  END IF ! inrt%permission(iNod)
198 
199  END DO ! iNod
200 
201  IF (inrt%nIntl > 0) THEN
202 
203  WRITE(stdout,3010) solver_name//' Internal Activeness: '// &
204  trim(nodestr(indintl)), inrt%activeness(indintl),' '// &
205  trim(fullactvstr(inrt%activeness(indintl)))
206 
207  END IF ! inrt%nIntl
208 
209  DO iedge = 1,inrt%nEdges
210 
211  edge => inrt%edges(iedge)
212 
213  edgestr = trim(nodestr(edge%iNode(1)))//' '//permstr(edge%token(1))// &
214  '-----'//tedgestr(edge%tEdge)//'----'//permstr(edge%token(2))
215 
216  tempstr = trim(nodestr(edge%iNode(2)))
217 
218  IF (tempstr(1:1) == ' ') THEN
219  edgestr = trim(edgestr)//trim(tempstr)
220  ELSE
221  edgestr = trim(edgestr)//' '//trim(tempstr)
222  END IF
223 
224  WRITE(stdout,1030) solver_name//' '//trim(edgestr)
225 
226  END DO ! iEdge
227 
228  WRITE(stdout,*)
229 
230  END DO ! iInrt
231 
232 ! finalize --------------------------------------------------------------------
233 
234  CALL deregisterfunction( global )
235 
236 1010 FORMAT(a,' =',i3)
237 1015 FORMAT(a,' =',i9)
238 1025 FORMAT(a,' = ',l1)
239 1030 FORMAT(a)
240 2010 FORMAT(a,i2,' =',i3)
241 2020 FORMAT(a,i2,' =',es13.5)
242 3010 FORMAT(a,':',i3,a)
243 
244 CONTAINS
245 
246  CHARACTER(13) FUNCTION defstr(eq)
247 
248  LOGICAL, INTENT(IN) :: eq
249 
250  IF (eq) THEN
251  defstr = '(default) '
252  ELSE
253  defstr = '(non-default)'
254  END IF ! eq
255 
256  END FUNCTION defstr
257 
258  CHARACTER(10) FUNCTION nodestr(ind)
259 
260  INTEGER, INTENT(IN) :: ind
261 
262  IF (ind == indmixt) THEN
263  nodestr = ' G'
264 
265  ELSE IF (indplag0 + 1 <= ind .AND. ind <= indplag0 + nplag) THEN
266  nodestr = trim(plagstr(ind - indplag0))
267 
268  ELSE IF (indplagvapor == ind) THEN
269  nodestr = 'LV'
270 
271  ELSE IF (indpeul0 + 1 <= ind .AND. ind <= indpeul0 + npeul) THEN
272  nodestr = trim(peulstr(ind - indpeul0))
273 
274  ELSE IF (ind == indintl) THEN
275  nodestr = ' X'
276 
277  ELSE
278  CALL errorstop( global,err_reached_default,__line__ )
279 
280  END IF ! ind
281 
282  END FUNCTION nodestr
283 
284  CHARACTER(1) FUNCTION permstr(perm)
285 
286  INTEGER, INTENT(IN) :: perm
287 
288  SELECT CASE (perm)
289 
290  CASE (inrt_perm_block)
291  permstr = 'x'
292 
293  CASE (inrt_perm_pmass)
294  permstr = 'm'
295 
296  CASE (inrt_perm_pmome)
297  permstr = 'o'
298 
299  CASE (inrt_perm_pall)
300  permstr = '-'
301 
302  CASE default
303  CALL errorstop( global,err_reached_default,__line__ )
304 
305  END SELECT ! perm
306 
307  END FUNCTION permstr
308 
309  CHARACTER(5) FUNCTION tedgestr(tEdge)
310 
311  INTEGER, INTENT(IN) :: tedge
312 
313  SELECT CASE (tedge)
314 
315  CASE (inrt_edge_bad)
316  tedgestr = 'ERROR'
317 
318  CASE (inrt_edge_mass)
319  tedgestr = 'MASS-'
320 
321  CASE (inrt_edge_mome_dum)
322  tedgestr = 'DUMMY'
323 
324  CASE (inrt_edge_mome)
325  tedgestr = 'MOME-'
326 
327  CASE (inrt_edge_ener)
328  tedgestr = 'ENER-'
329 
330  CASE (inrt_edge_mass_gho)
331  tedgestr = 'GMASS'
332 
333  CASE default
334  CALL errorstop( global,err_reached_default,__line__ )
335 
336  END SELECT ! tEdge
337 
338  END FUNCTION tedgestr
339 
340  CHARACTER(20) FUNCTION fullactvstr(actv)
341 
342  INTEGER, INTENT(IN) :: actv
343 
344  SELECT CASE (actv)
345 
346  CASE (inrt_act_active)
347  fullactvstr = '(active)'
348 
349  CASE (inrt_act_active-1)
350  fullactvstr = '(passive)'
351 
352  CASE (:inrt_act_active-2)
353  fullactvstr = '(very passive)'
354 
355  CASE default
356  fullactvstr = '(Error!)'
357 
358  END SELECT ! actv
359 
360  END FUNCTION fullactvstr
361 
362  CHARACTER(40) FUNCTION fullpermstr(perm)
363 
364  INTEGER, INTENT(IN) :: perm
365 
366  SELECT CASE (perm)
367 
368  CASE (inrt_perm_block)
369  fullpermstr = '(permit nothing)'
370 
371  CASE (inrt_perm_pmass)
372  fullpermstr = '(permit mass only)'
373 
374  CASE (inrt_perm_pmome)
375  fullpermstr = '(permit mass and momentum only)'
376 
377  CASE (inrt_perm_pall)
378  fullpermstr = '(permit all)'
379 
380  CASE default
381  fullpermstr = '(Error!)'
382 
383  END SELECT ! perm
384 
385  END FUNCTION fullpermstr
386 
387 END SUBROUTINE inrt_printuserinput
388 
389 !******************************************************************************
390 !
391 ! RCS Revision history:
392 !
393 ! $Log: INRT_PrintUserInput.F90,v $
394 ! Revision 1.3 2008/12/06 08:44:31 mtcampbe
395 ! Updated license.
396 !
397 ! Revision 1.2 2008/11/19 22:17:44 mtcampbe
398 ! Added Illinois Open Source License/Copyright
399 !
400 ! Revision 1.1 2004/12/01 21:56:30 fnajjar
401 ! Initial revision after changing case
402 !
403 ! Revision 1.11 2004/07/28 15:42:12 jferry
404 ! deleted defunct constructs: useDetangle, useSmokeDrag, useSmokeHeatTransfer
405 !
406 ! Revision 1.10 2004/07/27 21:30:00 jferry
407 ! integrated maxConEdges and maxDisEdges variables more fully
408 !
409 ! Revision 1.9 2004/03/05 22:09:03 jferry
410 ! created global variables for peul, plag, and inrt use
411 !
412 ! Revision 1.8 2004/03/02 21:48:09 jferry
413 ! First phase of replacing Detangle interaction
414 !
415 ! Revision 1.7 2003/09/19 20:35:26 jferry
416 ! Implemented oxidizer species for burning interaction
417 !
418 ! Revision 1.6 2003/04/07 18:26:16 jferry
419 ! minor correction
420 !
421 ! Revision 1.5 2003/04/03 21:10:18 jferry
422 ! implemented additional safety checks for rocinteract
423 !
424 ! Revision 1.4 2003/04/02 22:32:04 jferry
425 ! codified Activeness and Permission structures for rocinteract
426 !
427 ! Revision 1.3 2003/03/24 23:30:52 jferry
428 ! overhauled rocinteract to allow interaction design to use user input
429 !
430 ! Revision 1.2 2003/03/11 16:09:39 jferry
431 ! Added comments
432 !
433 ! Revision 1.1 2003/03/04 22:12:35 jferry
434 ! Initial import of Rocinteract
435 !
436 !******************************************************************************
437 
438 
439 
440 
441 
442 
443 
subroutine makenumberedkeys(keys, indBegin, string, numBegin, numEnd, numSkip)
CHARACTER(40) function fullpermstr(perm)
CHARACTER(13) function defstr(eq)
CHARACTER(20) function fullactvstr(actv)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
CHARACTER(5) function tedgestr(tEdge)
CHARACTER(1) function permstr(perm)
subroutine input(X, NNODE, NDC, NCELL, NFCE, NBPTS, NBFACE, ITYP, NPROP, XBNDY, XFAR, YFAR, ZFAR)
CHARACTER(10) function nodestr(ind)
subroutine inrt_printuserinput(region)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469
RT a() const
Definition: Line_2.h:140