Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ReadThrustSection.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 calculation of thrust.
26 !
27 ! Description: none.
28 !
29 ! Input: user input file.
30 !
31 ! Output: global = parameters for calculation of thrust.
32 !
33 ! Notes: none.
34 !
35 !******************************************************************************
36 !
37 ! $Id: ReadThrustSection.F90,v 1.4 2008/12/06 08:44:10 mtcampbe Exp $
38 !
39 ! Copyright: (c) 2003 by the University of Illinois
40 !
41 !******************************************************************************
42 
43 SUBROUTINE readthrustsection( 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(10) :: keys(7)
57 
58  LOGICAL :: defined(7)
59 
60  REAL(RFREAL) :: vals(7)
61 
62 !******************************************************************************
63 
64  CALL registerfunction( global,'ReadThrustSection',&
65  'ReadThrustSection.F90' )
66 
67 ! specify keywords and search for them
68 
69  keys(1) = 'TYPE'
70  keys(2) = 'PLANE'
71  keys(3) = 'COORD'
72  keys(4) = 'WRITIME'
73  keys(5) = 'WRIITER'
74  keys(6) = 'OPENCLOSE'
75  keys(7) = 'PAMB'
76 
77  CALL readsection( global,if_input,7,keys,vals,defined )
78 
79  IF (defined(1).eqv..true.) THEN
80  global%thrustType = thrust_none
81  IF (vals(1)>0.9 .AND. vals(1)<1.1) global%thrustType = thrust_mom
82  IF (vals(1) > 1.9) global%thrustType = thrust_momp
83  ENDIF
84  IF (defined(2).eqv..true.) THEN
85  IF (vals(2) < 1.1) global%thrustPlane = xcoord
86  IF (vals(2)>=1.1 .AND. vals(2)<2.1) global%thrustPlane = ycoord
87  IF (vals(2) >= 2.1) global%thrustPlane = zcoord
88  ENDIF
89  IF (defined(3).eqv..true.) THEN
90  global%thrustCoord = vals(3)
91  ENDIF
92  IF (defined(4).eqv..true.) global%thrustSaveTime = abs(vals(4))
93  IF (defined(5).eqv..true.) THEN
94  global%thrustSaveIter = int(abs(vals(5))+0.5_rfreal)
95  global%thrustSaveIter = max(1,global%thrustSaveIter)
96  ENDIF
97  IF (defined(6).eqv..true.) THEN
98  IF (vals(6) < 0.5_rfreal) THEN
99  global%thrustOpenClose = .false.
100  ELSE
101  global%thrustOpenClose = .true.
102  ENDIF
103  ENDIF
104  IF (defined(7).eqv..true.) THEN
105  global%thrustPamb = abs(vals(7))
106  ENDIF
107 
108 ! finalize
109 
110  CALL deregisterfunction( global )
111 
112 END SUBROUTINE readthrustsection
113 
114 !******************************************************************************
115 !
116 ! RCS Revision history:
117 !
118 ! $Log: ReadThrustSection.F90,v $
119 ! Revision 1.4 2008/12/06 08:44:10 mtcampbe
120 ! Updated license.
121 !
122 ! Revision 1.3 2008/11/19 22:17:23 mtcampbe
123 ! Added Illinois Open Source License/Copyright
124 !
125 ! Revision 1.2 2008/10/23 18:20:55 mtcampbe
126 ! Crazy number of changes to track and fix initialization and
127 ! restart bugs. Many improperly formed logical expressions
128 ! were fixed, and bug in allocation for data associated with
129 ! the BC_INFLOWVELTEMP boundary condition squashed in
130 ! RFLO_ReadBcInflowVelSection.F90.
131 !
132 ! Revision 1.1 2004/12/01 16:50:52 haselbac
133 ! Initial revision after changing case
134 !
135 ! Revision 1.4 2003/11/20 16:40:35 mdbrandy
136 ! Backing out RocfluidMP changes from 11-17-03
137 !
138 ! Revision 1.1 2003/06/02 17:12:00 jblazek
139 ! Added computation of thrust.
140 !
141 !******************************************************************************
142 
143 
144 
145 
146 
147 
148 
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine readthrustsection(global)
subroutine readsection(global, fileID, nvals, keys, vals, defined)
subroutine deregisterfunction(global)
Definition: ModError.F90:469