Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_InitMemory.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: initialize memory for all variables associated
26 ! with the Lagrangian particles (PLAG).
27 !
28 ! Description: none.
29 !
30 ! Input: region = current region
31 !
32 ! Output: region%plag = plag variables
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: PLAG_InitMemory.F90,v 1.5 2008/12/06 08:44:33 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2002 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE plag_initmemory( region )
45 
46  USE moddatatypes
47  USE moddatastruct, ONLY : t_region, t_level
48  USE modglobal, ONLY : t_global
49  USE modpartlag, ONLY : t_plag, t_plag_input
50  USE moderror
51  USE modparameters
52  USE modmpi
54 #ifdef STATS
56  USE plag_modstats, ONLY: plag_initstat
57 #endif
58 
59  IMPLICIT NONE
60 
61 ! ... parameters
62  TYPE(t_region) :: region
63 
64 ! ... loop variables
65  INTEGER :: icont, ilev
66 
67 ! ... local variables
68  CHARACTER(CHRLEN) :: rcsidentstring
69 
70  INTEGER :: naiv, narv, ncont, ncv, ndv, ntv
71  INTEGER :: iaiv, iarv, icv, idv, ipcl, itv, npclsmax
72 
73  TYPE(t_level), POINTER :: plevel
74  TYPE(t_plag), POINTER :: pplag
75  TYPE(t_global), POINTER :: global
76 
77 !******************************************************************************
78 
79  rcsidentstring = '$RCSfile: PLAG_InitMemory.F90,v $ $Revision: 1.5 $'
80 
81  global => region%global
82 
83  CALL registerfunction( global, 'PLAG_InitMemory',&
84  'PLAG_InitMemory.F90' )
85 
86  IF ( global%myProcid == masterproc .AND. &
87  global%verbLevel > verbose_none ) THEN
88  WRITE(stdout,'(A,3X,A)') solver_name,'Initializing memory for PLAG...'
89  END IF ! global%verbLevel
90 
91 ! Loop over all grid levels ---------------------------------------------------
92 
93  DO ilev=1,region%nGridLevels
94 
95  plevel => region%levels(ilev)
96  pplag => region%levels(ilev)%plag
97 
98  ncont = region%plagInput%nCont
99  npclsmax = region%plagInput%nPclsMax
100  naiv = region%levels(ilev)%plag%nAiv
101  narv = region%levels(ilev)%plag%nArv
102  ncv = region%levels(ilev)%plag%nCv
103  ndv = region%levels(ilev)%plag%nDv
104  ntv = region%levels(ilev)%plag%nTv
105 
106  DO icont = 1, ncont
107  WRITE(stdout,'(A,3(I2,3X))') 'iCont, cvPlagMass, dvPlagVolu ', &
108  icont, pplag%cvPlagMass(icont), &
109  pplag%dvPlagVolu(icont)
110  END DO ! iCont
111 
112  pplag%nPcls = 0
113  pplag%nextIdNumber= 0
114  pplag%nPclsMax = npclsmax
115 
116  DO ipcl = 1, npclsmax
117  DO iaiv = 1, naiv
118 ! pPlag%aiv(iAiv,iPcl) = 0
119 ! pPlag%aivOld(iAiv,iPcl) = 0
120  pplag%aiv(iaiv,ipcl) = crazy_value_int
121  pplag%aivOld(iaiv,ipcl) = crazy_value_int
122  END DO ! iAiv
123 
124  DO iarv = 1, narv
125 ! pPlag%arv(iArv,iPcl) = 0.0_RFREAL
126 ! pPlag%arvOld(iArv,iPcl) = 0.0_RFREAL
127  pplag%arv(iarv,ipcl) = -1.0e+30_rfreal
128  pplag%arvOld(iarv,ipcl) = -1.0e+30_rfreal
129  END DO ! iArv
130 
131  DO icv = 1, ncv
132 ! pPlag%cv(iCv,iPcl) = 0.0_RFREAL
133 ! pPlag%rhs(iCv,iPcl) = 0.0_RFREAL
134 ! pPlag%rhsSum(iCv,iPcl) = 0.0_RFREAL
135 ! pPlag%cvOld(iCv,iPcl) = 0.0_RFREAL
136 
137  pplag%cv(icv,ipcl) = -1.0e+30_rfreal
138  pplag%rhs(icv,ipcl) = -1.0e+30_rfreal
139  pplag%rhsSum(icv,ipcl) = -1.0e+30_rfreal
140  pplag%cvOld(icv,ipcl) = -1.0e+30_rfreal
141  END DO ! iCv
142 
143  DO idv = 1, ndv
144 ! pPlag%dv(iDv,iPcl) = 0.0_RFREAL
145  pplag%dv(idv,ipcl) = -1.0e+30_rfreal
146  END DO ! iDv
147 
148  DO itv = 1, ntv
149 ! pPlag%tv(iTv,iPcl) = 0.0_RFREAL
150  pplag%tv(itv,ipcl) = -1.0e+30_rfreal
151  END DO ! iTv
152  ENDDO ! iPcl
153 
154 ! - Initialize memory for statistics -------------------------------------------
155 
156 #ifdef STATS
157  IF ( ( global%flowType == flow_unsteady ) .AND. &
158  ( global%doStat == active ) ) THEN
159  CALL plag_initeulerianfield( region, pplag )
160  CALL plag_initstat( region, pplag )
161  END IF ! global%flowType
162 #endif
163 
164  ENDDO ! iLev
165 
166 ! finalize --------------------------------------------------------------------
167 
168  CALL deregisterfunction( global )
169 
170 END SUBROUTINE plag_initmemory
171 
172 !******************************************************************************
173 !
174 ! RCS Revision history:
175 !
176 ! $Log: PLAG_InitMemory.F90,v $
177 ! Revision 1.5 2008/12/06 08:44:33 mtcampbe
178 ! Updated license.
179 !
180 ! Revision 1.4 2008/11/19 22:17:46 mtcampbe
181 ! Added Illinois Open Source License/Copyright
182 !
183 ! Revision 1.3 2007/03/06 23:13:13 fnajjar
184 ! Renamed nPclsTot to nPclsMax
185 !
186 ! Revision 1.2 2005/01/08 20:42:13 fnajjar
187 ! Included initialization calls for PLAG statistics
188 !
189 ! Revision 1.1 2004/12/01 20:57:38 fnajjar
190 ! Initial revision after changing case
191 !
192 ! Revision 1.5 2004/07/28 18:58:13 fnajjar
193 ! Included new definition for nPclsTot from dynamic memory reallocation
194 !
195 ! Revision 1.4 2004/04/09 23:11:23 fnajjar
196 ! Made initialization within DO loop construct and added crazy values for proper trapping
197 !
198 ! Revision 1.3 2003/11/21 22:43:18 fnajjar
199 ! Removed nPclsTot and added nextIdNumber
200 !
201 ! Revision 1.2 2003/05/27 19:19:57 fnajjar
202 ! Removed distPartBurning and all pertinent LOGICAL datastructure
203 !
204 ! Revision 1.1 2002/10/25 14:16:31 f-najjar
205 ! Initial Import of Rocpart
206 !
207 !
208 !******************************************************************************
209 
210 
211 
212 
213 
214 
215 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine, public plag_initstat(pRegion, pPlag)
subroutine plag_initmemory(region)
subroutine, public plag_initeulerianfield(pRegion, pPlag)
subroutine deregisterfunction(global)
Definition: ModError.F90:469