Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PERI_ReadInputFile.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: call section readers pertinent to PERI (done on all processors).
26 !
27 ! Description: none.
28 !
29 ! Input: regions = user input file of all regions.
30 !
31 ! Output: regions = PERI input parameters.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: PERI_ReadInputFile.F90,v 1.4 2008/12/06 08:44:36 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2001 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE peri_readinputfile( regions )
44 
45  USE moddatatypes
46  USE moddatastruct, ONLY : t_region
47  USE modglobal, ONLY : t_global
49  USE moderror
50  USE modparameters
51 
52  IMPLICIT NONE
53 
54 ! ... parameters
55  TYPE(t_region), POINTER :: regions(:)
56 
57 ! ... local variables
58  CHARACTER(CHRLEN) :: rcsidentstring
59  TYPE(t_global), POINTER :: global
60 
61  CHARACTER(2*CHRLEN+4) :: fname
62  CHARACTER(256) :: line
63  INTEGER :: errorflag
64 
65 !******************************************************************************
66 
67  rcsidentstring = '$RCSfile: PERI_ReadInputFile.F90,v $'
68 
69  global => regions(1)%global
70  CALL registerfunction( global,'PERI_ReadInputFile',&
71  'PERI_ReadInputFile.F90' )
72 
73 ! open file
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) &
79  CALL errorstop( global,err_file_open,__line__,'File: '//trim(fname) )
80 
81 ! read file looking for keywords
82 
83  DO
84  READ(if_input,'(A256)',err=10,end=86) line
85 
86  SELECT CASE(trim(line))
87  CASE ('# PERIODICFLOW')
88  CALL peri_readperisection( regions )
89  END SELECT
90  ENDDO
91 
92 86 CONTINUE
93 
94 ! close file ------------------------------------------------------------------
95 
96  CLOSE(if_input,iostat=errorflag)
97  global%error = errorflag
98  IF (global%error /= 0) &
99  CALL errorstop( global,err_file_close,__line__,'File: '//trim(fname) )
100 
101  goto 999
102 
103 ! error handling
104 
105 10 CONTINUE
106  CALL errorstop( global,err_file_read,__line__,'File: '//trim(fname) )
107 
108 999 CONTINUE
109 
110  CALL deregisterfunction( global )
111 
112 END SUBROUTINE peri_readinputfile
113 
114 !******************************************************************************
115 !
116 ! RCS Revision history:
117 !
118 ! $Log: PERI_ReadInputFile.F90,v $
119 ! Revision 1.4 2008/12/06 08:44:36 mtcampbe
120 ! Updated license.
121 !
122 ! Revision 1.3 2008/11/19 22:17:49 mtcampbe
123 ! Added Illinois Open Source License/Copyright
124 !
125 ! Revision 1.2 2004/06/11 21:49:40 wasistho
126 ! prepared for RFLU
127 !
128 ! Revision 1.1 2004/06/08 23:56:56 wasistho
129 ! changed nomenclature
130 !
131 ! Revision 1.1.1.1 2003/03/29 03:36:30 wasistho
132 ! install ROCPERI
133 !
134 !
135 !******************************************************************************
136 
137 
138 
139 
140 
141 
142 
subroutine peri_readinputfile(regions)
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 peri_readperisection(regions)
**********************************************************************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 errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469