Debian Codegraph @

packages/seacas/libraries/suplib/ffneed.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 FFNEED (IFLD, INTYP, FTYPE, NFLD, EXPECT, *)
9 C=======================================================================
10
11 C --*** FFNEED *** (FFLIB) Check free-field fields for type
12 C -- Written by Amy Gilkey - revised 10/21/86
13 C --
14 C --FFNEED checks that the next free-format fields exist and are of the
15 C --appropriate type.
16 C --
17 C --Parameters:
18 C -- IFLD - IN - the index of the current field number, NOT incremented
19 C -- INTYP - IN - the input types from the free-field reader
20 C -- FTYPE - IN - the expected field type:
21 C -- C for character, R for real, I for integer, other for character
22 C -- NFLD - IN - the number of expected fields
23 C -- EXPECT - IN - the value to expect string, for error
24 C -- * - return statement if the fields do not exist or are not of the
25 C -- expected type; message is printed
26
27 INTEGER IFLD
28 INTEGER INTYP(*)
29 CHARACTER*(*) FTYPE
30 INTEGER NFLD
31 CHARACTER*(*) EXPECT
32
33 CHARACTER*80 ERRMSG
34
35 IF (FTYPE(1:1) .EQ. 'R') THEN
36 ITYPE = 1
37 ELSE IF (FTYPE(1:1) .EQ. 'I') THEN
38 ITYPE = 2
39 ELSE
40 ITYPE = 0
41 END IF
42
43 DO 100 ICHK = IFLD, IFLD + NFLD - 1
44 IF (INTYP(ICHK) .NE. ITYPE) THEN
45 IF ((ITYPE .NE. 1) .OR. (INTYP(ICHK) .NE. 2)) THEN
46 ERRMSG = 'Expected ' // EXPECT
47 CALL PRTERR ('CMDERR', ERRMSG(:LENSTR(ERRMSG)))
48 GOTO 110
49 END IF
50 END IF
51 100 CONTINUE
52
53 RETURN
54
55 110 CONTINUE
56 RETURN 1
57 END