Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SPEC_RFLU_AllocateMemorySol.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: Allocate 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_AllocateMemorySol.F90,v 1.6 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_allocatememorysol(pRegion)
45 
46  USE moddatatypes
47  USE moderror
48  USE modparameters
49  USE modglobal, ONLY: t_global
50  USE modgrid, ONLY: t_grid
51  USE moddatastruct, ONLY: t_region
52  USE modmpi
53 
54  IMPLICIT NONE
55 
56 ! ******************************************************************************
57 ! Definitions and declarations
58 ! ******************************************************************************
59 
60 ! ==============================================================================
61 ! Arguments
62 ! ==============================================================================
63 
64  TYPE(t_region), POINTER :: pregion
65 
66 ! ==============================================================================
67 ! Locals
68 ! ==============================================================================
69 
70  CHARACTER(CHRLEN) :: rcsidentstring
71  INTEGER :: errorflag,ispec,nspecies
72  TYPE(t_grid), POINTER :: pgrid
73  TYPE(t_global), POINTER :: global
74 
75 ! ******************************************************************************
76 ! Start
77 ! ******************************************************************************
78 
79  rcsidentstring = '$RCSfile: SPEC_RFLU_AllocateMemorySol.F90,v $ $Revision: 1.6 $'
80 
81  global => pregion%global
82 
83  CALL registerfunction(global,'SPEC_RFLU_AllocateMemorySol',&
84  'SPEC_RFLU_AllocateMemorySol.F90')
85 
86 ! ******************************************************************************
87 ! Set pointers and variables
88 ! ******************************************************************************
89 
90  pgrid => pregion%grid
91 
92  nspecies = pregion%specInput%nSpecies
93 
94 ! ******************************************************************************
95 ! Allocate memory
96 ! ******************************************************************************
97 
98 ! ==============================================================================
99 ! State vectors
100 ! ==============================================================================
101 
102  ALLOCATE(pregion%spec%cv(nspecies,pgrid%nCellsTot),stat=errorflag)
103  global%error = errorflag
104  IF (global%error /= err_none) THEN
105  CALL errorstop(global,err_allocate,__line__,'pRegion%spec%cv')
106  END IF ! global%error
107 
108  ALLOCATE(pregion%spec%cvInfo(nspecies),stat=errorflag)
109  global%error = errorflag
110  IF (global%error /= err_none) THEN
111  CALL errorstop(global,err_allocate,__line__,'pRegion%spec%cvInfo')
112  END IF ! global%error
113 
114 ! ==============================================================================
115 ! Transport variables
116 ! ==============================================================================
117 
118  IF ( pregion%mixtInput%flowModel == flow_navst ) THEN
119  ALLOCATE(pregion%spec%tv(nspecies,pgrid%nCellsTot),stat=errorflag)
120  global%error = errorflag
121  IF (global%error /= err_none) THEN
122  CALL errorstop(global,err_allocate,__line__,'pRegion%spec%tv')
123  END IF ! global%error
124  ELSE
125  nullify(pregion%spec%tv)
126  END IF ! pMixtInput%flowModel
127 
128 ! ******************************************************************************
129 ! End
130 ! ******************************************************************************
131 
132  CALL deregisterfunction(global)
133 
134 END SUBROUTINE spec_rflu_allocatememorysol
135 
136 ! ******************************************************************************
137 !
138 ! RCS Revision history:
139 !
140 ! $Log: SPEC_RFLU_AllocateMemorySol.F90,v $
141 ! Revision 1.6 2008/12/06 08:44:40 mtcampbe
142 ! Updated license.
143 !
144 ! Revision 1.5 2008/11/19 22:17:52 mtcampbe
145 ! Added Illinois Open Source License/Copyright
146 !
147 ! Revision 1.4 2004/11/02 02:33:52 haselbac
148 ! Removed init of cvInfo, cosmetics
149 !
150 ! Revision 1.3 2004/03/03 23:54:41 jferry
151 ! Corrected typo
152 !
153 ! Revision 1.2 2004/01/29 22:59:37 haselbac
154 ! Added allocation of cvInfo and tv
155 !
156 ! Revision 1.1 2003/11/25 21:08:37 haselbac
157 ! Initial revision
158 !
159 ! ******************************************************************************
160 
161 
162 
163 
164 
165 
166 
subroutine spec_rflu_allocatememorysol(pRegion)
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