Debian Codegraph @

packages/seacas/libraries/suplib/ffreal.f

raw
1 C Copyright(C) 1999-2020 National Technology & Engineering Solutions
2 C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 C NTESS, the U.S. Government retains certain rights in this software.
4 C
5 C See packages/seacas/LICENSE for details
6
7 C=======================================================================
8 SUBROUTINE FFREAL (IFLD, INTYP, RFIELD, EXPECT, DEFVAL, RVAL, *)
9 C=======================================================================
10
11 C --*** FFREAL *** (FFLIB) Parse free-field real
12 C -- Written by Amy Gilkey - revised 02/24/86
13 C --
14 C --FFREAL parses a real field. A default is supplied if the field
15 C --is empty.
16 C --
17 C --Parameters:
18 C -- IFLD - IN/OUT - the index of the current field number, incremented
19 C -- INTYP - IN - the input type from the free-field reader
20 C -- RFIELD - IN - the real field
21 C -- EXPECT - IN - the value to expect string, for error
22 C -- DEFVAL - IN - the default value if field is empty
23 C -- RVAL - OUT - the real value, set only if no error
24 C -- * - return statement if the field is invalid; message is printed
25
26 INTEGER IFLD
27 INTEGER INTYP(*)
28 REAL RFIELD(*)
29 CHARACTER*(*) EXPECT
30 REAL DEFVAL, RVAL
31
32 CHARACTER*80 ERRMSG
33
34 IF (INTYP(IFLD) .GE. 1) THEN
35 RVAL = RFIELD(IFLD)
36 ELSE IF (INTYP(IFLD) .LE. -1) THEN
37 RVAL = DEFVAL
38 ELSE
39 ERRMSG = 'Expected ' // EXPECT
40 CALL PRTERR ('CMDERR', ERRMSG(:LENSTR(ERRMSG)))
41 GOTO 100
42 END IF
43
44 IF (INTYP(IFLD) .GE. -1) IFLD = IFLD + 1
45 RETURN
46
47 100 CONTINUE
48 IF (INTYP(IFLD) .GE. -1) IFLD = IFLD + 1
49 RETURN 1
50 END