Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_CreateRegions.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 region pointer.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! global Pointer to global type
31 ! iLev Level index
32 ! levels Pointer to levels
33 !
34 ! Output: None.
35 !
36 ! Notes:
37 ! 1. This routine exists only for speeding up compilation with optimization.
38 ! See routine RFLU_BuildDataStruct for detailed comments.
39 !
40 !******************************************************************************
41 !
42 ! $Id: RFLU_CreateRegions.F90,v 1.3 2008/12/06 08:44:12 mtcampbe Exp $
43 !
44 ! Copyright: (c) 2003 by the University of Illinois
45 !
46 !******************************************************************************
47 
48 SUBROUTINE rflu_createregions(global,iLev,levels)
49 
50  USE modglobal, ONLY: t_global
51  USE moddatatypes
52  USE moddatastruct, ONLY: t_level,t_region
53  USE moderror
54 
55  IMPLICIT NONE
56 
57 ! ******************************************************************************
58 ! Declarations and definitions
59 ! ******************************************************************************
60 
61 ! ==============================================================================
62 ! Arguments
63 ! ==============================================================================
64 
65  INTEGER, INTENT(IN) :: ilev
66  TYPE(t_global), POINTER :: global
67  TYPE(t_level), DIMENSION(:), POINTER :: levels
68 
69 ! ==============================================================================
70 ! Local variables
71 ! ==============================================================================
72 
73  INTEGER :: errorflag,ireglow,iregupp
74  CHARACTER(CHRLEN) :: rcsidentstring
75 
76 ! ******************************************************************************
77 ! Start
78 ! ******************************************************************************
79 
80  rcsidentstring = '$RCSfile: RFLU_CreateRegions.F90,v $ $Revision: 1.3 $'
81 
82  CALL registerfunction(global,'RFLU_CreateRegions',&
83  'RFLU_CreateRegions.F90')
84 
85 ! ******************************************************************************
86 ! Allocate memory
87 ! ******************************************************************************
88 
89  iregupp = global%nRegionsLocal
90 
91  IF ( ilev == 1 ) THEN ! finest level
92  ireglow = 0
93  ELSE ! coarse level
94  ireglow = 1
95  END IF ! iLev
96 
97  ALLOCATE(levels(ilev)%regions(ireglow:iregupp),stat=errorflag)
98  global%error = errorflag
99  IF ( global%error /= err_none ) THEN
100  CALL errorstop(global,err_allocate,__line__,'levels%regions')
101  END IF ! global%error
102 
103 ! ******************************************************************************
104 ! End
105 ! ******************************************************************************
106 
107  CALL deregisterfunction(global)
108 
109 END SUBROUTINE rflu_createregions
110 
111 !******************************************************************************
112 !
113 ! RCS Revision history:
114 !
115 ! $Log: RFLU_CreateRegions.F90,v $
116 ! Revision 1.3 2008/12/06 08:44:12 mtcampbe
117 ! Updated license.
118 !
119 ! Revision 1.2 2008/11/19 22:17:25 mtcampbe
120 ! Added Illinois Open Source License/Copyright
121 !
122 ! Revision 1.1 2003/06/09 14:04:05 haselbac
123 ! Initial revision
124 !
125 !******************************************************************************
126 
127 
128 
129 
130 
131 
132 
133 
subroutine rflu_createregions(global, iLev, levels)
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