Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_RFLU_DeallocMemTStep.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 particles related to time stepping.
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_DeallocMemTStep.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_deallocmemtstep(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 
56  IMPLICIT NONE
57 
58 ! ******************************************************************************
59 ! Definitions and declarations
60 ! ******************************************************************************
61 
62 ! ==============================================================================
63 ! Arguments
64 ! ==============================================================================
65 
66  TYPE(t_region), POINTER :: pregion
67  TYPE(t_plag), POINTER :: pplag
68 
69 ! ==============================================================================
70 ! Locals
71 ! ==============================================================================
72 
73  CHARACTER(CHRLEN) :: rcsidentstring
74  INTEGER :: errorflag
75  TYPE(t_grid), POINTER :: pgrid
76  TYPE(t_global), POINTER :: global
77 
78 ! ******************************************************************************
79 ! Start
80 ! ******************************************************************************
81 
82  rcsidentstring = '$RCSfile: PLAG_RFLU_DeallocMemTStep.F90,v $ $Revision: 1.4 $'
83 
84  global => pregion%global
85 
86  CALL registerfunction(global,'PLAG_RFLU_DeallocMemTStep',&
87  'PLAG_RFLU_DeallocMemTStep.F90')
88 
89 ! ******************************************************************************
90 ! Set pointers and variables
91 ! ******************************************************************************
92 
93  pgrid => pregion%grid
94 
95 ! ******************************************************************************
96 ! Deallocate memory
97 ! ******************************************************************************
98 
99 ! ==============================================================================
100 ! Old state vector
101 ! ==============================================================================
102 
103  DEALLOCATE(pplag%cvOld,stat=errorflag)
104  global%error = errorflag
105  IF (global%error /= err_none) THEN
106  CALL errorstop(global,err_deallocate,__line__,'pPlag%cvOld')
107  END IF ! global%error
108 
109 ! ==============================================================================
110 ! Additional variables
111 ! ==============================================================================
112 
113  DEALLOCATE(pplag%aivOld,stat=errorflag)
114  global%error = errorflag
115  IF (global%error /= err_none) THEN
116  CALL errorstop(global,err_deallocate,__line__,'pPlag%aivOld')
117  END IF ! global%error
118 
119  DEALLOCATE(pplag%arvOld,stat=errorflag)
120  global%error = errorflag
121  IF (global%error /= err_none) THEN
122  CALL errorstop(global,err_deallocate,__line__,'pPlag%arvOld')
123  END IF ! global%error
124 
125 ! ==============================================================================
126 ! Residuals
127 ! ==============================================================================
128 
129  DEALLOCATE(pplag%rhs,stat=errorflag)
130  global%error = errorflag
131  IF (global%error /= err_none) THEN
132  CALL errorstop(global,err_deallocate,__line__,'pPlag%rhs')
133  END IF ! global%error
134 
135  DEALLOCATE(pplag%rhsSum,stat=errorflag)
136  global%error = errorflag
137  IF (global%error /= err_none) THEN
138  CALL errorstop(global,err_deallocate,__line__,'pPlag%rhsSum')
139  END IF ! global%error
140 
141 ! ******************************************************************************
142 ! End
143 ! ******************************************************************************
144 
145  CALL deregisterfunction(global)
146 
147 END SUBROUTINE plag_rflu_deallocmemtstep
148 
149 !******************************************************************************
150 !
151 ! RCS Revision history:
152 !
153 ! $Log: PLAG_RFLU_DeallocMemTStep.F90,v $
154 ! Revision 1.4 2008/12/06 08:44:35 mtcampbe
155 ! Updated license.
156 !
157 ! Revision 1.3 2008/11/19 22:17:47 mtcampbe
158 ! Added Illinois Open Source License/Copyright
159 !
160 ! Revision 1.2 2006/04/07 15:19:24 haselbac
161 ! Removed tabs
162 !
163 ! Revision 1.1 2004/02/26 21:00:44 haselbac
164 ! Initial revision
165 !
166 !******************************************************************************
167 
168 
169 
170 
171 
172 
173 
subroutine plag_rflu_deallocmemtstep(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