| 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 |
C======================================================================= |
| 7 |
SUBROUTINE RIXID (INLINE, IFLD, INTYP, CFIELD, IFIELD, |
| 8 |
& SELMSG, MAXSEL, IDSEL, NUMSEL, IXSEL, *) |
| 9 |
C======================================================================= |
| 10 |
|
| 11 |
C --*** RIXID *** (BLOT) Parse selection command |
| 12 |
C -- |
| 13 |
C --RIXID selects the items listed in the command. If there are no |
| 14 |
C --fields, all the items are selected. If the first field is ADD, |
| 15 |
C --the items are added to the items already selected, otherwise |
| 16 |
C --only the listed items are selected. |
| 17 |
C -- |
| 18 |
C --Parameters: |
| 19 |
C -- INLINE - IN/OUT - the parsed input line for the log file |
| 20 |
C -- IFLD - IN/OUT - the free-field reader index |
| 21 |
C -- INTYP - IN - the free-field reader field types |
| 22 |
C -- CFIELD - IN - the character fields |
| 23 |
C -- IFIELD - IN - the integer fields |
| 24 |
C -- SELMSG - IN - the type of item for error messages |
| 25 |
C -- MAXSEL - IN - the number of the maximum selected items |
| 26 |
C -- IDSEL - IN - the IDs of the items to be selected |
| 27 |
C -- NUMSEL - IN/OUT - the number of selected items; set to zero |
| 28 |
C -- upon entry unless ADD is the first field |
| 29 |
C -- IXSEL - IN/OUT - the selected items |
| 30 |
C -- * - return statement if error before any items selected |
| 31 |
|
| 32 |
include 'exodusII.inc' |
| 33 |
CHARACTER*(*) INLINE |
| 34 |
INTEGER INTYP(*) |
| 35 |
CHARACTER*(*) CFIELD(*) |
| 36 |
INTEGER IFIELD(*) |
| 37 |
CHARACTER*(*) SELMSG |
| 38 |
INTEGER IDSEL(*) |
| 39 |
INTEGER IXSEL(*) |
| 40 |
|
| 41 |
LOGICAL FFEXST, FFNUMB, FFMATC |
| 42 |
CHARACTER*80 ERRMSG |
| 43 |
CHARACTER*(MXNAME) WORD |
| 44 |
|
| 45 |
IF (.NOT. (FFEXST (IFLD, INTYP))) THEN |
| 46 |
|
| 47 |
C --Select all items if no fields |
| 48 |
|
| 49 |
NUMSEL = MAXSEL |
| 50 |
DO 100 I = 1, MAXSEL |
| 51 |
IXSEL(I) = I |
| 52 |
100 CONTINUE |
| 53 |
|
| 54 |
ELSE IF (FFMATC (IFLD, INTYP, CFIELD, 'OFF', 3)) THEN |
| 55 |
|
| 56 |
C --Select no items if OFF |
| 57 |
|
| 58 |
CALL FFADDC ('OFF', INLINE) |
| 59 |
NUMSEL = 0 |
| 60 |
|
| 61 |
ELSE |
| 62 |
|
| 63 |
C --Reset to none selected unless ADD |
| 64 |
|
| 65 |
IF (FFMATC (IFLD, INTYP, CFIELD, 'ADD', 3)) THEN |
| 66 |
CALL FFADDC ('ADD', INLINE) |
| 67 |
ELSE |
| 68 |
NUMSEL = 0 |
| 69 |
IF (.NOT. FFNUMB (IFLD, INTYP)) THEN |
| 70 |
ERRMSG = |
| 71 |
& 'Expected "OFF" or "ADD" or ' // SELMSG // ' range' |
| 72 |
CALL PRTERR ('CMDERR', ERRMSG(:LENSTR(ERRMSG))) |
| 73 |
GOTO 130 |
| 74 |
END IF |
| 75 |
END IF |
| 76 |
|
| 77 |
110 CONTINUE |
| 78 |
IF (FFEXST (IFLD, INTYP)) THEN |
| 79 |
|
| 80 |
C --Scan ID |
| 81 |
|
| 82 |
CALL FFINTG (IFLD, INTYP, IFIELD, |
| 83 |
& SELMSG, 0, ID, *120) |
| 84 |
|
| 85 |
C --Find and store the index of the ID |
| 86 |
|
| 87 |
IX = LOCINT (ID, MAXSEL, IDSEL) |
| 88 |
|
| 89 |
IF (IX .LE. 0) THEN |
| 90 |
CALL INTSTR (1, 0, ID, WORD, LSTR) |
| 91 |
ERRMSG = SELMSG // ' ' // |
| 92 |
& WORD(:LSTR) // ' does not exist, ignored' |
| 93 |
CALL PRTERR ('CMDERR', ERRMSG(:LENSTR(ERRMSG))) |
| 94 |
|
| 95 |
ELSE IF (LOCINT (IX, NUMSEL, IXSEL) .LE. 0) THEN |
| 96 |
CALL FFADDI (ID, INLINE) |
| 97 |
IF (NUMSEL .GE. MAXSEL) THEN |
| 98 |
ERRMSG = 'Too many ' // SELMSG // 's selected' |
| 99 |
CALL PRTERR ('CMDERR', ERRMSG(:LENSTR(ERRMSG))) |
| 100 |
GOTO 120 |
| 101 |
END IF |
| 102 |
|
| 103 |
NUMSEL = NUMSEL + 1 |
| 104 |
IXSEL(NUMSEL) = IX |
| 105 |
END IF |
| 106 |
|
| 107 |
GOTO 110 |
| 108 |
END IF |
| 109 |
|
| 110 |
120 CONTINUE |
| 111 |
IF (NUMSEL .EQ. 0) THEN |
| 112 |
ERRMSG = 'No ' // SELMSG // 's are selected' |
| 113 |
CALL PRTERR ('CMDWARN', ERRMSG(:LENSTR(ERRMSG))) |
| 114 |
END IF |
| 115 |
END IF |
| 116 |
|
| 117 |
RETURN |
| 118 |
|
| 119 |
130 CONTINUE |
| 120 |
RETURN 1 |
| 121 |
END |