Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SPEC_RFLU_PrintFlowInfo.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: Display minimum and maximum values of species state vector for
26 ! given local domain.
27 !
28 ! Description: None.
29 !
30 ! Input:
31 ! pRegion Pointer to region
32 !
33 ! Output: N/A.
34 !
35 ! Notes: None.
36 !
37 !******************************************************************************
38 !
39 ! $Id: SPEC_RFLU_PrintFlowInfo.F90,v 1.3 2008/12/06 08:44:40 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2003 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE spec_rflu_printflowinfo(pRegion)
46 
47  USE modglobal, ONLY: t_global
48  USE moddatatypes
49  USE modparameters
50  USE moderror
51  USE modgrid, ONLY: t_grid
52  USE moddatastruct, ONLY: t_region
53 
55 
56  IMPLICIT NONE
57 
58 ! ******************************************************************************
59 ! Declarations and definitions
60 ! ******************************************************************************
61 
62 ! ==============================================================================
63 ! Parameters
64 ! ==============================================================================
65 
66  TYPE(t_region), POINTER :: pregion
67 
68 ! ==============================================================================
69 ! Local variables
70 ! ==============================================================================
71 
72  CHARACTER(CHRLEN) :: rcsidentstring
73  INTEGER :: errorflag,ispec,nspecies,upplim
74  INTEGER :: dummy(1)
75  INTEGER, DIMENSION(:,:), ALLOCATABLE :: loc
76  REAL(RFREAL), DIMENSION(:,:), POINTER :: pcv
77  TYPE(t_grid), POINTER :: pgrid
78  TYPE(t_global), POINTER :: global
79 
80  rcsidentstring = '$RCSfile: SPEC_RFLU_PrintFlowInfo.F90,v $ $Revision: 1.3 $'
81 
82 ! ******************************************************************************
83 ! Start
84 ! ******************************************************************************
85 
86  global => pregion%global
87 
88  CALL registerfunction(global,'SPEC_RFLU_PrintFlowInfo',&
89  'SPEC_RFLU_PrintFlowInfo.F90')
90 
91  IF ( global%verbLevel > verbose_none ) THEN
92  WRITE(stdout,'(A,1X,A)') solver_name,'Printing species information...'
93  WRITE(stdout,'(A,3X,A,1X,I5.5)') solver_name,'Global region:', &
94  pregion%iRegionGlobal
95  IF ( global%flowType == flow_unsteady ) THEN
96  WRITE(stdout,'(A,3X,A,1X,1PE11.5)') solver_name,'Current time:', &
97  global%currentTime
98  END IF ! global%flowType
99  END IF ! global%verbLevel
100 
101 ! ==============================================================================
102 ! Set pointers and variables
103 ! ==============================================================================
104 
105  pcv => pregion%spec%cv
106  pgrid => pregion%grid
107 
108 ! ==============================================================================
109 ! Allocate memory for location array
110 ! ==============================================================================
111 
112  nspecies = pregion%specInput%nSpecies
113 
114  ALLOCATE(loc(nspecies,min_val:max_val),stat=errorflag)
115  global%error = errorflag
116  IF ( global%error /= err_none ) THEN
117  CALL errorstop(global,err_allocate,__line__,'loc')
118  END IF ! global%error
119 
120 ! ==============================================================================
121 ! Set upper limit: useful for checking of cell/dummy cell values
122 ! ==============================================================================
123 
124  upplim = pgrid%nCells ! Only internal cells
125 ! uppLim = pGrid%nCellsTot ! Also dummy cells
126 
127 ! ==============================================================================
128 ! Find locations of extrema: NOTE Asinine coding needed because of poor
129 ! FORTRAN interface for MINLOC and MAXLOC functions...
130 ! ==============================================================================
131 
132  DO ispec = 1,nspecies
133  dummy = minloc(pcv(ispec,1:upplim))
134  loc(ispec,min_val) = dummy(1)
135 
136  dummy = maxloc(pcv(ispec,1:upplim))
137  loc(ispec,max_val) = dummy(1)
138  END DO ! iSpec
139 
140 ! ==============================================================================
141 ! Print locations of extrema
142 ! ==============================================================================
143 
144  DO ispec = 1,nspecies
145  WRITE(stdout,'(A,3X,A,2(1X,E23.16),2(1X,I9))') &
146  solver_name,'Density (kg/m^3):', &
147  minval(pcv(ispec,1:upplim)),maxval(pcv(ispec,1:upplim)), &
148  loc(ispec,min_val),loc(ispec,max_val)
149  END DO ! iSpec
150 
151 ! ==============================================================================
152 ! Print out locations of cells at which extrema occur
153 ! ==============================================================================
154 
155  IF ( global%verbLevel /= verbose_low ) THEN
156  CALL rflu_printlocinfo(pregion,loc,nspecies,locinfo_mode_silent, &
157  output_mode_master_only)
158  END IF ! global%verbLevel
159 
160 ! ==============================================================================
161 ! Deallocate memory for location array
162 ! ==============================================================================
163 
164  DEALLOCATE(loc,stat=errorflag)
165  global%error = errorflag
166  IF ( global%error /= err_none ) THEN
167  CALL errorstop(global,err_deallocate,__line__,'loc')
168  END IF ! global%error
169 
170 ! ******************************************************************************
171 ! End
172 ! ******************************************************************************
173 
174  IF ( global%verbLevel > verbose_none ) THEN
175  WRITE(stdout,'(A,1X,A)') solver_name,'Printing species information done.'
176  END IF ! global%verbLevel
177 
178  CALL deregisterfunction(global)
179 
180 END SUBROUTINE spec_rflu_printflowinfo
181 
182 
183 ! ******************************************************************************
184 !
185 ! RCS Revision history:
186 !
187 ! $Log: SPEC_RFLU_PrintFlowInfo.F90,v $
188 ! Revision 1.3 2008/12/06 08:44:40 mtcampbe
189 ! Updated license.
190 !
191 ! Revision 1.2 2008/11/19 22:17:53 mtcampbe
192 ! Added Illinois Open Source License/Copyright
193 !
194 ! Revision 1.1 2003/11/25 21:08:37 haselbac
195 ! Initial revision
196 !
197 ! ******************************************************************************
198 
199 
200 
201 
202 
203 
204 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine spec_rflu_printflowinfo(pRegion)
subroutine rflu_printlocinfo(pRegion, locUnsorted, nLocUnsorted, locInfoMode, outputMode)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469