Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_RFLU_DeallocMemTStepTile.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 ! on tiles.
27 !
28 ! Description: None.
29 !
30 ! Input:
31 ! pRegion Region pointer
32 !
33 ! Output: None.
34 !
35 ! Notes: None.
36 !
37 !******************************************************************************
38 !
39 ! $Id: PLAG_RFLU_DeallocMemTStepTile.F90,v 1.6 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_deallocmemtsteptile(pRegion)
46 
47  USE moddatatypes
48  USE moderror
49  USE modparameters
50  USE modglobal, ONLY: t_global
51  USE modbndpatch, ONLY: t_patch
52  USE modgrid, ONLY: t_grid
53  USE moddatastruct, ONLY: t_region
54  USE modpartlag, ONLY: t_tile_plag
55  USE modmpi
56 
57  IMPLICIT NONE
58 
59 ! ******************************************************************************
60 ! Definitions and declarations
61 ! ******************************************************************************
62 
63 ! ==============================================================================
64 ! Arguments
65 ! ==============================================================================
66 
67  TYPE(t_region), POINTER :: pregion
68 
69 ! ==============================================================================
70 ! Locals
71 ! ==============================================================================
72 
73  CHARACTER(CHRLEN) :: rcsidentstring
74  INTEGER :: errorflag,ipatch
75  TYPE(t_grid), POINTER :: pgrid
76  TYPE(t_global), POINTER :: global
77  TYPE(t_patch), POINTER :: ppatch
78  TYPE(t_tile_plag), POINTER :: ptileplag
79 
80 ! ******************************************************************************
81 ! Start
82 ! ******************************************************************************
83 
84  rcsidentstring = '$RCSfile: PLAG_RFLU_DeallocMemTStepTile.F90,v $ $Revision: 1.6 $'
85 
86  global => pregion%global
87 
88  CALL registerfunction(global,'PLAG_RFLU_DeallocMemTStepTile',&
89  'PLAG_RFLU_DeallocMemTStepTile.F90')
90 
91 ! ******************************************************************************
92 ! Set pointers and variables
93 ! ******************************************************************************
94 
95  pgrid => pregion%grid
96 
97 ! ******************************************************************************
98 ! Deallocate memory
99 ! ******************************************************************************
100 
101 ! ==============================================================================
102 ! Patch data
103 ! ==============================================================================
104 
105  DO ipatch = 1,pgrid%nPatches
106  ppatch => pregion%patches(ipatch)
107 
108 ! ------------------------------------------------------------------------------
109 ! Allocate memory only for injection boundaries
110 ! ------------------------------------------------------------------------------
111 
112  IF ( (ppatch%bcType >= bc_injection .AND. ppatch%bcType <= bc_injection + bc_range) .OR. &
113  (ppatch%bcType >= bc_inflow .AND. ppatch%bcType <= bc_inflow + bc_range) ) THEN
114  ptileplag => ppatch%tilePlag
115 
116  DEALLOCATE(ptileplag%cvOld,stat=errorflag)
117  global%error = errorflag
118  IF (global%error /= err_none) THEN
119  CALL errorstop(global, err_deallocate,__line__,'pTilePlag%cvOld')
120  END IF ! global%error
121 
122  DEALLOCATE(ptileplag%rhs,stat=errorflag)
123  global%error = errorflag
124  IF (global%error /= err_none) THEN
125  CALL errorstop(global,err_deallocate,__line__,'pTilePlag%rhs')
126  END IF ! global%error
127 
128  DEALLOCATE(ptileplag%rhsSum,stat=errorflag)
129  global%error = errorflag
130  IF (global%error /= err_none) THEN
131  CALL errorstop(global,err_deallocate,__line__,'pTilePlag%rhsSum')
132  END IF ! global%error
133 
134  DEALLOCATE(ptileplag%nPclsInjc,stat=errorflag)
135  global%error = errorflag
136  IF (global%error /= err_none) THEN
137  CALL errorstop(global,err_deallocate,__line__,'pTilePlag%nPclsInjc')
138  END IF ! global%error
139  END IF ! pPatch%bcType
140  END DO ! iPatch
141 
142 ! ******************************************************************************
143 ! End
144 ! ******************************************************************************
145 
146  CALL deregisterfunction(global)
147 
148 END SUBROUTINE plag_rflu_deallocmemtsteptile
149 
150 !******************************************************************************
151 !
152 ! RCS Revision history:
153 !
154 ! $Log: PLAG_RFLU_DeallocMemTStepTile.F90,v $
155 ! Revision 1.6 2008/12/06 08:44:35 mtcampbe
156 ! Updated license.
157 !
158 ! Revision 1.5 2008/11/19 22:17:47 mtcampbe
159 ! Added Illinois Open Source License/Copyright
160 !
161 ! Revision 1.4 2006/09/18 20:32:50 fnajjar
162 ! Activated tile datastructure for inflow bc
163 !
164 ! Revision 1.3 2006/04/07 15:19:24 haselbac
165 ! Removed tabs
166 !
167 ! Revision 1.2 2004/03/03 03:23:49 fnajjar
168 ! Dealloacated nPclsInjc array
169 !
170 ! Revision 1.1 2004/02/26 21:00:45 haselbac
171 ! Initial revision
172 !
173 !******************************************************************************
174 
175 
176 
177 
178 
179 
180 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine plag_rflu_deallocmemtsteptile(pRegion)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469