Debian Codegraph @

packages/seacas/libraries/suplib/ffchar.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 FFCHAR (IFLD, INTYP, CFIELD, DEFVAL, CVAL)
9 C=======================================================================
10
11 C --*** FFCHAR *** (FFLIB) Parse free-field character string
12 C -- Written by Amy Gilkey - revised 02/24/86
13 C --
14 C --FFCHAR parses a character 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 type from the free-field reader
20 C -- CFIELD - IN - the character fields
21 C -- DEFVAL - IN - the default value if field is empty
22 C -- CVAL - OUT - the character value
23
24 INTEGER IFLD
25 INTEGER INTYP(*)
26 CHARACTER*(*) CFIELD(*)
27 CHARACTER*(*) DEFVAL, CVAL
28
29 IF (INTYP(IFLD) .GE. 0) THEN
30 CVAL = CFIELD(IFLD)
31 ELSE IF (INTYP(IFLD) .LE. -1) THEN
32 CVAL = DEFVAL
33 END IF
34
35 IF (INTYP(IFLD) .GE. -1) IFLD = IFLD + 1
36 RETURN
37 END