Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SPEC_ReadSpecSection.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 user input applicable to all species.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! regions Data associated with regions
31 !
32 ! Output: None.
33 !
34 ! Notes: None.
35 !
36 ! ******************************************************************************
37 !
38 ! $Id: SPEC_ReadSpecSection.F90,v 1.5 2008/12/06 08:44:41 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2003-2005 by the University of Illinois
41 !
42 ! ******************************************************************************
43 
44 SUBROUTINE spec_readspecsection(regions)
45 
46  USE modglobal, ONLY: t_global
47  USE moddatatypes
48  USE moddatastruct, ONLY: t_region
49  USE moderror
50  USE modparameters
51 
52 #ifdef RFLU
53  USE modinterfaces, ONLY: readsection
54 #endif
55 
56  IMPLICIT NONE
57 
58 ! ******************************************************************************
59 ! Definitions and declarations
60 ! ******************************************************************************
61 
62 ! ==============================================================================
63 ! Arguments
64 ! ==============================================================================
65 
66  TYPE(t_region), DIMENSION(:), POINTER :: regions
67 
68 ! ==============================================================================
69 ! Locals
70 ! ==============================================================================
71 
72  INTEGER, PARAMETER :: nkeys = 2
73 
74  CHARACTER(CHRLEN) :: keys(nkeys)
75  CHARACTER(CHRLEN) :: rcsidentstring
76  LOGICAL :: defined(nkeys),usedflag
77  INTEGER :: errorflag
78  REAL(RFREAL) :: vals(nkeys)
79  TYPE(t_global), POINTER :: global
80 
81 #ifdef RFLU
82  INTEGER :: ireg
83 #endif
84 
85 ! ******************************************************************************
86 ! Start
87 ! ******************************************************************************
88 
89  rcsidentstring = '$RCSfile: SPEC_ReadSpecSection.F90,v $ $Revision: 1.5 $'
90 
91  global => regions(1)%global
92 
93  CALL registerfunction(global,'SPEC_ReadSpecSection',&
94  'SPEC_ReadSpecSection.F90')
95 
96 ! ******************************************************************************
97 ! Read user input for species
98 ! ******************************************************************************
99 
100  keys(1) = 'USED'
101  keys(2) = 'NSPECIES'
102 
103 #ifdef RFLU
104  CALL readsection(regions(1)%global,if_input,nkeys,keys,vals,defined)
105 
106  IF ( defined(1) .EQV. .true. ) THEN
107  usedflag = (nint(vals(1)) /= 0) ! if keyword USED appears, evaluate
108  ELSE
109  usedflag = .true. ! if it does not appear, default = true
110  END IF ! defined(1)
111 
112  DO ireg = lbound(regions,1),ubound(regions,1)
113  regions(ireg)%specInput%usedFlag = usedflag
114  END DO ! iReg
115 
116  IF ( (defined(2) .EQV. .true.) .AND. (usedflag .EQV. .true.) ) THEN
117  DO ireg = lbound(regions,1),ubound(regions,1)
118  regions(ireg)%specInput%nSpecies = nint(vals(2))
119  regions(ireg)%global%nSpecies = regions(ireg)%specInput%nSpecies
120  END DO ! iReg
121  END IF ! defined
122 #endif
123 
124 ! ******************************************************************************
125 ! End
126 ! ******************************************************************************
127 
128  CALL deregisterfunction(global)
129 
130 END SUBROUTINE spec_readspecsection
131 
132 ! ******************************************************************************
133 !
134 ! RCS Revision history:
135 !
136 ! $Log: SPEC_ReadSpecSection.F90,v $
137 ! Revision 1.5 2008/12/06 08:44:41 mtcampbe
138 ! Updated license.
139 !
140 ! Revision 1.4 2008/11/19 22:17:53 mtcampbe
141 ! Added Illinois Open Source License/Copyright
142 !
143 ! Revision 1.3 2005/10/05 20:10:38 haselbac
144 ! Added setting of global%nSpecies
145 !
146 ! Revision 1.2 2004/07/28 15:31:34 jferry
147 ! added USED field to SPECIES input section
148 !
149 ! Revision 1.1 2003/11/25 21:08:37 haselbac
150 ! Initial revision
151 !
152 ! ******************************************************************************
153 
154 
155 
156 
157 
158 
159 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine readsection(global, fileID, nvals, keys, vals, defined)
subroutine spec_readspecsection(regions)
subroutine deregisterfunction(global)
Definition: ModError.F90:469