-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathreadParams.f90
200 lines (176 loc) · 4.6 KB
/
readParams.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
!> @file readParams.f90
!!
!! Reading in of user-input parameters.
!
! *****************************************************************************
!
! (c) J. Blazek, CFD Consulting & Analysis, www.cfd-ca.de
! Created February 25, 2014
! Last modification: May 20, 2014
!
! *****************************************************************************
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License
! as published by the Free Software Foundation; either version 2
! of the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with this program; if not, write to the Free Software
! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
!
! *****************************************************************************
!> Reads in user-input parameters.
!!
!! @param fname path and name of the user input file
!!
subroutine ReadParams( fname )
use ModControl
use ModFiles
use ModGeometry
use ModNumerics
use ModPhysics
use ModPlotQuant
use ModInterfaces, only : ErrorMessage, ReadChar
implicit none
! parameters
character(*), intent(in) :: fname
! local variables
character(1) :: ch
integer :: errFlag, i
! *****************************************************************************
open(unit=ifInp, file=fname, status="old", action="read", iostat=errFlag)
if (errFlag /= 0) call ErrorMessage( "cannot open input file" )
read(ifInp,"(1X)")
read(ifInp,"(A)") title
read(ifInp,"(1X)")
read(ifInp,"(1X)")
read(ifInp,"(A)") fnGrid
read(ifInp,"(1X)")
read(ifInp,"(1X)")
read(ifInp,"(A)") fnFlow
read(ifInp,"(1X)")
read(ifInp,"(1X)")
read(ifInp,"(A)") fnSurf
read(ifInp,"(1X)")
read(ifInp,"(1X)")
read(ifInp,"(A)") fnConv
read(ifInp,"(1X)")
read(ifInp,"(1X)")
read(ifInp,"(A)") fnRsti
read(ifInp,"(1X)")
read(ifInp,"(1X)")
read(ifInp,"(A)") fnRsto
! physics - general
read(ifInp,"(1X)")
read(ifInp,"(1X)")
read(ifInp,"(1X)")
ch = ReadChar( ifInp )
if (ch=="e" .or. ch=="E") then
kflow = "E"
else
kflow = "I"
endif
ch = ReadChar( ifInp )
if (ch=="e" .or. ch=="E") then
kequs = "E"
else
kequs = "N"
endif
read(ifInp,*) gamma
read(ifInp,*) cpgas
read(ifInp,*) renum
read(ifInp,*) refvel
read(ifInp,*) refrho
read(ifInp,*) prlam
! physics - external flow
read(ifInp,"(1X)")
read(ifInp,"(1X)")
read(ifInp,"(1X)")
read(ifInp,*) machinf
read(ifInp,*) alpha
read(ifInp,*) pinf
read(ifInp,*) tinf
! physics - internal flow
read(ifInp,"(1X)")
read(ifInp,"(1X)")
read(ifInp,"(1X)")
read(ifInp,*) ptinl
read(ifInp,*) ttinl
read(ifInp,*) betainl
read(ifInp,*) pout
read(ifInp,*) betaout
read(ifInp,*) p12rat
! geometrical reference values
read(ifInp,"(1X)")
read(ifInp,"(1X)")
read(ifInp,"(1X)")
read(ifInp,*) xref
read(ifInp,*) yref
read(ifInp,*) cref
! iteration control
read(ifInp,"(1X)")
read(ifInp,"(1X)")
read(ifInp,"(1X)")
read(ifInp,*) maxiter
read(ifInp,*) outstep
read(ifInp,*) convtol
ch = ReadChar( ifInp )
if (ch=="y" .or. ch=="Y") then
lrest = "Y"
else
lrest = "N"
endif
! numerical parameters
read(ifInp,"(1X)")
read(ifInp,"(1X)")
read(ifInp,"(1X)")
read(ifInp,*) cfl
read(ifInp,*) epsirs
read(ifInp,*) nitirs
ch = ReadChar( ifInp )
if (ch=="l" .or. ch=="L") then
ktimst = "L"
else
ktimst = "G"
endif
ch = ReadChar( ifInp )
if (ch=="y" .or. ch=="Y") then
kprecond = "Y"
else
kprecond = "N"
endif
read(ifInp,*) precoeff
read(ifInp,*) iorder
read(ifInp,*) limfac
read(ifInp,*) epsentr
ch = ReadChar( ifInp )
if (ch=="y" .or. ch=="Y") then
lvort = "Y"
else
lvort = "N"
endif
read(ifInp,*) nrk
read(ifInp,*) (ark (i), i=1,nrk)
read(ifInp,*) (betrk(i), i=1,nrk)
read(ifInp,*) (ldiss(i), i=1,nrk)
! quantities to plot
read(ifInp,"(1X)")
read(ifInp,"(1X)")
read(ifInp,"(1X)")
do i=1,mxquant
ch = ReadChar( ifInp )
if (ch=="y" .or. ch=="Y") then
lquant(i) = "Y"
else
lquant(i) = "N"
endif
enddo
! close input file
close(unit=ifInp)
end subroutine ReadParams