Debian Codegraph @

packages/seacas/libraries/supes/mem_mgr/mxget.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 MXGET (MYLOC, MNGET, VOID, LVOID, NVOIDS,
7 * CHRCOL, LASTER, VROW)
8
9 IMPLICIT INTEGER (A-Z)
10 INCLUDE 'params.inc'
11
12 C This subroutine returns the location (row number) of a void with
13 C sufficient space for the memory request. If necessary, memory is
14 C acquired from the system. The memory is contiguous.
15
16 C***********************************************************************
17
18 C MYLOC Address of internal reference array
19 C MNGET Memory request in numerical storage units
20 C VOID Void table
21 C LVOID Dimension of void table
22 C NVOIDS Number of voids
23 DIMENSION VOID(LVOID,CHRCOL,2), NVOIDS(2)
24 C CHRCOL Column for character tables.
25 C LASTER Error return
26 C VROW Row number of void which satisfies the memory request
27
28 C***********************************************************************
29
30 C IS THE MEMORY REQUEST SENSIBLE?
31
32 IF (MNGET .LT. 0) THEN
33 LASTER = BADLEN
34 RETURN
35 ELSE IF (MNGET .EQ. 0) THEN
36 LASTER = SUCCESS
37 RETURN
38 END IF
39
40 CALL MXLOOK (MNGET, VOID, CHRCOL*LVOID, NVOIDS(1), VROW, LASTER)
41 IF (LASTER .EQ. SUCCESS) RETURN
42
43 C CALL EXTENSION LIBRARY ROUTINE TO GET SPACE FROM SYSTEM.
44
45 CALL EXMEMY (MNGET, LOC, MEMRET)
46 LOC = LOC - MYLOC + 1
47
48 c On return from exmemy, memret is set equal to -1 on an invalid
49 c memory request (at least that's the plan under the new C code
50 c extension library). Therefore, I've made the change that should
51 c test the appropriate condition.
52
53 IF (MEMRET .LT. 0) THEN
54
55 C ILLEGAL MEMORY REQUEST.
56
57 LASTER = NOGET
58 RETURN
59
60 END IF
61
62 C UPDATE VOID TABLE.
63
64 CALL VTABLE (LOC, MEMRET, VOID, LVOID, NVOIDS(1), CHRCOL, LASTER)
65 IF (LASTER .NE. SUCCESS) RETURN
66
67 CALL MXLOOK (MNGET, VOID, CHRCOL*LVOID, NVOIDS(1), VROW, LASTER)
68
69 RETURN
70 END