Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AllocateMemoryWork.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 all variables associated with the mixture
26 ! for all active regions on current processor.
27 !
28 ! Description: none.
29 !
30 ! Input: region = current region
31 !
32 ! Output: region%work1D = 1D work array
33 ! region%work2D = 2D work array.
34 !
35 ! Notes: none.
36 !
37 !******************************************************************************
38 !
39 ! $Id: AllocateMemoryWork.F90,v 1.3 2008/12/06 08:44:08 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2001 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE allocatememorywork( region )
46 
47  USE moddatatypes
48  USE moddatastruct, ONLY : t_region
49  USE moderror
50  USE modparameters
51  IMPLICIT NONE
52 
53 ! ... parameters
54  TYPE(t_region) :: region
55 
56 ! ... local variables
57  INTEGER :: errorflag
58 
59 !******************************************************************************
60 
61  CALL registerfunction( region%global,'AllocateMemoryWork',&
62  'AllocateMemoryWork.F90' )
63 
64 ! allocate work space
65 
66 #ifdef RFLO
67  ALLOCATE( region%work1D(region%dimWork1D),stat=errorflag )
68  region%global%error = errorflag
69  IF (region%global%error /= 0) &
70  CALL errorstop( region%global,err_allocate,__line__ )
71 
72  ALLOCATE( region%work2D(region%dimWork2D(1),region%dimWork2D(2)), &
73  stat=errorflag )
74  region%global%error = errorflag
75  IF (region%global%error /= 0) &
76  CALL errorstop( region%global,err_allocate,__line__ )
77 #endif
78 
79 ! finalize
80 
81  CALL deregisterfunction( region%global )
82 
83 END SUBROUTINE allocatememorywork
84 
85 !******************************************************************************
86 !
87 ! RCS Revision history:
88 !
89 ! $Log: AllocateMemoryWork.F90,v $
90 ! Revision 1.3 2008/12/06 08:44:08 mtcampbe
91 ! Updated license.
92 !
93 ! Revision 1.2 2008/11/19 22:17:22 mtcampbe
94 ! Added Illinois Open Source License/Copyright
95 !
96 ! Revision 1.1 2004/12/01 16:47:48 haselbac
97 ! Initial revision after changing case
98 !
99 ! Revision 1.9 2003/05/15 02:57:02 jblazek
100 ! Inlined index function.
101 !
102 ! Revision 1.8 2002/10/08 15:48:35 haselbac
103 ! {IO}STAT=global%error replaced by {IO}STAT=errorFlag - SGI problem
104 !
105 ! Revision 1.7 2002/09/05 17:40:19 jblazek
106 ! Variable global moved into regions().
107 !
108 ! Revision 1.6 2002/08/30 19:08:58 jblazek
109 ! Dimensions of work arrays now set in derivedInputValues.
110 !
111 ! Revision 1.5 2002/08/24 03:12:54 wasistho
112 ! put safety within #ifdef TURB
113 !
114 ! Revision 1.4 2002/08/07 20:40:07 jblazek
115 ! Added RFLO preprocessor directive around memory allocation.
116 !
117 ! Revision 1.3 2002/07/15 22:03:34 jblazek
118 ! Extended allocation of work space to physical modules.
119 !
120 ! Revision 1.2 2002/02/21 23:25:05 jblazek
121 ! Blocks renamed as regions.
122 !
123 ! Revision 1.1 2002/01/28 23:55:22 jblazek
124 ! Added flux computation (central scheme).
125 !
126 !******************************************************************************
127 
128 
129 
130 
131 
132 
133 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine allocatememorywork(region)
subroutine deregisterfunction(global)
Definition: ModError.F90:469