12 INTEGER(kind=large) :: numwordsalloc = 0
13 INTEGER(kind=large) :: maxwordsalloc = 0
14 INTEGER :: nummpalloc = 0
15 INTEGER :: nummpdealloc = 0
16 INTEGER :: printflagalloc = 0
33 DOUBLE PRECISION,
DIMENSION(:),
INTENT(IN OUT),
ALLOCATABLE :: array
34 INTEGER(kind=large),
INTENT(IN) :: length
35 CHARACTER (LEN=*),
INTENT(IN) :: text
38 ALLOCATE (array(length),stat=ifail)
44 REAL,
DIMENSION(:),
INTENT(IN OUT),
ALLOCATABLE :: array
45 INTEGER(kind=large),
INTENT(IN) :: length
46 CHARACTER (LEN=*),
INTENT(IN) :: text
49 ALLOCATE (array(length),stat=ifail)
55 INTEGER,
DIMENSION(:),
INTENT(IN OUT),
ALLOCATABLE :: array
56 INTEGER(kind=large),
INTENT(IN) :: length
57 CHARACTER (LEN=*),
INTENT(IN) :: text
60 ALLOCATE (array(length),stat=ifail)
66 REAL,
DIMENSION(:,:),
INTENT(IN OUT),
ALLOCATABLE :: array
67 INTEGER(kind=large),
INTENT(IN) :: rows
68 INTEGER(kind=large),
INTENT(IN) :: cols
69 CHARACTER (LEN=*),
INTENT(IN) :: text
72 ALLOCATE (array(rows,cols),stat=ifail)
78 INTEGER,
DIMENSION(:,:),
INTENT(IN OUT),
ALLOCATABLE :: array
79 INTEGER(kind=large),
INTENT(IN) :: rows
80 INTEGER(kind=large),
INTENT(IN) :: cols
81 CHARACTER (LEN=*),
INTENT(IN) :: text
84 ALLOCATE (array(rows,cols),stat=ifail)
90 INTEGER(kind=large),
DIMENSION(:,:),
INTENT(IN OUT),
ALLOCATABLE :: array
91 INTEGER(kind=large),
INTENT(IN) :: rows
92 INTEGER(kind=large),
INTENT(IN) :: cols
93 CHARACTER (LEN=*),
INTENT(IN) :: text
96 ALLOCATE (array(rows,cols),stat=ifail)
102 TYPE(listitem),
DIMENSION(:),
INTENT(IN OUT),
ALLOCATABLE :: array
103 INTEGER(kind=large),
INTENT(IN) :: length
104 CHARACTER (LEN=*),
INTENT(IN) :: text
107 ALLOCATE (array(length),stat=ifail)
113 CHARACTER,
DIMENSION(:),
INTENT(IN OUT),
ALLOCATABLE :: array
114 INTEGER(kind=large),
INTENT(IN) :: length
115 CHARACTER (LEN=*),
INTENT(IN) :: text
118 ALLOCATE (array(length),stat=ifail)
124 INTEGER,
INTENT(IN) :: ifail
125 INTEGER(kind=large),
INTENT(IN) :: numwords
126 CHARACTER (LEN=*),
INTENT(IN) :: text
128 nummpalloc=nummpalloc+1
129 numwordsalloc = numwordsalloc + numwords
130 maxwordsalloc = max(maxwordsalloc, numwordsalloc)
131 IF (printflagalloc /= 0)
THEN
132 print *,
' MPALLOC allocated ', numwords,
' words for : ', text
133 print *,
' words used ', numwordsalloc, maxwordsalloc
136 print *,
' MPALLOC failed to allocate ', numwords,
' words for : ', text
137 print *,
' MPALLOC words used ', numwordsalloc, maxwordsalloc
138 print *,
' MPALLOC stat = ', ifail
145 DOUBLE PRECISION,
DIMENSION(:),
INTENT(IN OUT),
ALLOCATABLE :: array
148 INTEGER(kind=large) :: isize
149 isize = 2*
size(array,kind=large)
150 DEALLOCATE (array,stat=ifail)
156 REAL,
DIMENSION(:),
INTENT(IN OUT),
ALLOCATABLE :: array
159 INTEGER(kind=large) :: isize
160 isize =
size(array,kind=large)
161 DEALLOCATE (array,stat=ifail)
167 INTEGER,
DIMENSION(:),
INTENT(IN OUT),
ALLOCATABLE :: array
170 INTEGER(kind=large) :: isize
171 isize =
size(array,kind=large)
172 DEALLOCATE (array,stat=ifail)
178 REAL,
DIMENSION(:,:),
INTENT(IN OUT),
ALLOCATABLE :: array
181 INTEGER(kind=large) :: isize
182 isize =
size(array,kind=large)
183 DEALLOCATE (array,stat=ifail)
189 INTEGER,
DIMENSION(:,:),
INTENT(IN OUT),
ALLOCATABLE :: array
192 INTEGER(kind=large) :: isize
193 isize =
size(array,kind=large)
194 DEALLOCATE (array,stat=ifail)
200 INTEGER(kind=large),
DIMENSION(:,:),
INTENT(IN OUT),
ALLOCATABLE :: array
203 INTEGER(kind=large) :: isize
204 isize =
size(array,kind=large)*large/4
205 DEALLOCATE (array,stat=ifail)
211 TYPE(listitem),
DIMENSION(:),
INTENT(IN OUT),
ALLOCATABLE :: array
214 INTEGER(kind=large) :: isize
215 isize = 2*
size(array,kind=large)
216 DEALLOCATE (array,stat=ifail)
222 CHARACTER,
DIMENSION(:),
INTENT(IN OUT),
ALLOCATABLE :: array
225 INTEGER(kind=large) :: isize
226 isize = (
size(array,kind=large)+3)/4
227 DEALLOCATE (array,stat=ifail)
233 INTEGER,
INTENT(IN) :: ifail
234 INTEGER(kind=large),
INTENT(IN) :: numwords
236 numwordsalloc = numwordsalloc - numwords
237 nummpdealloc=nummpdealloc+1
238 IF (printflagalloc /= 0)
THEN
239 print *,
' MPDEALLOC deallocated ', numwords,
' words '
240 print *,
' words used ', numwordsalloc, maxwordsalloc
243 print *,
' MPDEALLOC failed to deallocate ', numwords,
' words'
244 print *,
' MPDEALLOC words used ', numwordsalloc, maxwordsalloc
245 print *,
' MPDEALLOC stat = ', ifail