Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLO_ReadRegionMapSection.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: read in user input related to region mapping and activation.
26 !
27 ! Description: none.
28 !
29 ! Input: user input file.
30 !
31 ! Output: global = type of mapping regions to processors.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: RFLO_ReadRegionMapSection.F90,v 1.5 2008/12/06 08:44:27 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2001 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE rflo_readregionmapsection( global )
44 
45  USE moddatatypes
46  USE modglobal, ONLY : t_global
47  USE modinterfaces, ONLY : readsection
48  USE moderror
49  USE modparameters
50  IMPLICIT NONE
51 
52 ! ... parameters
53  TYPE(t_global), POINTER :: global
54 
55 ! ... local variables
56  CHARACTER(2*CHRLEN+4) :: fname
57  CHARACTER(10) :: keys(1)
58  CHARACTER(256) :: line
59 
60  INTEGER :: errorflag
61 
62  LOGICAL :: defined(1)
63 
64  REAL(RFREAL) :: vals(1)
65 
66 !******************************************************************************
67 
68  CALL registerfunction( global,'RFLO_ReadRegionMapSection',&
69  'RFLO_ReadRegionMapSection.F90' )
70 
71 ! open file and search for keywords
72 
73  keys(1) = 'NBLOCKS'
74 
75  fname = trim(global%inDir)//trim(global%casename)//'.inp'
76  OPEN(if_input,file=fname,form='formatted',status='old',iostat=errorflag)
77  global%error = errorflag
78  IF (global%error /= 0) CALL errorstop( global,err_file_open,__line__,fname )
79 
80  DO
81  READ(if_input,'(A256)',err=10,end=86) line
82  IF (trim(line) == '# BLOCKMAP') THEN
83  CALL readsection( global,if_input,1,keys,vals,defined )
84  IF (defined(1).eqv. .true.) global%nRegionsProc = nint(vals(1))
85  EXIT
86  ENDIF
87  ENDDO
88 
89 86 CONTINUE
90 
91 ! close file ------------------------------------------------------------------
92 
93  CLOSE(if_input,iostat=errorflag)
94  global%error = errorflag
95  IF (global%error /= 0) CALL errorstop( global,err_file_close,__line__,fname )
96 
97 ! finalization & error handling -----------------------------------------------
98 
99  CALL deregisterfunction( global )
100  goto 999
101 
102 10 CONTINUE
103  CALL errorstop( global,err_file_read,__line__,fname )
104 
105 999 CONTINUE
106 
107 END SUBROUTINE rflo_readregionmapsection
108 
109 !******************************************************************************
110 !
111 ! RCS Revision history:
112 !
113 ! $Log: RFLO_ReadRegionMapSection.F90,v $
114 ! Revision 1.5 2008/12/06 08:44:27 mtcampbe
115 ! Updated license.
116 !
117 ! Revision 1.4 2008/11/19 22:17:38 mtcampbe
118 ! Added Illinois Open Source License/Copyright
119 !
120 ! Revision 1.3 2008/10/23 18:20:57 mtcampbe
121 ! Crazy number of changes to track and fix initialization and
122 ! restart bugs. Many improperly formed logical expressions
123 ! were fixed, and bug in allocation for data associated with
124 ! the BC_INFLOWVELTEMP boundary condition squashed in
125 ! RFLO_ReadBcInflowVelSection.F90.
126 !
127 ! Revision 1.2 2005/01/12 04:19:11 wasistho
128 ! applied NINT to vals(1)
129 !
130 ! Revision 1.1 2004/11/29 20:51:39 wasistho
131 ! lower to upper case
132 !
133 ! Revision 1.10 2003/11/20 16:40:40 mdbrandy
134 ! Backing out RocfluidMP changes from 11-17-03
135 !
136 ! Revision 1.6 2003/05/15 02:57:04 jblazek
137 ! Inlined index function.
138 !
139 ! Revision 1.5 2003/02/26 23:38:30 jferry
140 ! eliminated end=999 convention to ensure that files get closed
141 !
142 ! Revision 1.4 2002/10/12 03:20:50 jblazek
143 ! Replaced [io]stat=global%error with local errorFlag for Rocflo.
144 !
145 ! Revision 1.3 2002/09/20 22:22:36 jblazek
146 ! Finalized integration into GenX.
147 !
148 ! Revision 1.2 2002/09/05 17:40:22 jblazek
149 ! Variable global moved into regions().
150 !
151 ! Revision 1.1 2002/02/21 23:25:06 jblazek
152 ! Blocks renamed as regions.
153 !
154 ! Revision 1.3 2002/01/11 17:20:19 jblazek
155 ! Added time stamp or iteration number to file names.
156 !
157 ! Revision 1.2 2001/12/22 00:09:39 jblazek
158 ! Added routines to store grid and solution.
159 !
160 ! Revision 1.1.1.1 2001/12/03 21:44:04 jblazek
161 ! Import of RocfluidMP
162 !
163 !******************************************************************************
164 
165 
166 
167 
168 
169 
170 
CImg< T > & line(const unsigned int y0)
Get a line.
Definition: CImg.h:18421
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
subroutine rflo_readregionmapsection(global)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE form
subroutine readsection(global, fileID, nvals, keys, vals, defined)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469