| 1 |
C Copyright(C) 1999-2025 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 |
PROGRAM GREPOS |
| 9 |
C======================================================================= |
| 10 |
|
| 11 |
C --*** GREPOS *** (GREPOS) GENESIS Positioning Program |
| 12 |
C -- Written by Greg Sjaardema - revised 03/07/89 |
| 13 |
C -- Modified from GEN3D |
| 14 |
C -- |
| 15 |
C --Expected input: |
| 16 |
C -- o The commands on the standard input device. |
| 17 |
C -- o The 3D GENESIS database on unit 9 |
| 18 |
C -- |
| 19 |
C --Output: |
| 20 |
C -- o A listing of the input database information and any errors |
| 21 |
C -- found on the standard output device. |
| 22 |
C -- o The repositioned 3D GENESIS database on unit 10. |
| 23 |
C -- |
| 24 |
C --Developed at Sandia National Laboratories. |
| 25 |
C -- |
| 26 |
C --Current author and code sponsor: Greg Sjaardema |
| 27 |
C -- |
| 28 |
C --Revision History: |
| 29 |
C -- Modified from GEN3D [04/86 Created (Amy Gilkey)] |
| 30 |
C -- |
| 31 |
C --Source is in FORTRAN 77 |
| 32 |
C -- |
| 33 |
C --External software used: |
| 34 |
C -- SUPES package (dynamic memory, free-field reader, FORTRAN extensions) |
| 35 |
C -- ExodusII library |
| 36 |
C -- NetCDF library (with modified parameters) |
| 37 |
C -- |
| 38 |
C --Documentation: |
| 39 |
C -- none |
| 40 |
|
| 41 |
include 'exodusII.inc' |
| 42 |
|
| 43 |
include 'gp_namlen.blk' |
| 44 |
include 'gp_progqa.blk' |
| 45 |
include 'gp_dbase.blk' |
| 46 |
include 'gp_dbtitl.blk' |
| 47 |
include 'gp_dbnums.blk' |
| 48 |
include 'gp_xyzoff.blk' |
| 49 |
include 'gp_xyzrot.blk' |
| 50 |
include 'gp_xyzmir.blk' |
| 51 |
include 'gp_xyzwrp.blk' |
| 52 |
include 'gp_nsset.blk' |
| 53 |
include 'gp_smooth.blk' |
| 54 |
include 'gp_snap.blk' |
| 55 |
include 'gp_combine.blk' |
| 56 |
include 'gp_deform.blk' |
| 57 |
include 'gp_attrot.blk' |
| 58 |
INCLUDE 'argparse.inc' |
| 59 |
|
| 60 |
CHARACTER*2048 FILIN, FILOUT, SCRATCH, SYNTAX, HELP, VALUE |
| 61 |
CHARACTER*80 SCRSTR |
| 62 |
|
| 63 |
C... String containing name of common element topology in model |
| 64 |
C or 'MULTIPLE_TOPOLOGIES' if not common topology. |
| 65 |
character*(MXSTLN) comtop |
| 66 |
|
| 67 |
LOGICAL EXODUS, NONQUD, ALLONE, ORDER |
| 68 |
LOGICAL SMOOTH, SWPSS, USRSUB, CENTRD |
| 69 |
|
| 70 |
LOGICAL ISATRB, EXECUT, L64BIT |
| 71 |
|
| 72 |
LOGICAL RENEL, DELEL, DELNP |
| 73 |
|
| 74 |
INTEGER CMPSIZ, IOWS |
| 75 |
integer goff, noff, eoff, moff, soff |
| 76 |
|
| 77 |
DIMENSION A(1) |
| 78 |
INTEGER IA(1) |
| 79 |
LOGICAL LA(1) |
| 80 |
EQUIVALENCE (A(1), IA(1)) |
| 81 |
EQUIVALENCE (A(1), LA(1)) |
| 82 |
CHARACTER*1 C(1) |
| 83 |
|
| 84 |
C --A - the dynamic numeric memory base array |
| 85 |
|
| 86 |
INCLUDE 'gp_qainfo.blk' |
| 87 |
CALL STRTUP (QAINFO) |
| 88 |
|
| 89 |
WRITE (*, 70) |
| 90 |
CALL BANNER (0, QAINFO, |
| 91 |
& 'A GENESIS DATABASE POSITIONING PROGRAM', |
| 92 |
& ' ', ' ') |
| 93 |
call cpyrgt (0, '1990') |
| 94 |
|
| 95 |
CALL MDINIT (A) |
| 96 |
CALL MCINIT (C) |
| 97 |
CALL MDSTAT (NERR, MEM) |
| 98 |
IF (NERR .GT. 0) GOTO 40 |
| 99 |
|
| 100 |
C .. Get filename from command line. If not specified, emit error message |
| 101 |
SYNTAX = |
| 102 |
* 'Syntax is: "grepos [-name_length len] [-64] ' // |
| 103 |
$ '[-change_set #] file_in file_out"' |
| 104 |
HELP = 'Documentation: https://sandialabs.github.io' // |
| 105 |
$ '/seacas-docs/sphinx/html/index.html#grepos' |
| 106 |
NARG = argument_count() |
| 107 |
if (narg .lt. 2) then |
| 108 |
CALL PRTERR ('FATAL', 'Filenames not specified.') |
| 109 |
CALL PRTERR ('CMDSPEC', SYNTAX(:LENSTR(SYNTAX))) |
| 110 |
CALL PRTERR ('CMDSPEC', HELP(:LENSTR(HELP))) |
| 111 |
GOTO 60 |
| 112 |
end if |
| 113 |
|
| 114 |
C --Open the input database and read the initial variables |
| 115 |
NDBIN = 9 |
| 116 |
NDBOUT = 10 |
| 117 |
|
| 118 |
CMPSIZ = 0 |
| 119 |
IOWS = 0 |
| 120 |
|
| 121 |
FILIN = ' ' |
| 122 |
CALL get_argument(narg-1,FILIN, LNAM) |
| 123 |
|
| 124 |
FILOUT = ' ' |
| 125 |
CALL get_argument(narg,FILOUT, LFIL) |
| 126 |
|
| 127 |
if (filin .eq. filout) then |
| 128 |
CALL PRTERR ('FATAL', |
| 129 |
$ 'Input and Output filename are the same. Not allowed') |
| 130 |
goto 60 |
| 131 |
endif |
| 132 |
|
| 133 |
NDBIN = exopen(filin(:lnam), EXREAD, CMPSIZ, IOWS, vers, IERR) |
| 134 |
IF (IERR .NE. 0) THEN |
| 135 |
SCRATCH = 'Database "'//FILIN(:LNAM)//'" does not exist.' |
| 136 |
CALL PRTERR ('FATAL', SCRATCH(:LENSTR(SCRATCH))) |
| 137 |
GOTO 60 |
| 138 |
END IF |
| 139 |
|
| 140 |
C ... Parse options... |
| 141 |
name_len = 0 |
| 142 |
l64bit = .false. |
| 143 |
if (narg .gt. 2) then |
| 144 |
iarg = 1 |
| 145 |
do |
| 146 |
CALL get_argument(iarg,FILIN, LNAM) |
| 147 |
if (filin(:lnam) .eq. '-name_length') then |
| 148 |
CALL get_argument(iarg+1,FILIN, LNAM) |
| 149 |
read (filin(:lnam), '(i10)') name_len |
| 150 |
iarg = iarg + 2 |
| 151 |
else if (filin(:lnam) .eq. '-64') then |
| 152 |
l64bit = .true. |
| 153 |
iarg = iarg + 1 |
| 154 |
else if (filin(:lnam) .eq. '-change_set' .or. |
| 155 |
* filin(:lnam) .eq. '--change_set') then |
| 156 |
C ... Convert `value` to an integer. |
| 157 |
CALL get_argument(iarg+1,value, lv) |
| 158 |
iarg = iarg + 2 |
| 159 |
read (value(:lv), '(i10)') nchange |
| 160 |
C ... Check that file contains at least that many change sets... |
| 161 |
ndbr = iand(ndbin, EX_FILE_ID_MASK) |
| 162 |
call exinq(ndbr, EX_INQ_NUM_CHILD_GROUPS, |
| 163 |
$ idum, rdum, cdum, ierr) |
| 164 |
if (nchange .gt. idum) then |
| 165 |
write (SCRATCH,*) 'Selected change set', nchange, |
| 166 |
$ 'but there are only ', idum, ' change sets in file.' |
| 167 |
call sqzstr(scratch, lscratch) |
| 168 |
call PRTERR('CMDERR', SCRATCH(:LSCRATCH)) |
| 169 |
goto 60 |
| 170 |
else |
| 171 |
write (scratch,99) nchange |
| 172 |
99 format(1x,'NOTE: Selecting change set ', i3) |
| 173 |
call sqzstr(scratch, lscratch) |
| 174 |
call PRTERR('CMDSPEC', scratch(:lscratch)) |
| 175 |
ndbin = ndbr + nchange |
| 176 |
end if |
| 177 |
else |
| 178 |
SCRATCH = 'Unrecognized command option "'//FILIN(:LNAM)//'"' |
| 179 |
CALL PRTERR ('FATAL', SCRATCH(:LENSTR(SCRATCH))) |
| 180 |
CALL PRTERR ('CMDSPEC', SYNTAX(:LENSTR(SYNTAX))) |
| 181 |
CALL PRTERR ('CMDSPEC', HELP(:LENSTR(HELP))) |
| 182 |
end if |
| 183 |
if (iarg .gt. narg-2) exit |
| 184 |
end do |
| 185 |
end if |
| 186 |
|
| 187 |
call exgini(ndbin, title, ndim, numnp, numel, nelblk, |
| 188 |
* numnps, numess, ierr) |
| 189 |
if (numnps .gt. 0) then |
| 190 |
call exinq(ndbin, EXNSNL, lnpsnl, rdum, cdum, ierr) |
| 191 |
call exinq(ndbin, EXNSDF, lnpsdf, rdum, cdum, ierr) |
| 192 |
else |
| 193 |
lnpsnl = 0 |
| 194 |
lnpsdf = 0 |
| 195 |
end if |
| 196 |
if (numess .gt. 0) then |
| 197 |
call exinq(ndbin, EXSSEL, lessel, rdum, cdum, ierr) |
| 198 |
call exinq(ndbin, EXSSDF, lessdf, rdum, cdum, ierr) |
| 199 |
else |
| 200 |
lessel = 0 |
| 201 |
lessdf = 0 |
| 202 |
end if |
| 203 |
|
| 204 |
call exinq(ndbin, EXDBMXUSNM, namlen, rdum, cdum, ierr) |
| 205 |
if (name_len .eq. 0) then |
| 206 |
if (namlen < 32) namlen = 32 |
| 207 |
if (namlen .gt. mxname) then |
| 208 |
namlen = mxname |
| 209 |
maxnam = mxname |
| 210 |
else |
| 211 |
maxnam = namlen |
| 212 |
end if |
| 213 |
else |
| 214 |
C ... Use user-specified length |
| 215 |
namlen = name_len |
| 216 |
maxnam = name_len |
| 217 |
end if |
| 218 |
|
| 219 |
call exmxnm(ndbin, namlen, ierr) |
| 220 |
|
| 221 |
C --Reserve memory for the input information |
| 222 |
CALL MDRSRV ('XN', KXN, NUMNP) |
| 223 |
IF (NDIM .GE. 2) THEN |
| 224 |
CALL MDRSRV ('YN', KYN, NUMNP) |
| 225 |
END IF |
| 226 |
IF (NDIM .EQ. 3) THEN |
| 227 |
CALL MDRSRV ('ZN', KZN, NUMNP) |
| 228 |
ELSE |
| 229 |
CALL MDRSRV ('ZN', KZN, 1) |
| 230 |
END IF |
| 231 |
|
| 232 |
CALL MDRSRV ('MAPNN', KMAPNN, NUMNP) |
| 233 |
CALL MDRSRV ('MAPEL', KMAPEL, NUMEL) |
| 234 |
CALL MDRSRV ('ATRIB', KATRIB, 0) |
| 235 |
CALL MDRSRV ('LINK', KLINK, 0) |
| 236 |
|
| 237 |
CALL MDRSRV ('IDELB', KIDELB, NELBLK) |
| 238 |
CALL MDRSRV ('IDELB2', KIDELB2,NELBLK) |
| 239 |
CALL MDRSRV ('NUMELB', KNELB, NELBLK) |
| 240 |
CALL MDRSRV ('NUMLNK', KNLNK, NELBLK) |
| 241 |
CALL MDRSRV ('NUMATR', KNATR, NELBLK) |
| 242 |
CALL MCRSRV ('BLKTYP', KBKTYP, MXSTLN*NELBLK) |
| 243 |
CALL MCRSRV ('NAMEEB', KNAMEB, maxnam*NELBLK) |
| 244 |
|
| 245 |
CALL MDRSRV ('IDNPS', KIDNS, NUMNPS) |
| 246 |
CALL MDRSRV ('NNNPS', KNNNS, NUMNPS) |
| 247 |
CALL MDRSRV ('NDNPS', KNDNPS, NUMNPS) |
| 248 |
CALL MDRSRV ('IXNNPS', KIXNNS, NUMNPS) |
| 249 |
CALL MDRSRV ('IXDNPS', KIXDNS, NUMNPS) |
| 250 |
CALL MDRSRV ('LTNNPS', KLTNNS, LNPSNL) |
| 251 |
CALL MDRSRV ('FACNPS', KFACNS, LNPSDF) |
| 252 |
CALL MCRSRV ('NAMENP', KNAMNP, maxnam*NUMNPS) |
| 253 |
|
| 254 |
CALL MDRSRV ('IDESS', KIDSS, NUMESS) |
| 255 |
CALL MDRSRV ('NEESS', KNESS, NUMESS) |
| 256 |
CALL MDRSRV ('NDESS', KNDSS, NUMESS) |
| 257 |
CALL MDRSRV ('IXEESS', KIXESS, NUMESS) |
| 258 |
CALL MDRSRV ('IXDESS', KIXDSS, NUMESS) |
| 259 |
CALL MDRSRV ('LTEESS', KLTESS, LESSEL) |
| 260 |
CALL MDRSRV ('LTSESS', KLTSSS, LESSEL) |
| 261 |
CALL MDRSRV ('LTSSNC', KLTSNC, LESSEL) |
| 262 |
CALL MDRSRV ('FACESS', KFACSS, LESSDF) |
| 263 |
CALL MCRSRV ('NAMESS', KNAMSS, maxnam*NUMESS) |
| 264 |
CALL MCRSRV ('NAMECO', KNAMCO, maxnam*ndim) |
| 265 |
|
| 266 |
CALL MDSTAT (NERR, MEM) |
| 267 |
IF (NERR .GT. 0) GOTO 40 |
| 268 |
|
| 269 |
C --Read information from the database and close file |
| 270 |
|
| 271 |
call exgcor (ndbin, a(kxn), a(kyn), a(kzn), ierr) |
| 272 |
|
| 273 |
call exopts (0, ierr) |
| 274 |
call exgnnm (ndbin, ia(kmapnn), ierr) |
| 275 |
call exgenm (ndbin, ia(kmapel), ierr) |
| 276 |
call exopts (EXVRBS, ierr) |
| 277 |
call getcon (ndbin, ndim, C(knamco), ierr) |
| 278 |
|
| 279 |
CALL DBIELB (NDBIN, '*', 1, NELBLK, |
| 280 |
& IA(KIDELB), IA(KNELB), IA(KNLNK), IA(KNATR), |
| 281 |
& A(1), IA(1), KLINK, KATRIB, C(KBKTYP), |
| 282 |
* numatt, *60) |
| 283 |
|
| 284 |
call CHKTOP(NELBLK, C(KBKTYP), COMTOP) |
| 285 |
call getnam(NDBIN, 1, nelblk, C(KNAMEB)) |
| 286 |
|
| 287 |
C ... Save original element block ids in case the user changes them |
| 288 |
C Needed when reading/writing element variables. |
| 289 |
call cpyid(nelblk, ia(kidelb), ia(kidelb2)) |
| 290 |
|
| 291 |
C ... Attribute names... |
| 292 |
call mcrsrv('NAMATT', KNAMATT, maxnam*NUMATT) |
| 293 |
CALL MDSTAT (NERR, MEM) |
| 294 |
IF (NERR .GT. 0) GOTO 40 |
| 295 |
call getattnam(ndbin, nelblk, ia(kidelb), ia(knatr), c(knamatt)) |
| 296 |
|
| 297 |
if (numnps .gt. 0) then |
| 298 |
call exgcns(ndbin, ia(kidns), ia(knnns), ia(kndnps), |
| 299 |
& ia(kixnns), ia(kixdns), ia(kltnns), a(kfacns), ierr) |
| 300 |
call getnam(NDBIN, 2, numnps, C(KNAMNP)) |
| 301 |
end if |
| 302 |
if (numess .gt. 0) then |
| 303 |
call getss(ndbin, numess, ia(kidss), ia(kness), ia(kndss), |
| 304 |
& ia(kixess), ia(kixdss), ia(kltess), ia(kltsss), |
| 305 |
& ia(kltsnc), kfacss, a, allone, lessdf, *50) |
| 306 |
call getnam(NDBIN, 3, numess, C(KNAMSS)) |
| 307 |
end if |
| 308 |
|
| 309 |
EXODUS = .TRUE. |
| 310 |
call exinq(ndbin, EXQA, nqarec, rdum, cdum, ierr) |
| 311 |
call exinq(ndbin, EXINFO, ninfo, rdum, cdum, ierr) |
| 312 |
call mcrsrv('QAREC', kqarec, (nqarec+1) * 4 * MXSTLN) |
| 313 |
call mcrsrv('INFREC', kinfo, (ninfo+2) * MXLNLN) |
| 314 |
CALL MCSTAT (NERR, MEM) |
| 315 |
IF (NERR .GT. 0) GOTO 40 |
| 316 |
if (nqarec .gt. 0) then |
| 317 |
C ... Wrapper to get strings the right length |
| 318 |
call exgqaw(ndbin, c(kqarec), ierr) |
| 319 |
end if |
| 320 |
if (ninfo .gt. 0) then |
| 321 |
C ... Wrapper to get info record the right length |
| 322 |
call exginw(ndbin, c(kinfo), ierr) |
| 323 |
end if |
| 324 |
|
| 325 |
C --Read the database time steps |
| 326 |
c determine how many time steps are stored |
| 327 |
call exinq (ndbin, EXTIMS, NSTEPS, rdum, cdum, ierr) |
| 328 |
call mdrsrv('TIMES', KTIMES, NSTEPS) |
| 329 |
CALL MDSTAT (NERR, MEM) |
| 330 |
IF (NERR .GT. 0) GOTO 40 |
| 331 |
|
| 332 |
c read time values at all time steps |
| 333 |
if (nsteps .gt. 0) then |
| 334 |
call exgatm (ndbin, a(ktimes), ierr) |
| 335 |
end if |
| 336 |
|
| 337 |
exodus = (nsteps .gt. 0) |
| 338 |
|
| 339 |
IF (EXODUS) THEN |
| 340 |
CALL DBINAM (NDBIN, '*', NDIM, NELBLK, NUMNPS, NUMESS, |
| 341 |
& NNDIM, NNELB, NVARGL, NVARNP, NVAREL, NVARNS, NVARSS, |
| 342 |
& IXGV, IXNV, IXEV, IXNSV, IXSSV, |
| 343 |
& A, IA, KIEVOK, KNSVOK, KSSVOK, C, KNAMES, EXODUS, *40) |
| 344 |
CALL MDSTAT (NERR, MEM) |
| 345 |
IF (NERR .GT. 0) GOTO 40 |
| 346 |
ELSE |
| 347 |
nvargl = 0 |
| 348 |
nvarnp = 0 |
| 349 |
nvarel = 0 |
| 350 |
nvarns = 0 |
| 351 |
nvarss = 0 |
| 352 |
ixgv = 0 |
| 353 |
ixnv = 0 |
| 354 |
ixev = 0 |
| 355 |
ixnsv = 0 |
| 356 |
ixssv = 0 |
| 357 |
kievok = 0 |
| 358 |
knsvok = 0 |
| 359 |
kssvok = 0 |
| 360 |
knames = 0 |
| 361 |
|
| 362 |
END IF |
| 363 |
|
| 364 |
CALL DBPINI ('NTISV', NDBIN, TITLE, NDIM, NUMNP, NUMEL, NELBLK, |
| 365 |
& NUMNPS, LNPSNL, LNPSDF, NUMESS, LESSEL, |
| 366 |
& LESSDF, NVARGL, NVARNP, NVAREL, NVARNS, NVARSS, FILIN) |
| 367 |
|
| 368 |
C --Read in runtime parameters |
| 369 |
|
| 370 |
C --Reserve memory for offsets |
| 371 |
|
| 372 |
MBLK = MAX(NELBLK, NUMNPS) |
| 373 |
CALL MDRSRV ('XEXPL', KXEXPL, MBLK) |
| 374 |
IF (NDIM .GE. 2) THEN |
| 375 |
CALL MDRSRV ('YEXPL', KYEXPL, MBLK) |
| 376 |
ELSE |
| 377 |
CALL MDRSRV ('YEXPL', KYEXPL, 1) |
| 378 |
END IF |
| 379 |
IF (NDIM .EQ. 3) THEN |
| 380 |
CALL MDRSRV ('ZEXPL', KZEXPL, MBLK) |
| 381 |
ELSE |
| 382 |
CALL MDRSRV ('ZEXPL', KZEXPL, 1) |
| 383 |
END IF |
| 384 |
|
| 385 |
C -- Reserve memory for node equiv (equiv node X with Y handled in command) |
| 386 |
|
| 387 |
call mdrsrv ('IXNP', KIXNP, NUMNP) |
| 388 |
|
| 389 |
CALL MDSTAT (NERR, MEM) |
| 390 |
IF (NERR .GT. 0) GOTO 40 |
| 391 |
|
| 392 |
C .. ISATRB is TRUE if the model contains attributes |
| 393 |
CALL MDFIND('ATRIB', KATRIB, KALEN) |
| 394 |
ISATRB = (KALEN .NE. 0) |
| 395 |
|
| 396 |
C .. Allocate memory for attribute scaling |
| 397 |
CALL CNTATR(NELBLK, IA(KNATR), IATCNT) |
| 398 |
CALL MDRSRV('ATRSCL', KATRSC, 2*IATCNT) |
| 399 |
CALL MDSTAT (NERR, MEM) |
| 400 |
IF (NERR .GT. 0) GOTO 40 |
| 401 |
|
| 402 |
C .. Set up status arrays for user manipulation of element blocks and sets |
| 403 |
|
| 404 |
CALL MDRSRV ('IELBST', KIELBS, NELBLK) |
| 405 |
CALL MDRSRV ('INPSST', KINPSS, NUMNPS) |
| 406 |
CALL MDRSRV ('IESSST', KIESSS, NUMESS) |
| 407 |
CALL MDRSRV ('ITIMST', KITIMS, NSTEPS) |
| 408 |
CALL MDSTAT (NERR, MEM) |
| 409 |
IF (NERR .GT. 0) GOTO 40 |
| 410 |
|
| 411 |
C .. Set up status arrays for element to nodal variable conversion |
| 412 |
call mdrsrv ('INOD2EL', KINOD2EL, NVARNP) |
| 413 |
CALL MDSTAT (NERR, MEM) |
| 414 |
IF (NERR .GT. 0) GOTO 40 |
| 415 |
|
| 416 |
25 CONTINUE |
| 417 |
|
| 418 |
goff = 0 |
| 419 |
noff = goff + (nvargl * maxnam) |
| 420 |
eoff = noff + (nvarnp * maxnam) |
| 421 |
moff = eoff + (nvarel * maxnam) |
| 422 |
soff = moff + (nvarns * maxnam) |
| 423 |
|
| 424 |
CALL COMAND (NDBIN, EXECUT, |
| 425 |
& IA(KIDELB), IA(KNELB), IA(KNLNK), IA(KNATR), |
| 426 |
& IA(KIDNS), IA(KNNNS), IA(KNDNPS),IA(KIXNNS),IA(KIXDNS), |
| 427 |
$ IA(KLTNNS), A(KFACNS), |
| 428 |
& IA(KIDSS), IA(KNESS), IA(KNDSS), IA(KIXESS), IA(KIXDSS), |
| 429 |
& IA(KLTESS), IA(KLTSSS), A(KFACSS), |
| 430 |
& A(KXN), A(KYN), A(KZN), |
| 431 |
& A(KXEXPL), A(KYEXPL), A(KZEXPL), MODBLK, |
| 432 |
& ISATRB, A(KATRSC), IA(KIXNP), IA(KMAPNN), IA(KMAPEL), |
| 433 |
& IA(KIELBS), IA(KINPSS), IA(KIESSS), |
| 434 |
& NQAREC, C(KQAREC), NINFO, c(kinfo), c(kbktyp), |
| 435 |
* c(knameb), c(knamnp), c(knamss), c(knamatt), |
| 436 |
& c(knames+goff), nvargl, c(knames+noff), nvarnp, |
| 437 |
& c(knames+eoff), nvarel, c(knames+moff), nvarns, |
| 438 |
* c(knames+soff), nvarss, IA(KINOD2EL), |
| 439 |
& SWPSS, SMOOTH, USRSUB, CENTRD, |
| 440 |
& NSTEPS, A(KTIMES), IA(KITIMS), A, IA, *60) |
| 441 |
|
| 442 |
C ... Snap |
| 443 |
if (numsnp .gt. 0) then |
| 444 |
call mdrsrv('ssblk', issblk, nelblk) |
| 445 |
call mdrsrv('iscrn', iscrnp, numnp) |
| 446 |
call mdrsrv('iscre', iscrep, numel) |
| 447 |
do 30 i=1, numsnp |
| 448 |
if (ismtyp(i) .eq. ISNAP) then |
| 449 |
call snap(ndbin, a, ia, i, a(kxn), a(kyn), a(kzn), ndim, |
| 450 |
* numnp, numess, ia(kidss), ia(kness), ia(kixess), |
| 451 |
* nelblk, ia(kidelb), ia(knelb), ia(knlnk)) |
| 452 |
else |
| 453 |
call move(ndbin, a, ia, i, a(kxn), a(kyn), a(kzn), ndim, |
| 454 |
* numnp, numel, numess, ia(kidss), ia(kness), ia(kixess), |
| 455 |
* ia(kltess), |
| 456 |
* nelblk, ia(kidelb), ia(knelb), ia(knlnk), ia(klink), |
| 457 |
* ia(issblk), ia(iscrnp), ia(iscrep)) |
| 458 |
end if |
| 459 |
30 continue |
| 460 |
call mddel('ssblk') |
| 461 |
call mddel('iscrn') |
| 462 |
call mddel('iscre') |
| 463 |
end if |
| 464 |
|
| 465 |
C ... Warp |
| 466 |
if (iwarp .ne. 0) then |
| 467 |
if (ndim .ne. 3) then |
| 468 |
CALL PRTERR('PROGRAM', |
| 469 |
* 'Warp cannot be specified for 2D databases') |
| 470 |
else |
| 471 |
call wrpxyz(a(kxn), a(kyn), a(kzn), numnp, |
| 472 |
* iwarp, nrmwrp, wrpdis) |
| 473 |
end if |
| 474 |
end if |
| 475 |
|
| 476 |
C --Get the new positions for the elements and nodes |
| 477 |
IF (XMIRR * YMIRR * ZMIRR .LT. 0.0) THEN |
| 478 |
CALL DBMIRR (1, NELBLK, IA(KIDELB), IA(KNELB), IA(KNLNK), |
| 479 |
* IA(KLINK), c(kbktyp), NDIM, NONQUD) |
| 480 |
|
| 481 |
CALL MDRSRV ('iblock', kiblock, nelblk) |
| 482 |
call chkss(nelblk, ia(knelb), ia(kiblock)) |
| 483 |
|
| 484 |
CALL MIRSS (IA(KIDSS), IA(KNESS), |
| 485 |
* IA(KIXESS), IA(KLTESS), |
| 486 |
* IA(KLTSSS), |
| 487 |
* IA(KIBLOCK), c(kbktyp), ALLONE, COMTOP) |
| 488 |
|
| 489 |
call mddel('iblock') |
| 490 |
END IF |
| 491 |
|
| 492 |
C ... Swaps the orientation of a sideset. Should only be used on shells... |
| 493 |
IF (SWPSS) THEN |
| 494 |
CALL SWPESS (NUMESS, IA(KIDSS), IA(KNESS), IA(KNDSS), |
| 495 |
* IA(KIXESS), IA(KIXDSS), IA(KLTESS), |
| 496 |
* IA(KLTSSS), IA(KLTSNC), A(KFACSS), ALLONE, NONQUD, |
| 497 |
* COMTOP) |
| 498 |
END IF |
| 499 |
|
| 500 |
IF (USRSUB) THEN |
| 501 |
CALL MDRSRV ('XNEW', kxnew, numnp) |
| 502 |
CALL MDRSRV ('YNEW', kynew, numnp) |
| 503 |
if (ndim .eq. 3) then |
| 504 |
CALL MDRSRV ('ZNEW', kznew, numnp) |
| 505 |
else |
| 506 |
CALL MDRSRV ('ZNEW', kznew, 1) |
| 507 |
end if |
| 508 |
|
| 509 |
CALL XYZMOD (numnp, ndim, A(KXN), A(KYN), A(KZN), |
| 510 |
* A(KXNEW), A(KYNEW), A(KZNEW)) |
| 511 |
|
| 512 |
CALL CPYREA(NUMNP, A(KXNEW), A(KXN)) |
| 513 |
CALL CPYREA(NUMNP, A(KYNEW), A(KYN)) |
| 514 |
if (ndim .eq. 3) CALL CPYREA(NUMNP, A(KZNEW), A(KZN)) |
| 515 |
CALL MDDEL ('XNEW') |
| 516 |
CALL MDDEL ('YNEW') |
| 517 |
CALL MDDEL ('ZNEW') |
| 518 |
END IF |
| 519 |
|
| 520 |
CALL NEWXYZ (A(KXN), A(KYN), A(KZN), NUMNP, NDIM, A) |
| 521 |
|
| 522 |
C --Offset or scale each block if specified (EXPLODE, SCALE BLOCK) |
| 523 |
C -- MODBLK = 1 if block explode |
| 524 |
C -- MODBLK = 2 if block scale |
| 525 |
C -- MODBLK = 3 if block randomize |
| 526 |
|
| 527 |
IF (MODBLK .EQ. 1 .OR. MODBLK .EQ. 2 .OR. MODBLK .EQ. 3) THEN |
| 528 |
CALL MDRSRV ('ICONOD', KICOND, NELBLK*NUMNP) |
| 529 |
CALL MDRSRV ('MATMAP', KMTMAP, NELBLK*NELBLK) |
| 530 |
CALL MDSTAT (NERR, MEM) |
| 531 |
IF (NERR .GT. 0) GOTO 40 |
| 532 |
|
| 533 |
CALL EXPXYZ (A(KXN), A(KYN), A(KZN), IA(KICOND), |
| 534 |
& A(KXEXPL), A(KYEXPL), A(KZEXPL), IA(KMTMAP), |
| 535 |
& NELBLK, IA(KIDELB), IA(KNELB), IA(KNLNK), IA(KLINK), |
| 536 |
& NUMNP, NDIM, MODBLK) |
| 537 |
END IF |
| 538 |
|
| 539 |
C -- MODBLK = 4 if nodeset randomize |
| 540 |
IF (MODBLK .EQ. 4) THEN |
| 541 |
CALL EXPXYZN (A(KXN), A(KYN), A(KZN), |
| 542 |
& A(KXEXPL), A(KYEXPL), A(KZEXPL), |
| 543 |
& NUMNPS, IA(KIDNS), IA(KNNNS), IA(KIXNNS), IA(KLTNNS), |
| 544 |
& NUMNP, NDIM, MODBLK) |
| 545 |
END IF |
| 546 |
|
| 547 |
C ... Deform |
| 548 |
if (idefst .gt. 0) then |
| 549 |
if (.not. exodus) then |
| 550 |
CALL PRTERR ('FATAL', |
| 551 |
* 'Deform command requires displacements.') |
| 552 |
GOTO 60 |
| 553 |
end if |
| 554 |
if (nsteps .lt. idefst) then |
| 555 |
CALL PRTERR ('FATAL', |
| 556 |
* 'Deformation step is larger than database step count.') |
| 557 |
GOTO 60 |
| 558 |
end if |
| 559 |
if (nvarnp .lt. ndim) then |
| 560 |
CALL PRTERR ('FATAL', |
| 561 |
* 'There are not enough nodal displacement variables.') |
| 562 |
GOTO 60 |
| 563 |
end if |
| 564 |
call mdrsrv('DISPX', kdispx, numnp) |
| 565 |
call mdrsrv('DISPY', kdispy, numnp) |
| 566 |
call mdrsrv('DISPZ', kdispz, numnp) |
| 567 |
CALL MDSTAT (NERR, MEM) |
| 568 |
IF (NERR .GT. 0) GOTO 40 |
| 569 |
|
| 570 |
call deform(a(kxn), a(kyn), a(kzn), numnp, ndim, |
| 571 |
* a(kdispx), a(kdispy), a(kdispz), ndbin, idefst) |
| 572 |
|
| 573 |
call mddel('DISPX') |
| 574 |
call mddel('DISPY') |
| 575 |
call mddel('DISPZ') |
| 576 |
end if |
| 577 |
|
| 578 |
C ... Scale the attributes |
| 579 |
IF (ISATRB) THEN |
| 580 |
CALL NEWATR (NELBLK, IA(KNATR), A(KATRSC), IA(KNELB), |
| 581 |
& A(KATRIB)) |
| 582 |
END IF |
| 583 |
|
| 584 |
IF (REVATT) THEN |
| 585 |
CALL ROTATR (NELBLK, NDIM, IA(KIDELB), C(KBKTYP), IA(KNATR), |
| 586 |
* IA(KNELB), A(KATRIB)) |
| 587 |
END IF |
| 588 |
|
| 589 |
IF (SMOOTH) THEN |
| 590 |
call mdrsrv ('COSIN', ICOSIN, numnp * ndim) |
| 591 |
call mdrsrv ('NODES', inodes, numnp) |
| 592 |
call mdrsrv ('ISBND', iisbnd, numnp) |
| 593 |
|
| 594 |
call dobnd (a(kxn), a(kyn), a(kzn), ia(knelb), ia(knlnk), |
| 595 |
& ia(kidelb), ia(klink), a(icosin), ia(inodes), ia(iisbnd), |
| 596 |
& numnp, ndim, nelblk) |
| 597 |
call mddel('COSIN') |
| 598 |
call mdrsrv('XSCR', ixscr, numnp) |
| 599 |
call mdrsrv('YSCR', iyscr, numnp) |
| 600 |
if (ndim .eq. 3) then |
| 601 |
call mdrsrv('ZSCR', izscr, numnp) |
| 602 |
else |
| 603 |
izscr = 1 |
| 604 |
end if |
| 605 |
call smogs (a(kxn), a(kyn), a(kzn), ia(knelb), ia(knlnk), |
| 606 |
& ia(kidelb), ia(klink), ia(iisbnd), nelblk, numnp, |
| 607 |
& nit, toler, r0, |
| 608 |
& a(ixscr), a(iyscr), a(izscr), ia(inodes), ndim) |
| 609 |
END IF |
| 610 |
|
| 611 |
C ... Incremental execution mode (re-enter COMAND routine) |
| 612 |
C ... NOTE: the code from 'CALL COMAND' to here can be reexecuted. |
| 613 |
C if MDRSRV or MDDEL is called, make sure it can be run |
| 614 |
C multiple times. |
| 615 |
|
| 616 |
if (execut) go to 25 |
| 617 |
|
| 618 |
C ... Calculate centroid if requested... |
| 619 |
if (centrd) then |
| 620 |
if (exodus) then |
| 621 |
CALL PRTERR ('FATAL', |
| 622 |
* 'Centroid function does not work for exodus databases yet.') |
| 623 |
GOTO 60 |
| 624 |
end if |
| 625 |
call mdrsrv ('CENTROID', KCENT, NDIM*NUMEL) |
| 626 |
CALL MDSTAT (NERR, MEM) |
| 627 |
IF (NERR .GT. 0) GOTO 40 |
| 628 |
|
| 629 |
call centroid(a(kxn), a(kyn), a(kzn), |
| 630 |
* a(kcent), a(kcent+numel), a(kcent+2*numel), nelblk, |
| 631 |
* ia(knelb), ia(knlnk), ia(klink), ndim) |
| 632 |
end if |
| 633 |
|
| 634 |
C ... See if node equivalencing specified |
| 635 |
DELNP = .FALSE. |
| 636 |
|
| 637 |
if (equiv) then |
| 638 |
if (eqtoler .ge. 0.0) then |
| 639 |
call mdrsrv ('IX', KIX, NUMNP) |
| 640 |
CALL MDSTAT (NERR, MEM) |
| 641 |
IF (NERR .GT. 0) GOTO 40 |
| 642 |
|
| 643 |
call matxyz(ndim, numnp, a(kxn), a(kyn), a(kzn), ia(kix), |
| 644 |
& ia(kixnp), nmatch, eqtoler) |
| 645 |
CALL MDDEL('IX') |
| 646 |
CALL MDSTAT (NERR, MEM) |
| 647 |
IF (NERR .GT. 0) GOTO 40 |
| 648 |
else |
| 649 |
nmatch = 0 |
| 650 |
do i=1, numnp |
| 651 |
if (ia(kixnp+i-1) .ne. i) nmatch = nmatch+1 |
| 652 |
end do |
| 653 |
end if |
| 654 |
write (*,*) 'Equivalencing ', nmatch, ' nodes' |
| 655 |
DELNP = (NMATCH .NE. 0) |
| 656 |
|
| 657 |
end if |
| 658 |
C --"Munch" the element blocks |
| 659 |
|
| 660 |
C ... Save old counts that are needed for writing timesteps |
| 661 |
numel0 = numel |
| 662 |
nelblk0 = nelblk |
| 663 |
numnp0 = numnp |
| 664 |
|
| 665 |
C --location of original numelb, isevok arrays |
| 666 |
kidelb0 = kidelb2 |
| 667 |
knelb0 = knelb |
| 668 |
kievok0 = kievok |
| 669 |
|
| 670 |
I = INTCNT (0, IA(KIELBS), NELBLK) |
| 671 |
RENEL = (I .LT. NELBLK) |
| 672 |
NUMEL1 = NUMEL |
| 673 |
|
| 674 |
if (renel .or. delnp) then |
| 675 |
CALL MDRSRV ('MSCR', KMSCR, MAX(NUMEL0, NUMNP0)) |
| 676 |
if (exodus) then |
| 677 |
C ... Map from new var to old for mapping variables. |
| 678 |
CALL MDRSRV ('MAPL', KMAPL, NUMEL0) |
| 679 |
CALL MDRSRV ('MAPN', KMAPN, NUMNP0) |
| 680 |
CALL MDSTAT (NERR, MEM) |
| 681 |
IF (NERR .GT. 0) GOTO 40 |
| 682 |
CALL INIMAP(NUMEL0, IA(KMAPL)) |
| 683 |
CALL INIMAP(NUMNP0, IA(KMAPN)) |
| 684 |
end if |
| 685 |
end if |
| 686 |
|
| 687 |
IF (RENEL) THEN |
| 688 |
C ... Reserve space for original NUMELB and ISEVOK arrays and copy |
| 689 |
C old array contents into new (Only needed if EXODUS) |
| 690 |
IF (EXODUS) THEN |
| 691 |
CALL MDRSRV ('NUMELB0', KNELB0, NELBLK0) |
| 692 |
CALL MDRSRV ('IDELB0', KIDELB0, NELBLK0) |
| 693 |
CALL MDFIND ('ISEVOK', IDUM, LIEVOK) |
| 694 |
CALL MDRSRV ('ISEVOK0', KIEVOK0, LIEVOK) |
| 695 |
CALL MDSTAT (NERR, MEM) |
| 696 |
IF (NERR .GT. 0) GOTO 40 |
| 697 |
CALL CPYINT (NELBLK0, IA(KNELB), IA(KNELB0)) |
| 698 |
CALL CPYINT (NELBLK0, IA(KIDELB2), IA(KIDELB0)) |
| 699 |
CALL CPYINT (LIEVOK, IA(KIEVOK), IA(KIEVOK0)) |
| 700 |
END IF |
| 701 |
|
| 702 |
CALL MDRSRV ('IXEL', KIXEL, NUMEL) |
| 703 |
CALL MDSTAT (NERR, MEM) |
| 704 |
IF (NERR .GT. 0) GOTO 40 |
| 705 |
|
| 706 |
CALL MDFIND ('LINK', IDUM, LLNK) |
| 707 |
CALL MDRSRV ('LINKO', KLINKO, LLNK) |
| 708 |
|
| 709 |
CALL MDFIND ('ATRIB', IDUM, LATR) |
| 710 |
CALL MDRSRV ('ATRIBO', KATRO, LATR) |
| 711 |
|
| 712 |
CALL MDRSRV ('IXELB', KIXELB, NELBLK) |
| 713 |
CALL MDRSRV ('JNELB', KJNELB, NELBLK) |
| 714 |
CALL MDRSRV ('ISCR', KISCR, NELBLK) |
| 715 |
CALL MCRSRV ('NAMSCR', KNMSC, maxnam*NELBLK) |
| 716 |
CALL MDSTAT (NERR, MEM) |
| 717 |
IF (NERR .GT. 0) GOTO 40 |
| 718 |
|
| 719 |
C ... NUMEL changed in this block (if elements deleted) |
| 720 |
CALL MUNELB (NELBLK, IA(KIELBS), NUMEL, |
| 721 |
& IA(KIDELB), IA(KNELB), IA(KNLNK), IA(KNATR), |
| 722 |
& IA(KLINK), A(KATRIB), IA(KLINKO), A(KATRO), |
| 723 |
& IA(KIXEL), IA(KIXELB), IA(KJNELB), IA(KISCR), |
| 724 |
& c(kbktyp), c(knmsc), LLINK, LATRIB, c(knamatt), |
| 725 |
* c(knameb)) |
| 726 |
|
| 727 |
C ... Fix up the truth table if the element block count changes... |
| 728 |
if (exodus .and. nvarel .gt. 0 .and. nelblk .ne. nelblk0) then |
| 729 |
call muntt(nelblk0, nelblk, nvarel, |
| 730 |
$ ia(kievok0), ia(kievok), ia(kielbs)) |
| 731 |
end if |
| 732 |
|
| 733 |
CALL MDDEL ('LINKO') |
| 734 |
CALL MDDEL ('ATRIBO') |
| 735 |
CALL MDDEL ('IXELB') |
| 736 |
CALL MDDEL ('JNELB') |
| 737 |
CALL MDDEL ('ISCR') |
| 738 |
CALL MCDEL ('NAMSCR') |
| 739 |
CALL MDLONG('LINK', KLINK, LLINK) |
| 740 |
CALL MDLONG('ATRIB', KATRIB, LATRIB) |
| 741 |
CALL MDSTAT (NERR, MEM) |
| 742 |
IF (NERR .GT. 0) GOTO 40 |
| 743 |
END IF |
| 744 |
|
| 745 |
CALL MDDEL ('IELBST') |
| 746 |
|
| 747 |
C --Mark if any elements are deleted |
| 748 |
|
| 749 |
DELEL = NUMEL .LT. NUMEL1 |
| 750 |
|
| 751 |
IF (DELEL) THEN |
| 752 |
|
| 753 |
C --Make up an index of nodes in the existing element blocks |
| 754 |
N = NUMNP |
| 755 |
CALL ZMFIXD (NELBLK, IA(KNELB), IA(KNLNK), IA(KLINK), |
| 756 |
* N, IA(KIXNP)) |
| 757 |
|
| 758 |
DELNP = (N .LT. NUMNP) |
| 759 |
|
| 760 |
END IF |
| 761 |
|
| 762 |
C --Squeeze the coordinates |
| 763 |
|
| 764 |
IF (DELNP) THEN |
| 765 |
C ... NUMNP modified in this call |
| 766 |
CALL ZMXYZ (NDIM, NUMNP, IA(KIXNP), A(KXN), A(KYN), A(KZN)) |
| 767 |
|
| 768 |
CALL MDLONG ('XN', KXN, NUMNP) |
| 769 |
CALL MDLONG ('YN', KYN, NUMNP) |
| 770 |
IF (NDIM .EQ. 3) THEN |
| 771 |
CALL MDLONG ('ZN', KZN, NUMNP) |
| 772 |
END IF |
| 773 |
CALL MDSTAT (NERR, MEM) |
| 774 |
IF (NERR .GT. 0) GOTO 40 |
| 775 |
CALL REMAP(NUMNP0, IA(KIXNP), IA(KMAPNN), IA(KMSCR)) |
| 776 |
IF (EXODUS) THEN |
| 777 |
CALL REMAP (NUMNP0, IA(KIXNP), IA(KMAPN), IA(KMSCR)) |
| 778 |
END IF |
| 779 |
END IF |
| 780 |
|
| 781 |
C --Renumber the element map |
| 782 |
|
| 783 |
IF (RENEL) THEN |
| 784 |
CALL REMAP (NUMEL0, IA(KIXEL), IA(KMAPEL), IA(KMSCR)) |
| 785 |
IF (EXODUS) THEN |
| 786 |
CALL REMAP (NUMEL0, IA(KIXEL), IA(KMAPL), IA(KMSCR)) |
| 787 |
END IF |
| 788 |
END IF |
| 789 |
|
| 790 |
C --Squeeze the element map |
| 791 |
|
| 792 |
IF (DELEL) THEN |
| 793 |
C ... Changes first argument |
| 794 |
CALL ZMMAP (NUMEL0, IA(KMAPEL)) |
| 795 |
CALL MDLONG ('MAPEL', KMAPEL, NUMEL) |
| 796 |
IF (EXODUS) THEN |
| 797 |
CALL ZMMAP (NUMEL0, IA(KMAPL)) |
| 798 |
CALL MDLONG ('MAPL', KMAPL, NUMEL) |
| 799 |
END IF |
| 800 |
END IF |
| 801 |
|
| 802 |
C --Renumber the element block nodes |
| 803 |
|
| 804 |
IF (DELNP) THEN |
| 805 |
CALL ZMMAP(NUMNP0, IA(KMAPNN)) |
| 806 |
CALL MDLONG ('MAPNN', KMAPNN, NUMNP) |
| 807 |
CALL RENELB (NELBLK, -999, IA(KIXNP), |
| 808 |
& IA(KNELB), IA(KNLNK), IA(KLINK)) |
| 809 |
END IF |
| 810 |
|
| 811 |
C --Renumber the nodal point set nodes |
| 812 |
|
| 813 |
IF (DELNP) THEN |
| 814 |
CALL RENIX (LNPSNL, -999, IA(KIXNP), IA(KLTNNS), .TRUE.) |
| 815 |
END IF |
| 816 |
|
| 817 |
C --Renumber the element side set elements |
| 818 |
|
| 819 |
IF (RENEL) THEN |
| 820 |
CALL RENIX (LESSEL, -999, IA(KIXEL), IA(KLTESS), .TRUE.) |
| 821 |
END IF |
| 822 |
|
| 823 |
IF (RENEL) THEN |
| 824 |
CALL MDDEL ('IXEL') |
| 825 |
END IF |
| 826 |
|
| 827 |
C --"Munch" the nodal point sets |
| 828 |
|
| 829 |
I = INTCNT (0, IA(KINPSS), NUMNPS) |
| 830 |
|
| 831 |
NUMNPS0 = NUMNPS |
| 832 |
KIDNS0 = KIDNS |
| 833 |
KNNNS0 = KNNNS |
| 834 |
LNPSNL0 = LNPSNL |
| 835 |
KNSVOK0 = KNSVOK |
| 836 |
|
| 837 |
IF ((I .LT. NUMNPS) .OR. DELNP) THEN |
| 838 |
CALL MDRSRV ('LTNNPO', KLTNNO, LNPSNL) |
| 839 |
CALL MDRSRV ('FACNPO', KFACNO, LNPSNL) |
| 840 |
CALL MDRSRV ('IXNNPO', KIXNNO, NUMNPS) |
| 841 |
CALL MDRSRV ('NNNPO', KNNNO, NUMNPS) |
| 842 |
CALL MDRSRV ('ISCR', KISCR, NUMNPS) |
| 843 |
CALL MDRSRV ('IDNS0', KIDNS0, NUMNPS0) |
| 844 |
CALL MDRSRV ('NNNPS0', KNNNS0, NUMNPS0) |
| 845 |
CALL MCRSRV ('NAMSCR', KNMSC, maxnam*NUMNPS) |
| 846 |
CALL MDSTAT (NERR, MEM) |
| 847 |
IF (NERR .GT. 0) GOTO 40 |
| 848 |
|
| 849 |
CALL CPYINT (NUMNPS0, IA(KIDNS), IA(KIDNS0)) |
| 850 |
CALL CPYINT (NUMNPS0, IA(KNNNS), IA(KNNNS0)) |
| 851 |
|
| 852 |
CALL MUNNPS (NUMNPS, IA(KINPSS), LNPSNL, LNPSDF, |
| 853 |
& IA(KIDNS), IA(KNNNS), IA(KIXNNS), IA(KLTNNS), A(KFACNS), |
| 854 |
& IA(KLTNNO), A(KFACNO), IA(KIXNNO), IA(KNNNO), IA(KISCR), |
| 855 |
* C(KNMSC), C(KNAMNP)) |
| 856 |
|
| 857 |
CALL MDDEL ('LTNNPO') |
| 858 |
CALL MDDEL ('FACNPO') |
| 859 |
CALL MDDEL ('IXNNPO') |
| 860 |
CALL MDDEL ('NNNPO') |
| 861 |
CALL MDDEL ('ISCR') |
| 862 |
CALL MCDEL ('NAMSCR') |
| 863 |
|
| 864 |
C --Squeeze the nodal point sets |
| 865 |
|
| 866 |
IF (DELNP) THEN |
| 867 |
CALL ZMNPS (NUMNPS, IA(KINPSS), LNPSNL, LNPSDF, |
| 868 |
* IA(KIDNS), IA(KNNNS), IA(KIXNNS), IA(KLTNNS), A(KFACNS), |
| 869 |
* C(KNAMNP)) |
| 870 |
END IF |
| 871 |
|
| 872 |
C ... Fix up the truth table if the nodeset count changes... |
| 873 |
if (exodus .and. nvarns .gt. 0 .and. numnps .ne. numnps0) then |
| 874 |
CALL MDFIND ('ISNSVOK', IDUM, LNSVOK) |
| 875 |
CALL MDRSRV ('ISNSVOK0', KNSVOK0, LNSVOK) |
| 876 |
CALL MDSTAT (NERR, MEM) |
| 877 |
IF (NERR .GT. 0) GOTO 40 |
| 878 |
CALL CPYINT (LNSVOK, IA(KNSVOK), IA(KNSVOK0)) |
| 879 |
|
| 880 |
call muntt(numnps0, numnps, nvarns, |
| 881 |
$ ia(knsvok0), ia(knsvok), ia(kinpss)) |
| 882 |
|
| 883 |
C ... check that the nodesets that are retained contain the same number |
| 884 |
C of nodes that the original nodesets contain. At the current time, |
| 885 |
C can only map nodeset variables if the nodesets are the same... |
| 886 |
i1 = 0 |
| 887 |
do i=0,numnps0-1 |
| 888 |
if (ia(kinpss+i) .eq.0) then |
| 889 |
if (IA(KNNNS0+i) .ne. IA(KNNNS+i1)) then |
| 890 |
write (*,900) 'Nodeset', ia(kidns0+i), 'nodeset' |
| 891 |
end if |
| 892 |
i1 = i1 + 1 |
| 893 |
end if |
| 894 |
end do |
| 895 |
end if |
| 896 |
|
| 897 |
CALL MDLONG ('IDNPS', KIDNS, NUMNPS) |
| 898 |
CALL MDLONG ('NNNPS', KNNNS, NUMNPS) |
| 899 |
CALL MDLONG ('IXNNPS', KIXNNS, NUMNPS) |
| 900 |
CALL MDLONG ('LTNNPS', KLTNNS, LNPSNL) |
| 901 |
CALL MDLONG ('FACNPS', KFACNS, LNPSDF) |
| 902 |
END IF |
| 903 |
|
| 904 |
CALL MDDEL ('INPSST') |
| 905 |
CALL MDSTAT (NERR, MEM) |
| 906 |
IF (NERR .GT. 0) GOTO 40 |
| 907 |
|
| 908 |
C --"Munch" the element side sets |
| 909 |
|
| 910 |
I = INTCNT (0, IA(KIESSS), NUMESS) |
| 911 |
|
| 912 |
NUMESS0 = NUMESS |
| 913 |
KIDSS0 = KIDSS |
| 914 |
KNESS0 = KNESS |
| 915 |
LESSEL0 = LESSEL |
| 916 |
KSSVOK0 = KSSVOK |
| 917 |
|
| 918 |
IF ((I .LT. NUMESS) .OR. DELEL) THEN |
| 919 |
CALL MDRSRV ('LTEESO', KLTESO, LESSEL) |
| 920 |
CALL MDRSRV ('LTSSO', KLTSSO, LESSEL) |
| 921 |
CALL MDRSRV ('FACS0', KFACS0, LESSDF) |
| 922 |
CALL MDRSRV ('IXEESO', KIXESO, NUMESS) |
| 923 |
CALL MDRSRV ('IXEDS0', KIXDS0, NUMESS) |
| 924 |
CALL MDRSRV ('NEESO', KNESO, NUMESS) |
| 925 |
CALL MDRSRV ('NEDS0', KNDS0, NUMESS) |
| 926 |
CALL MDRSRV ('ISCR', KISCR, NUMESS) |
| 927 |
CALL MDRSRV ('IDSS0', KIDSS0, NUMESS0) |
| 928 |
CALL MDRSRV ('NEESS0', KNESS0, NUMESS0) |
| 929 |
CALL MCRSRV ('NAMSCR', KNMSC, maxnam*NUMESS) |
| 930 |
CALL MDSTAT (NERR, MEM) |
| 931 |
IF (NERR .GT. 0) GOTO 40 |
| 932 |
|
| 933 |
CALL CPYINT (NUMESS0, IA(KIDSS), IA(KIDSS0)) |
| 934 |
CALL CPYINT (NUMESS0, IA(KNESS), IA(KNESS0)) |
| 935 |
|
| 936 |
CALL MUNESS (NUMESS, IA(KIESSS), LESSEL, LESSDF, |
| 937 |
& IA(KIDSS), IA(KNESS), IA(KNDSS), IA(KIXESS), IA(KIXDSS), |
| 938 |
& IA(KLTESS), IA(KLTSSS), A(KFACSS), |
| 939 |
& IA(KLTESO), IA(KLTSSO), A(KFACS0), IA(KIXESO), IA(KIXDS0), |
| 940 |
& IA(KNESO), IA(KNDS0), IA(KISCR), C(KNMSC), C(KNAMSS)) |
| 941 |
|
| 942 |
CALL MDDEL ('LTEESO') |
| 943 |
CALL MDDEL ('LTSSO') |
| 944 |
CALL MDDEL ('FACS0') |
| 945 |
CALL MDDEL ('IXEESO') |
| 946 |
CALL MDDEL ('IXEDS0') |
| 947 |
CALL MDDEL ('NEESO') |
| 948 |
CALL MDDEL ('NEDS0') |
| 949 |
CALL MDDEL ('ISCR') |
| 950 |
CALL MCDEL ('NAMSCR') |
| 951 |
CALL MDSTAT (NERR, MEM) |
| 952 |
IF (NERR .GT. 0) GOTO 40 |
| 953 |
|
| 954 |
C --Squeeze the element side sets |
| 955 |
|
| 956 |
IF (DELEL) THEN |
| 957 |
CALL ZMESS (NUMESS, ia(kiesss), LESSEL, LESSDF, |
| 958 |
& IA(KIDSS), IA(KNESS), IA(KNDSS), IA(KIXESS), |
| 959 |
* IA(KIXDSS), IA(KLTESS), IA(KLTSSS), IA(KLTSNC), A(KFACSS), |
| 960 |
* C(KNAMSS)) |
| 961 |
END IF |
| 962 |
|
| 963 |
C ... Fix up the truth table if the sideset count changes... |
| 964 |
if (exodus .and. nvarss .gt. 0 .and. numess .ne. numess0) then |
| 965 |
CALL MDFIND ('ISSSVOK', IDUM, LSSVOK) |
| 966 |
CALL MDRSRV ('ISSSVOK0', KSSVOK0, LSSVOK) |
| 967 |
CALL MDSTAT (NERR, MEM) |
| 968 |
IF (NERR .GT. 0) GOTO 40 |
| 969 |
call cpyint(lssvok, ia(kssvok),ia(kssvok0)) |
| 970 |
|
| 971 |
call muntt(numess0, numess, nvarss, |
| 972 |
$ ia(kssvok0), ia(kssvok), ia(kiesss)) |
| 973 |
endif |
| 974 |
|
| 975 |
C ... check that the sidesets that are retained contain the same number |
| 976 |
C of faces that the original sidesets contain. At the current time, |
| 977 |
C can only map sideset variables if the sidesets are the same... |
| 978 |
if (delel .and. nvarss .gt. 0) then |
| 979 |
i1 = 0 |
| 980 |
do i=0,numess0-1 |
| 981 |
if (ia(kiesss+i) .eq.0) then |
| 982 |
if (IA(KNESS0+i) .ne. IA(KNESS+i1)) then |
| 983 |
write (*,900) 'Sideset', ia(kidss0+i), 'sideset' |
| 984 |
stop 'Cannot Map Sideset Variables' |
| 985 |
end if |
| 986 |
i1 = i1 + 1 |
| 987 |
end if |
| 988 |
end do |
| 989 |
end if |
| 990 |
|
| 991 |
CALL MDLONG ('IDESS', KIDSS, NUMESS) |
| 992 |
CALL MDLONG ('NEESS', KNESS, NUMESS) |
| 993 |
CALL MDLONG ('IXEESS', KIXESS, NUMESS) |
| 994 |
CALL MDLONG ('LTEESS', KLTESS, LESSEL) |
| 995 |
CALL MDLONG ('LTSESS', KLTSSS, LESSEL) |
| 996 |
CALL MDLONG ('FACESS', KFACSS, LESSDF) |
| 997 |
CALL MDSTAT (NERR, MEM) |
| 998 |
IF (NERR .GT. 0) GOTO 40 |
| 999 |
END IF |
| 1000 |
|
| 1001 |
CALL MDDEL ('IESSST') |
| 1002 |
CALL MDSTAT (NERR, MEM) |
| 1003 |
IF (NERR .GT. 0) GOTO 40 |
| 1004 |
|
| 1005 |
CALL MDDEL ('IXNP') |
| 1006 |
CALL MDSTAT (NERR, MEM) |
| 1007 |
IF (NERR .GT. 0) GOTO 40 |
| 1008 |
|
| 1009 |
CALL MINMAX (NUMNP, A(KXN), XMIN, XMAX) |
| 1010 |
CALL MINMAX (NUMNP, A(KYN), YMIN, YMAX) |
| 1011 |
IF (NDIM .EQ. 3) THEN |
| 1012 |
CALL MINMAX (NUMNP, A(KZN), ZMIN, ZMAX) |
| 1013 |
END IF |
| 1014 |
|
| 1015 |
call limits('Output Mesh Limits:', ndim, |
| 1016 |
& xmin, xmax, ymin, ymax, zmin, zmax) |
| 1017 |
|
| 1018 |
C --Open the output database |
| 1019 |
|
| 1020 |
CMPSIZ = 0 |
| 1021 |
IOWS = iowdsz() |
| 1022 |
MODE = EXCLOB |
| 1023 |
if (l64bit) then |
| 1024 |
MODE = MODE + EX_ALL_INT64_DB + EX_ALL_INT64_API |
| 1025 |
end if |
| 1026 |
ndbout = excre(filout(:lfil), MODE, CMPSIZ, IOWS, IERR) |
| 1027 |
if (ierr .lt. 0) then |
| 1028 |
call exopts (EXVRBS, ierr1) |
| 1029 |
call exerr('grepos', 'Error from excre', ierr) |
| 1030 |
go to 50 |
| 1031 |
endif |
| 1032 |
call exmxnm(ndbout, maxnam, ierr) |
| 1033 |
|
| 1034 |
if (l64bit) then |
| 1035 |
C ... Compress the output |
| 1036 |
call exsetopt(ndbout, EX_OPT_COMPRESSION_LEVEL, 1, ierr) |
| 1037 |
call exsetopt(ndbout, EX_OPT_COMPRESSION_SHUFFLE, 1, ierr) |
| 1038 |
end if |
| 1039 |
|
| 1040 |
C --Write the QA records |
| 1041 |
CALL DBOQA (NDBOUT, QAINFO, NQAREC, c(kqarec), |
| 1042 |
& NINFO, c(kinfo), ' Grepos: ', FILIN) |
| 1043 |
|
| 1044 |
C --Write the initial variables |
| 1045 |
call expini (ndbout, title, ndim, numnp, numel, nelblk, numnps, |
| 1046 |
& numess, ierr) |
| 1047 |
|
| 1048 |
C --Write the coordinates |
| 1049 |
call expcor (ndbout, a(kxn), a(kyn), a(kzn), ierr) |
| 1050 |
|
| 1051 |
C --Write the node/element order maps |
| 1052 |
C ... If the maps are 1..num, then don't write them... |
| 1053 |
call check_map(ia(kmapel), numel, order) |
| 1054 |
if (.not. order) then |
| 1055 |
call expenm (ndbout, ia(kmapel), ierr) |
| 1056 |
end if |
| 1057 |
call check_map(ia(kmapnn), numnp, order) |
| 1058 |
if (.not. order) then |
| 1059 |
call expnnm (ndbout, ia(kmapnn), ierr) |
| 1060 |
end if |
| 1061 |
|
| 1062 |
C --Write the element block |
| 1063 |
CALL DBOELB (NDBOUT, 1, NELBLK, |
| 1064 |
& IA(KIDELB), IA(KNELB), IA(KNLNK), IA(KNATR), |
| 1065 |
& IA(KLINK), c(kbktyp), A(KATRIB)) |
| 1066 |
call putnam(NDBOUT, 1, nelblk, C(KNAMEB)) |
| 1067 |
|
| 1068 |
call putattnam(ndbout, nelblk, ia(kidelb), ia(knatr), c(knamatt)) |
| 1069 |
|
| 1070 |
C --Write the node sets |
| 1071 |
if (numnps .gt. 0) then |
| 1072 |
if (lnpsdf .eq. 0) then |
| 1073 |
do i= 0, numnps-1 |
| 1074 |
ia(kndnps+i) = 0 |
| 1075 |
ia(kixdns+i) = 0 |
| 1076 |
end do |
| 1077 |
call expcns (ndbout, ia(kidns), ia(knnns), ia(kndnps), |
| 1078 |
& ia(kixnns), ia(kixdns), ia(kltnns), a(kfacns), ierr) |
| 1079 |
else |
| 1080 |
C ... This strangeness is due to bug in gfortran compiler |
| 1081 |
C which was optimizing out the setting of ia(kidns) and ia(indnps). |
| 1082 |
C since they are the same as ia(knnns) and ia(kixnns), just use |
| 1083 |
C those values. Bug is in gfortran-4.8 up to 5.0? |
| 1084 |
call expcns (ndbout, ia(kidns), ia(knnns), ia(knnns), |
| 1085 |
& ia(kixnns), ia(kixnns), ia(kltnns), a(kfacns), ierr) |
| 1086 |
end if |
| 1087 |
call putnam(NDBOUT, 2, numnps, C(KNAMNP)) |
| 1088 |
end if |
| 1089 |
|
| 1090 |
C --Write the side sets |
| 1091 |
if (numess .gt. 0) then |
| 1092 |
call putss(ndbout, numess, ia(kidss), ia(kness), ia(kndss), |
| 1093 |
* ia(kixess), ia(kixdss), ia(kltess), ia(kltsss), |
| 1094 |
* a(kfacss), *40) |
| 1095 |
call putnam(NDBOUT, 3, numess, C(KNAMSS)) |
| 1096 |
end if |
| 1097 |
|
| 1098 |
inod2el = 0 |
| 1099 |
do i=1, nvarnp |
| 1100 |
inod2el = inod2el + ia(kinod2el+i-1) |
| 1101 |
end do |
| 1102 |
if (inod2el .gt. 0) then |
| 1103 |
call mdrsrv('ELEMTIZE', kelmtz, inod2el*numel) |
| 1104 |
CALL MDSTAT (NERR, MEM) |
| 1105 |
IF (NERR .GT. 0) GOTO 40 |
| 1106 |
end if |
| 1107 |
|
| 1108 |
CALL DBPINI ('NTISV', NDBOUT, TITLE, NDIM, NUMNP, NUMEL, NELBLK, |
| 1109 |
& NUMNPS, LNPSNL, LNPSDF, NUMESS, LESSEL, LESSDF, |
| 1110 |
& NVARGL, NVARNP, NVAREL+inod2el, NVARNS, NVARSS, FILOUT) |
| 1111 |
|
| 1112 |
C ... See if writing the CENTROID field to the database... |
| 1113 |
if (centrd) then |
| 1114 |
if (.not. exodus) then |
| 1115 |
nvarel = ndim |
| 1116 |
CALL MCRSRV('NAMES', KNAMES, maxnam*NVAREL) |
| 1117 |
CALL MDRSRV ('ISEVOK', KIEVOK, NELBLK * NVAREL) |
| 1118 |
CALL MCSTAT (NERR, MEM) |
| 1119 |
IF (NERR .GT. 0) GOTO 40 |
| 1120 |
call centnam(c(knames), ia(kievok), nelblk, nvarel, ndim) |
| 1121 |
ixev = 1 |
| 1122 |
end if |
| 1123 |
end if |
| 1124 |
|
| 1125 |
C --Write the database names |
| 1126 |
if (inod2el .gt. 0) then |
| 1127 |
call dbonam(ndbout, ndim, c(knamco), |
| 1128 |
& nvargl, ixgv, nvarnp, ixnv, 0, ixev, |
| 1129 |
* nvarns, ixnsv, nvarss, ixssv, c(knames)) |
| 1130 |
call mcrsrv('TNAME', KTNAM, maxnam*(nvarel+inod2el)) |
| 1131 |
call eltznam(c(ktnam), c(knames), ixnv, nvarnp, |
| 1132 |
* ia(kinod2el), ixev, nvarel) |
| 1133 |
call dbonam(ndbout, 0, c(knamco), |
| 1134 |
& 0, ixgv, 0, ixnv, nvarel+inod2el, 1, |
| 1135 |
* 0, ixnsv, 0, ixssv, c(ktnam)) |
| 1136 |
call mcdel('TNAME') |
| 1137 |
else |
| 1138 |
call dbonam(ndbout, ndim, c(knamco), |
| 1139 |
& nvargl, ixgv, nvarnp, ixnv, nvarel, ixev, |
| 1140 |
* nvarns, ixnsv, nvarss, ixssv, c(knames)) |
| 1141 |
end if |
| 1142 |
|
| 1143 |
C ... Truth Table. |
| 1144 |
if (nvarel+inod2el .gt. 0) then |
| 1145 |
CALL MDRSRV ('ITMP', ktmp, NELBLK * (NVAREL+INOD2EL)) |
| 1146 |
CALL MDSTAT (NERR, MEM) |
| 1147 |
IF (NERR .GT. 0) GOTO 40 |
| 1148 |
call dbott(ndbout, 'E', nelblk, nvarel, inod2el, |
| 1149 |
* la(kievok), ia(ktmp)) |
| 1150 |
call mddel('itmp') |
| 1151 |
CALL MDSTAT (NERR, MEM) |
| 1152 |
IF (NERR .GT. 0) GOTO 40 |
| 1153 |
end if |
| 1154 |
|
| 1155 |
if (nvarns .gt. 0) then |
| 1156 |
CALL MDRSRV ('ITMP', ktmp, NUMNPS * NVARNS) |
| 1157 |
CALL MDSTAT (NERR, MEM) |
| 1158 |
IF (NERR .GT. 0) GOTO 40 |
| 1159 |
call dbott(ndbout, 'M', numnps, nvarns, 0, la(knsvok), ia(ktmp)) |
| 1160 |
call mddel('itmp') |
| 1161 |
CALL MDSTAT (NERR, MEM) |
| 1162 |
IF (NERR .GT. 0) GOTO 40 |
| 1163 |
end if |
| 1164 |
|
| 1165 |
if (nvarss .gt. 0) then |
| 1166 |
CALL MDRSRV ('ITMP', ktmp, NUMESS * NVARSS) |
| 1167 |
CALL MDSTAT (NERR, MEM) |
| 1168 |
IF (NERR .GT. 0) GOTO 40 |
| 1169 |
call dbott(ndbout, 'S', numess, nvarss, 0, la(kssvok), ia(ktmp)) |
| 1170 |
call mddel('itmp') |
| 1171 |
CALL MDSTAT (NERR, MEM) |
| 1172 |
IF (NERR .GT. 0) GOTO 40 |
| 1173 |
end if |
| 1174 |
|
| 1175 |
if (centrd .and. .not. exodus) then |
| 1176 |
istep = 1 |
| 1177 |
time = 0.0 |
| 1178 |
CALL DBOSTE (NDBOUT, ISTEP, |
| 1179 |
& NVARGL, NVARNP, NUMNP, NVAREL, 0, NELBLK, |
| 1180 |
& IA(KNELB), LA(KIEVOK), IA(KIDELB), |
| 1181 |
* NVARNS, NUMNPS, IA(KNNNS), IA(KNSVOK), IA(KIDNS), |
| 1182 |
* NVARSS, NUMESS, IA(KNESS), IA(KSSVOK), IA(KIDSS), |
| 1183 |
* TIME, A(KVARGL), A(KVARNP), A(KCENT), A(KVARNS), A(KVARSS), |
| 1184 |
$ A(1)) |
| 1185 |
|
| 1186 |
call mddel('CENTROID') |
| 1187 |
CALL MDSTAT (NERR, MEM) |
| 1188 |
IF (NERR .GT. 0) GOTO 40 |
| 1189 |
end if |
| 1190 |
if (.not. exodus) GOTO 50 |
| 1191 |
|
| 1192 |
C --Read the database time steps |
| 1193 |
MXV = MAX(NVARNP*NUMNP0, NVAREL*NUMEL0, |
| 1194 |
* NVARNS*LNPSNL0, NVARSS*LESSEL0, INOD2EL*NUMNP0) |
| 1195 |
CALL MDRSRV ('VARGL', KVARGL, NVARGL) |
| 1196 |
CALL MDRSRV ('VARNP', KVARNP, NVARNP * NUMNP0) |
| 1197 |
CALL MDRSRV ('VAREL', KVAREL, (NVAREL+INOD2EL) * NUMEL0) |
| 1198 |
CALL MDRSRV ('VARNS', KVARNS, NVARNS * LNPSNL0) |
| 1199 |
CALL MDRSRV ('VARSS', KVARSS, NVARSS * LESSEL0) |
| 1200 |
IF (RENEL .OR. DELNP .OR. DELEL) THEN |
| 1201 |
CALL MDRSRV ('VARSCR', KVARSC, MXV) |
| 1202 |
ELSE |
| 1203 |
CALL MDRSRV ('VARSCR', KVARSC, 0) |
| 1204 |
END IF |
| 1205 |
CALL MDSTAT (NERR, MEM) |
| 1206 |
IF (NERR .GT. 0) GOTO 40 |
| 1207 |
|
| 1208 |
WRITE (*, *) |
| 1209 |
WRITE (*, *) |
| 1210 |
|
| 1211 |
C ... NOTE: VARNP and VAREL are treated as doubly-dimensioned arrays |
| 1212 |
C dimensioned as (NUMEL, NVAREL) |
| 1213 |
iostep = 0 |
| 1214 |
|
| 1215 |
do 110 istep = 1, nsteps |
| 1216 |
if (ia(kitims+istep-1) .eq. 0) then |
| 1217 |
iostep = iostep + 1 |
| 1218 |
CALL DBISTE (NDBIN, '*', istep, |
| 1219 |
& NVARGL, |
| 1220 |
* NVARNP, NUMNP0, |
| 1221 |
* NVAREL, NELBLK0, IA(KNELB0), LA(KIEVOK0), IA(KIDELB0), |
| 1222 |
* NVARNS, NUMNPS0, IA(KNNNS0), IA(KNSVOK0), IA(KIDNS0), |
| 1223 |
* NVARSS, NUMESS0, IA(KNESS0), IA(KSSVOK0), IA(KIDSS0), |
| 1224 |
& TIME, |
| 1225 |
* A(KVARGL), A(KVARNP), A(KVAREL), A(KVARNS), A(KVARSS), *120) |
| 1226 |
|
| 1227 |
if (istep .eq. idefst) then |
| 1228 |
C ... The model was deformed at this step, zero out the displacements |
| 1229 |
C at this step (Technically, should also subtract off this steps |
| 1230 |
C displacements from every other step, but that isn't supported yet... |
| 1231 |
C Assumes that displacements are the first 'ndim' nodal variables. |
| 1232 |
do i=1, ndim*numnp |
| 1233 |
a(kvarnp+i-1) = 0.0 |
| 1234 |
end do |
| 1235 |
end if |
| 1236 |
|
| 1237 |
if (inod2el .gt. 0) then |
| 1238 |
ioff = 0 |
| 1239 |
inoff = 0 |
| 1240 |
do i=1, nvarnp |
| 1241 |
if (ia(kinod2el+i-1) .gt. 0) then |
| 1242 |
call elementize(a(kvarnp+inoff), a(kelmtz+ioff), |
| 1243 |
* nelblk, ia(knelb), ia(knlnk), ia(klink)) |
| 1244 |
ioff = ioff + numel |
| 1245 |
end if |
| 1246 |
inoff = inoff + numnp |
| 1247 |
end do |
| 1248 |
end if |
| 1249 |
|
| 1250 |
IF (RENEL .OR. DELNP .OR. DELEL) THEN |
| 1251 |
if (nvarnp .gt. 0) then |
| 1252 |
CALL MAPVAR(NUMNP0, NUMNP, NVARNP, IA(KMAPN), |
| 1253 |
& A(KVARNP), A(KVARSC)) |
| 1254 |
end if |
| 1255 |
if (nvarel .gt. 0) then |
| 1256 |
C ... Pass in the NEW element block parameters (number elements/block), |
| 1257 |
C number element blocks, and truth table. |
| 1258 |
CALL MAPEV(NUMEL0, NUMEL, NVAREL, IA(KMAPL), |
| 1259 |
& A(KVAREL), A(KVARSC)) |
| 1260 |
end if |
| 1261 |
|
| 1262 |
if (inod2el .gt. 0) then |
| 1263 |
CALL MAPEV(NUMEL0, NUMEL, inod2el, IA(KMAPL), |
| 1264 |
& A(kelmtz), A(KVARSC)) |
| 1265 |
end if |
| 1266 |
|
| 1267 |
END IF |
| 1268 |
|
| 1269 |
CALL DBOSTE (NDBOUT, IOSTEP, |
| 1270 |
& NVARGL, NVARNP, NUMNP, NVAREL, INOD2EL, NELBLK, |
| 1271 |
$ IA(KNELB), LA(KIEVOK), IA(KIDELB), |
| 1272 |
$ NVARNS, NUMNPS0, IA(KNNNS0), IA(KNSVOK0), IA(KIDNS0), |
| 1273 |
$ NVARSS, NUMESS0, IA(KNESS0), IA(KSSVOK0), IA(KIDSS0), |
| 1274 |
$ TIME, |
| 1275 |
$ A(KVARGL), A(KVARNP), A(KVAREL), A(KVARNS), A(KVARSS), |
| 1276 |
$ A(KELMTZ)) |
| 1277 |
|
| 1278 |
WRITE (*, 10000) IOSTEP, TIME |
| 1279 |
10000 FORMAT (' ', I8, ' time steps processed. Time = ',1PE10.3) |
| 1280 |
end if |
| 1281 |
110 continue |
| 1282 |
|
| 1283 |
120 CONTINUE |
| 1284 |
WRITE (SCRSTR, '(I9)', IOSTAT=K) IOSTEP |
| 1285 |
CALL SQZSTR (SCRSTR, LSTR) |
| 1286 |
WRITE (*, 10010) SCRSTR(:LSTR) |
| 1287 |
10010 FORMAT (/, 4X, A, |
| 1288 |
& ' time steps have been written to the output database') |
| 1289 |
|
| 1290 |
GO TO 50 |
| 1291 |
40 CONTINUE |
| 1292 |
CALL MEMERR |
| 1293 |
GOTO 50 |
| 1294 |
|
| 1295 |
50 CONTINUE |
| 1296 |
call mdfree() |
| 1297 |
call exclos(ndbin, ierr) |
| 1298 |
call exclos(ndbout, ierr) |
| 1299 |
|
| 1300 |
60 CONTINUE |
| 1301 |
call addlog (QAINFO(1)(:lenstr(QAINFO(1)))) |
| 1302 |
CALL WRAPUP (QAINFO(1)) |
| 1303 |
|
| 1304 |
70 FORMAT (/ |
| 1305 |
& 14X,' GGGGG RRRRRR EEEEEEE PPPPPP OOOOO SSSSSS'/ |
| 1306 |
& 14X,'GG GG RR RR EE PP PP OO OO SS '/ |
| 1307 |
& 14X,'GG RR RR EE PP PP OO OO SS '/ |
| 1308 |
& 14X,'GG RRRRRR EEEEE PPPPPP OO OO SSSSS '/ |
| 1309 |
& 14X,'GG GGG RRRRR EE PP OO OO SS'/ |
| 1310 |
& 14X,'GG GG RR RR EE PP OO OO SS'/ |
| 1311 |
& 14X,' GGGGG RR RR EEEEEEE PP OOOOO SSSSSS ') |
| 1312 |
900 FORMAT(/,'WARNING: ',A,i5,' is a different size in the output', |
| 1313 |
$ /,9x,'database than in the input database. The ', |
| 1314 |
$ /,9x,'variables on this ',A,' will be transferred', |
| 1315 |
$ /,9x,'incorrectly. Contact [email protected]', |
| 1316 |
$ /,9x,'if you need this capability.') |
| 1317 |
END |
| 1318 |
|
| 1319 |
subroutine exgqaw(ndb, qarec, ierr) |
| 1320 |
include 'gp_params.blk' |
| 1321 |
character*(mxstln) qarec(4, *) |
| 1322 |
call exgqa(ndb, qarec, ierr) |
| 1323 |
return |
| 1324 |
end |
| 1325 |
subroutine exginw(ndb, info, ierr) |
| 1326 |
include 'gp_params.blk' |
| 1327 |
character*(mxlnln) info(*) |
| 1328 |
call exginf(ndb, info, ierr) |
| 1329 |
return |
| 1330 |
end |
| 1331 |
|
| 1332 |
subroutine dbott(ndbout, type, nblk, nvar, iextra, ievok, itmp) |
| 1333 |
character*1 type |
| 1334 |
logical IEVOK(nblk,nvar) |
| 1335 |
INTEGER ITMP(NVAR+iextra,nblk) |
| 1336 |
|
| 1337 |
do 20 i=1, nvar |
| 1338 |
do 10 ielb = 1, nblk |
| 1339 |
if (ievok(ielb,i)) then |
| 1340 |
itmp(i,ielb) = 1 |
| 1341 |
else |
| 1342 |
itmp(i,ielb) = 0 |
| 1343 |
end if |
| 1344 |
10 continue |
| 1345 |
20 continue |
| 1346 |
|
| 1347 |
do i=1, iextra |
| 1348 |
do ielb = 1, nblk |
| 1349 |
itmp(i+nvar, ielb) = 1 |
| 1350 |
end do |
| 1351 |
end do |
| 1352 |
if (type .eq. 'E') then |
| 1353 |
call expvtt(ndbout, nblk, nvar+iextra, itmp, ierr) |
| 1354 |
else if (type .eq. 'M') then |
| 1355 |
call expnstt(ndbout, nblk, nvar+iextra, itmp, ierr) |
| 1356 |
else if (type .eq. 'S') then |
| 1357 |
call expsstt(ndbout, nblk, nvar+iextra, itmp, ierr) |
| 1358 |
end if |
| 1359 |
return |
| 1360 |
end |
| 1361 |
|
| 1362 |
subroutine centnam(names, isevok, nelblk, nvarel, ndim) |
| 1363 |
include 'gp_namlen.blk' |
| 1364 |
character*(maxnam) names(*) |
| 1365 |
integer isevok(nelblk, nvarel) |
| 1366 |
|
| 1367 |
names(1)(:maxnam) = 'centroid_x' |
| 1368 |
if (ndim .ge. 2) names(2)(:maxnam) = 'centroid_y' |
| 1369 |
if (ndim .eq. 3) names(3)(:maxnam) = 'centroid_z' |
| 1370 |
|
| 1371 |
do 20 i=1, nelblk |
| 1372 |
do 10 j=1, nvarel |
| 1373 |
isevok(i,j) = 1 |
| 1374 |
10 continue |
| 1375 |
20 continue |
| 1376 |
|
| 1377 |
return |
| 1378 |
end |
| 1379 |
|
| 1380 |
subroutine eltznam(evnames, names, ixnv, nvarnp, |
| 1381 |
* inod2el, ixev, nvarel) |
| 1382 |
include 'gp_namlen.blk' |
| 1383 |
character*(maxnam) names(*), evnames(*) |
| 1384 |
integer inod2el(*) |
| 1385 |
|
| 1386 |
do i=1, nvarel |
| 1387 |
evnames(i) = names(ixev+i-1) |
| 1388 |
end do |
| 1389 |
|
| 1390 |
isum = 0 |
| 1391 |
do i=1, nvarnp |
| 1392 |
if (inod2el(i) .gt. 0) then |
| 1393 |
isum = isum + 1 |
| 1394 |
evnames(nvarel+isum)(:2) = 'n_' |
| 1395 |
evnames(nvarel+isum)(3:maxnam) = names(ixnv+i-1)(:maxnam-3) |
| 1396 |
end if |
| 1397 |
end do |
| 1398 |
|
| 1399 |
return |
| 1400 |
end |
| 1401 |
|
| 1402 |
SUBROUTINE PRTT(NELBLK, NVAREL, truth) |
| 1403 |
LOGICAL TRUTH(NELBLK, NVAREL) |
| 1404 |
DO 10 I=1, NELBLK |
| 1405 |
WRITE (*,*) (TRUTH(I,IVAR),IVAR=1,NVAREL) |
| 1406 |
10 CONTINUE |
| 1407 |
RETURN |
| 1408 |
END |
| 1409 |
|
| 1410 |
C...Check whether model contains elements of a single topology. |
| 1411 |
C This is currently used in the sideset mirroring code |
| 1412 |
subroutine chktop(nelblk, blktyp, comtop) |
| 1413 |
|
| 1414 |
include 'exodusII.inc' |
| 1415 |
integer nelblk |
| 1416 |
character*(MXSTLN) blktyp(nelblk) |
| 1417 |
character*(MXSTLN) comtop |
| 1418 |
|
| 1419 |
comtop = blktyp(1)(:3) |
| 1420 |
do 10 i=2, nelblk |
| 1421 |
if (blktyp(i)(:3) .ne. comtop(:3)) then |
| 1422 |
comtop = 'MULTIPLE_TOPOLOGIES' |
| 1423 |
return |
| 1424 |
end if |
| 1425 |
10 continue |
| 1426 |
return |
| 1427 |
end |
| 1428 |
|
| 1429 |
subroutine getcon(ndb, ndim, nameco, ierr) |
| 1430 |
include 'gp_namlen.blk' |
| 1431 |
|
| 1432 |
character*(maxnam) nameco(*) |
| 1433 |
CALL INISTR (NDIM, ' ', nameco) |
| 1434 |
call exgcon (ndb, nameco, ierr) |
| 1435 |
return |
| 1436 |
end |
| 1437 |
|
| 1438 |
subroutine getnam(ndb, itype, isiz, names) |
| 1439 |
include 'gp_namlen.blk' |
| 1440 |
character*(maxnam) names(*) |
| 1441 |
|
| 1442 |
call exgnams(ndb, itype, isiz, names, ierr) |
| 1443 |
return |
| 1444 |
end |
| 1445 |
|
| 1446 |
subroutine putnam(ndb, itype, isiz, names) |
| 1447 |
include 'gp_namlen.blk' |
| 1448 |
character*(namlen) names(*) |
| 1449 |
|
| 1450 |
call expnams(ndb, itype, isiz, names, ierr) |
| 1451 |
return |
| 1452 |
end |
| 1453 |
|
| 1454 |
subroutine cpyid(nelblk, idin, idout) |
| 1455 |
integer idin(nelblk) |
| 1456 |
integer idout(nelblk) |
| 1457 |
|
| 1458 |
do i=1, nelblk |
| 1459 |
idout(i) = idin(i) |
| 1460 |
end do |
| 1461 |
return |
| 1462 |
end |
| 1463 |
|
| 1464 |
subroutine check_map(map, length, order) |
| 1465 |
integer map(*) |
| 1466 |
integer length |
| 1467 |
logical order |
| 1468 |
|
| 1469 |
do i = 1, length |
| 1470 |
if (map(i) .ne. i) then |
| 1471 |
order = .false. |
| 1472 |
return |
| 1473 |
end if |
| 1474 |
end do |
| 1475 |
order = .true. |
| 1476 |
return |
| 1477 |
end |