Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_DoMemoryAllocation.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: allocate memory required for all physical modules.
26 !
27 ! Description: none.
28 !
29 ! Input: regions = dimensions and user input.
30 !
31 ! Output: regions = allocated flow and work variables.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: RFLO_DoMemoryAllocation.F90,v 1.3 2008/12/06 08:44:26 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2001 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE rflo_domemoryallocation( regions )
44 
45  USE moddatatypes
46  USE moddatastruct, ONLY : t_region
47  USE modglobal, ONLY : t_global
50 #ifdef PLAG
52 #endif
53 #ifdef PEUL
55 #endif
56 #ifdef PERI
58 #endif
59 #ifdef RADI
61 #endif
62 #ifdef SPEC
63  USE modinterfacesspecies, ONLY : spec_allocatememory
64 #endif
65 #ifdef TURB
68 #endif
69  USE moderror
70  USE modparameters
71  IMPLICIT NONE
72 
73 ! ... parameters
74  TYPE (t_region), POINTER :: regions(:)
75 
76 ! ... loop variables
77  INTEGER :: ireg
78 
79 ! ... local variables
80  INTEGER :: errorflag
81 
82  TYPE(t_global), POINTER :: global
83 
84 !******************************************************************************
85 
86  global => regions(1)%global
87 
88  CALL registerfunction( global,'RFLO_DoMemoryAllocation',&
89  'RFLO_DoMemoryAllocation.F90' )
90 
91 ! loop over all regions
92 
93  global%nRequests = 0
94 
95  DO ireg=1,global%nRegions
96  IF (regions(ireg)%procid==global%myProcid .AND. & ! region active and
97  regions(ireg)%active==active) THEN ! on my processor
98 
99  CALL rflo_allocatememory( regions(ireg) ) ! mixture variables
100 
101  CALL allocatememorywork( regions(ireg) ) ! work arrays
102 
103 ! --- allocate buffers for data exchange between regions
104 
105  CALL rflo_allocatedatabuffers( regions,ireg )
106 
107 ! --- memory required by physical modules
108 
109 #ifdef PLAG
110  IF (global%plagUsed) THEN
111  CALL plag_allocatememory( regions(ireg) )
112 
113 ! --- allocate buffers for data exchange between regions
114 
115  CALL plag_allocatedatabuffers( regions, ireg )
116  END IF ! plagUsed
117 #endif
118 
119 #ifdef PEUL
120  IF (global%peulUsed) THEN
121  CALL peul_allocatememory( regions(ireg) )
122  CALL peul_allocatedatabuffers( regions, ireg )
123  ENDIF ! peulUsed
124 #endif
125 
126 #ifdef RADI
127  IF (regions(ireg)%mixtInput%radiUsed) THEN
128  CALL radi_allocatememory( regions(ireg) )
129  ENDIF
130 #endif
131 
132 #ifdef SPEC
133  CALL spec_allocatememory( regions(ireg) )
134 #endif
135 
136 #ifdef TURB
137  IF ((regions(ireg)%mixtInput%flowModel == flow_navst) .AND. &
138  (regions(ireg)%mixtInput%turbModel /= turb_model_none)) THEN
139  CALL turb_allocatememory( regions(ireg) )
140  CALL turb_rflo_ransallocdatabuffers( regions, ireg )
141  ENDIF
142 #endif
143 
144 #ifdef PERI
145  IF (regions(ireg)%periInput%flowKind /= off) THEN
146  CALL peri_allocatememory( regions(ireg) )
147  ENDIF
148 #endif
149 
150  ENDIF ! region on this processor and active
151  ENDDO ! iReg
152 
153 ! allocate array for send requests
154 
155 #ifdef MPI
156  ALLOCATE( global%requests(global%nRequests),stat=errorflag )
157  global%error = errorflag
158  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
159 #endif
160 
161 ! finalize
162 
163  CALL deregisterfunction( global )
164 
165 END SUBROUTINE rflo_domemoryallocation
166 
167 !******************************************************************************
168 !
169 ! RCS Revision history:
170 !
171 ! $Log: RFLO_DoMemoryAllocation.F90,v $
172 ! Revision 1.3 2008/12/06 08:44:26 mtcampbe
173 ! Updated license.
174 !
175 ! Revision 1.2 2008/11/19 22:17:37 mtcampbe
176 ! Added Illinois Open Source License/Copyright
177 !
178 ! Revision 1.1 2004/11/29 20:51:39 wasistho
179 ! lower to upper case
180 !
181 ! Revision 1.26 2004/07/27 21:27:14 jferry
182 ! removed rocinteract allocation routines (moved to rocpart)
183 !
184 ! Revision 1.25 2004/03/11 03:30:54 wasistho
185 ! changed rocturb nomenclature
186 !
187 ! Revision 1.24 2004/03/05 22:09:02 jferry
188 ! created global variables for peul, plag, and inrt use
189 !
190 ! Revision 1.23 2004/03/02 21:49:22 jferry
191 ! Added inrtUsed flag to mixture data structure
192 !
193 ! Revision 1.22 2003/11/20 16:40:39 mdbrandy
194 ! Backing out RocfluidMP changes from 11-17-03
195 !
196 ! Revision 1.18 2003/10/03 20:18:24 wasistho
197 ! initial installation of turbModel SA and DES
198 !
199 ! Revision 1.17 2003/09/26 21:44:28 fnajjar
200 ! Modified ModInterfaces calls to proper physical modules
201 !
202 ! Revision 1.16 2003/08/28 20:35:06 wasistho
203 ! excluced ModInterfacesTurbulence,Radiation,Periodic from ModInterfaces
204 !
205 ! Revision 1.15 2003/07/17 01:02:33 wasistho
206 ! initial activation rocrad
207 !
208 ! Revision 1.14 2003/05/15 02:57:03 jblazek
209 ! Inlined index function.
210 !
211 ! Revision 1.13 2003/04/09 15:05:05 jferry
212 ! added check that particles are used before calling PLAG routines
213 !
214 ! Revision 1.12 2003/04/09 14:15:10 fnajjar
215 ! Added call to PEUL_allocateDataBuffers
216 !
217 ! Revision 1.11 2003/03/29 03:29:55 wasistho
218 ! install ROCPERI
219 !
220 ! Revision 1.10 2003/03/11 16:04:19 jferry
221 ! Enclosed USE statements for multi-physics routines within ifdefs
222 !
223 ! Revision 1.9 2003/03/04 22:12:34 jferry
224 ! Initial import of Rocinteract
225 !
226 ! Revision 1.8 2003/02/11 22:53:19 jferry
227 ! Initial import of Rocsmoke
228 !
229 ! Revision 1.7 2003/01/13 18:58:17 f-najjar
230 ! Added PLAG_allocateDataBuffers
231 !
232 ! Revision 1.6 2002/10/25 18:36:47 jblazek
233 ! Replaced [io]stat=global%error with local errorFlag for Rocflo.
234 !
235 ! Revision 1.5 2002/09/17 22:51:23 jferry
236 ! Removed Fast Eulerian particle type
237 !
238 ! Revision 1.4 2002/09/05 17:40:21 jblazek
239 ! Variable global moved into regions().
240 !
241 ! Revision 1.3 2002/08/24 03:16:13 wasistho
242 ! put safety within #ifdef TURB
243 !
244 ! Revision 1.2 2002/03/29 23:15:22 jblazek
245 ! Corrected bug in MPI send.
246 !
247 ! Revision 1.1 2002/02/25 22:36:52 jblazek
248 ! Simplified solver initialization routine.
249 !
250 !******************************************************************************
251 
252 
253 
254 
255 
256 
257 
subroutine turb_allocatememory(region)
subroutine rflo_allocatedatabuffers(regions, iReg)
subroutine rflo_allocatememory(region)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine turb_rflo_ransallocdatabuffers(regions, iReg)
subroutine plag_allocatememory(region)
subroutine peri_allocatememory(region)
subroutine peul_allocatememory(region)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine plag_allocatedatabuffers(regions, iReg)
subroutine radi_allocatememory(region)
subroutine allocatememorywork(region)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine peul_allocatedatabuffers(regions, iReg)
subroutine rflo_domemoryallocation(regions)