Debian Codegraph @

packages/seacas/libraries/supes/mem_mgr/myget.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 MYGET (MYLOC, MNGET, VOID, LVOID, NVOIDS,
7 * CHRCOL, MAXSIZ, 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 requested from the system. The memory is contiguous.
15 C This routine is to be used only if CHRCOL = 2.
16
17 C***********************************************************************
18
19 C MYLOC Address of internal reference array
20 C MNGET Memory request in character storage units
21 C VOID Void table
22 C LVOID Dimension of void table
23 C NVOIDS Number of voids
24 DIMENSION VOID(LVOID,CHRCOL,2), NVOIDS(2)
25 C CHRCOL Column for character tables (must be 2)
26 C MAXSIZ Dimension of static character array.
27 C LASTER Error return
28 C VROW Row number of void which satisfies the memory request
29
30 C***********************************************************************
31
32 C IS THE MEMORY REQUEST SENSIBLE?
33
34 IF (MNGET .LT. 0) THEN
35 LASTER = BADLEN
36 RETURN
37 ELSE IF (MNGET .EQ. 0) THEN
38 LASTER = SUCCESS
39 RETURN
40 END IF
41
42 CALL MXLOOK (MNGET, VOID(1,CHRCOL,1), CHRCOL*LVOID,
43 * NVOIDS(CHRCOL), VROW, LASTER)
44 IF (LASTER .EQ. SUCCESS) RETURN
45
46 C CALL EXTENSION LIBRARY ROUTINE TO GET SPACE FROM SYSTEM.
47
48 CALL MYMEMY (MNGET, LOC, MEMRET, MAXSIZ)
49 LOC = LOC - MYLOC + 1
50
51 IF (MEMRET .LT. 0) THEN
52
53 C ILLEGAL MEMORY BLOCK SIZE.
54
55 LASTER = ILBLK
56 RETURN
57
58 END IF
59
60 C UPDATE VOID TABLE.
61
62 CALL VTABLE (LOC, MEMRET, VOID(1,CHRCOL,1), LVOID,
63 * NVOIDS(CHRCOL), CHRCOL, LASTER)
64 IF (LASTER .NE. SUCCESS) RETURN
65
66 CALL MXLOOK (MNGET, VOID(1,CHRCOL,1), CHRCOL*LVOID,
67 * NVOIDS(CHRCOL), VROW, LASTER)
68
69 RETURN
70 END