|
subroutine | reallocate_int1d (aint, nrow, name, mem_path) |
| Reallocate a 1-dimensional integer array. More...
|
|
subroutine | reallocate_int2d (aint, ncol, nrow, name, mem_path) |
| Reallocate a 2-dimensional integer array. More...
|
|
subroutine | reallocate_dbl1d (adbl, nrow, name, mem_path) |
| Reallocate a 1-dimensional real array. More...
|
|
subroutine | reallocate_dbl2d (adbl, ncol, nrow, name, mem_path) |
| Reallocate a 2-dimensional real array. More...
|
|
subroutine | reallocate_str1d (astr, ilen, nrow, name, mem_path) |
| Reallocate a 1-dimensional defined length string array. More...
|
|
subroutine | reallocate_charstr1d (acharstr1d, ilen, nrow, name, mem_path) |
| Reallocate a 1-dimensional deferred length string array. More...
|
|
Definition at line 79 of file MemoryManager.f90.
◆ reallocate_charstr1d()
subroutine memorymanagermodule::mem_reallocate::reallocate_charstr1d |
( |
type(characterstringtype), dimension(:), intent(inout), pointer, contiguous |
acharstr1d, |
|
|
integer(i4b), intent(in) |
ilen, |
|
|
integer(i4b), intent(in) |
nrow, |
|
|
character(len=*), intent(in) |
name, |
|
|
character(len=*), intent(in) |
mem_path |
|
) |
| |
|
private |
- Parameters
-
[in,out] | acharstr1d | the reallocated charstring array |
[in] | ilen | string length |
[in] | nrow | number of rows |
[in] | name | variable name |
[in] | mem_path | path where variable is stored |
Definition at line 1181 of file MemoryManager.f90.
1182 type(CharacterStringType),
dimension(:),
pointer,
contiguous, &
1183 intent(inout) :: acharstr1d
1184 integer(I4B),
intent(in) :: ilen
1185 integer(I4B),
intent(in) :: nrow
1186 character(len=*),
intent(in) :: name
1187 character(len=*),
intent(in) :: mem_path
1189 type(MemoryType),
pointer :: mt
1190 logical(LGP) :: found
1191 type(CharacterStringType),
dimension(:),
allocatable :: astrtemp
1192 character(len=ilen) :: string
1193 integer(I4B) :: istat
1194 integer(I4B) :: isize
1195 integer(I4B) :: isize_old
1196 integer(I4B) :: nrow_old
1203 call get_from_memorystore(name, mem_path, mt, found)
1207 isize_old = mt%isize
1208 if (isize_old > 0)
then
1209 nrow_old =
size(acharstr1d)
1218 allocate (astrtemp(nrow), stat=istat, errmsg=errmsg)
1219 if (istat /= 0)
then
1220 call allocate_error(name, mem_path, istat, isize)
1225 astrtemp(n) = acharstr1d(n)
1226 call acharstr1d(n)%destroy()
1230 do n = nrow_old + 1, nrow
1231 astrtemp(n) = string
1235 deallocate (acharstr1d)
1238 allocate (acharstr1d(nrow), stat=istat, errmsg=errmsg)
1239 if (istat /= 0)
then
1240 call allocate_error(name, mem_path, istat, isize)
1245 acharstr1d(n) = astrtemp(n)
1246 call astrtemp(n)%destroy()
1250 deallocate (astrtemp)
1253 mt%acharstr1d => acharstr1d
1254 mt%element_size = ilen
1256 mt%nrealloc = mt%nrealloc + 1
1258 nvalues_astr = nvalues_astr + isize - isize_old
1259 write (mt%memtype,
"(a,' LEN=',i0,' (',i0,')')")
'STRING', ilen, nrow
1261 errmsg =
"Programming error, variable '"//trim(name)//
"' from '"// &
1262 trim(mem_path)//
"' is not defined in the memory manager. Use "// &
1263 "mem_allocate instead."
1264 call store_error(errmsg, terminate=.true.)
◆ reallocate_dbl1d()
subroutine memorymanagermodule::mem_reallocate::reallocate_dbl1d |
( |
real(dp), dimension(:), intent(inout), pointer, contiguous |
adbl, |
|
|
integer(i4b), intent(in) |
nrow, |
|
|
character(len=*), intent(in) |
name, |
|
|
character(len=*), intent(in) |
mem_path |
|
) |
| |
|
private |
- Parameters
-
[in,out] | adbl | the reallocated 1d real array |
[in] | nrow | number of rows |
[in] | name | variable name |
[in] | mem_path | path where variable is stored |
Definition at line 1359 of file MemoryManager.f90.
1360 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: adbl
1361 integer(I4B),
intent(in) :: nrow
1362 character(len=*),
intent(in) :: name
1363 character(len=*),
intent(in) :: mem_path
1365 type(MemoryType),
pointer :: mt
1366 integer(I4B) :: istat
1367 integer(I4B) :: isize
1369 integer(I4B) :: isizeold
1370 integer(I4B) :: ifill
1371 logical(LGP) :: found
1375 call get_from_memorystore(name, mem_path, mt, found)
1379 isizeold =
size(mt%adbl1d)
1380 ifill = min(isizeold, isize)
1381 allocate (adbl(nrow), stat=istat, errmsg=errmsg)
1382 if (istat /= 0)
then
1383 call allocate_error(name, mem_path, istat, isize)
1386 adbl(i) = mt%adbl1d(i)
1390 deallocate (mt%adbl1d)
1392 mt%element_size = dp
1394 mt%nrealloc = mt%nrealloc + 1
1396 nvalues_adbl = nvalues_adbl + isize - isizeold
1397 write (mt%memtype,
"(a,' (',i0,')')")
'DOUBLE', isize
◆ reallocate_dbl2d()
subroutine memorymanagermodule::mem_reallocate::reallocate_dbl2d |
( |
real(dp), dimension(:, :), intent(inout), pointer, contiguous |
adbl, |
|
|
integer(i4b), intent(in) |
ncol, |
|
|
integer(i4b), intent(in) |
nrow, |
|
|
character(len=*), intent(in) |
name, |
|
|
character(len=*), intent(in) |
mem_path |
|
) |
| |
|
private |
- Parameters
-
[in,out] | adbl | the reallocated 2d real array |
[in] | ncol | number of columns |
[in] | nrow | number of rows |
[in] | name | variable name |
[in] | mem_path | path where variable is stored |
Definition at line 1402 of file MemoryManager.f90.
1403 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: adbl
1404 integer(I4B),
intent(in) :: ncol
1405 integer(I4B),
intent(in) :: nrow
1406 character(len=*),
intent(in) :: name
1407 character(len=*),
intent(in) :: mem_path
1409 type(MemoryType),
pointer :: mt
1410 logical(LGP) :: found
1411 integer(I4B) :: istat
1412 integer(I4B),
dimension(2) :: ishape
1415 integer(I4B) :: isize
1416 integer(I4B) :: isizeold
1420 call get_from_memorystore(name, mem_path, mt, found)
1423 ishape = shape(mt%adbl2d)
1425 isizeold = ishape(1) * ishape(2)
1426 allocate (adbl(ncol, nrow), stat=istat, errmsg=errmsg)
1427 if (istat /= 0)
then
1428 call allocate_error(name, mem_path, istat, isize)
1432 adbl(j, i) = mt%adbl2d(j, i)
1437 deallocate (mt%adbl2d)
1439 mt%element_size = dp
1441 mt%nrealloc = mt%nrealloc + 1
1443 nvalues_adbl = nvalues_adbl + isize - isizeold
1444 write (mt%memtype,
"(a,' (',i0,',',i0,')')")
'DOUBLE', ncol, nrow
◆ reallocate_int1d()
subroutine memorymanagermodule::mem_reallocate::reallocate_int1d |
( |
integer(i4b), dimension(:), intent(inout), pointer, contiguous |
aint, |
|
|
integer(i4b), intent(in) |
nrow, |
|
|
character(len=*), intent(in) |
name, |
|
|
character(len=*), intent(in) |
mem_path |
|
) |
| |
|
private |
- Parameters
-
[in,out] | aint | the reallocated integer array |
[in] | nrow | number of rows |
[in] | name | variable name |
[in] | mem_path | path where variable is stored |
Definition at line 1270 of file MemoryManager.f90.
1271 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: aint
1272 integer(I4B),
intent(in) :: nrow
1273 character(len=*),
intent(in) :: name
1274 character(len=*),
intent(in) :: mem_path
1276 type(MemoryType),
pointer :: mt
1277 logical(LGP) :: found
1278 integer(I4B) :: istat
1279 integer(I4B) :: isize
1281 integer(I4B) :: isizeold
1282 integer(I4B) :: ifill
1286 call get_from_memorystore(name, mem_path, mt, found)
1290 isizeold =
size(mt%aint1d)
1291 ifill = min(isizeold, isize)
1292 allocate (aint(nrow), stat=istat, errmsg=errmsg)
1293 if (istat /= 0)
then
1294 call allocate_error(name, mem_path, istat, isize)
1297 aint(i) = mt%aint1d(i)
1301 deallocate (mt%aint1d)
1303 mt%element_size = i4b
1305 mt%nrealloc = mt%nrealloc + 1
1307 nvalues_aint = nvalues_aint + isize - isizeold
◆ reallocate_int2d()
subroutine memorymanagermodule::mem_reallocate::reallocate_int2d |
( |
integer(i4b), dimension(:, :), intent(inout), pointer, contiguous |
aint, |
|
|
integer(i4b), intent(in) |
ncol, |
|
|
integer(i4b), intent(in) |
nrow, |
|
|
character(len=*), intent(in) |
name, |
|
|
character(len=*), intent(in) |
mem_path |
|
) |
| |
|
private |
- Parameters
-
[in,out] | aint | the reallocated 2d integer array |
[in] | ncol | number of columns |
[in] | nrow | number of rows |
[in] | name | variable name |
[in] | mem_path | path where variable is stored |
Definition at line 1312 of file MemoryManager.f90.
1313 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: aint
1314 integer(I4B),
intent(in) :: ncol
1315 integer(I4B),
intent(in) :: nrow
1316 character(len=*),
intent(in) :: name
1317 character(len=*),
intent(in) :: mem_path
1319 type(MemoryType),
pointer :: mt
1320 logical(LGP) :: found
1321 integer(I4B) :: istat
1322 integer(I4B),
dimension(2) :: ishape
1325 integer(I4B) :: isize
1326 integer(I4B) :: isizeold
1330 call get_from_memorystore(name, mem_path, mt, found)
1333 ishape = shape(mt%aint2d)
1335 isizeold = ishape(1) * ishape(2)
1336 allocate (aint(ncol, nrow), stat=istat, errmsg=errmsg)
1337 if (istat /= 0)
then
1338 call allocate_error(name, mem_path, istat, isize)
1342 aint(j, i) = mt%aint2d(j, i)
1347 deallocate (mt%aint2d)
1349 mt%element_size = i4b
1351 mt%nrealloc = mt%nrealloc + 1
1353 nvalues_aint = nvalues_aint + isize - isizeold
1354 write (mt%memtype,
"(a,' (',i0,',',i0,')')")
'INTEGER', ncol, nrow
◆ reallocate_str1d()
subroutine memorymanagermodule::mem_reallocate::reallocate_str1d |
( |
character(len=ilen), dimension(:), intent(inout), pointer, contiguous |
astr, |
|
|
integer(i4b), intent(in) |
ilen, |
|
|
integer(i4b), intent(in) |
nrow, |
|
|
character(len=*), intent(in) |
name, |
|
|
character(len=*), intent(in) |
mem_path |
|
) |
| |
|
private |
- Parameters
-
[in] | ilen | string length |
[in] | nrow | number of rows |
[in,out] | astr | the reallocated string array |
[in] | name | variable name |
[in] | mem_path | path where variable is stored |
Definition at line 1100 of file MemoryManager.f90.
1101 integer(I4B),
intent(in) :: ilen
1102 integer(I4B),
intent(in) :: nrow
1103 character(len=ilen),
dimension(:),
pointer,
contiguous,
intent(inout) :: astr
1104 character(len=*),
intent(in) :: name
1105 character(len=*),
intent(in) :: mem_path
1107 type(MemoryType),
pointer :: mt
1108 logical(LGP) :: found
1109 character(len=ilen),
dimension(:),
allocatable :: astrtemp
1110 integer(I4B) :: istat
1111 integer(I4B) :: isize
1112 integer(I4B) :: isize_old
1113 integer(I4B) :: nrow_old
1117 call get_from_memorystore(name, mem_path, mt, found)
1121 isize_old = mt%isize
1122 if (isize_old > 0)
then
1123 nrow_old =
size(astr)
1132 allocate (astrtemp(nrow), stat=istat, errmsg=errmsg)
1133 if (istat /= 0)
then
1134 call allocate_error(name, mem_path, istat, isize)
1139 astrtemp(n) = astr(n)
1143 do n = nrow_old + 1, nrow
1151 allocate (astr(nrow), stat=istat, errmsg=errmsg)
1152 if (istat /= 0)
then
1153 call allocate_error(name, mem_path, istat, isize)
1158 astr(n) = astrtemp(n)
1162 deallocate (astrtemp)
1165 mt%element_size = ilen
1167 mt%nrealloc = mt%nrealloc + 1
1169 nvalues_astr = nvalues_astr + isize - isize_old
1170 write (mt%memtype,
"(a,' LEN=',i0,' (',i0,')')")
'STRING', ilen, nrow
1172 errmsg =
"Programming error, variable '"//trim(name)//
"' from '"// &
1173 trim(mem_path)//
"' is not defined in the memory manager. Use "// &
1174 "mem_allocate instead."
1175 call store_error(errmsg, terminate=.true.)
The documentation for this interface was generated from the following file: