Screamer Project  V3.3.1
Screamer Structure
 All Files Functions Variables
rdpw3prm.f
Go to the documentation of this file.
1  subroutine readctab (parms, nparms, eofflg, nlines, nerrors)
2 
3 c Modification log
4 c
5 c 2008-07-17 RBS: Changed the length of currline to 120 from 80
6 c 2014-02-06 RBS: Changed real*4 to real
7 c 2014-05-01 RBS: Changed eofflag to eofflg to match all other subroutines
8 c
9 c Passed variable definitions
10 
11  real parms(*)
12  integer nparms, eofflg, nlines, nerrors
13 c
14 c This subroutine reads in a set of (X,Y,Z) values to be used in a
15 c piecewise linear model. Up to 134 (X,Y,Z) pairs
16 c may be entered, three per line.
17 c The first coefficient on each line is X, the second is Y, the third Z.
18 c The subroutine quits reading when an error is detected (there were
19 c not three numbers on the line). If the error is because there was
20 c the keyword 'LAS*T' is on the line, then it returns normally with the X,Y,Z
21 c array entered properly. If the error is caused by something besides the
22 c keyword as the first data on the line, an error is signalled and the
23 c subroutine exits and not all the X,Y,Z may have been read.
24 c If more than 134 triplets are read in,
25 c only the first 134 area kept and an error is signalled.
26 c X1 is parms(1), Y1 is parms(2), Z1 is parms(3),
27 c X2 is parms(4), Y2 is parms(5), Z2 is parms(6)...
28 c nparms is three times the number of triplets read in.
29 c
30 c
31 c Include the common block containing the keywords.
32 c
33  include 'zdemparm.h'
34 c
35 c Various parameters and variable types.
36 c
37  integer flag1, flag2, flag3
38  integer noerr, error, notext
39  parameter(noerr = 0, error = 1, notext = 0)
40  parameter(max_pwl_parms = 402)
41  parameter(max_pwl_pairs = 201)
42  parameter(max_fields = 10)
43  character field(max_fields)*80, keyword*(keyword_len)
44  character currline*120
45 
46 c
47 c Set the counter for the number of elements read and the limit check to
48 c no error
49 c
50  nparms = 0
51  limit = noerr
52 c
53 c Get the line.
54 c
55  200 continue
56  call get_next_line(currline, field, nlines, eofflg, max_fields)
57  if (eofflag .eq. error) return
58 c
59  if (nparms .lt. max_pwl_parms) then
60 c
61 c Attempt to convert each field into a real number.
62 c
63  call text_to_real(field(1), parms(nparms+1), flag1)
64  call text_to_real(field(2), parms(nparms+2), flag2)
65  call text_to_real(field(3), parms(nparms+3), flag3)
66 c
67 c If we failed to convert a number, see if we had the last entry keyword.
68 c If so, then set the number of parameters entered, else signal an error.
69 c If we did fail, this will cause the subroutine to exit.
70 c
71  if ((flag1+flag2+flag3) .eq. noerr) then
72  nparms = nparms + 3
73  else
74  keyword = field(1)(1:keyword_len)
75  if (keyword .ne. k_last_entry) then
76  call print_bad_line(currline, nlines, nerrors)
77  end if
78  go to 1000
79  end if
80 c
81 c If we have read in the maximum number of pairs, check this line
82 c for LAST keyword. If not LAST do not use anything on the line.
83 c
84  else
85  keyword = field(1)(1:keyword_len)
86  if (keyword .ne. k_last_entry) then
87  nerrors = nerrors + 1
88  limit = error
89  else
90  go to 1000
91  end if
92 c
93  end if
94  go to 200
95 c
96 c If we were over the limit, send a message and tell what the current limit
97 c is.
98 c
99  1000 continue
100  eofflag = noerr
101  if (limit .eq. error) then
102  write(9,41) max_pwl_pairs
103  41 format ('0', 'Error, too many table values entered, only ',
104  & i3, ' points allowed!')
105  end if
106 c
107  return
108  end
subroutine readctab(parms, nparms, eofflg, nlines, nerrors)
Definition: rdpw3prm.f:1
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line corrected spelling errors in format added statement for Zflow Plasma Loss Model added format for CSV output type fixed more lines longer than characters added format for Measure Zflow Block and forward c reverse current directions in Zflow plasma loss c and Zflow POS models added format for SFC output type c removed from all code calls c c c c c a80 c i10 c No grids on plots c Do not write files containing the plotted points c Execute only one cycle c Do not echo the setup parameters and indicies c i3
Definition: zdemfmt.h:36
subroutine get_next_line(currline, field, nlines, eofflg, max_fields)
Definition: getnxtln.f:1
subroutine print_bad_line(currline, nlines, numerr)
Definition: prtbadln.f:1
subroutine text_to_real(text, rvalue, flag)
Definition: txt2real.f:1