Screamer Project  V3.3.1
Screamer Structure
 All Files Functions Variables
rdlsfprm.f
Go to the documentation of this file.
1  subroutine read_lsf_parms (parms, num_parms, eofflg, nlines,
2  & numerr)
3 
4 c Modification log
5 c
6 c 2008-07-17 RBS: Changed the length of currline to 120 from 80
7 c 2014-02-06 RBS: Changed real*4 to real
8 c 2014-05-01 RBS: Changed integer*4 to integer
9 c
10 c Define passed parameters
11 c
12  real parms(*)
13  integer num_parms, eofflg, nlines, numerr
14 c
15  character currline*120
16 c
17 c This subroutine reads in a set of coefficients to be used in a least
18 c squares polynomial model. Up to 7 coefficients
19 c may be entered (6th order polynomial), all on one line.
20 c The first coefficient (parms(1)) is for the constant term,
21 c the second (parms(2)) for the linear term, ...
22 c num_parms is the number of coefficients read in on the line.
23 c This subroutine does not print any of the data read in, but does
24 c print an error message if a user error is encountered.
25 c
26 c Various parameters and variable types.
27 c
28  integer flag
29  integer noerr, error, notext
30  parameter(noerr = 0, error = 1, notext = 0)
31  parameter(max_fields = 10)
32  parameter(max_lsf_parms = 10)
33  character field(max_fields)*80
34 c
35 c Get the line.
36 c
37  call get_next_line(currline, field, nlines, eofflg, max_fields)
38  if (eofflg .eq. error) return
39 c
40 c Attempt to convert each field into a real number.
41 c
42  flag = noerr
43  i = 0
44  do while ((flag .eq. noerr) .and. (i .lt. max_lsf_parms))
45  i = i + 1
46  call text_to_real(field(i), parms(i), flag)
47  end do
48 c
49 c If we failed to convert a number, then see if we ran out of fields.
50 c If so, then set the number of parameters entered, else signal an error.
51 c
52  if (flag .eq. error) then
53  call strip(field(i), istart, iend)
54  if (istart .eq. notext) then
55  num_parms = i - 1
56  else
57  call print_bad_line(currline, nlines, numerr)
58  end if
59 c
60 c Did not fail to convert all numbers (the maximum amount were entered).
61 c So set the number of parameters entered.
62 c
63  else
64  num_parms = i
65  end if
66 c
67  return
68  end
subroutine get_next_line(currline, field, nlines, eofflg, max_fields)
Definition: getnxtln.f:1
subroutine strip(text, start, end)
Definition: strpblnk.f:1
subroutine print_bad_line(currline, nlines, numerr)
Definition: prtbadln.f:1
subroutine read_lsf_parms(parms, num_parms, eofflg, nlines, numerr)
Definition: rdlsfprm.f:1
subroutine text_to_real(text, rvalue, flag)
Definition: txt2real.f:1