|
| subroutine | reallocate_logical1d (alog, nrow, name, mem_path) |
| | Reallocate a 1-dimensional logical array. More...
|
| |
| 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 82 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 1272 of file MemoryManager.f90.
1273 type(CharacterStringType),
dimension(:),
pointer,
contiguous, &
1274 intent(inout) :: acharstr1d
1275 integer(I4B),
intent(in) :: ilen
1276 integer(I4B),
intent(in) :: nrow
1277 character(len=*),
intent(in) :: name
1278 character(len=*),
intent(in) :: mem_path
1280 type(MemoryType),
pointer :: mt
1281 logical(LGP) :: found
1282 type(CharacterStringType),
dimension(:),
allocatable :: astrtemp
1283 character(len=ilen) :: string
1284 integer(I4B) :: istat
1285 integer(I4B) :: isize
1286 integer(I4B) :: isize_old
1287 integer(I4B) :: nrow_old
1294 call get_from_memorystore(name, mem_path, mt, found)
1298 isize_old = mt%isize
1299 if (isize_old > 0)
then
1300 nrow_old =
size(acharstr1d)
1309 allocate (astrtemp(nrow), stat=istat, errmsg=errmsg)
1310 if (istat /= 0)
then
1311 call allocate_error(name, mem_path, istat, isize)
1315 do n = 1, min(nrow_old, nrow)
1316 astrtemp(n) = acharstr1d(n)
1317 call acharstr1d(n)%destroy()
1321 do n = nrow + 1, nrow_old
1322 call acharstr1d(n)%destroy()
1326 do n = nrow_old + 1, nrow
1327 astrtemp(n) = string
1331 deallocate (acharstr1d)
1334 allocate (acharstr1d(nrow), stat=istat, errmsg=errmsg)
1335 if (istat /= 0)
then
1336 call allocate_error(name, mem_path, istat, isize)
1341 acharstr1d(n) = astrtemp(n)
1342 call astrtemp(n)%destroy()
1346 deallocate (astrtemp)
1349 mt%acharstr1d => acharstr1d
1350 mt%element_size = ilen
1352 mt%nrealloc = mt%nrealloc + 1
1354 nvalues_astr = nvalues_astr + isize - isize_old
1355 write (mt%memtype,
"(a,' LEN=',i0,' (',i0,')')")
'STRING', ilen, nrow
1357 errmsg =
"Programming error, variable '"//trim(name)//
"' from '"// &
1358 trim(mem_path)//
"' is not defined in the memory manager. Use "// &
1359 "mem_allocate instead."
1360 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 1498 of file MemoryManager.f90.
1499 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: adbl
1500 integer(I4B),
intent(in) :: nrow
1501 character(len=*),
intent(in) :: name
1502 character(len=*),
intent(in) :: mem_path
1504 type(MemoryType),
pointer :: mt
1505 integer(I4B) :: istat
1506 integer(I4B) :: isize
1508 integer(I4B) :: isizeold
1509 integer(I4B) :: ifill
1510 logical(LGP) :: found
1514 call get_from_memorystore(name, mem_path, mt, found)
1518 isizeold =
size(mt%adbl1d)
1519 ifill = min(isizeold, isize)
1520 allocate (adbl(nrow), stat=istat, errmsg=errmsg)
1521 if (istat /= 0)
then
1522 call allocate_error(name, mem_path, istat, isize)
1525 adbl(i) = mt%adbl1d(i)
1529 deallocate (mt%adbl1d)
1531 mt%element_size = dp
1533 mt%nrealloc = mt%nrealloc + 1
1535 nvalues_adbl = nvalues_adbl + isize - isizeold
1536 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 1541 of file MemoryManager.f90.
1542 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: adbl
1543 integer(I4B),
intent(in) :: ncol
1544 integer(I4B),
intent(in) :: nrow
1545 character(len=*),
intent(in) :: name
1546 character(len=*),
intent(in) :: mem_path
1548 type(MemoryType),
pointer :: mt
1549 logical(LGP) :: found
1550 integer(I4B) :: istat
1551 integer(I4B),
dimension(2) :: ishape
1554 integer(I4B) :: isize
1555 integer(I4B) :: isizeold
1559 call get_from_memorystore(name, mem_path, mt, found)
1562 ishape = shape(mt%adbl2d)
1564 isizeold = ishape(1) * ishape(2)
1565 allocate (adbl(ncol, nrow), stat=istat, errmsg=errmsg)
1566 if (istat /= 0)
then
1567 call allocate_error(name, mem_path, istat, isize)
1570 do i = 1, min(ishape(2), nrow)
1571 do j = 1, min(ishape(1), ncol)
1572 adbl(j, i) = mt%adbl2d(j, i)
1577 deallocate (mt%adbl2d)
1579 mt%element_size = dp
1581 mt%nrealloc = mt%nrealloc + 1
1583 nvalues_adbl = nvalues_adbl + isize - isizeold
1584 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 1408 of file MemoryManager.f90.
1409 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: aint
1410 integer(I4B),
intent(in) :: nrow
1411 character(len=*),
intent(in) :: name
1412 character(len=*),
intent(in) :: mem_path
1414 type(MemoryType),
pointer :: mt
1415 logical(LGP) :: found
1416 integer(I4B) :: istat
1417 integer(I4B) :: isize
1419 integer(I4B) :: isizeold
1420 integer(I4B) :: ifill
1424 call get_from_memorystore(name, mem_path, mt, found)
1428 isizeold =
size(mt%aint1d)
1429 ifill = min(isizeold, isize)
1430 allocate (aint(nrow), stat=istat, errmsg=errmsg)
1431 if (istat /= 0)
then
1432 call allocate_error(name, mem_path, istat, isize)
1435 aint(i) = mt%aint1d(i)
1439 deallocate (mt%aint1d)
1441 mt%element_size = i4b
1443 mt%nrealloc = mt%nrealloc + 1
1445 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 1450 of file MemoryManager.f90.
1451 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: aint
1452 integer(I4B),
intent(in) :: ncol
1453 integer(I4B),
intent(in) :: nrow
1454 character(len=*),
intent(in) :: name
1455 character(len=*),
intent(in) :: mem_path
1457 type(MemoryType),
pointer :: mt
1458 logical(LGP) :: found
1459 integer(I4B) :: istat
1460 integer(I4B),
dimension(2) :: ishape
1463 integer(I4B) :: isize
1464 integer(I4B) :: isizeold
1468 call get_from_memorystore(name, mem_path, mt, found)
1471 ishape = shape(mt%aint2d)
1473 isizeold = ishape(1) * ishape(2)
1474 allocate (aint(ncol, nrow), stat=istat, errmsg=errmsg)
1475 if (istat /= 0)
then
1476 call allocate_error(name, mem_path, istat, isize)
1479 do i = 1, min(ishape(2), nrow)
1480 do j = 1, min(ishape(1), ncol)
1481 aint(j, i) = mt%aint2d(j, i)
1486 deallocate (mt%aint2d)
1488 mt%element_size = i4b
1490 mt%nrealloc = mt%nrealloc + 1
1492 nvalues_aint = nvalues_aint + isize - isizeold
1493 write (mt%memtype,
"(a,' (',i0,',',i0,')')")
'INTEGER', ncol, nrow
◆ reallocate_logical1d()
| subroutine memorymanagermodule::mem_reallocate::reallocate_logical1d |
( |
logical(lgp), dimension(:), intent(inout), pointer, contiguous |
alog, |
|
|
integer(i4b), intent(in) |
nrow, |
|
|
character(len=*), intent(in) |
name, |
|
|
character(len=*), intent(in) |
mem_path |
|
) |
| |
|
private |
- Parameters
-
| [in,out] | alog | the reallocated logical array |
| [in] | nrow | number of rows |
| [in] | name | variable name |
| [in] | mem_path | path where variable is stored |
Definition at line 1366 of file MemoryManager.f90.
1367 logical(LGP),
dimension(:),
pointer,
contiguous,
intent(inout) :: alog
1368 integer(I4B),
intent(in) :: nrow
1369 character(len=*),
intent(in) :: name
1370 character(len=*),
intent(in) :: mem_path
1372 type(MemoryType),
pointer :: mt
1373 logical(LGP) :: found
1374 integer(I4B) :: istat
1375 integer(I4B) :: isize
1377 integer(I4B) :: isizeold
1378 integer(I4B) :: ifill
1382 call get_from_memorystore(name, mem_path, mt, found)
1386 isizeold =
size(mt%alogical1d)
1387 ifill = min(isizeold, isize)
1388 allocate (alog(nrow), stat=istat, errmsg=errmsg)
1389 if (istat /= 0)
then
1390 call allocate_error(name, mem_path, istat, isize)
1393 alog(i) = mt%alogical1d(i)
1397 deallocate (mt%alogical1d)
1398 mt%alogical1d => alog
1399 mt%element_size = lgp
1401 mt%nrealloc = mt%nrealloc + 1
1403 nvalues_alogical = nvalues_alogical + isize - isizeold
◆ 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 1190 of file MemoryManager.f90.
1191 integer(I4B),
intent(in) :: ilen
1192 integer(I4B),
intent(in) :: nrow
1193 character(len=ilen),
dimension(:),
pointer,
contiguous,
intent(inout) :: astr
1194 character(len=*),
intent(in) :: name
1195 character(len=*),
intent(in) :: mem_path
1197 type(MemoryType),
pointer :: mt
1198 logical(LGP) :: found
1199 character(len=ilen),
dimension(:),
allocatable :: astrtemp
1200 integer(I4B) :: istat
1201 integer(I4B) :: isize
1202 integer(I4B) :: isize_old
1203 integer(I4B) :: nrow_old
1207 call get_from_memorystore(name, mem_path, mt, found)
1211 isize_old = mt%isize
1212 if (isize_old > 0)
then
1213 nrow_old =
size(astr)
1222 allocate (astrtemp(nrow), stat=istat, errmsg=errmsg)
1223 if (istat /= 0)
then
1224 call allocate_error(name, mem_path, istat, isize)
1228 do n = 1, min(nrow_old, nrow)
1229 astrtemp(n) = astr(n)
1233 do n = nrow_old + 1, nrow
1241 allocate (astr(nrow), stat=istat, errmsg=errmsg)
1242 if (istat /= 0)
then
1243 call allocate_error(name, mem_path, istat, isize)
1248 astr(n) = astrtemp(n)
1252 deallocate (astrtemp)
1256 mt%element_size = ilen
1258 mt%nrealloc = mt%nrealloc + 1
1260 nvalues_astr = nvalues_astr + isize - isize_old
1261 write (mt%memtype,
"(a,' LEN=',i0,' (',i0,')')")
'STRING', ilen, nrow
1263 errmsg =
"Programming error, variable '"//trim(name)//
"' from '"// &
1264 trim(mem_path)//
"' is not defined in the memory manager. Use "// &
1265 "mem_allocate instead."
1266 call store_error(errmsg, terminate=.true.)
The documentation for this interface was generated from the following file: