Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_PickRegions.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: Pick regions.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! regions Region data
31 !
32 ! Output: None.
33 !
34 ! Notes: None.
35 !
36 !******************************************************************************
37 !
38 ! $Id: RFLU_PickRegions.F90,v 1.5 2008/12/06 08:45:04 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2003 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE rflu_pickregions(regions)
45 
46  USE moddatatypes
47  USE modglobal, ONLY: t_global
48  USE moddatastruct, ONLY: t_region
49  USE moderror
50  USE modmpi
51  USE modparameters
52 
53  IMPLICIT NONE
54 
55 ! ******************************************************************************
56 ! Declarations and definitions
57 ! ******************************************************************************
58 
59 ! ==============================================================================
60 ! Arguments
61 ! ==============================================================================
62 
63  TYPE(t_region), DIMENSION(:), POINTER :: regions
64 
65 ! ==============================================================================
66 ! Local variables
67 ! ==============================================================================
68 
69  CHARACTER :: infotype
70  CHARACTER(CHRLEN) :: rcsidentstring
71  INTEGER :: ireg
72  TYPE(t_global), POINTER :: global
73 
74 ! ******************************************************************************
75 ! Start
76 ! ******************************************************************************
77 
78  rcsidentstring = '$RCSfile: RFLU_PickRegions.F90,v $ $Revision: 1.5 $'
79 
80  global => regions(1)%global
81 
82  CALL registerfunction(global,'RFLU_PickRegions',&
83  'RFLU_PickRegions.F90')
84 
85  IF ( global%myProcid == masterproc .AND. &
86  global%verbLevel > verbose_none ) THEN
87  WRITE(stdout,'(A,1X,A)') solver_name,'Picking regions...'
88  END IF ! global%verbLevel
89 
90 ! ******************************************************************************
91 ! Enter information
92 ! ******************************************************************************
93 
94  WRITE(stdout,'(A,3X,A)') solver_name,'Enter information on regions:'
95  WRITE(stdout,'(A,5X,A)') solver_name,'a - Pick all regions'
96  WRITE(stdout,'(A,5X,A)') solver_name,'s - Pick some regions'
97  WRITE(stdout,'(A,3X,A)') solver_name,'Enter information type:'
98  READ(stdin,'(A)') infotype
99 
100  SELECT CASE ( infotype )
101 
102 ! ==============================================================================
103 ! All regions
104 ! ==============================================================================
105 
106  CASE ( 'a' )
107  DO ireg = 1,global%nRegionsLocal
108  regions(ireg)%activeFlag = .true.
109  END DO ! iReg
110 
111 ! ==============================================================================
112 ! Some regions
113 ! ==============================================================================
114 
115  CASE ( 's' )
116  DO ireg = 1,global%nRegionsLocal ! Must initialize first
117  regions(ireg)%activeFlag = .false.
118  END DO ! iReg
119 
120  DO
121  WRITE(stdout,'(A,3X,A)') solver_name, &
122  'Enter global region index (< 1 to exit):'
123  READ(stdin,*) ireg
124 
125  IF ( ireg < 1 ) THEN
126  EXIT
127  ELSE IF ( ireg > global%nRegionsLocal ) THEN
128  global%warnCounter = global%warnCounter + 1
129 
130  WRITE(stdout,'(A,5X,A,1X,A,I7,1X,A)') solver_name, &
131  '*** WARNING *** Invalid input.', &
132  'There are only ',global%nRegionsLocal,'regions.'
133  END IF ! iReg
134 
135  regions(ireg)%activeFlag = .true.
136  END DO ! <empty>
137 
138 ! ==============================================================================
139 ! Default
140 ! ==============================================================================
141 
142  CASE default
143  global%warnCounter = global%warnCounter + 1
144 
145  WRITE(stdout,'(A,5X,A,1X,A)') solver_name, &
146  '*** WARNING *** Invalid input.', &
147  'No regions selected.'
148 
149  DO ireg = 1,global%nRegionsLocal
150  regions(ireg)%activeFlag = .false.
151  END DO ! iReg
152  END SELECT ! infoType
153 
154 ! ******************************************************************************
155 ! End
156 ! ******************************************************************************
157 
158  IF ( (global%myProcid == masterproc) .AND. &
159  (global%verbLevel > verbose_none) ) THEN
160  WRITE(stdout,'(A,1X,A)') solver_name,'Picking regions done.'
161  END IF ! global%verbLevel
162 
163  CALL deregisterfunction(global)
164 
165 END SUBROUTINE rflu_pickregions
166 
167 !******************************************************************************
168 !
169 ! RCS Revision history:
170 !
171 ! $Log: RFLU_PickRegions.F90,v $
172 ! Revision 1.5 2008/12/06 08:45:04 mtcampbe
173 ! Updated license.
174 !
175 ! Revision 1.4 2008/11/19 22:18:15 mtcampbe
176 ! Added Illinois Open Source License/Copyright
177 !
178 ! Revision 1.3 2005/06/14 17:48:47 haselbac
179 ! Bug fix: Missing SOLVER_NAME
180 !
181 ! Revision 1.2 2003/07/22 02:08:33 haselbac
182 ! Added global%warnCounter
183 !
184 ! Revision 1.1.1.1 2003/06/04 22:31:20 haselbac
185 ! Initial revision
186 !
187 !******************************************************************************
188 
189 
190 
191 
192 
193 
194 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflu_pickregions(regions)
subroutine deregisterfunction(global)
Definition: ModError.F90:469