Screamer Project  V3.3.1
Screamer Structure
 All Files Functions Variables
rdscrparm.f
Go to the documentation of this file.
1 c----------------------------------------------------------------------
2 c @(#)rdscrparm.f version 1.0 created 06/15/2005 by Mathias Bavay
3 c----------------------------------------------------------------------
4 c---------------------------------------------------------------------
5 c
6 c This subroutine does the processing of the general parameters
7 c at the begining of an input deck.
8 c
9 c Modifications:
10 c 2014-05-01 RBS: Initialize switch_time to zero
11 c---------------------------------------------------------------------
12 
13  subroutine readscreamerparameters(status)
14 
15  include 'zdemmax.h'
16  include 'zdemcomm.h'
17  include 'zdemout.h'
18 c
19 c Include the files with the keywords and the integer flags as parameters.
20 c
21  include 'zdemparm.h'
22  include 'zdempprm.h'
23  include 'zdemenv.h'
24 
25  include 'rdscrdat.h'
26 c
27 c Define passed variables
28 c
29  integer status
30 c
31  status=0
32 
33 c Get the initial parameters.
34 c First, set the flags which tell if a particular parameter has been entered,
35 c set the TITLE to blanks in case one is not entered,
36 c then zero the counters for the number of lines with errors.
37 c In this section, any line starting with diaglabel_key or a
38 c diaglabel_altkey is considered a comment line.
39 c
40  tstepflg = err
41  endtflg = err
42  nprtflg = err
43  ncyclflg = err
44  restflg = err
45  plot_grid = no_grid
46  maxfpts = max_plot_points
47  echoset = no_echo
48  detail_prints = detail_prints_min
49  title = ' '
50  numerr = 0
51 
52  do i = 1, max_switch_points
53  switch_time(i) = 0.0
54  enddo
55 
56 c
57 c Get the title, assumed to be everything on line 1,
58 c and set the counter for the number of lines read.
59 c Write a banner page using the title and then start a new page writing the
60 c time.
61 c
62  read (lunit, 100) title
63  100 format (a80)
64  nlines = 1
65  call banner(title)
66 c
67 c Get the initial parameters, checking for comments.
68 c
69  200 continue
70 c
71  call get_next_line(currline, field, nlines, eofflg, max_fields)
72  if (eofflg .eq. err) then
73  status=1000
74  return
75  endif
76  keyword = field(1)(1:keyword_len)
77 c
78 c Plot grids?
79 c
80  if (keyword .eq. k_plot_grid) then
81  if (field(2)(1:1) .eq. k_yes_grid) then
82  plot_grid = yes_grid
83  end if
84 c
85 c Echo the setup parameters and indicies?
86 c
87  else if (keyword .eq. k_echo) then
88  if (field(2)(1:1) .eq. k_yes_echo) then
89  echoset = yes_echo
90  end if
91 c
92 c Set level of detail on printing to log file?
93 c
94  else if (keyword .eq. k_detail_prints) then
95  if (field(2)(1:keyword_len) .eq. k_detail_prints_full) then
96  detail_prints = detail_prints_full
97  end if
98 c
99 c Time step
100 c
101  else if (keyword .eq. k_time_step) then
102  call text_to_real(field(2), time_step, flag)
103  if (flag .eq. noerr) then
104  ht = time_step
105  tstepflg = noerr
106  else
107  call print_bad_line(currline, nlines, numerr)
108  end if
109 c
110 c Stop time (end simulation)
111 c
112  else if (keyword .eq. k_end_time) then
113  call text_to_real(field(2), end_time, flag)
114  if (flag .eq. noerr) then
115  tmax = end_time
116  endtflg = noerr
117  else
118  call print_bad_line(currline, nlines, numerr)
119  end if
120 c
121 c Number of print outs during the execution.
122 c
123  else if (keyword .eq. k_num_prints) then
124  call text_to_int(field(2), num_prints, flag)
125  if (flag .eq. noerr) then
126  nprint = num_prints
127  nprtflg = noerr
128  else
129  call print_bad_line(currline, nlines, numerr)
130  end if
131 c
132 c Number of cycles to execute (one or all).
133 c
134  else if (keyword .eq. k_num_cycles) then
135  keychar = field(2)(1:1)
136  if (keychar .eq. k_all_cycles) then
137  iset = all_cycles
138  ncyclflg = noerr
139  else if (keychar .eq. k_one_cycle) then
140  iset = one_cycle
141  ncyclflg = noerr
142  else
143  call print_bad_line(currline, nlines, numerr)
144  end if
145 c
146 c Resolution time step (transmission lines only).
147 c
148  else if (keyword .eq. k_res_time) then
149  call text_to_real(field(2), rtime, flag)
150  if (flag .eq. noerr) then
151  res_time = rtime
152  restflg = noerr
153  else
154  call print_bad_line(currline, nlines, numerr)
155  end if
156 c
157 c Maximum number of points to store for plots, prints, and files.
158 c
159  else if (keyword .eq. k_maxfpts) then
160  call text_to_int(field(2), jmax, flag)
161  if (flag .eq. noerr) then
162  if (jmax .le. max_plot_points) then
163  maxfpts = jmax
164  end if
165  else
166  call print_bad_line(currline, nlines, numerr)
167  end if
168 c
169 c Look for switch table input, input vector values
170 c
171  else if (keyword .eq. k_switch_time) then
172  call read_vector(switch_time, num_pts, eofflg, nlines, numerr)
173 c
174 c Is this the first branch after the set up parameters?
175 c
176  else if (keyword .eq. k_branch) then
177  goto 300
178 c
179 c Comment line.
180 c
181  else if ((keyword(1:1) .eq. comment_key) .or.
182  + (keyword(1:1) .eq. diaglabel_key) .or.
183  + (keyword(1:1) .eq. diaglabel_altkey) )then
184  continue
185 c
186 c Something unknown, so signal error.
187 c
188  else
189  call print_bad_line(currline, nlines, numerr)
190  end if
191 c
192 c Go and get another line.
193 c
194  go to 200
195 
196 c if (0 .eq. 1) then
197 c 1000 status=1000
198 c end if
199 
200  300 continue
201  return
202  end
subroutine readscreamerparameters(status)
Definition: rdscrparm.f:13
subroutine get_next_line(currline, field, nlines, eofflg, max_fields)
Definition: getnxtln.f:1
subroutine text_to_int(text, int, flag)
Definition: txt2int.f:1
subroutine banner(line)
Definition: prtbannr.f:1
subroutine read_vector(vals, num_vals, eofflg, nlines, numerr)
Definition: rdvector.f:1
subroutine print_bad_line(currline, nlines, numerr)
Definition: prtbadln.f:1
subroutine text_to_real(text, rvalue, flag)
Definition: txt2real.f:1