Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SPEC_RFLU_DeallocateMemorySol.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 species 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: SPEC_RFLU_DeallocateMemorySol.F90,v 1.5 2008/12/06 08:44:40 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2003-2004 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE spec_rflu_deallocatememorysol(pRegion)
45 
46  USE moddatatypes
47  USE moderror
48  USE modparameters
49  USE modglobal, ONLY: t_global
50  USE moddatastruct, ONLY: t_region
51  USE modmpi
52 
53  IMPLICIT NONE
54 
55 ! ******************************************************************************
56 ! Definitions and declarations
57 ! ******************************************************************************
58 
59 ! ==============================================================================
60 ! Arguments
61 ! ==============================================================================
62 
63  TYPE(t_region), POINTER :: pregion
64 
65 ! ==============================================================================
66 ! Locals
67 ! ==============================================================================
68 
69  CHARACTER(CHRLEN) :: rcsidentstring
70  INTEGER :: errorflag
71  TYPE(t_global), POINTER :: global
72 
73 ! ******************************************************************************
74 ! Start
75 ! ******************************************************************************
76 
77  rcsidentstring = '$RCSfile: SPEC_RFLU_DeallocateMemorySol.F90,v $ $Revision: 1.5 $'
78 
79  global => pregion%global
80 
81  CALL registerfunction(global,'SPEC_RFLU_DeallocateMemorySol',&
82  'SPEC_RFLU_DeallocateMemorySol.F90')
83 
84 ! ******************************************************************************
85 ! Allocate memory
86 ! ******************************************************************************
87 
88 ! ==============================================================================
89 ! State vectors
90 ! ==============================================================================
91 
92  DEALLOCATE(pregion%spec%cv,stat=errorflag)
93  global%error = errorflag
94  IF (global%error /= err_none) THEN
95  CALL errorstop(global,err_deallocate,__line__,'pRegion%spec%cv')
96  END IF ! global%error
97 
98  DEALLOCATE(pregion%spec%cvInfo,stat=errorflag)
99  global%error = errorflag
100  IF (global%error /= err_none) THEN
101  CALL errorstop(global,err_deallocate,__line__,'pRegion%spec%cvInfo')
102  END IF ! global%error
103 
104 ! ==============================================================================
105 ! Transport variables
106 ! ==============================================================================
107 
108  IF ( pregion%mixtInput%flowModel == flow_navst ) THEN
109  DEALLOCATE(pregion%spec%tv,stat=errorflag)
110  global%error = errorflag
111  IF (global%error /= err_none) THEN
112  CALL errorstop(global,err_deallocate,__line__,'pRegion%spec%tv')
113  END IF ! global%error
114  END IF ! pMixtInput%flowModel
115 
116 ! ******************************************************************************
117 ! End
118 ! ******************************************************************************
119 
120  CALL deregisterfunction(global)
121 
122 END SUBROUTINE spec_rflu_deallocatememorysol
123 
124 !******************************************************************************
125 !
126 ! RCS Revision history:
127 !
128 ! $Log: SPEC_RFLU_DeallocateMemorySol.F90,v $
129 ! Revision 1.5 2008/12/06 08:44:40 mtcampbe
130 ! Updated license.
131 !
132 ! Revision 1.4 2008/11/19 22:17:52 mtcampbe
133 ! Added Illinois Open Source License/Copyright
134 !
135 ! Revision 1.3 2006/04/07 15:19:24 haselbac
136 ! Removed tabs
137 !
138 ! Revision 1.2 2004/01/29 22:59:39 haselbac
139 ! Added deallocation of cvInfo and tv
140 !
141 ! Revision 1.1 2003/11/25 21:08:37 haselbac
142 ! Initial revision
143 !
144 !******************************************************************************
145 
146 
147 
148 
149 
150 
151 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine spec_rflu_deallocatememorysol(pRegion)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469