| 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 |
SUBROUTINE MXFREE (OFFSET, DICT, DPOINT, LDICT, NNAMES, CHRCOL, |
| 7 |
* MYLOC) |
| 8 |
|
| 9 |
IMPLICIT INTEGER (A-Z) |
| 10 |
INCLUDE 'params.inc' |
| 11 |
|
| 12 |
C This routine frees all memory allocated by SUPES. |
| 13 |
C All addresses are invalid at this point forward. |
| 14 |
|
| 15 |
C*********************************************************************** |
| 16 |
|
| 17 |
C OFFSET Offset to internal reference vector |
| 18 |
C DICT Dictionary name table |
| 19 |
C DPOINT Dictionary pointer table |
| 20 |
C LDICT Dimension of dictionary tables |
| 21 |
C NNAMES Number of names in the dictionary |
| 22 |
CHARACTER*8 DICT(LDICT,CHRCOL) |
| 23 |
DIMENSION DPOINT(LDICT,CHRCOL,3), NNAMES(2) |
| 24 |
C CHRCOL Number of column for character names. |
| 25 |
|
| 26 |
C*********************************************************************** |
| 27 |
|
| 28 |
TOFF = OFFSET |
| 29 |
DO ICOL = 1, CHRCOL |
| 30 |
IF (ICOL .EQ. 2) THEN |
| 31 |
TOFF = 0 |
| 32 |
END IF |
| 33 |
C DICTIONARY. |
| 34 |
|
| 35 |
DO I = 1, NNAMES(ICOL) |
| 36 |
LOC = DPOINT(I,ICOL,1) |
| 37 |
LEN = DPOINT(I,ICOL,2) |
| 38 |
|
| 39 |
C ... Using malloc/free -- let system manage void space. Return |
| 40 |
C memory to system via 'free'. The value given to memret |
| 41 |
C is a flag which tells the system that this is a 'safe' free |
| 42 |
C which should actually execute. (Major Kludge...) |
| 43 |
if (len .gt. 0) then |
| 44 |
LASTER = SUCCESS |
| 45 |
memret = -999 |
| 46 |
oldadr = loc+myloc-1 |
| 47 |
call exmemy(-len, oldadr, memret) |
| 48 |
if (memret .lt. 0 .or. memret .gt. len) then |
| 49 |
write (*,*) 'ERROR in MXDEL', memret, len |
| 50 |
laster = ilblk |
| 51 |
end if |
| 52 |
end if |
| 53 |
end do |
| 54 |
end do |
| 55 |
|
| 56 |
RETURN |
| 57 |
END |