Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
rflupost.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: Driver routine for postprocessor.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! caseString String with casename
31 ! stampString String with iteration or time stamp
32 ! verbLevel Verbosity level
33 !
34 ! Output: None.
35 !
36 ! Notes: None.
37 !
38 ! ******************************************************************************
39 !
40 ! $Id: rflupost.F90,v 1.10 2008/12/06 08:45:06 mtcampbe Exp $
41 !
42 ! Copyright: (c) 2004-2005 by the University of Illinois
43 !
44 ! ******************************************************************************
45 
46 SUBROUTINE rflupost(caseString,stampString,verbLevel)
47 
48  USE moddatatypes
49  USE modglobal, ONLY: t_global
50  USE moderror
51  USE moddatastruct, ONLY: t_level,t_region
52  USE modparameters
53  USE modmpi
54 
56 
68 
69  IMPLICIT NONE
70 
71 ! ******************************************************************************
72 ! Declarations and definitions
73 ! ******************************************************************************
74 
75 ! ==============================================================================
76 ! Arguments
77 ! ==============================================================================
78 
79  CHARACTER(*) :: casestring,stampstring
80  INTEGER, INTENT(IN) :: verblevel
81 
82 ! ==============================================================================
83 ! Local variables
84 ! ==============================================================================
85 
86  CHARACTER(CHRLEN) :: casename,nregions,rcsidentstring,stamp
87  INTEGER :: errorflag,ireg
88  TYPE(t_region), POINTER :: pregion
89  TYPE(t_global), POINTER :: global
90  TYPE(t_level), POINTER :: levels(:)
91 
92 ! ******************************************************************************
93 ! Start
94 ! ******************************************************************************
95 
96  rcsidentstring = '$RCSfile: rflupost.F90,v $ $Revision: 1.10 $'
97 
98 ! ******************************************************************************
99 ! Initialize global data
100 ! ******************************************************************************
101 
102  ALLOCATE(global,stat=errorflag)
103  IF ( errorflag /= err_none ) THEN
104  WRITE(stderr,'(A,1X,A)') solver_name,'ERROR - Pointer allocation failed.'
105  stop
106  END IF ! errorFlag
107 
108  casename = casestring(1:len(casestring))
109  stamp = stampstring(1:len(stampstring))
110 
111  CALL rflu_initglobal(casename,verblevel,crazy_value_int,global)
112 
113  CALL registerfunction(global,'rflupost', &
114  'rflupost.F90')
115 
116  CALL rflu_setmoduletype(global,module_type_postproc)
117 
118 ! ******************************************************************************
119 ! Print header and write version string
120 ! ******************************************************************************
121 
122  IF ( global%myProcid == masterproc ) THEN
123  CALL rflu_writeversionstring(global)
124  IF ( global%verbLevel /= verbose_none ) THEN
125  CALL rflu_printheader(global)
126  END IF ! global%verbLevel
127  END IF ! global%myProcid
128 
129 ! ******************************************************************************
130 ! Read mapping file, impose serial mapping, and build basic data structure
131 ! ******************************************************************************
132 
133  CALL rflu_readregionmappingfile(global,mapfile_readmode_peek,global%myProcid)
134  CALL rflu_setregionmappingserial(global)
135  CALL rflu_createregionmapping(global,maptype_reg)
136  CALL rflu_imposeregionmappingserial(global)
137 
138  CALL rflu_builddatastruct(global,levels)
139  CALL rflu_applyregionmapping(global,levels)
140  CALL rflu_destroyregionmapping(global,maptype_reg)
141 
142 ! ******************************************************************************
143 ! Read input file
144 ! ******************************************************************************
145 
146  CALL rflu_getuserinput(levels(1)%regions)
147 
148  IF ( global%flowType == flow_steady ) THEN
149  READ(stamp,*) global%currentIter
150  ELSE
151  READ(stamp,*) global%currentTime
152  END IF ! global%flowType
153 
154 ! ******************************************************************************
155 ! Check for TECPLOT library. NOTE if not available, continue anyway if have
156 ! solution initialized from hardcode, because this is likely to mean that errors
157 ! will be computed in RFLU_PostProcess* routines.
158 ! ******************************************************************************
159 
160 #ifdef NO_TECPLOT
161  IF ( global%postOutputFormat == post_output_format_tecplot ) THEN
162  IF ( global%initFlowFlag /= initflow_fromhardcode ) THEN
163  CALL errorstop(global,err_post_output_format_invalid,__line__)
164  ELSE
165  global%warnCounter = global%warnCounter + 1
166  WRITE(stdout,'(A,1X,A,1X,A)') solver_name,'*** WARNING ***', &
167  'TECPLOT library not available. Continuing anyway.'
168  END IF ! global%initFlowFlag
169  END IF ! global%postOutputFormat
170 #endif
171 
172 ! ******************************************************************************
173 ! Call appropriate routine to write output
174 ! ******************************************************************************
175 
176  IF ( global%postMergeFlag .EQV. .true.) THEN
177  IF ( global%nRegionsLocal > 1 ) THEN
178  CALL rflu_mergepostprocessregions(levels)
179  ELSE
180  SELECT CASE ( global%postOutputFormat )
181  CASE ( post_output_format_tecplot )
182  CALL rflu_postprocessregions(levels)
183  CASE ( post_output_format_ensight )
184  CALL rflu_postprocessregions_ens(levels)
185  CASE default
186  CALL errorstop(global,err_reached_default,__line__)
187  END SELECT ! global%postOutputFormat
188  END IF ! global%nRegionsLocal
189  ELSE
190  SELECT CASE ( global%postOutputFormat )
191  CASE ( post_output_format_tecplot )
192  CALL rflu_postprocessregions(levels)
193  CASE ( post_output_format_ensight )
194  CALL rflu_postprocessregions_ens(levels)
195  CASE default
196  CALL errorstop(global,err_reached_default,__line__)
197  END SELECT ! global%postOutputFormat
198  END IF ! global%postMergeFlag
199 
200 ! ******************************************************************************
201 ! Print info about warnings
202 ! ******************************************************************************
203 
204  CALL rflu_printwarninfo(global)
205 
206 ! ******************************************************************************
207 ! End
208 ! ******************************************************************************
209 
210  CALL deregisterfunction(global)
211 
212 END SUBROUTINE rflupost
213 
214 ! ******************************************************************************
215 !
216 ! RCS Revision history:
217 !
218 ! $Log: rflupost.F90,v $
219 ! Revision 1.10 2008/12/06 08:45:06 mtcampbe
220 ! Updated license.
221 !
222 ! Revision 1.9 2008/11/19 22:18:17 mtcampbe
223 ! Added Illinois Open Source License/Copyright
224 !
225 ! Revision 1.8 2006/04/07 15:19:26 haselbac
226 ! Removed tabs
227 !
228 ! Revision 1.7 2006/02/06 23:55:55 haselbac
229 ! Added comm argument to RFLU_InitGlobal
230 !
231 ! Revision 1.6 2005/11/27 02:07:38 haselbac
232 ! Added setting of module type (for reading of EEv data)
233 !
234 ! Revision 1.5 2005/10/05 20:15:12 haselbac
235 ! Added support for ENSIGHT
236 !
237 ! Revision 1.4 2005/05/03 03:12:21 haselbac
238 ! Converted to C++ reading of command-line
239 !
240 ! Revision 1.3 2005/04/15 15:08:38 haselbac
241 ! Removed Charm/FEM stuff
242 !
243 ! Revision 1.2 2005/01/14 21:02:02 haselbac
244 ! Changed call for peeking at reg map
245 !
246 ! Revision 1.1 2004/12/29 20:58:54 haselbac
247 ! Initial revision
248 !
249 ! ******************************************************************************
250 
251 
252 
253 
254 
255 
256 
subroutine rflupost(caseString, stampString, verbLevel)
Definition: rflupost.F90:46
subroutine rflu_mergepostprocessregions(levels)
subroutine rflu_printwarninfo(global)
subroutine, public rflu_destroyregionmapping(global, mapType)
subroutine rflu_getuserinput(regions, inPrep)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflu_printheader(global)
subroutine, public rflu_setregionmappingserial(global)
subroutine rflu_postprocessregions(levels)
subroutine, public rflu_readregionmappingfile(global, readMode, myProcId)
subroutine rflu_builddatastruct(global, levels)
subroutine rflu_setmoduletype(global, moduleType)
subroutine rflu_postprocessregions_ens(levels)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine rflu_writeversionstring(global)
subroutine, public rflu_applyregionmapping(global, levels)
subroutine rflu_initglobal(casename, verbLevel, communicator, global)
subroutine, public rflu_imposeregionmappingserial(global)
subroutine, public rflu_createregionmapping(global, mapType)