Debian Codegraph @

packages/seacas/libraries/supes/mem_mgr/mydel.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 MYDEL (NAME1, DICT, DPOINT, LDICT, NNAMES, VOID,
7 * LVOID, NVOIDS, CHRCOL, LASTER, MYLOC, MYCLOC)
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 MYFIND (NAME1, DICT, DPOINT, LDICT, NNAMES,
37 * CHRCOL, LASTER, ROW)
38 IF (LASTER .NE. SUCCESS) RETURN
39
40 LOC = DPOINT(ROW,CHRCOL,1)
41 LEN = DPOINT(ROW,CHRCOL,2)
42
43 C DELETE DICTIONARY ENTRY.
44
45 CALL SHFTC (DICT(1,CHRCOL), CHRCOL*LDICT, ROW+1,
46 * NNAMES(CHRCOL), 1)
47 CALL SHFTI (DPOINT(1,CHRCOL,1), CHRCOL*LDICT, 3, ROW+1,
48 * NNAMES(CHRCOL), 1)
49 NNAMES(CHRCOL) = NNAMES(CHRCOL) - 1
50 IF (LEN .LE. 0) RETURN
51
52 C ... Using malloc/free -- let system manage void space. Return
53 C memory to system via 'free'. The value given to memret
54 C is a flag which tells the system that this is a 'safe' free
55 C which should actually execute. (Major Kludge...)
56 LASTER = SUCCESS
57 memret = -999
58 if (chrcol .eq. 1) then
59 oldadr = loc+myloc-1
60 else
61 oldadr = loc+mycloc-1
62 end if
63 call exmemy(-len, oldadr, memret)
64 if (memret .lt. 0 .or. memret .gt. len) then
65 write (*,*) 'ERROR in MYDEL', memret, len
66 laster = ilblk
67 return
68 end if
69
70 RETURN
71 END