| 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 -*- Mode: fortran -*- |
| 8 |
C======================================================================= |
| 9 |
|
| 10 |
SUBROUTINE COMAND (A, IELBST, IDELB, NUMELB, NUMLNK, NUMATR, |
| 11 |
& NAMELB, INPSST, IDNPS, NNNPS, IESSST, IDESS, NEESS, DONE, *) |
| 12 |
C======================================================================= |
| 13 |
|
| 14 |
C --*** COMAND *** (GJOIN) Command input and execution |
| 15 |
C -- Written by Amy Gilkey - revised 02/23/88 |
| 16 |
C -- |
| 17 |
C --COMAND inputs and executes an user command. |
| 18 |
C -- |
| 19 |
C --Parameters: |
| 20 |
C -- A - IN - the dynamic memory base array |
| 21 |
C -- IELBST - IN/OUT - the element block status |
| 22 |
C -- IDELB - IN/OUT - the element block ID for each block |
| 23 |
C -- NUMELB - IN - the number of elements for each block |
| 24 |
C -- NUMLNK - IN - the number of nodes per element for each block |
| 25 |
C -- NUMATR - IN - the number of attributes for each block |
| 26 |
C -- INPSST - IN/OUT - the nodal point set status |
| 27 |
C -- IDNPS - IN/OUT - the nodal point set ID for each set |
| 28 |
C -- NNNPS - IN - the number of nodes for each set |
| 29 |
C -- IESSST - IN/OUT - the element side set status |
| 30 |
C -- IDESS - IN/OUT - the element side set ID for each set |
| 31 |
C -- NEESS - IN - the number of elements for each set |
| 32 |
C -- DONE - OUT - true iff no more input files |
| 33 |
C -- * - return statement if quit |
| 34 |
C -- |
| 35 |
C --Common Variables: |
| 36 |
C -- Sets and uses /TITLES/ |
| 37 |
C -- Uses /DBVARS/ |
| 38 |
|
| 39 |
PARAMETER (MAXFLD=80) |
| 40 |
|
| 41 |
include 'exodusII.inc' |
| 42 |
|
| 43 |
include 'gj_params.blk' |
| 44 |
include 'gj_filnum.blk' |
| 45 |
include 'gj_titles.blk' |
| 46 |
include 'gj_dbvars.blk' |
| 47 |
|
| 48 |
DIMENSION A(*) |
| 49 |
INTEGER IELBST(*) |
| 50 |
INTEGER IDELB(*) |
| 51 |
INTEGER NUMELB(*) |
| 52 |
INTEGER NUMLNK(*) |
| 53 |
INTEGER NUMATR(*) |
| 54 |
CHARACTER*(MXSTLN) NAMELB(*) |
| 55 |
INTEGER INPSST(*) |
| 56 |
INTEGER IDNPS(*) |
| 57 |
INTEGER NNNPS(*) |
| 58 |
INTEGER IESSST(*) |
| 59 |
INTEGER IDESS(*) |
| 60 |
INTEGER NEESS(*) |
| 61 |
LOGICAL DONE |
| 62 |
|
| 63 |
CHARACTER*8 WORD, VERB, STRA, STRB |
| 64 |
INTEGER INTYP(MAXFLD+1) |
| 65 |
CHARACTER*8 CFIELD(MAXFLD) |
| 66 |
INTEGER IFIELD(MAXFLD) |
| 67 |
REAL RFIELD(MAXFLD) |
| 68 |
LOGICAL ISON |
| 69 |
|
| 70 |
CHARACTER*8 CMDTBL(14) |
| 71 |
SAVE CMDTBL |
| 72 |
C --CMDTBL - the valid commands table |
| 73 |
|
| 74 |
C --Command table follows. Remember to change the dimensioned size when |
| 75 |
C --changing the table. |
| 76 |
DATA CMDTBL / |
| 77 |
$ 'TITLE ', 'BLOCKS ', 'MATERIAL', 'NSETS ', 'SSETS ', |
| 78 |
$ 'HELP ', 'FINISH ', 'EXIT ', 'END ', 'QUIT ', |
| 79 |
$ 'NODESETS', 'SIDESETS', 'ADD ', ' ' / |
| 80 |
|
| 81 |
WRITE (*, *) |
| 82 |
|
| 83 |
C --Initialize the database title |
| 84 |
|
| 85 |
TITLE = TITLE1 |
| 86 |
|
| 87 |
C --Initialize the element blocks |
| 88 |
|
| 89 |
DO 100 IELB = 1, NEWELB |
| 90 |
IELBST(IELB) = 0 |
| 91 |
100 CONTINUE |
| 92 |
ISON = .FALSE. |
| 93 |
DO 110 IELB = 1, NEWELB |
| 94 |
I = LOCINT (IDELB(IELB), NEWELB, IDELB) |
| 95 |
IF (I .LT. IELB) THEN |
| 96 |
ISON = .TRUE. |
| 97 |
IELBST(IELB) = I |
| 98 |
IELBST(I) = I |
| 99 |
C ... Check for compatible element blocks if combining... |
| 100 |
IF ( (NUMLNK(I) .NE. NUMLNK(IELB)) .OR. |
| 101 |
& (NUMATR(I) .NE. NUMATR(IELB)) ) THEN |
| 102 |
CALL INTSTR (1, -1, I, STRA, LSTRA) |
| 103 |
CALL INTSTR (1, -1, IELB, STRB, LSTRB) |
| 104 |
CALL PRTERR ('CMDWARN', |
| 105 |
& 'Element blocks '//STRA(:LSTRA)//' and ' |
| 106 |
& //STRB(:LSTRB)// |
| 107 |
& ' have duplicate IDS but are not compatible') |
| 108 |
ELSE IF (NAMELB(I) .NE. NAMELB(IELB)) THEN |
| 109 |
CALL INTSTR (1, -1, I, STRA, LSTRA) |
| 110 |
CALL INTSTR (1, -1, IELB, STRB, LSTRB) |
| 111 |
CALL PRTERR ('CMDWARN', |
| 112 |
& 'Element blocks '//STRA(:LSTRA)//' and ' |
| 113 |
& //STRB(:LSTRB)// |
| 114 |
& ' have duplicate IDS but different element types') |
| 115 |
END IF |
| 116 |
END IF |
| 117 |
110 CONTINUE |
| 118 |
IF (ISON) |
| 119 |
& CALL PRTERR ('CMDWARN', 'Duplicate IDs in element blocks' |
| 120 |
& // ' - combined unless changed') |
| 121 |
|
| 122 |
C --Initialize the nodal point sets |
| 123 |
|
| 124 |
DO 120 INPS = 1, NEWNPS |
| 125 |
INPSST(INPS) = 0 |
| 126 |
120 CONTINUE |
| 127 |
ISON = .FALSE. |
| 128 |
DO 130 INPS = 1, NEWNPS |
| 129 |
I = LOCINT (IDNPS(INPS), NEWNPS, IDNPS) |
| 130 |
IF (I .LT. INPS) THEN |
| 131 |
ISON = .TRUE. |
| 132 |
INPSST(INPS) = I |
| 133 |
INPSST(I) = I |
| 134 |
END IF |
| 135 |
130 CONTINUE |
| 136 |
IF (ISON) |
| 137 |
& CALL PRTERR ('CMDWARN', 'Duplicate IDs in nodal point sets' |
| 138 |
& // ' - combined unless changed') |
| 139 |
|
| 140 |
C --Initialize the element side sets |
| 141 |
|
| 142 |
DO 140 IESS = 1, NEWESS |
| 143 |
IESSST(IESS) = 0 |
| 144 |
140 CONTINUE |
| 145 |
ISON = .FALSE. |
| 146 |
DO 150 IESS = 1, NEWESS |
| 147 |
I = LOCINT (IDESS(IESS), NEWESS, IDESS) |
| 148 |
IF (I .LT. IESS) THEN |
| 149 |
ISON = .TRUE. |
| 150 |
IESSST(IESS) = I |
| 151 |
IESSST(I) = I |
| 152 |
END IF |
| 153 |
150 CONTINUE |
| 154 |
IF (ISON) |
| 155 |
& CALL PRTERR ('CMDWARN', 'Duplicate IDs in element side sets' |
| 156 |
& // ' - combined unless changed') |
| 157 |
|
| 158 |
160 CONTINUE |
| 159 |
|
| 160 |
DONE = .FALSE. |
| 161 |
|
| 162 |
C --Read command line |
| 163 |
|
| 164 |
WRITE (*, *) |
| 165 |
CALL FREFLD (0, 0, 'GJOIN> ', MAXFLD, |
| 166 |
& IOSTAT, NUMFLD, INTYP, CFIELD, IFIELD, RFIELD) |
| 167 |
IF (IOSTAT .LT. 0) GOTO 210 |
| 168 |
IF (NUMFLD .EQ. 0) GOTO 160 |
| 169 |
|
| 170 |
INTYP(MIN(MAXFLD,NUMFLD)+1) = -999 |
| 171 |
|
| 172 |
IFLD = 1 |
| 173 |
CALL FFCHAR (IFLD, INTYP, CFIELD, ' ', WORD) |
| 174 |
CALL ABRSTR (VERB, WORD, CMDTBL) |
| 175 |
IF (VERB .EQ. ' ') VERB = WORD |
| 176 |
CFIELD(IFLD-1) = VERB |
| 177 |
CALL OUTLOG (KLOG, NUMFLD, INTYP, CFIELD, IFIELD, RFIELD) |
| 178 |
|
| 179 |
IF (VERB .EQ. 'TITLE') THEN |
| 180 |
|
| 181 |
C --Allow user to select the database title |
| 182 |
CALL SETITL (TWODB) |
| 183 |
|
| 184 |
ELSE IF ((VERB .EQ. 'BLOCKS') .OR. (VERB .EQ. 'MATERIAL')) THEN |
| 185 |
|
| 186 |
C --Allow user to change element blocks |
| 187 |
|
| 188 |
CALL CKNONE (NEWELB, .FALSE., 'element blocks', *210) |
| 189 |
|
| 190 |
CALL MDRSRV ('ISCR', KISCR, NEWELB) |
| 191 |
CALL MDSTAT (NERR, MEM) |
| 192 |
IF (NERR .GT. 0) GOTO 210 |
| 193 |
|
| 194 |
180 CONTINUE |
| 195 |
CALL PRTELB (IELBST, NELBL1, NELBL2, |
| 196 |
& IDELB, NUMELB, NUMLNK, NUMATR, A(KISCR)) |
| 197 |
CALL SETSTA ('BLOCKS> ', 'element block', |
| 198 |
& NELBL1, NELBL2, IDELB, IELBST, *180) |
| 199 |
|
| 200 |
CALL MDDEL ('ISCR') |
| 201 |
|
| 202 |
ELSE IF (VERB .EQ. 'NSETS' .or. VERB .EQ. 'NODESETS') THEN |
| 203 |
|
| 204 |
C --Allow user to change nodal point sets |
| 205 |
|
| 206 |
CALL CKNONE (NEWNPS, .FALSE., 'nodal point sets', *210) |
| 207 |
|
| 208 |
CALL MDRSRV ('ISCR', KISCR, NEWNPS) |
| 209 |
CALL MDSTAT (NERR, MEM) |
| 210 |
IF (NERR .GT. 0) GOTO 210 |
| 211 |
|
| 212 |
190 CONTINUE |
| 213 |
CALL PRTNPS (INPSST, NNPS1, NNPS2, IDNPS, NNNPS, |
| 214 |
& A(KISCR)) |
| 215 |
CALL SETSTA ('NSETS> ', 'nodal point set', |
| 216 |
& NNPS1, NNPS2, IDNPS, INPSST, *190) |
| 217 |
|
| 218 |
CALL MDDEL ('ISCR') |
| 219 |
|
| 220 |
ELSE IF (VERB .EQ. 'SSETS' .or. VERB .eq. 'SIDESETS') THEN |
| 221 |
|
| 222 |
C --Allow user to change element side sets |
| 223 |
|
| 224 |
CALL CKNONE (NEWESS, .FALSE., 'element side sets', *210) |
| 225 |
|
| 226 |
CALL MDRSRV ('ISCR', KISCR, NEWESS) |
| 227 |
CALL MDSTAT (NERR, MEM) |
| 228 |
IF (NERR .GT. 0) GOTO 210 |
| 229 |
|
| 230 |
200 CONTINUE |
| 231 |
CALL PRTESS (IESSST, NESS1, NESS2, |
| 232 |
& IDESS, NEESS, A(KISCR)) |
| 233 |
CALL SETSTA ('SSETS> ', 'element side set', |
| 234 |
& NESS1, NESS2, IDESS, IESSST, *200) |
| 235 |
|
| 236 |
CALL MDDEL ('ISCR') |
| 237 |
|
| 238 |
ELSE IF (VERB .EQ. 'HELP') THEN |
| 239 |
WRITE (*, 10000) |
| 240 |
10000 FORMAT ( |
| 241 |
& /,1X,'Valid Commands:', |
| 242 |
& /,4X,'TITLE - change the database title' |
| 243 |
& /,4X,'BLOCKS - manipulate the element blocks' |
| 244 |
& /,4X,'NSETS - manipulate the nodal point sets' |
| 245 |
& /,4X,'SSETS - manipulate the element side sets' |
| 246 |
& /,4X,'EXIT - end command input, start processing' |
| 247 |
$ /,4X,'FINISH - end command input, write output file' |
| 248 |
& /,4X,'QUIT - abort processing' |
| 249 |
& ) |
| 250 |
|
| 251 |
ELSE IF ((VERB .EQ. 'EXIT') .OR. (VERB .EQ. 'END')) THEN |
| 252 |
CALL PRTERR ('CMDWARN', 'Please use "ADD" or "FINISH"') |
| 253 |
IF (TWODB) THEN |
| 254 |
WRITE (*, *) |
| 255 |
CALL FREFLD (0, 0, 'Is there another database? ', MAXFLD, |
| 256 |
& IOSTAT, NUMFLD, INTYP, CFIELD, IFIELD, RFIELD) |
| 257 |
CALL OUTLOG (KLOG, NUMFLD, INTYP, CFIELD, IFIELD, RFIELD) |
| 258 |
DONE = (CFIELD(1)(1:1) .NE. 'Y') |
| 259 |
ELSE |
| 260 |
DONE = .TRUE. |
| 261 |
END IF |
| 262 |
CALL SCNEOF |
| 263 |
GOTO 210 |
| 264 |
|
| 265 |
ELSE IF (VERB .EQ. 'FINISH') THEN |
| 266 |
DONE = .TRUE. |
| 267 |
CALL SCNEOF |
| 268 |
GOTO 210 |
| 269 |
|
| 270 |
ELSE IF (VERB .EQ. 'ADD') THEN |
| 271 |
DONE = .FALSE. |
| 272 |
CALL SCNEOF |
| 273 |
GOTO 210 |
| 274 |
|
| 275 |
ELSE IF (VERB .EQ. 'QUIT') THEN |
| 276 |
CALL SCNEOF |
| 277 |
RETURN 1 |
| 278 |
|
| 279 |
ELSE |
| 280 |
CALL PRTERR ('CMDERR', '"' // VERB(:LENSTR(VERB)) |
| 281 |
& // '" is an invalid command') |
| 282 |
END IF |
| 283 |
|
| 284 |
GOTO 160 |
| 285 |
|
| 286 |
210 CONTINUE |
| 287 |
RETURN |
| 288 |
END |