| 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 COMID (TYPE, IDLST, ISTAT, NUMID, IDFINAL, ID) |
| 9 |
C======================================================================= |
| 10 |
|
| 11 |
C -- ISTAT - IN/OUT - the status of each item |
| 12 |
C -- 0 = same |
| 13 |
C -- - = delete |
| 14 |
C -- n = combine with entity n |
| 15 |
|
| 16 |
CHARACTER*(*) TYPE |
| 17 |
DIMENSION IDLST(*) |
| 18 |
INTEGER ISTAT(*) |
| 19 |
CHARACTER*80 STRING |
| 20 |
CHARACTER*8 STRA |
| 21 |
|
| 22 |
IF (TYPE(:1) .EQ. 'M') THEN |
| 23 |
STRA = 'Material' |
| 24 |
ELSE IF (TYPE(:1) .EQ. 'S') THEN |
| 25 |
STRA = 'Sideset' |
| 26 |
ELSE IF (TYPE(:1) .EQ. 'N') THEN |
| 27 |
STRA = 'Nodeset' |
| 28 |
ELSE |
| 29 |
CALL PRTERR ('PROGRAM', 'unrecognized id type in COMID') |
| 30 |
RETURN |
| 31 |
END IF |
| 32 |
|
| 33 |
C ... Check that IDFINAL and ID are different |
| 34 |
if (idfinal .eq. id) then |
| 35 |
write (string, 80) type(:lenstr(type)), idfinal |
| 36 |
80 format('Cannot combine ',A,1x,I11,' with itself. Ignoring') |
| 37 |
call sqzstr(string, lstr) |
| 38 |
call prterr ('CMDWARN', string(:lstr)) |
| 39 |
return |
| 40 |
end if |
| 41 |
|
| 42 |
C ... Determine location of FINAL ID (entity combined to) |
| 43 |
IMATF = LOCINT (IDFINAL, NUMID, IDLST) |
| 44 |
IF (IMATF .EQ. 0) THEN |
| 45 |
WRITE (STRING, 90) STRA, IDFINAL |
| 46 |
CALL SQZSTR (STRING, LSTR) |
| 47 |
CALL PRTERR ('ERROR', STRING(:LSTR)) |
| 48 |
RETURN |
| 49 |
END IF |
| 50 |
|
| 51 |
C ... Check that the entity with id IDFINAL is active |
| 52 |
if (istat(imatf) .ne. 0 .and. istat(imatf) .ne. imatf) then |
| 53 |
WRITE (STRING, 85) STRA, IDFINAL |
| 54 |
85 FORMAT (A,1X,I5,' has been modified. This is not allowed') |
| 55 |
CALL SQZSTR (STRING, LSTR) |
| 56 |
CALL PRTERR ('ERROR', STRING(:LSTR)) |
| 57 |
RETURN |
| 58 |
END IF |
| 59 |
|
| 60 |
C ... Determine location of ID to be changed |
| 61 |
IMAT = LOCINT (ID, NUMID, IDLST) |
| 62 |
IF (IMAT .EQ. 0) THEN |
| 63 |
WRITE (STRING, 90) STRA, ID |
| 64 |
90 FORMAT (A,1X,I5,' does not exist') |
| 65 |
CALL SQZSTR (STRING, LSTR) |
| 66 |
CALL PRTERR ('ERROR', STRING(:LSTR)) |
| 67 |
ELSE |
| 68 |
WRITE (STRING, 100) STRA, ID, STRA, IDFINAL |
| 69 |
100 FORMAT (A,1X,I11,' combined with ',A,1x,I11) |
| 70 |
ISTAT(IMAT) = IMATF |
| 71 |
ISTAT(IMATF) = IMATF |
| 72 |
CALL SQZSTR (STRING, LSTR) |
| 73 |
CALL PRTERR ('CMDSPEC', STRING(:LSTR)) |
| 74 |
END IF |
| 75 |
|
| 76 |
RETURN |
| 77 |
END |