Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_BuildDataStruct.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: Prepare data structure for ROCFLU.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! global Pointer to global type
31 !
32 ! Output: None.
33 !
34 ! Notes:
35 ! 1. Allocation for regions on each level starts from 0, which is used
36 ! to store undecomposed grid on finest level
37 ! 2. The allocation of the regions was removed from this routine and put
38 ! into separate routine because compilation of this routine with
39 ! optimization took a very long time and it was determined that the
40 ! compilation of the allocation statement was responsible. This was
41 ! likely due to compiler trying to optimize the allocation as it was
42 ! inside a DO-loop. Putting allocation into separate routine (without
43 ! DO-loop) will break optimization.
44 !
45 ! ******************************************************************************
46 !
47 ! $Id: RFLU_BuildDataStruct.F90,v 1.8 2008/12/06 08:44:11 mtcampbe Exp $
48 !
49 ! Copyright: (c) 2001-2004 by the University of Illinois
50 !
51 ! ******************************************************************************
52 
53 SUBROUTINE rflu_builddatastruct(global,levels)
54 
55  USE modglobal, ONLY: t_global
56  USE moddatatypes
57  USE modparameters
58  USE moddatastruct, ONLY: t_level,t_region
59  USE moderror
60  USE modmpi
61 
63 
64  IMPLICIT NONE
65 
66 ! ******************************************************************************
67 ! Declarations and definitions
68 ! ******************************************************************************
69 
70 ! ==============================================================================
71 ! Arguments
72 ! ==============================================================================
73 
74  TYPE(t_global), POINTER :: global
75  TYPE(t_level), DIMENSION(:), POINTER :: levels
76  TYPE(t_region), DIMENSION(:), POINTER :: pregions
77 
78 ! ==============================================================================
79 ! Local variables
80 ! ==============================================================================
81 
82  INTEGER :: errorflag,ilev,ireg,ireglow,iregupp
83  CHARACTER(CHRLEN) :: rcsidentstring
84 
85 ! ******************************************************************************
86 ! Start
87 ! ******************************************************************************
88 
89  rcsidentstring = '$RCSfile: RFLU_BuildDataStruct.F90,v $ $Revision: 1.8 $'
90 
91  CALL registerfunction(global,'RFLU_BuildDataStruct',&
92  'RFLU_BuildDataStruct.F90')
93 
94  IF ( global%myProcid == masterproc .AND. &
95  global%verbLevel >= verbose_high ) THEN
96  WRITE(stdout,'(A,1X,A)') solver_name,'Building data structure...'
97  END IF ! global%verbLevel
98 
99  ALLOCATE(levels(global%nLevels),stat=errorflag)
100  global%error = errorflag
101  IF ( global%error /= err_none ) THEN
102  CALL errorstop(global,err_allocate,__line__,'levels')
103  END IF ! global%error
104 
105 ! ******************************************************************************
106 ! Loop over levels and allocate memory for regions
107 ! ******************************************************************************
108 
109  DO ilev = 1,global%nLevels
110  CALL rflu_createregions(global,ilev,levels)
111  END DO ! iLev
112 
113 ! ******************************************************************************
114 ! Set global pointer and postActiveFlag
115 ! ******************************************************************************
116 
117  DO ilev = 1,global%nLevels
118  pregions => levels(ilev)%regions
119 
120  DO ireg = lbound(pregions,1),ubound(pregions,1)
121  pregions(ireg)%pRegion => pregions(ireg)
122  pregions(ireg)%global => global
123 
124  pregions(ireg)%postActiveFlag = .true.
125  END DO ! iReg
126  END DO ! iLev
127 
128 ! ******************************************************************************
129 ! End
130 ! ******************************************************************************
131 
132  IF ( global%myProcid == masterproc .AND. &
133  global%verbLevel >= verbose_high ) THEN
134  WRITE(stdout,'(A,1X,A)') solver_name,'Building data structure done.'
135  END IF ! global%verbLevel
136 
137  CALL deregisterfunction(global)
138 
139 END SUBROUTINE rflu_builddatastruct
140 
141 ! ******************************************************************************
142 !
143 ! RCS Revision history:
144 !
145 ! $Log: RFLU_BuildDataStruct.F90,v $
146 ! Revision 1.8 2008/12/06 08:44:11 mtcampbe
147 ! Updated license.
148 !
149 ! Revision 1.7 2008/11/19 22:17:24 mtcampbe
150 ! Added Illinois Open Source License/Copyright
151 !
152 ! Revision 1.6 2004/10/19 19:24:06 haselbac
153 ! Cosmetics only
154 !
155 ! Revision 1.5 2003/08/07 15:30:09 haselbac
156 ! Changed var name
157 !
158 ! Revision 1.4 2003/07/22 01:54:26 haselbac
159 ! Added setting of region%pRegion
160 !
161 ! Revision 1.3 2003/06/09 14:02:40 haselbac
162 ! Rewrite to give faster compilation with optimization
163 !
164 ! Revision 1.2 2003/06/04 21:58:30 haselbac
165 ! Added setting of activeFlag (for rflupost)
166 !
167 ! Revision 1.1 2003/01/28 15:53:31 haselbac
168 ! Initial revision
169 !
170 ! Revision 1.11 2002/10/27 18:52:28 haselbac
171 ! Removed tabs
172 !
173 ! Revision 1.10 2002/10/08 15:48:56 haselbac
174 ! {IO}STAT=global%error replaced by {IO}STAT=errorFlag - SGI problem
175 !
176 ! Revision 1.9 2002/10/05 18:47:44 haselbac
177 ! Integration into GENX: Now also pass levels, some cosmetics
178 !
179 ! Revision 1.8 2002/09/09 14:15:01 haselbac
180 ! global now under regions
181 !
182 ! Revision 1.7 2002/07/25 14:42:23 haselbac
183 ! Now only write out messages for MASTERPROC
184 !
185 ! Revision 1.6 2002/06/17 13:31:22 haselbac
186 ! Prefixed SOLVER_NAME to all screen output
187 !
188 ! Revision 1.5 2002/06/14 20:08:36 haselbac
189 ! ModLocal deleted, so local% becomes global%
190 !
191 ! Revision 1.4 2002/05/04 16:12:04 haselbac
192 ! Clean up and added type local
193 !
194 ! Revision 1.3 2002/03/26 18:54:50 haselbac
195 ! Added IF statement for verbosity level check
196 !
197 ! Revision 1.2 2002/03/01 16:06:02 haselbac
198 ! Deleted previous region and renamed domain to region
199 !
200 ! Revision 1.1 2002/02/08 14:54:30 haselbac
201 ! Moved to libflu from rfluprep
202 !
203 ! Revision 1.2 2002/01/14 20:26:44 haselbac
204 ! Added RCS revision history section...
205 !
206 ! ******************************************************************************
207 
208 
209 
210 
211 
212 
213 
214 
subroutine rflu_createregions(global, iLev, levels)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflu_builddatastruct(global, levels)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469