Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PEUL_AllocateMemory.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 for all variables associated with the Eulerian
26 ! particles for all active regions on current processor.
27 !
28 ! Description: none.
29 !
30 ! Input: region = current region
31 !
32 ! Output: region%levels(iLev)%peul = Eulerian particle variables
33 ! region%levels(iLev)%grid = grid variables
34 !
35 ! Notes: none.
36 !
37 !******************************************************************************
38 !
39 ! $Id: PEUL_AllocateMemory.F90,v 1.3 2008/12/06 08:44:38 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2002 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE peul_allocatememory( region ) ! PUBLIC
46 
47  USE moddatatypes
48  USE moddatastruct, ONLY : t_region, t_level
49  USE modglobal, ONLY : t_global
50  USE modgrid, ONLY : t_grid
51  USE modparteul, ONLY : t_peul
52  USE moderror
53  USE modparameters
54 
57  IMPLICIT NONE
58 
59 #include "Indexing.h"
60 
61 ! ... parameters
62  TYPE(t_region), INTENT(INOUT) :: region
63 
64 ! ... loop variables
65  INTEGER :: ilev
66 
67 ! ... local variables
68  CHARACTER(CHRLEN) :: rcsidentstring
69 
70  INTEGER :: idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend
71  INTEGER :: idnbeg, idnend, jdnbeg, jdnend, kdnbeg, kdnend
72  INTEGER :: ibc, iec, ibn, ien, icelloffset, ijcelloffset
73  INTEGER :: inodeoffset, ijnodeoffset, errorflag
74 
75  TYPE(t_level), POINTER :: level
76  TYPE(t_grid) , POINTER :: grid, gridold
77  TYPE(t_peul) , POINTER :: peul
78  TYPE(t_global), POINTER :: global
79 
80 !******************************************************************************
81 
82  rcsidentstring = '$RCSfile: PEUL_AllocateMemory.F90,v $ $Revision: 1.3 $'
83 
84  global => region%global
85 
86  CALL registerfunction( global,'PEUL_AllocateMemory',&
87  'PEUL_AllocateMemory.F90' )
88 
89 ! begin -----------------------------------------------------------------------
90 
91 ! loop over all grid levels
92 
93  DO ilev=1,region%nGridLevels
94 
95  level => region%levels(ilev)
96  grid => level%grid
97  gridold => level%gridOld
98  peul => level%peul
99 
100 ! - get cell and node dimensions
101 
102  CALL rflo_getdimensdummy( region,ilev,idcbeg,idcend, &
103  jdcbeg,jdcend,kdcbeg,kdcend )
104  CALL rflo_getcelloffset( region,ilev,icelloffset,ijcelloffset )
105  ibc = indijk(idcbeg,jdcbeg,kdcbeg,icelloffset,ijcelloffset)
106  iec = indijk(idcend,jdcend,kdcend,icelloffset,ijcelloffset)
107 
108  CALL rflo_getdimensdummynodes( region,ilev,idnbeg,idnend, &
109  jdnbeg,jdnend,kdnbeg,kdnend )
110  CALL rflo_getnodeoffset( region,ilev,inodeoffset,ijnodeoffset )
111  ibn = indijk(idnbeg,jdnbeg,kdnbeg,inodeoffset,ijnodeoffset)
112  ien = indijk(idnend,jdnend,kdnend,inodeoffset,ijnodeoffset)
113 
114 ! - spectral radii
115 
116  ALLOCATE( peul%srad(3,ibc:iec),stat=errorflag )
117  global%error = errorflag
118  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
119 
120 ! - coefficients of implicit residual smoothing
121 
122  IF (global%flowType==flow_steady .AND. &
123  region%peulInput%smoocf>0._rfreal) THEN
124  ALLOCATE( peul%epsIrs(3,ibc:iec), stat=errorflag )
125  global%error = errorflag
126  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
127  ELSE
128  nullify( peul%epsIrs )
129  ENDIF
130 
131 ! - Eulerian particle variables
132 
133  ALLOCATE( peul%cv (peul%nCv,ibc:iec),stat=errorflag )
134  global%error = errorflag
135  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
136 
137  ALLOCATE( peul%cvOld(peul%nCv,ibc:iec),stat=errorflag )
138  global%error = errorflag
139  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
140 
141  ALLOCATE( peul%rhs (peul%nCv,ibc:iec),stat=errorflag )
142  global%error = errorflag
143  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
144 
145  ALLOCATE( peul%diss (peul%nCv,ibc:iec),stat=errorflag )
146  global%error = errorflag
147  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
148 
149  IF (peul%nDv > 0) THEN
150  ALLOCATE( peul%dv(peul%nDv,ibc:iec),stat=errorflag )
151  global%error = errorflag
152  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
153  ELSE
154  nullify( peul%dv )
155  ENDIF
156 
157  IF (peul%nTv > 0) THEN
158  ALLOCATE( peul%tv(peul%nTv,ibc:iec),stat=errorflag )
159  global%error = errorflag
160  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
161  ELSE
162  nullify( peul%tv )
163  ENDIF
164 
165  IF (ilev>1 .AND. global%cycleType/=mgcycle_no) THEN
166  ALLOCATE( peul%fterm(peul%nCv,ibc:iec),stat=errorflag )
167  global%error = errorflag
168  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
169  ELSE
170  nullify( peul%fterm )
171  ENDIF
172 
173  IF (global%flowType == flow_unsteady) THEN
174  ALLOCATE( peul%rhsSum(peul%nCv,ibc:iec),stat=errorflag )
175  global%error = errorflag
176  IF (global%error /= 0) CALL errorstop( global,err_allocate,__line__ )
177  ELSE
178  nullify( peul%rhsSum )
179  ENDIF
180 
181  ENDDO ! iLev
182 
183 ! finalize --------------------------------------------------------------------
184 
185  CALL deregisterfunction( global )
186 
187 END SUBROUTINE peul_allocatememory
188 
189 !******************************************************************************
190 !
191 ! RCS Revision history:
192 !
193 ! $Log: PEUL_AllocateMemory.F90,v $
194 ! Revision 1.3 2008/12/06 08:44:38 mtcampbe
195 ! Updated license.
196 !
197 ! Revision 1.2 2008/11/19 22:17:51 mtcampbe
198 ! Added Illinois Open Source License/Copyright
199 !
200 ! Revision 1.1 2004/12/01 21:09:13 haselbac
201 ! Initial revision after changing case
202 !
203 ! Revision 1.5 2004/03/05 22:09:04 jferry
204 ! created global variables for peul, plag, and inrt use
205 !
206 ! Revision 1.4 2003/05/15 02:57:05 jblazek
207 ! Inlined index function.
208 !
209 ! Revision 1.3 2003/04/07 18:29:01 jferry
210 ! added inflow boundary condition and initialization to a constant
211 !
212 ! Revision 1.2 2003/02/12 23:34:48 jferry
213 ! Replaced [io]stat=global%error with local errorFlag
214 !
215 ! Revision 1.1 2003/02/11 22:52:50 jferry
216 ! Initial import of Rocsmoke
217 !
218 !******************************************************************************
219 
220 
221 
222 
223 
224 
225 
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE idcend
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE jdnbeg
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE idnend
subroutine rflo_getnodeoffset(region, iLev, iNodeOffset, ijNodeOffset)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE jdnend
subroutine rflo_getdimensdummy(region, iLev, idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE idnbeg
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE kdcbeg
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE idcbeg
subroutine peul_allocatememory(region)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE jdcend
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE jdcbeg
subroutine rflo_getdimensdummynodes(region, iLev, idnbeg, idnend, jdnbeg, jdnend, kdnbeg, kdnend)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine grid(bp)
Definition: setup_py.f90:257
subroutine deregisterfunction(global)
Definition: ModError.F90:469
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE kdnbeg