|
| 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 1273 of file MemoryManager.f90.
1274 type(CharacterStringType),
dimension(:),
pointer,
contiguous, &
1275 intent(inout) :: acharstr1d
1276 integer(I4B),
intent(in) :: ilen
1277 integer(I4B),
intent(in) :: nrow
1278 character(len=*),
intent(in) :: name
1279 character(len=*),
intent(in) :: mem_path
1281 type(MemoryType),
pointer :: mt
1282 logical(LGP) :: found
1283 type(CharacterStringType),
dimension(:),
allocatable :: astrtemp
1284 character(len=ilen) :: string
1285 integer(I4B) :: istat
1286 integer(I4B) :: isize
1287 integer(I4B) :: isize_old
1288 integer(I4B) :: nrow_old
1295 call get_from_memorystore(name, mem_path, mt, found)
1299 isize_old = mt%isize
1300 if (isize_old > 0)
then
1301 nrow_old =
size(acharstr1d)
1310 allocate (astrtemp(nrow), stat=istat, errmsg=errmsg)
1311 if (istat /= 0)
then
1312 call allocate_error(name, mem_path, istat, isize)
1316 do n = 1, min(nrow_old, nrow)
1317 astrtemp(n) = acharstr1d(n)
1318 call acharstr1d(n)%destroy()
1322 do n = nrow + 1, nrow_old
1323 call acharstr1d(n)%destroy()
1327 do n = nrow_old + 1, nrow
1328 astrtemp(n) = string
1332 deallocate (acharstr1d)
1335 allocate (acharstr1d(nrow), stat=istat, errmsg=errmsg)
1336 if (istat /= 0)
then
1337 call allocate_error(name, mem_path, istat, isize)
1342 acharstr1d(n) = astrtemp(n)
1343 call astrtemp(n)%destroy()
1347 deallocate (astrtemp)
1350 mt%acharstr1d => acharstr1d
1351 mt%element_size = ilen
1353 mt%nrealloc = mt%nrealloc + 1
1355 nvalues_astr = nvalues_astr + isize - isize_old
1356 write (mt%memtype,
"(a,' LEN=',i0,' (',i0,')')")
'STRING', ilen, nrow
1358 errmsg =
"Programming error, variable '"//trim(name)//
"' from '"// &
1359 trim(mem_path)//
"' is not defined in the memory manager. Use "// &
1360 "mem_allocate instead."
1361 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 1499 of file MemoryManager.f90.
1500 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: adbl
1501 integer(I4B),
intent(in) :: nrow
1502 character(len=*),
intent(in) :: name
1503 character(len=*),
intent(in) :: mem_path
1505 type(MemoryType),
pointer :: mt
1506 integer(I4B) :: istat
1507 integer(I4B) :: isize
1509 integer(I4B) :: isizeold
1510 integer(I4B) :: ifill
1511 logical(LGP) :: found
1515 call get_from_memorystore(name, mem_path, mt, found)
1519 isizeold =
size(mt%adbl1d)
1520 ifill = min(isizeold, isize)
1521 allocate (adbl(nrow), stat=istat, errmsg=errmsg)
1522 if (istat /= 0)
then
1523 call allocate_error(name, mem_path, istat, isize)
1526 adbl(i) = mt%adbl1d(i)
1530 deallocate (mt%adbl1d)
1532 mt%element_size = dp
1534 mt%nrealloc = mt%nrealloc + 1
1536 nvalues_adbl = nvalues_adbl + isize - isizeold
1537 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 1542 of file MemoryManager.f90.
1543 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: adbl
1544 integer(I4B),
intent(in) :: ncol
1545 integer(I4B),
intent(in) :: nrow
1546 character(len=*),
intent(in) :: name
1547 character(len=*),
intent(in) :: mem_path
1549 type(MemoryType),
pointer :: mt
1550 logical(LGP) :: found
1551 integer(I4B) :: istat
1552 integer(I4B),
dimension(2) :: ishape
1555 integer(I4B) :: isize
1556 integer(I4B) :: isizeold
1560 call get_from_memorystore(name, mem_path, mt, found)
1563 ishape = shape(mt%adbl2d)
1565 isizeold = ishape(1) * ishape(2)
1566 allocate (adbl(ncol, nrow), stat=istat, errmsg=errmsg)
1567 if (istat /= 0)
then
1568 call allocate_error(name, mem_path, istat, isize)
1571 do i = 1, min(ishape(2), nrow)
1572 do j = 1, min(ishape(1), ncol)
1573 adbl(j, i) = mt%adbl2d(j, i)
1578 deallocate (mt%adbl2d)
1580 mt%element_size = dp
1582 mt%nrealloc = mt%nrealloc + 1
1584 nvalues_adbl = nvalues_adbl + isize - isizeold
1585 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 1409 of file MemoryManager.f90.
1410 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: aint
1411 integer(I4B),
intent(in) :: nrow
1412 character(len=*),
intent(in) :: name
1413 character(len=*),
intent(in) :: mem_path
1415 type(MemoryType),
pointer :: mt
1416 logical(LGP) :: found
1417 integer(I4B) :: istat
1418 integer(I4B) :: isize
1420 integer(I4B) :: isizeold
1421 integer(I4B) :: ifill
1425 call get_from_memorystore(name, mem_path, mt, found)
1429 isizeold =
size(mt%aint1d)
1430 ifill = min(isizeold, isize)
1431 allocate (aint(nrow), stat=istat, errmsg=errmsg)
1432 if (istat /= 0)
then
1433 call allocate_error(name, mem_path, istat, isize)
1436 aint(i) = mt%aint1d(i)
1440 deallocate (mt%aint1d)
1442 mt%element_size = i4b
1444 mt%nrealloc = mt%nrealloc + 1
1446 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 1451 of file MemoryManager.f90.
1452 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: aint
1453 integer(I4B),
intent(in) :: ncol
1454 integer(I4B),
intent(in) :: nrow
1455 character(len=*),
intent(in) :: name
1456 character(len=*),
intent(in) :: mem_path
1458 type(MemoryType),
pointer :: mt
1459 logical(LGP) :: found
1460 integer(I4B) :: istat
1461 integer(I4B),
dimension(2) :: ishape
1464 integer(I4B) :: isize
1465 integer(I4B) :: isizeold
1469 call get_from_memorystore(name, mem_path, mt, found)
1472 ishape = shape(mt%aint2d)
1474 isizeold = ishape(1) * ishape(2)
1475 allocate (aint(ncol, nrow), stat=istat, errmsg=errmsg)
1476 if (istat /= 0)
then
1477 call allocate_error(name, mem_path, istat, isize)
1480 do i = 1, min(ishape(2), nrow)
1481 do j = 1, min(ishape(1), ncol)
1482 aint(j, i) = mt%aint2d(j, i)
1487 deallocate (mt%aint2d)
1489 mt%element_size = i4b
1491 mt%nrealloc = mt%nrealloc + 1
1493 nvalues_aint = nvalues_aint + isize - isizeold
1494 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 1367 of file MemoryManager.f90.
1368 logical(LGP),
dimension(:),
pointer,
contiguous,
intent(inout) :: alog
1369 integer(I4B),
intent(in) :: nrow
1370 character(len=*),
intent(in) :: name
1371 character(len=*),
intent(in) :: mem_path
1373 type(MemoryType),
pointer :: mt
1374 logical(LGP) :: found
1375 integer(I4B) :: istat
1376 integer(I4B) :: isize
1378 integer(I4B) :: isizeold
1379 integer(I4B) :: ifill
1383 call get_from_memorystore(name, mem_path, mt, found)
1387 isizeold =
size(mt%alogical1d)
1388 ifill = min(isizeold, isize)
1389 allocate (alog(nrow), stat=istat, errmsg=errmsg)
1390 if (istat /= 0)
then
1391 call allocate_error(name, mem_path, istat, isize)
1394 alog(i) = mt%alogical1d(i)
1398 deallocate (mt%alogical1d)
1399 mt%alogical1d => alog
1400 mt%element_size = lgp
1402 mt%nrealloc = mt%nrealloc + 1
1404 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 1191 of file MemoryManager.f90.
1192 integer(I4B),
intent(in) :: ilen
1193 integer(I4B),
intent(in) :: nrow
1194 character(len=ilen),
dimension(:),
pointer,
contiguous,
intent(inout) :: astr
1195 character(len=*),
intent(in) :: name
1196 character(len=*),
intent(in) :: mem_path
1198 type(MemoryType),
pointer :: mt
1199 logical(LGP) :: found
1200 character(len=ilen),
dimension(:),
allocatable :: astrtemp
1201 integer(I4B) :: istat
1202 integer(I4B) :: isize
1203 integer(I4B) :: isize_old
1204 integer(I4B) :: nrow_old
1208 call get_from_memorystore(name, mem_path, mt, found)
1212 isize_old = mt%isize
1213 if (isize_old > 0)
then
1214 nrow_old =
size(astr)
1223 allocate (astrtemp(nrow), stat=istat, errmsg=errmsg)
1224 if (istat /= 0)
then
1225 call allocate_error(name, mem_path, istat, isize)
1229 do n = 1, min(nrow_old, nrow)
1230 astrtemp(n) = astr(n)
1234 do n = nrow_old + 1, nrow
1242 allocate (astr(nrow), stat=istat, errmsg=errmsg)
1243 if (istat /= 0)
then
1244 call allocate_error(name, mem_path, istat, isize)
1249 astr(n) = astrtemp(n)
1253 deallocate (astrtemp)
1257 mt%element_size = ilen
1259 mt%nrealloc = mt%nrealloc + 1
1261 nvalues_astr = nvalues_astr + isize - isize_old
1262 write (mt%memtype,
"(a,' LEN=',i0,' (',i0,')')")
'STRING', ilen, nrow
1264 errmsg =
"Programming error, variable '"//trim(name)//
"' from '"// &
1265 trim(mem_path)//
"' is not defined in the memory manager. Use "// &
1266 "mem_allocate instead."
1267 call store_error(errmsg, terminate=.true.)
The documentation for this interface was generated from the following file: