| 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 RDELB (NDB, NELBLK, IDELB, NUMELB, NUMLNK, NUMATR, |
| 8 |
& A, C, KLINK, KATRIB, KATRNM, ISEOF, EBTYPE, EBNAME, NAMLEN) |
| 9 |
C======================================================================= |
| 10 |
|
| 11 |
C --*** RDELB *** (EXPLORE) Read database element blocks |
| 12 |
C -- |
| 13 |
C --RDELB reads the element block information from the database. |
| 14 |
C --Some dynamic dimensioning is done. |
| 15 |
C --An error message is displayed if the end of file is read. |
| 16 |
C -- |
| 17 |
C --Parameters: |
| 18 |
C -- NDB - IN - the database file |
| 19 |
C -- NELBLK - IN - the number of element blocks to read |
| 20 |
C -- IDELB - OUT - the element block ID for each block |
| 21 |
C -- NUMELB - OUT - the number of elements for each block |
| 22 |
C -- NUMLNK - OUT - the number of nodes per element for each block |
| 23 |
C -- NUMATR - OUT - the number of attributes for each block |
| 24 |
C -- A - IN - the dynamic memory base array |
| 25 |
C -- KLINK - OUT - the dynamic memory pointer to the connectivity array |
| 26 |
C -- (named 'LINK') |
| 27 |
C -- KATRIB - OUT - the dynamic memory pointer to the attribute array |
| 28 |
C -- (named 'ATRIB') |
| 29 |
C -- ISEOF - IN/OUT - set true if end of file read |
| 30 |
|
| 31 |
include 'exodusII.inc' |
| 32 |
|
| 33 |
INTEGER IDELB(*) |
| 34 |
INTEGER NUMELB(*) |
| 35 |
INTEGER NUMLNK(*) |
| 36 |
INTEGER NUMATR(*) |
| 37 |
CHARACTER*(MXSTLN) EBTYPE(*) |
| 38 |
CHARACTER*(NAMLEN) EBNAME(*) |
| 39 |
|
| 40 |
DIMENSION A(*) |
| 41 |
CHARACTER*1 C(*) |
| 42 |
LOGICAL ISEOF |
| 43 |
|
| 44 |
CHARACTER*80 ERRMSG |
| 45 |
|
| 46 |
CALL INIINT (NELBLK, 0, IDELB) |
| 47 |
CALL INIINT (NELBLK, 0, NUMELB) |
| 48 |
CALL INIINT (NELBLK, 0, NUMLNK) |
| 49 |
CALL INIINT (NELBLK, 0, NUMATR) |
| 50 |
CALL INISTR (NELBLK, ' ', EBTYPE) |
| 51 |
CALL INISTR (NELBLK, ' ', EBNAME) |
| 52 |
|
| 53 |
C ... Get element block ids |
| 54 |
if (nelblk .gt. 0) then |
| 55 |
call exgebi(ndb, idelb, ierr) |
| 56 |
if (ierr .ne. 0) go to 120 |
| 57 |
end if |
| 58 |
|
| 59 |
C ... Read element block sizing parameters |
| 60 |
IELNK = 0 |
| 61 |
IEATR = 0 |
| 62 |
INATR = 0 |
| 63 |
DO 100 IELB = 1, NELBLK |
| 64 |
call exgelb(ndb, idelb(ielb), ebtype(ielb), numelb(ielb), |
| 65 |
& numlnk(ielb), numatr(ielb), ierr) |
| 66 |
if (ierr .ne. 0) go to 120 |
| 67 |
|
| 68 |
if (ebtype(ielb) .eq. 'nsided' .or. |
| 69 |
* ebtype(ielb) .eq. 'NSIDED') THEN |
| 70 |
IELNK = IELNK + NUMLNK(IELB) |
| 71 |
else |
| 72 |
IELNK = IELNK + NUMLNK(IELB) * NUMELB(IELB) |
| 73 |
end if |
| 74 |
IEATR = IEATR + NUMATR(IELB) * NUMELB(IELB) |
| 75 |
INATR = INATR + NUMATR(IELB) |
| 76 |
100 CONTINUE |
| 77 |
|
| 78 |
CALL MDRSRV ('LINK', KLINK, IELNK) |
| 79 |
CALL MDRSRV ('ATRIB', KATRIB, IEATR) |
| 80 |
call mcrsrv ('ATRNM', KATRNM, INATR*NAMLEN) |
| 81 |
CALL MDSTAT (NERR, MEM) |
| 82 |
if (nerr .gt. 0) go to 140 |
| 83 |
|
| 84 |
C ... Read element block connectivity and attributes |
| 85 |
ielnk = 0 |
| 86 |
ieatr = 0 |
| 87 |
inatr = 0 |
| 88 |
do 110 ielb = 1, nelblk |
| 89 |
islnk = ielnk + 1 |
| 90 |
if (ebtype(ielb) .eq. 'nsided' .or. |
| 91 |
* ebtype(ielb) .eq. 'NSIDED') THEN |
| 92 |
ielnk = islnk + numlnk(ielb) - 1 |
| 93 |
else |
| 94 |
ielnk = islnk + numlnk(ielb) * numelb(ielb) - 1 |
| 95 |
end if |
| 96 |
isatr = ieatr + 1 |
| 97 |
ieatr = isatr + numatr(ielb) * numelb(ielb) - 1 |
| 98 |
|
| 99 |
CALL RDEB1 (NDB, |
| 100 |
& IDELB(IELB), NUMELB(IELB), NUMLNK(IELB), NUMATR(IELB), |
| 101 |
& A(KLINK+ISLNK-1), A(KATRIB+ISATR-1), |
| 102 |
& C(KATRNM+NAMLEN*INATR), NAMLEN) |
| 103 |
|
| 104 |
inatr = inatr + numatr(ielb) |
| 105 |
110 CONTINUE |
| 106 |
|
| 107 |
C ... Read element block names (if they exist) |
| 108 |
CALL EXGNAMS(NDB, EXEBLK, nelblk, ebname, ierr) |
| 109 |
RETURN |
| 110 |
|
| 111 |
120 CONTINUE |
| 112 |
WRITE (ERRMSG, 10000, IOSTAT=IDUM) |
| 113 |
& 'ELEMENT BLOCK SIZING PARAMETERS for block', IELB |
| 114 |
GOTO 130 |
| 115 |
130 CONTINUE |
| 116 |
CALL WDBERR (IERR, ERRMSG) |
| 117 |
ISEOF = .TRUE. |
| 118 |
140 CONTINUE |
| 119 |
RETURN |
| 120 |
|
| 121 |
10000 FORMAT (5 (A, I12)) |
| 122 |
END |