Debian Codegraph @

packages/seacas/libraries/supes/mem_mgr/mxdel.f

raw
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 MXDEL (NAME1, DICT, DPOINT, LDICT, NNAMES, VOID,
7 * LVOID, NVOIDS, CHRCOL, LASTER, MYLOC)
8
9 IMPLICIT INTEGER (A-Z)
10 INCLUDE 'params.inc'
11
12 C This routine removes a name from the dictionary and returns the
13 C available space to the void table.
14
15 C***********************************************************************
16
17 C NAME1 Name to be deleted
18 CHARACTER*8 NAME1
19 C DICT Dictionary name table
20 C DPOINT Dictionary pointer table
21 C LDICT Dimension of dictionary tables
22 C NNAMES Number of names in the dictionary
23 CHARACTER*8 DICT(LDICT,CHRCOL)
24 DIMENSION DPOINT(LDICT,CHRCOL,3), NNAMES(2)
25 C VOID Void table
26 C LVOID Dimension of void table
27 C NVOIDS Number of voids
28 DIMENSION VOID(LVOID,CHRCOL,2), NVOIDS(2)
29 C CHRCOL Number of column for character names.
30 C LASTER Error return
31
32 C***********************************************************************
33
34 C FIND NAME1 IN DICTIONARY.
35
36 CALL MXFIND (NAME1, DICT, DPOINT, LDICT, NNAMES,
37 * CHRCOL, LASTER, ROW)
38 IF (LASTER .NE. SUCCESS) RETURN
39
40 LOC = DPOINT(ROW,1,1)
41 LEN = DPOINT(ROW,1,2)
42
43 C DELETE DICTIONARY ENTRY.
44
45 CALL SHFTC (DICT, CHRCOL*LDICT, ROW+1, NNAMES(1), 1)
46 CALL SHFTI (DPOINT, LDICT*CHRCOL, 3, ROW+1, NNAMES(1), 1)
47 NNAMES(1) = NNAMES(1) - 1
48 IF (LEN .LE. 0) RETURN
49
50 C MAKE AN ENTRY IN THE VOID TABLE.
51
52 c CALL VTABLE (LOC, LEN, VOID, LVOID, NVOIDS(1), CHRCOL, LASTER)
53
54 C ... Using malloc/free -- let system manage void space. Return
55 C memory to system via 'free'. The value given to memret
56 C is a flag which tells the system that this is a 'safe' free
57 C which should actually execute. (Major Kludge...)
58 LASTER = SUCCESS
59 memret = -999
60 oldadr = loc+myloc-1
61 call exmemy(-len, oldadr, memret)
62 if (memret .lt. 0 .or. memret .gt. len) then
63 write (*,*) 'ERROR in MXDEL', name1, memret, len
64 laster = ilblk
65 return
66 end if
67
68 RETURN
69 END