Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RADI_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 RADI (done on all processors).
26 !
27 ! Description: none.
28 !
29 ! Input: regions = user input file of all regions.
30 !
31 ! Output: regions = RADI input parameters.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: RADI_ReadInputFile.F90,v 1.3 2008/12/06 08:44:37 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2001 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 #ifdef RFLO
44 SUBROUTINE radi_readinputfile( regions )
45 #endif
46 #ifdef RFLU
47 SUBROUTINE radi_readinputfile
48 #endif
49 
50  USE moddatatypes
51 #ifdef RFLO
52  USE moddatastruct, ONLY : t_region
53 #endif
54  USE modglobal, ONLY : t_global
56  USE moderror
57  USE modparameters
58 
59  IMPLICIT NONE
60 
61 ! ... parameters
62 #ifdef RFLO
63  TYPE(t_region), POINTER :: regions(:)
64 #endif
65 
66 ! ... local variables
67  TYPE(t_global), POINTER :: global
68 
69  CHARACTER(2*CHRLEN+4) :: fname
70  CHARACTER(256) :: line
71  INTEGER :: errorflag
72 
73 !******************************************************************************
74 
75  global => regions(1)%global
76  CALL registerfunction( global,'RADI_ReadInputFile',&
77  'RADI_ReadInputFile.F90' )
78 
79 ! open file
80 
81  fname = trim(global%inDir)//trim(global%casename)//'.inp'
82  OPEN(if_input,file=fname,form='formatted',status='old',iostat=errorflag)
83  global%error = errorflag
84  IF (global%error /= 0) &
85  CALL errorstop( global,err_file_open,__line__,'File: '//trim(fname) )
86 
87 ! read file looking for keywords
88 
89  DO
90  READ(if_input,'(A256)',err=10,end=86) line
91 
92  SELECT CASE(trim(line))
93  CASE ('# RADIATION')
94 #ifdef RFLO
95  CALL radi_readradisection( regions )
96 #endif
97 #ifdef RFLU
99 #endif
100  END SELECT
101  ENDDO
102 
103 86 CONTINUE
104 
105 ! close file ------------------------------------------------------------------
106 
107  CLOSE(if_input,iostat=errorflag)
108  global%error = errorflag
109  IF (global%error /= 0) &
110  CALL errorstop( global,err_file_close,__line__,'File: '//trim(fname) )
111 
112  goto 999
113 
114 ! error handling
115 
116 10 CONTINUE
117  CALL errorstop( global,err_file_read,__line__,'File: '//trim(fname) )
118 
119 999 CONTINUE
120 
121  CALL deregisterfunction( global )
122 
123 END SUBROUTINE radi_readinputfile
124 
125 !******************************************************************************
126 !
127 ! RCS Revision history:
128 !
129 ! $Log: RADI_ReadInputFile.F90,v $
130 ! Revision 1.3 2008/12/06 08:44:37 mtcampbe
131 ! Updated license.
132 !
133 ! Revision 1.2 2008/11/19 22:17:50 mtcampbe
134 ! Added Illinois Open Source License/Copyright
135 !
136 ! Revision 1.1 2004/09/22 02:35:50 wasistho
137 ! changed file nomenclature from lower to upper case
138 !
139 ! Revision 1.1 2003/07/17 01:16:59 wasistho
140 ! initial activation rocrad
141 !
142 !
143 !
144 !******************************************************************************
145 
146 
147 
148 
149 
150 
151 
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
**********************************************************************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