Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_RFLU_DeallocMemSol.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: Deallocate memory for Lagrangian particle solution.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! pRegion Region pointer
31 ! pPlag Pointer to particle data structure
32 !
33 ! Output: None.
34 !
35 ! Notes: None.
36 !
37 !******************************************************************************
38 !
39 ! $Id: PLAG_RFLU_DeallocMemSol.F90,v 1.4 2008/12/06 08:44:35 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2004 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE plag_rflu_deallocmemsol(pRegion,pPlag)
46 
47  USE moddatatypes
48  USE moderror
49  USE modparameters
50  USE modglobal, ONLY: t_global
51  USE modgrid, ONLY: t_grid
52  USE moddatastruct, ONLY: t_region
53  USE modpartlag, ONLY: t_plag
54  USE modmpi
55 
57 
58  IMPLICIT NONE
59 
60 ! ******************************************************************************
61 ! Definitions and declarations
62 ! ******************************************************************************
63 
64 ! ==============================================================================
65 ! Arguments
66 ! ==============================================================================
67 
68  TYPE(t_region), POINTER :: pregion
69  TYPE(t_plag), POINTER :: pplag
70 
71 ! ==============================================================================
72 ! Locals
73 ! ==============================================================================
74 
75  CHARACTER(CHRLEN) :: rcsidentstring
76  INTEGER :: errorflag
77  TYPE(t_grid), POINTER :: pgrid
78  TYPE(t_global), POINTER :: global
79 
80 ! ******************************************************************************
81 ! Start
82 ! ******************************************************************************
83 
84  rcsidentstring = '$RCSfile: PLAG_RFLU_DeallocMemSol.F90,v $ $Revision: 1.4 $'
85 
86  global => pregion%global
87 
88  CALL registerfunction(global,'PLAG_RFLU_DeallocMemSol',&
89  'PLAG_RFLU_DeallocMemSol.F90')
90 
91 ! ******************************************************************************
92 ! Set pointers and variables
93 ! ******************************************************************************
94 
95  pgrid => pregion%grid
96 
97 ! ******************************************************************************
98 ! Allocate memory
99 ! ******************************************************************************
100 
101 ! ==============================================================================
102 ! State vector
103 ! ==============================================================================
104 
105  DEALLOCATE(pplag%cv,stat=errorflag)
106  global%error = errorflag
107  IF (global%error /= err_none) THEN
108  CALL errorstop(global,err_deallocate,__line__,'pPlag%cv')
109  END IF ! global%error
110 
111 ! ==============================================================================
112 ! Dependent variables
113 ! ==============================================================================
114 
115  DEALLOCATE(pplag%dv,stat=errorflag)
116  global%error = errorflag
117  IF (global%error /= err_none) THEN
118  CALL errorstop(global,err_deallocate,__line__,'pPlag%dv')
119  END IF ! global%error
120 
121 ! ==============================================================================
122 ! Transport variables
123 ! ==============================================================================
124 
125  DEALLOCATE(pplag%tv,stat=errorflag)
126  global%error = errorflag
127  IF (global%error /= err_none) THEN
128  CALL errorstop(global,err_deallocate,__line__,'pPlag%tv')
129  END IF ! global%error
130 
131 ! ==============================================================================
132 ! Additional variables
133 ! ==============================================================================
134 
135  DEALLOCATE(pplag%aiv,stat=errorflag)
136  global%error = errorflag
137  IF (global%error /= err_none) THEN
138  CALL errorstop(global,err_deallocate,__line__,'pPlag%aiv')
139  END IF ! global%error
140 
141  DEALLOCATE(pplag%arv,stat=errorflag)
142  global%error = errorflag
143  IF (global%error /= err_none) THEN
144  CALL errorstop(global,err_deallocate,__line__,'pPlag%arv')
145  END IF ! global%error
146 
147 ! ==============================================================================
148 ! Lagrangian particles mass and volume indices
149 ! ==============================================================================
150 
151  DEALLOCATE(pplag%cvPlagMass,stat=errorflag)
152  global%error = errorflag
153  IF (global%error /= err_none) THEN
154  CALL errorstop(global, err_deallocate,__line__ ,'pPlag%cvPlagMass')
155  END IF ! global%error
156 
157  DEALLOCATE(pplag%dvPlagVolu,stat=errorflag)
158  global%error = errorflag
159  IF (global%error /= err_none) THEN
160  CALL errorstop(global, err_deallocate,__line__ ,'pPlag%dvPlagVolu')
161  END IF ! global%error
162 
163 ! ******************************************************************************
164 ! End
165 ! ******************************************************************************
166 
167  CALL deregisterfunction(global)
168 
169 END SUBROUTINE plag_rflu_deallocmemsol
170 
171 !******************************************************************************
172 !
173 ! RCS Revision history:
174 !
175 ! $Log: PLAG_RFLU_DeallocMemSol.F90,v $
176 ! Revision 1.4 2008/12/06 08:44:35 mtcampbe
177 ! Updated license.
178 !
179 ! Revision 1.3 2008/11/19 22:17:47 mtcampbe
180 ! Added Illinois Open Source License/Copyright
181 !
182 ! Revision 1.2 2006/04/07 15:19:24 haselbac
183 ! Removed tabs
184 !
185 ! Revision 1.1 2004/02/26 21:00:41 haselbac
186 ! Initial revision
187 !
188 !******************************************************************************
189 
190 
191 
192 
193 
194 
195 
subroutine plag_rflu_deallocmemsol(pRegion, pPlag)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469