Debian Codegraph @

packages/seacas/libraries/suplib/ffintg.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 FFINTG (IFLD, INTYP, IFIELD, EXPECT, IDEFVL, IVAL, *)
9 C=======================================================================
10
11 C --*** FFINTG *** (FFLIB) Parse free-field integer
12 C -- Written by Amy Gilkey - revised 02/24/86
13 C --
14 C --FFINTG parses an integer field. A default is supplied if the
15 C --field 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 types from the free-field reader
20 C -- IFIELD - IN - the integer fields
21 C -- EXPECT - IN - the value to expect string, for error
22 C -- IDEFVL - IN - the default value if field is empty
23 C -- IVAL - OUT - the integer 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 INTEGER IFIELD(*)
29 CHARACTER*(*) EXPECT
30 INTEGER IDEFVL, IVAL
31
32 CHARACTER*80 ERRMSG
33
34 IF (INTYP(IFLD) .GE. 2) THEN
35 IVAL = IFIELD(IFLD)
36 ELSE IF (INTYP(IFLD) .LE. -1) THEN
37 IVAL = IDEFVL
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