| 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 |
subroutine getss(ndbin, numess, idess, neess, ndess, ixeess, |
| 8 |
* ixdess, lteess, ltsess, ltssnc, kfacss, a, allone, lessdf, |
| 9 |
* *) |
| 10 |
|
| 11 |
integer idess(*), neess(*), ndess(*), ixeess(*), ixdess(*) |
| 12 |
integer lteess(*), ltsess(*) |
| 13 |
integer ltssnc(*) |
| 14 |
real a(*) |
| 15 |
logical allone |
| 16 |
|
| 17 |
character*256 STRING |
| 18 |
|
| 19 |
C ... Get the sideset ids |
| 20 |
call exgssi(ndbin, idess, ierr) |
| 21 |
if (ierr .gt. 0) return 1 |
| 22 |
|
| 23 |
isoff = 1 |
| 24 |
inoff = 1 |
| 25 |
idoff = 1 |
| 26 |
allone = .TRUE. |
| 27 |
|
| 28 |
call exgcssc(ndbin, ltssnc, ierr) |
| 29 |
if (ierr .gt. 0) then |
| 30 |
call exopts (EXVRBS, ierr1) |
| 31 |
call exerr('grepos/getss', 'Error from exgssc', ierr) |
| 32 |
return 1 |
| 33 |
end if |
| 34 |
|
| 35 |
C ... Read each sideset |
| 36 |
itotdf = 0 |
| 37 |
do 104 i=1, numess |
| 38 |
|
| 39 |
C ... Get the sideset parameters |
| 40 |
call exgsp(ndbin, idess(i), nsides, ndist, ierr) |
| 41 |
if (ierr .gt. 0) then |
| 42 |
call exopts (EXVRBS, ierr1) |
| 43 |
call exerr('grepos/getss', 'Error from exgsp', ierr) |
| 44 |
return 1 |
| 45 |
end if |
| 46 |
|
| 47 |
if (nsides .gt. 0) then |
| 48 |
call exgss(ndbin, idess(i), lteess(isoff), ltsess(isoff), |
| 49 |
* ierr) |
| 50 |
if (ierr .gt. 0) then |
| 51 |
call exopts (EXVRBS, ierr1) |
| 52 |
call exerr('grepos/getss', 'Error from exgss', ierr) |
| 53 |
return 1 |
| 54 |
end if |
| 55 |
end if |
| 56 |
|
| 57 |
C ... Count number of nodes in the node list |
| 58 |
incnt = 0 |
| 59 |
do 102 ii = 0, nsides-1 |
| 60 |
incnt = incnt + ltssnc(isoff+ii) |
| 61 |
102 continue |
| 62 |
|
| 63 |
ixeess(i) = isoff |
| 64 |
neess(i) = nsides |
| 65 |
ixdess(i) = inoff |
| 66 |
ndess(i) = incnt |
| 67 |
itotdf = itotdf + incnt |
| 68 |
isoff = isoff + nsides |
| 69 |
inoff = inoff + incnt |
| 70 |
104 continue |
| 71 |
|
| 72 |
call mdlong('FACESS', kfacss, itotdf) |
| 73 |
lessdf = itotdf |
| 74 |
|
| 75 |
inoff = 0 |
| 76 |
do i=1, numess |
| 77 |
call exgsp(ndbin, idess(i), nsides, ndist, ierr) |
| 78 |
|
| 79 |
C ... See if the number of distribution factors is 0 or 'incnt' |
| 80 |
if (ndist .eq. 0 .or. ndist .ne. ndess(i)) then |
| 81 |
C ... Fill in the missing dist factors with '1.0' |
| 82 |
do ii = 0, ndess(i)-1 |
| 83 |
a(kfacss+inoff+ii) = 1.0 |
| 84 |
end do |
| 85 |
else |
| 86 |
C ... Read in the existing distribution factors |
| 87 |
call exgssd(ndbin, idess(i), a(kfacss+inoff), ierr) |
| 88 |
end if |
| 89 |
C ... There are distribution factors, but an incorrect number |
| 90 |
if (ndist .gt. 0 .and. ndist .ne. ndess(i)) then |
| 91 |
write (string, 900) idess(i) |
| 92 |
call sqzstr(string, lstr) |
| 93 |
call prterr('ERROR',STRING(:LSTR)) |
| 94 |
write (string, 901) ndist, ndess(i) |
| 95 |
call sqzstr(string, lstr) |
| 96 |
call prterr('ERROR',STRING(:LSTR)) |
| 97 |
end if |
| 98 |
|
| 99 |
inoff = inoff + ndess(i) |
| 100 |
end do |
| 101 |
|
| 102 |
C... Check whether all distribution factors are constant for each sideset. |
| 103 |
lessnl = inoff - 1 |
| 104 |
if (lessnl .gt. 0) then |
| 105 |
value = a(kfacss) |
| 106 |
else |
| 107 |
value = 1.0 |
| 108 |
end if |
| 109 |
do 105 i=1, lessnl-1 |
| 110 |
if (a(kfacss+i) .ne. value) then |
| 111 |
allone = .FALSE. |
| 112 |
go to 106 |
| 113 |
end if |
| 114 |
105 continue |
| 115 |
106 continue |
| 116 |
return |
| 117 |
|
| 118 |
900 format('Sideset ',i5,' has distribution factor/sideset', |
| 119 |
$ ' node count mismatch.') |
| 120 |
901 format('Database has ',i7,' df, but ',i7, |
| 121 |
* ' sideset nodes. All DF set to 1.0') |
| 122 |
end |