Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PLAG_RFLU_DeallocMemSolTile.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 tile solution.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! pRegion Region pointer
31 !
32 ! Output: None.
33 !
34 ! Notes: None.
35 !
36 !******************************************************************************
37 !
38 ! $Id: PLAG_RFLU_DeallocMemSolTile.F90,v 1.5 2008/12/06 08:44:35 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2004 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE plag_rflu_deallocmemsoltile(pRegion)
45 
46  USE moddatatypes
47  USE moderror
48  USE modparameters
49  USE modglobal, ONLY: t_global
50  USE modbndpatch, ONLY: t_patch
51  USE modgrid, ONLY: t_grid
52  USE moddatastruct, ONLY: t_region
53  USE modpartlag, ONLY: t_tile_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 
70 ! ==============================================================================
71 ! Locals
72 ! ==============================================================================
73 
74  CHARACTER(CHRLEN) :: rcsidentstring
75  INTEGER :: errorflag,ipatch
76  TYPE(t_grid), POINTER :: pgrid
77  TYPE(t_global), POINTER :: global
78  TYPE(t_patch), POINTER :: ppatch
79  TYPE(t_tile_plag), POINTER :: ptileplag
80 
81 ! ******************************************************************************
82 ! Start
83 ! ******************************************************************************
84 
85  rcsidentstring = '$RCSfile: PLAG_RFLU_DeallocMemSolTile.F90,v $ $Revision: 1.5 $'
86 
87  global => pregion%global
88 
89  CALL registerfunction(global,'PLAG_RFLU_DeallocMemSolTile',&
90  'PLAG_RFLU_DeallocMemSolTile.F90')
91 
92 ! ******************************************************************************
93 ! Set pointers and variables
94 ! ******************************************************************************
95 
96  pgrid => pregion%grid
97 
98 ! ******************************************************************************
99 ! Deallocate memory
100 ! ******************************************************************************
101 
102  DO ipatch = 1,pgrid%nPatches
103  ppatch => pregion%patches(ipatch)
104 
105  IF ( (ppatch%bcType >= bc_injection .AND. ppatch%bcType <= bc_injection + bc_range) .OR. &
106  (ppatch%bcType >= bc_inflow .AND. ppatch%bcType <= bc_inflow + bc_range) ) THEN
107  ptileplag => ppatch%tilePlag
108 
109  DEALLOCATE(ptileplag%cv,stat=errorflag)
110  global%error = errorflag
111  IF (global%error /= err_none) THEN
112  CALL errorstop(global, err_deallocate,__line__,'pTilePlag%cv')
113  END IF ! global%error
114 
115  DEALLOCATE(ptileplag%dv,stat=errorflag)
116  global%error = errorflag
117  IF (global%error /= err_none) THEN
118  CALL errorstop(global, err_deallocate,__line__,'pTilePlag%dv')
119  END IF ! global%error
120 
121  DEALLOCATE(ptileplag%cvTileMass,stat=errorflag)
122  global%error = errorflag
123  IF (global%error /= err_none) THEN
124  CALL errorstop(global, err_deallocate,__line__,'pTilePlag%cvTileMass')
125  END IF ! global%error
126  END IF ! pPatch%bcType
127  END DO ! iPatch
128 
129 ! ******************************************************************************
130 ! End
131 ! ******************************************************************************
132 
133  CALL deregisterfunction(global)
134 
135 END SUBROUTINE plag_rflu_deallocmemsoltile
136 
137 !******************************************************************************
138 !
139 ! RCS Revision history:
140 !
141 ! $Log: PLAG_RFLU_DeallocMemSolTile.F90,v $
142 ! Revision 1.5 2008/12/06 08:44:35 mtcampbe
143 ! Updated license.
144 !
145 ! Revision 1.4 2008/11/19 22:17:47 mtcampbe
146 ! Added Illinois Open Source License/Copyright
147 !
148 ! Revision 1.3 2006/09/18 20:32:50 fnajjar
149 ! Activated tile datastructure for inflow bc
150 !
151 ! Revision 1.2 2006/04/07 15:19:24 haselbac
152 ! Removed tabs
153 !
154 ! Revision 1.1 2004/02/26 21:00:43 haselbac
155 ! Initial revision
156 !
157 !******************************************************************************
158 
159 
160 
161 
162 
163 
164 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine plag_rflu_deallocmemsoltile(pRegion)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469