|
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 78 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 1262 of file MemoryManager.f90.
1263 type(CharacterStringType),
dimension(:),
pointer,
contiguous, &
1264 intent(inout) :: acharstr1d
1265 integer(I4B),
intent(in) :: ilen
1266 integer(I4B),
intent(in) :: nrow
1267 character(len=*),
intent(in) :: name
1268 character(len=*),
intent(in) :: mem_path
1270 type(MemoryType),
pointer :: mt
1271 logical(LGP) :: found
1272 type(CharacterStringType),
dimension(:),
allocatable :: astrtemp
1273 character(len=ilen) :: string
1274 integer(I4B) :: istat
1275 integer(I4B) :: isize
1276 integer(I4B) :: isize_old
1277 integer(I4B) :: nrow_old
1284 call get_from_memorylist(name, mem_path, mt, found)
1288 isize_old = mt%isize
1289 if (isize_old > 0)
then
1290 nrow_old =
size(acharstr1d)
1299 allocate (astrtemp(nrow), stat=istat, errmsg=errmsg)
1300 if (istat /= 0)
then
1301 call allocate_error(name, mem_path, istat, isize)
1306 astrtemp(n) = acharstr1d(n)
1310 do n = nrow_old + 1, nrow
1311 astrtemp(n) = string
1315 deallocate (acharstr1d)
1318 allocate (acharstr1d(nrow), stat=istat, errmsg=errmsg)
1319 if (istat /= 0)
then
1320 call allocate_error(name, mem_path, istat, isize)
1325 acharstr1d(n) = astrtemp(n)
1329 deallocate (astrtemp)
1332 mt%acharstr1d => acharstr1d
1333 mt%element_size = ilen
1335 mt%nrealloc = mt%nrealloc + 1
1337 nvalues_astr = nvalues_astr + isize - isize_old
1338 write (mt%memtype,
"(a,' LEN=',i0,' (',i0,')')")
'STRING', ilen, nrow
1340 errmsg =
"Programming error, variable '"//trim(name)//
"' from '"// &
1341 trim(mem_path)//
"' is not defined in the memory manager. Use "// &
1342 "mem_allocate instead."
1343 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 1447 of file MemoryManager.f90.
1448 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: adbl
1449 integer(I4B),
intent(in) :: nrow
1450 character(len=*),
intent(in) :: name
1451 character(len=*),
intent(in) :: mem_path
1453 type(MemoryType),
pointer :: mt
1454 integer(I4B) :: istat
1455 integer(I4B) :: isize
1457 integer(I4B) :: isizeold
1458 integer(I4B) :: ifill
1459 logical(LGP) :: found
1463 call get_from_memorylist(name, mem_path, mt, found)
1467 isizeold =
size(mt%adbl1d)
1468 ifill = min(isizeold, isize)
1469 allocate (adbl(nrow), stat=istat, errmsg=errmsg)
1470 if (istat /= 0)
then
1471 call allocate_error(name, mem_path, istat, isize)
1474 adbl(i) = mt%adbl1d(i)
1478 deallocate (mt%adbl1d)
1480 mt%element_size = dp
1482 mt%nrealloc = mt%nrealloc + 1
1484 nvalues_adbl = nvalues_adbl + isize - isizeold
1485 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 1493 of file MemoryManager.f90.
1494 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: adbl
1495 integer(I4B),
intent(in) :: ncol
1496 integer(I4B),
intent(in) :: nrow
1497 character(len=*),
intent(in) :: name
1498 character(len=*),
intent(in) :: mem_path
1500 type(MemoryType),
pointer :: mt
1501 logical(LGP) :: found
1502 integer(I4B) :: istat
1503 integer(I4B),
dimension(2) :: ishape
1506 integer(I4B) :: isize
1507 integer(I4B) :: isizeold
1511 call get_from_memorylist(name, mem_path, mt, found)
1514 ishape = shape(mt%adbl2d)
1516 isizeold = ishape(1) * ishape(2)
1517 allocate (adbl(ncol, nrow), stat=istat, errmsg=errmsg)
1518 if (istat /= 0)
then
1519 call allocate_error(name, mem_path, istat, isize)
1523 adbl(j, i) = mt%adbl2d(j, i)
1528 deallocate (mt%adbl2d)
1530 mt%element_size = dp
1532 mt%nrealloc = mt%nrealloc + 1
1534 nvalues_adbl = nvalues_adbl + isize - isizeold
1535 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 1352 of file MemoryManager.f90.
1353 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: aint
1354 integer(I4B),
intent(in) :: nrow
1355 character(len=*),
intent(in) :: name
1356 character(len=*),
intent(in) :: mem_path
1358 type(MemoryType),
pointer :: mt
1359 logical(LGP) :: found
1360 integer(I4B) :: istat
1361 integer(I4B) :: isize
1363 integer(I4B) :: isizeold
1364 integer(I4B) :: ifill
1368 call get_from_memorylist(name, mem_path, mt, found)
1372 isizeold =
size(mt%aint1d)
1373 ifill = min(isizeold, isize)
1374 allocate (aint(nrow), stat=istat, errmsg=errmsg)
1375 if (istat /= 0)
then
1376 call allocate_error(name, mem_path, istat, isize)
1379 aint(i) = mt%aint1d(i)
1383 deallocate (mt%aint1d)
1385 mt%element_size = i4b
1387 mt%nrealloc = mt%nrealloc + 1
1389 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 1397 of file MemoryManager.f90.
1398 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: aint
1399 integer(I4B),
intent(in) :: ncol
1400 integer(I4B),
intent(in) :: nrow
1401 character(len=*),
intent(in) :: name
1402 character(len=*),
intent(in) :: mem_path
1404 type(MemoryType),
pointer :: mt
1405 logical(LGP) :: found
1406 integer(I4B) :: istat
1407 integer(I4B),
dimension(2) :: ishape
1410 integer(I4B) :: isize
1411 integer(I4B) :: isizeold
1415 call get_from_memorylist(name, mem_path, mt, found)
1418 ishape = shape(mt%aint2d)
1420 isizeold = ishape(1) * ishape(2)
1421 allocate (aint(ncol, nrow), stat=istat, errmsg=errmsg)
1422 if (istat /= 0)
then
1423 call allocate_error(name, mem_path, istat, isize)
1427 aint(j, i) = mt%aint2d(j, i)
1432 deallocate (mt%aint2d)
1434 mt%element_size = i4b
1436 mt%nrealloc = mt%nrealloc + 1
1438 nvalues_aint = nvalues_aint + isize - isizeold
1439 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 1178 of file MemoryManager.f90.
1179 integer(I4B),
intent(in) :: ilen
1180 integer(I4B),
intent(in) :: nrow
1181 character(len=ilen),
dimension(:),
pointer,
contiguous,
intent(inout) :: astr
1182 character(len=*),
intent(in) :: name
1183 character(len=*),
intent(in) :: mem_path
1185 type(MemoryType),
pointer :: mt
1186 logical(LGP) :: found
1187 character(len=ilen),
dimension(:),
allocatable :: astrtemp
1188 integer(I4B) :: istat
1189 integer(I4B) :: isize
1190 integer(I4B) :: isize_old
1191 integer(I4B) :: nrow_old
1195 call get_from_memorylist(name, mem_path, mt, found)
1199 isize_old = mt%isize
1200 if (isize_old > 0)
then
1201 nrow_old =
size(astr)
1210 allocate (astrtemp(nrow), stat=istat, errmsg=errmsg)
1211 if (istat /= 0)
then
1212 call allocate_error(name, mem_path, istat, isize)
1217 astrtemp(n) = astr(n)
1221 do n = nrow_old + 1, nrow
1229 allocate (astr(nrow), stat=istat, errmsg=errmsg)
1230 if (istat /= 0)
then
1231 call allocate_error(name, mem_path, istat, isize)
1236 astr(n) = astrtemp(n)
1240 deallocate (astrtemp)
1243 mt%element_size = ilen
1245 mt%nrealloc = mt%nrealloc + 1
1247 nvalues_astr = nvalues_astr + isize - isize_old
1248 write (mt%memtype,
"(a,' LEN=',i0,' (',i0,')')")
'STRING', ilen, nrow
1250 errmsg =
"Programming error, variable '"//trim(name)//
"' from '"// &
1251 trim(mem_path)//
"' is not defined in the memory manager. Use "// &
1252 "mem_allocate instead."
1253 call store_error(errmsg, terminate=.true.)
The documentation for this interface was generated from the following file: