154 character(len=*),
intent(in) :: name
155 character(len=*),
intent(in) :: mem_path
156 character(len=LENMEMTYPE),
intent(out) :: var_type
159 logical(LGP) :: found
165 var_type = mt%memtype
174 character(len=*),
intent(in) :: name
175 character(len=*),
intent(in) :: mem_path
176 integer(I4B),
intent(out) :: rank
179 logical(LGP) :: found
191 if (
associated(mt%logicalsclr)) rank = 0
192 if (
associated(mt%intsclr)) rank = 0
193 if (
associated(mt%dblsclr)) rank = 0
194 if (
associated(mt%alogical1d)) rank = 1
195 if (
associated(mt%aint1d)) rank = 1
196 if (
associated(mt%aint2d)) rank = 2
197 if (
associated(mt%aint3d)) rank = 3
198 if (
associated(mt%adbl1d)) rank = 1
199 if (
associated(mt%adbl2d)) rank = 2
200 if (
associated(mt%adbl3d)) rank = 3
201 if (
associated(mt%strsclr)) rank = 0
202 if (
associated(mt%astr1d)) rank = 1
203 if (
associated(mt%acharstr1d)) rank = 1
212 character(len=*),
intent(in) :: name
213 character(len=*),
intent(in) :: mem_path
214 integer(I4B),
intent(out) :: size
217 logical(LGP) :: found
228 size = mt%element_size
238 character(len=*),
intent(in) :: name
239 character(len=*),
intent(in) :: mem_path
240 integer(I4B),
dimension(:),
intent(out) :: mem_shape
243 logical(LGP) :: found
251 if (
associated(mt%logicalsclr)) mem_shape = shape(mt%logicalsclr)
252 if (
associated(mt%intsclr)) mem_shape = shape(mt%logicalsclr)
253 if (
associated(mt%dblsclr)) mem_shape = shape(mt%dblsclr)
254 if (
associated(mt%alogical1d)) mem_shape = shape(mt%alogical1d)
255 if (
associated(mt%aint1d)) mem_shape = shape(mt%aint1d)
256 if (
associated(mt%aint2d)) mem_shape = shape(mt%aint2d)
257 if (
associated(mt%aint3d)) mem_shape = shape(mt%aint3d)
258 if (
associated(mt%adbl1d)) mem_shape = shape(mt%adbl1d)
259 if (
associated(mt%adbl2d)) mem_shape = shape(mt%adbl2d)
260 if (
associated(mt%adbl3d)) mem_shape = shape(mt%adbl3d)
261 if (
associated(mt%strsclr)) mem_shape = shape(mt%strsclr)
262 if (
associated(mt%astr1d)) mem_shape = shape(mt%astr1d)
263 if (
associated(mt%acharstr1d)) mem_shape = shape(mt%acharstr1d)
277 character(len=*),
intent(in) :: name
278 character(len=*),
intent(in) :: mem_path
279 integer(I4B),
intent(out) :: isize
282 logical(LGP) :: found
283 logical(LGP) :: terminate
308 character(len=*),
intent(in) :: name
309 character(len=*),
intent(in) :: mem_path
310 type(
memorytype),
pointer,
intent(inout) :: mt
311 logical(LGP),
intent(out) :: found
312 logical(LGP),
intent(in),
optional :: check
315 logical(LGP) check_opt
318 found =
associated(mt)
321 if (
present(check))
then
325 if (.not. found)
then
326 errmsg =
"Programming error in memory manager. Variable '"// &
327 trim(name)//
"' in '"//trim(mem_path)//
"' cannot be "// &
328 "assigned because it does not exist in memory manager."
337 character(len=*),
intent(in) :: varname
338 character(len=*),
intent(in) :: mem_path
339 integer(I4B),
intent(in) :: istat
340 integer(I4B),
intent(in) :: isize
342 character(len=20) :: csize
343 character(len=20) :: cstat
347 write (csize,
'(i0)') isize
348 write (cstat,
'(i0)') istat
351 errmsg =
"Error trying to allocate memory. Path '"//trim(mem_path)// &
352 "' variable name '"//trim(varname)//
"' size '"//trim(csize)// &
353 "'. Error message is '"//trim(adjustl(
errmsg))// &
354 "'. Status code is "//trim(cstat)//
'.'
363 logical(LGP),
pointer,
intent(inout) :: sclr
364 character(len=*),
intent(in) :: name
365 character(len=*),
intent(in) :: mem_path
367 integer(I4B) :: istat
387 mt%logicalsclr => sclr
388 mt%element_size = lgp
392 write (mt%memtype,
"(a)")
'LOGICAL'
401 logical(LGP),
dimension(:),
pointer,
contiguous,
intent(inout) :: alog
402 integer(I4B),
intent(in) :: nrow
403 character(len=*),
intent(in) :: name
404 character(len=*),
intent(in) :: mem_path
407 integer(I4B) :: istat
408 integer(I4B) :: isize
430 mt%alogical1d => alog
431 mt%element_size = lgp
435 write (mt%memtype,
"(a,' (',i0,')')")
'LOGICAL', isize
444 integer(I4B),
intent(in) :: ilen
445 character(len=ilen),
pointer,
intent(inout) :: sclr
446 character(len=*),
intent(in) :: name
447 character(len=*),
intent(in) :: mem_path
449 integer(I4B) :: istat
456 errmsg =
'Programming error in allocate_str. ILEN must be greater than 0.'
464 allocate (
character(len=ilen) :: sclr, stat=istat,
errmsg=
errmsg)
480 mt%element_size = ilen
484 write (mt%memtype,
"(a,' LEN=',i0)")
'STRING', ilen
493 integer(I4B),
intent(in) :: ilen
494 character(len=ilen),
dimension(:), &
495 pointer,
contiguous,
intent(inout) :: astr1d
496 integer(I4B),
intent(in) :: nrow
497 character(len=*),
intent(in) :: name
498 character(len=*),
intent(in) :: mem_path
501 character(len=ilen) :: string
503 integer(I4B) :: istat
504 integer(I4B) :: isize
512 errmsg =
'Programming error in allocate_str1d. '// &
513 'ILEN must be greater than 0.'
524 allocate (
character(len=ilen) :: astr1d(nrow), stat=istat,
errmsg=
errmsg)
544 mt%element_size = ilen
548 write (mt%memtype,
"(a,' LEN=',i0,' (',i0,')')")
'STRING', ilen, nrow
558 pointer,
contiguous,
intent(inout) :: acharstr1d
559 integer(I4B),
intent(in) :: ilen
560 integer(I4B),
intent(in) :: nrow
561 character(len=*),
intent(in) :: name
562 character(len=*),
intent(in) :: mem_path
564 character(len=ilen) :: string
567 integer(I4B) :: istat
568 integer(I4B) :: isize
590 acharstr1d(n) = string
600 mt%acharstr1d => acharstr1d
601 mt%element_size = ilen
605 write (mt%memtype,
"(a,' LEN=',i0,' (',i0,')')")
'STRING', ilen, nrow
614 integer(I4B),
pointer,
intent(inout) :: sclr
615 character(len=*),
intent(in) :: name
616 character(len=*),
intent(in) :: mem_path
619 integer(I4B) :: istat
639 mt%element_size = i4b
643 write (mt%memtype,
"(a)")
'INTEGER'
652 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: aint
653 integer(I4B),
intent(in) :: nrow
654 character(len=*),
intent(in) :: name
655 character(len=*),
intent(in) :: mem_path
658 integer(I4B) :: istat
659 integer(I4B) :: isize
682 mt%element_size = i4b
686 write (mt%memtype,
"(a,' (',i0,')')")
'INTEGER', isize
695 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: aint
696 integer(I4B),
intent(in) :: ncol
697 integer(I4B),
intent(in) :: nrow
698 character(len=*),
intent(in) :: name
699 character(len=*),
intent(in) :: mem_path
702 integer(I4B) :: istat
703 integer(I4B) :: isize
726 mt%element_size = i4b
730 write (mt%memtype,
"(a,' (',i0,',',i0,')')")
'INTEGER', ncol, nrow
739 integer(I4B),
dimension(:, :, :),
pointer,
contiguous,
intent(inout) :: aint
740 integer(I4B),
intent(in) :: ncol
741 integer(I4B),
intent(in) :: nrow
742 integer(I4B),
intent(in) :: nlay
743 character(len=*),
intent(in) :: name
744 character(len=*),
intent(in) :: mem_path
747 integer(I4B) :: istat
748 integer(I4B) :: isize
755 isize = ncol * nrow * nlay
758 allocate (aint(ncol, nrow, nlay), stat=istat,
errmsg=
errmsg)
771 mt%element_size = i4b
775 write (mt%memtype,
"(a,' (',i0,',',i0,',',i0,')')")
'INTEGER', ncol, &
785 real(DP),
pointer,
intent(inout) :: sclr
786 character(len=*),
intent(in) :: name
787 character(len=*),
intent(in) :: mem_path
790 integer(I4B) :: istat
814 write (mt%memtype,
"(a)")
'DOUBLE'
823 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: adbl
824 integer(I4B),
intent(in) :: nrow
825 character(len=*),
intent(in) :: name
826 character(len=*),
intent(in) :: mem_path
829 integer(I4B) :: istat
830 integer(I4B) :: isize
857 write (mt%memtype,
"(a,' (',i0,')')")
'DOUBLE', isize
866 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: adbl
867 integer(I4B),
intent(in) :: ncol
868 integer(I4B),
intent(in) :: nrow
869 character(len=*),
intent(in) :: name
870 character(len=*),
intent(in) :: mem_path
873 integer(I4B) :: istat
874 integer(I4B) :: isize
901 write (mt%memtype,
"(a,' (',i0,',',i0,')')")
'DOUBLE', ncol, nrow
910 real(DP),
dimension(:, :, :),
pointer,
contiguous,
intent(inout) :: adbl
911 integer(I4B),
intent(in) :: ncol
912 integer(I4B),
intent(in) :: nrow
913 integer(I4B),
intent(in) :: nlay
914 character(len=*),
intent(in) :: name
915 character(len=*),
intent(in) :: mem_path
918 integer(I4B) :: istat
919 integer(I4B) :: isize
926 isize = ncol * nrow * nlay
929 allocate (adbl(ncol, nrow, nlay), stat=istat,
errmsg=
errmsg)
946 write (mt%memtype,
"(a,' (',i0,',',i0,',',i0,')')")
'DOUBLE', ncol, &
956 logical(LGP),
dimension(:),
pointer,
contiguous,
intent(in) :: alog
957 character(len=*),
intent(in) :: name
958 character(len=*),
intent(in) :: mem_path
959 character(len=*),
intent(in) :: name2
960 character(len=*),
intent(in) :: mem_path2
963 integer(I4B) :: isize
976 mt%alogical1d => alog
977 mt%element_size = lgp
981 write (mt%memtype,
"(a,' (',i0,')')")
'LOGICAL', isize
985 mt%mastername = name2
986 mt%masterPath = mem_path2
995 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: aint
996 character(len=*),
intent(in) :: name
997 character(len=*),
intent(in) :: mem_path
998 character(len=*),
intent(in) :: name2
999 character(len=*),
intent(in) :: mem_path2
1002 integer(I4B) :: isize
1016 mt%element_size = i4b
1020 write (mt%memtype,
"(a,' (',i0,')')")
'INTEGER', isize
1024 mt%mastername = name2
1025 mt%masterPath = mem_path2
1034 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: aint2d
1035 character(len=*),
intent(in) :: name
1036 character(len=*),
intent(in) :: mem_path
1037 character(len=*),
intent(in) :: name2
1038 character(len=*),
intent(in) :: mem_path2
1041 integer(I4B) :: ncol, nrow, isize
1048 ncol =
size(aint2d, dim=1)
1049 nrow =
size(aint2d, dim=2)
1060 write (mt%memtype,
"(a,' (',i0,',',i0,')')")
'INTEGER', ncol, nrow
1064 mt%mastername = name2
1065 mt%masterPath = mem_path2
1074 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: adbl
1075 character(len=*),
intent(in) :: name
1076 character(len=*),
intent(in) :: mem_path
1077 character(len=*),
intent(in) :: name2
1078 character(len=*),
intent(in) :: mem_path2
1081 integer(I4B) :: isize
1095 mt%element_size = dp
1099 write (mt%memtype,
"(a,' (',i0,')')")
'DOUBLE', isize
1103 mt%mastername = name2
1104 mt%masterPath = mem_path2
1113 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: adbl2d
1114 character(len=*),
intent(in) :: name
1115 character(len=*),
intent(in) :: mem_path
1116 character(len=*),
intent(in) :: name2
1117 character(len=*),
intent(in) :: mem_path2
1120 integer(I4B) :: ncol, nrow, isize
1127 ncol =
size(adbl2d, dim=1)
1128 nrow =
size(adbl2d, dim=2)
1139 write (mt%memtype,
"(a,' (',i0,',',i0,')')")
'DOUBLE', ncol, nrow
1143 mt%mastername = name2
1144 mt%masterPath = mem_path2
1154 pointer,
contiguous,
intent(inout) :: acharstr1d
1155 integer(I4B),
intent(in) :: ilen
1156 character(len=*),
intent(in) :: name
1157 character(len=*),
intent(in) :: mem_path
1158 character(len=*),
intent(in) :: name2
1159 character(len=*),
intent(in) :: mem_path2
1162 integer(I4B) :: isize
1169 isize =
size(acharstr1d)
1175 mt%acharstr1d => acharstr1d
1176 mt%element_size = ilen
1180 write (mt%memtype,
"(a,' LEN=',i0,' (',i0,')')")
'STRING', ilen, isize
1184 mt%mastername = name2
1185 mt%masterPath = mem_path2
1194 integer(I4B),
intent(in) :: ilen
1195 integer(I4B),
intent(in) :: nrow
1196 character(len=ilen),
dimension(:),
pointer,
contiguous,
intent(inout) :: astr
1197 character(len=*),
intent(in) :: name
1198 character(len=*),
intent(in) :: mem_path
1201 logical(LGP) :: found
1202 character(len=ilen),
dimension(:),
allocatable :: astrtemp
1203 integer(I4B) :: istat
1204 integer(I4B) :: isize
1205 integer(I4B) :: isize_old
1206 integer(I4B) :: nrow_old
1214 isize_old = mt%isize
1215 if (isize_old > 0)
then
1216 nrow_old =
size(astr)
1226 if (istat /= 0)
then
1231 do n = 1, min(nrow_old, nrow)
1232 astrtemp(n) = astr(n)
1236 do n = nrow_old + 1, nrow
1245 if (istat /= 0)
then
1251 astr(n) = astrtemp(n)
1255 deallocate (astrtemp)
1259 mt%element_size = ilen
1261 mt%nrealloc = mt%nrealloc + 1
1264 write (mt%memtype,
"(a,' LEN=',i0,' (',i0,')')")
'STRING', ilen, nrow
1266 errmsg =
"Programming error, variable '"//trim(name)//
"' from '"// &
1267 trim(mem_path)//
"' is not defined in the memory manager. Use "// &
1268 "mem_allocate instead."
1277 intent(inout) :: acharstr1d
1278 integer(I4B),
intent(in) :: ilen
1279 integer(I4B),
intent(in) :: nrow
1280 character(len=*),
intent(in) :: name
1281 character(len=*),
intent(in) :: mem_path
1284 logical(LGP) :: found
1286 character(len=ilen) :: string
1287 integer(I4B) :: istat
1288 integer(I4B) :: isize
1289 integer(I4B) :: isize_old
1290 integer(I4B) :: nrow_old
1301 isize_old = mt%isize
1302 if (isize_old > 0)
then
1303 nrow_old =
size(acharstr1d)
1313 if (istat /= 0)
then
1318 do n = 1, min(nrow_old, nrow)
1319 astrtemp(n) = acharstr1d(n)
1320 call acharstr1d(n)%destroy()
1324 do n = nrow + 1, nrow_old
1325 call acharstr1d(n)%destroy()
1329 do n = nrow_old + 1, nrow
1330 astrtemp(n) = string
1334 deallocate (acharstr1d)
1338 if (istat /= 0)
then
1344 acharstr1d(n) = astrtemp(n)
1345 call astrtemp(n)%destroy()
1349 deallocate (astrtemp)
1352 mt%acharstr1d => acharstr1d
1353 mt%element_size = ilen
1355 mt%nrealloc = mt%nrealloc + 1
1358 write (mt%memtype,
"(a,' LEN=',i0,' (',i0,')')")
'STRING', ilen, nrow
1360 errmsg =
"Programming error, variable '"//trim(name)//
"' from '"// &
1361 trim(mem_path)//
"' is not defined in the memory manager. Use "// &
1362 "mem_allocate instead."
1370 logical(LGP),
dimension(:),
pointer,
contiguous,
intent(inout) :: alog
1371 integer(I4B),
intent(in) :: nrow
1372 character(len=*),
intent(in) :: name
1373 character(len=*),
intent(in) :: mem_path
1376 logical(LGP) :: found
1377 integer(I4B) :: istat
1378 integer(I4B) :: isize
1380 integer(I4B) :: isizeold
1381 integer(I4B) :: ifill
1389 isizeold =
size(mt%alogical1d)
1390 ifill = min(isizeold, isize)
1392 if (istat /= 0)
then
1396 alog(i) = mt%alogical1d(i)
1400 deallocate (mt%alogical1d)
1401 mt%alogical1d => alog
1402 mt%element_size = lgp
1404 mt%nrealloc = mt%nrealloc + 1
1412 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: aint
1413 integer(I4B),
intent(in) :: nrow
1414 character(len=*),
intent(in) :: name
1415 character(len=*),
intent(in) :: mem_path
1418 logical(LGP) :: found
1419 integer(I4B) :: istat
1420 integer(I4B) :: isize
1422 integer(I4B) :: isizeold
1423 integer(I4B) :: ifill
1431 isizeold =
size(mt%aint1d)
1432 ifill = min(isizeold, isize)
1434 if (istat /= 0)
then
1438 aint(i) = mt%aint1d(i)
1442 deallocate (mt%aint1d)
1444 mt%element_size = i4b
1446 mt%nrealloc = mt%nrealloc + 1
1454 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: aint
1455 integer(I4B),
intent(in) :: ncol
1456 integer(I4B),
intent(in) :: nrow
1457 character(len=*),
intent(in) :: name
1458 character(len=*),
intent(in) :: mem_path
1461 logical(LGP) :: found
1462 integer(I4B) :: istat
1463 integer(I4B),
dimension(2) :: ishape
1466 integer(I4B) :: isize
1467 integer(I4B) :: isizeold
1474 ishape = shape(mt%aint2d)
1476 isizeold = ishape(1) * ishape(2)
1478 if (istat /= 0)
then
1482 do i = 1, min(ishape(2), nrow)
1483 do j = 1, min(ishape(1), ncol)
1484 aint(j, i) = mt%aint2d(j, i)
1489 deallocate (mt%aint2d)
1491 mt%element_size = i4b
1493 mt%nrealloc = mt%nrealloc + 1
1496 write (mt%memtype,
"(a,' (',i0,',',i0,')')")
'INTEGER', ncol, nrow
1502 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: adbl
1503 integer(I4B),
intent(in) :: nrow
1504 character(len=*),
intent(in) :: name
1505 character(len=*),
intent(in) :: mem_path
1508 integer(I4B) :: istat
1509 integer(I4B) :: isize
1511 integer(I4B) :: isizeold
1512 integer(I4B) :: ifill
1513 logical(LGP) :: found
1521 isizeold =
size(mt%adbl1d)
1522 ifill = min(isizeold, isize)
1524 if (istat /= 0)
then
1528 adbl(i) = mt%adbl1d(i)
1532 deallocate (mt%adbl1d)
1534 mt%element_size = dp
1536 mt%nrealloc = mt%nrealloc + 1
1539 write (mt%memtype,
"(a,' (',i0,')')")
'DOUBLE', isize
1545 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: adbl
1546 integer(I4B),
intent(in) :: ncol
1547 integer(I4B),
intent(in) :: nrow
1548 character(len=*),
intent(in) :: name
1549 character(len=*),
intent(in) :: mem_path
1552 logical(LGP) :: found
1553 integer(I4B) :: istat
1554 integer(I4B),
dimension(2) :: ishape
1557 integer(I4B) :: isize
1558 integer(I4B) :: isizeold
1565 ishape = shape(mt%adbl2d)
1567 isizeold = ishape(1) * ishape(2)
1569 if (istat /= 0)
then
1573 do i = 1, min(ishape(2), nrow)
1574 do j = 1, min(ishape(1), ncol)
1575 adbl(j, i) = mt%adbl2d(j, i)
1580 deallocate (mt%adbl2d)
1582 mt%element_size = dp
1584 mt%nrealloc = mt%nrealloc + 1
1587 write (mt%memtype,
"(a,' (',i0,',',i0,')')")
'DOUBLE', ncol, nrow
1593 logical(LGP),
pointer,
intent(inout) :: sclr
1594 character(len=*),
intent(in) :: name
1595 character(len=*),
intent(in) :: mem_path
1598 logical(LGP) :: found
1601 sclr => mt%logicalsclr
1607 integer(I4B),
pointer,
intent(inout) :: sclr
1608 character(len=*),
intent(in) :: name
1609 character(len=*),
intent(in) :: mem_path
1612 logical(LGP) :: found
1621 logical(LGP),
dimension(:),
pointer,
contiguous,
intent(inout) :: alog
1622 character(len=*),
intent(in) :: name
1623 character(len=*),
intent(in) :: mem_path
1626 logical(LGP) :: found
1629 alog => mt%alogical1d
1635 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: aint
1636 character(len=*),
intent(in) :: name
1637 character(len=*),
intent(in) :: mem_path
1640 logical(LGP) :: found
1649 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: aint
1650 character(len=*),
intent(in) :: name
1651 character(len=*),
intent(in) :: mem_path
1654 logical(LGP) :: found
1663 integer(I4B),
dimension(:, :, :),
pointer,
contiguous,
intent(inout) :: aint
1664 character(len=*),
intent(in) :: name
1665 character(len=*),
intent(in) :: mem_path
1668 logical(LGP) :: found
1677 real(DP),
pointer,
intent(inout) :: sclr
1678 character(len=*),
intent(in) :: name
1679 character(len=*),
intent(in) :: mem_path
1682 logical(LGP) :: found
1691 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: adbl
1692 character(len=*),
intent(in) :: name
1693 character(len=*),
intent(in) :: mem_path
1696 logical(LGP) :: found
1705 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: adbl
1706 character(len=*),
intent(in) :: name
1707 character(len=*),
intent(in) :: mem_path
1710 logical(LGP) :: found
1719 real(DP),
dimension(:, :, :),
pointer,
contiguous,
intent(inout) :: adbl
1720 character(len=*),
intent(in) :: name
1721 character(len=*),
intent(in) :: mem_path
1724 logical(LGP) :: found
1733 character(len=:),
pointer :: asrt
1734 character(len=*),
intent(in) :: name
1735 character(len=*),
intent(in) :: mem_path
1738 logical(LGP) :: found
1747 character(len=:),
dimension(:), &
1748 pointer,
contiguous,
intent(inout) :: astr1d
1749 character(len=*),
intent(in) :: name
1750 character(len=*),
intent(in) :: mem_path
1753 logical(LGP) :: found
1756 select type (item => mt%astr1d)
1757 type is (
character(*))
1768 intent(inout) :: acharstr1d
1769 character(len=*),
intent(in) :: name
1770 character(len=*),
intent(in) :: mem_path
1773 logical(LGP) :: found
1776 acharstr1d => mt%acharstr1d
1782 logical(LGP),
dimension(:),
pointer,
contiguous,
intent(inout) :: alog
1783 character(len=*),
intent(in) :: name
1784 character(len=*),
intent(in) :: mem_path
1785 character(len=*),
intent(in),
optional :: mem_path_copy
1790 logical(LGP) :: found
1796 if (
present(mem_path_copy))
then
1800 allocate (alog(
size(mt%alogical1d)))
1802 do n = 1,
size(mt%alogical1d)
1803 alog(n) = mt%alogical1d(n)
1810 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: aint
1811 character(len=*),
intent(in) :: name
1812 character(len=*),
intent(in) :: mem_path
1813 character(len=*),
intent(in),
optional :: mem_path_copy
1818 logical(LGP) :: found
1824 if (
present(mem_path_copy))
then
1825 call allocate_int1d(aint,
size(mt%aint1d), mt%name, mem_path_copy)
1828 allocate (aint(
size(mt%aint1d)))
1830 do n = 1,
size(mt%aint1d)
1831 aint(n) = mt%aint1d(n)
1838 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: aint
1839 character(len=*),
intent(in) :: name
1840 character(len=*),
intent(in) :: mem_path
1841 character(len=*),
intent(in),
optional :: mem_path_copy
1846 logical(LGP) :: found
1849 integer(I4B) :: ncol
1850 integer(I4B) :: nrow
1854 ncol =
size(mt%aint2d, dim=1)
1855 nrow =
size(mt%aint2d, dim=2)
1857 if (
present(mem_path_copy))
then
1861 allocate (aint(ncol, nrow))
1865 aint(j, i) = mt%aint2d(j, i)
1873 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: adbl
1874 character(len=*),
intent(in) :: name
1875 character(len=*),
intent(in) :: mem_path
1876 character(len=*),
intent(in),
optional :: mem_path_copy
1881 logical(LGP) :: found
1887 if (
present(mem_path_copy))
then
1888 call allocate_dbl1d(adbl,
size(mt%adbl1d), mt%name, mem_path_copy)
1891 allocate (adbl(
size(mt%adbl1d)))
1893 do n = 1,
size(mt%adbl1d)
1894 adbl(n) = mt%adbl1d(n)
1901 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: adbl
1902 character(len=*),
intent(in) :: name
1903 character(len=*),
intent(in) :: mem_path
1904 character(len=*),
intent(in),
optional :: mem_path_copy
1909 logical(LGP) :: found
1912 integer(I4B) :: ncol
1913 integer(I4B) :: nrow
1917 ncol =
size(mt%adbl2d, dim=1)
1918 nrow =
size(mt%adbl2d, dim=2)
1920 if (
present(mem_path_copy))
then
1924 allocate (adbl(ncol, nrow))
1928 adbl(j, i) = mt%adbl2d(j, i)
1936 real(dp),
dimension(:),
intent(inout) :: adbl
1937 character(len=*),
intent(in) :: name
1938 character(len=*),
intent(in) :: mem_path
1941 logical(LGP) :: found
1945 do n = 1,
size(mt%adbl1d)
1946 adbl(n) = mt%adbl1d(n)
1953 integer(I4B),
pointer,
intent(inout) :: sclr
1954 character(len=*),
intent(in) :: name
1955 character(len=*),
intent(in) :: mem_path
1956 character(len=*),
intent(in) :: name_target
1957 character(len=*),
intent(in) :: mem_path_target
1961 logical(LGP) :: found
1965 if (
associated(sclr))
then
1971 mt%element_size = i4b
1973 write (mt%memtype,
"(a,' (',i0,')')")
'INTEGER', mt%isize
1977 mt%mastername = name_target
1978 mt%masterPath = mem_path_target
1985 logical(LGP),
dimension(:),
pointer,
contiguous,
intent(inout) :: alog
1986 character(len=*),
intent(in) :: name
1987 character(len=*),
intent(in) :: mem_path
1988 character(len=*),
intent(in) :: name_target
1989 character(len=*),
intent(in) :: mem_path_target
1993 logical(LGP) :: found
1997 if (
size(alog) > 0)
then
2001 alog => mt2%alogical1d
2002 mt%alogical1d => alog
2003 mt%element_size = lgp
2004 mt%isize =
size(alog)
2005 write (mt%memtype,
"(a,' (',i0,')')")
'LOGICAL', mt%isize
2009 mt%mastername = name_target
2010 mt%masterPath = mem_path_target
2016 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: aint
2017 character(len=*),
intent(in) :: name
2018 character(len=*),
intent(in) :: mem_path
2019 character(len=*),
intent(in) :: name_target
2020 character(len=*),
intent(in) :: mem_path_target
2024 logical(LGP) :: found
2028 if (
size(aint) > 0)
then
2034 mt%element_size = i4b
2035 mt%isize =
size(aint)
2036 write (mt%memtype,
"(a,' (',i0,')')")
'INTEGER', mt%isize
2040 mt%mastername = name_target
2041 mt%masterPath = mem_path_target
2047 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: aint
2048 character(len=*),
intent(in) :: name
2049 character(len=*),
intent(in) :: mem_path
2050 character(len=*),
intent(in) :: name_target
2051 character(len=*),
intent(in) :: mem_path_target
2055 logical(LGP) :: found
2056 integer(I4B) :: ncol
2057 integer(I4B) :: nrow
2061 if (
size(aint) > 0)
then
2067 mt%element_size = i4b
2068 mt%isize =
size(aint)
2069 ncol =
size(aint, dim=1)
2070 nrow =
size(aint, dim=2)
2071 write (mt%memtype,
"(a,' (',i0,',',i0,')')")
'INTEGER', ncol, nrow
2075 mt%mastername = name_target
2076 mt%masterPath = mem_path_target
2082 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: adbl
2083 character(len=*),
intent(in) :: name
2084 character(len=*),
intent(in) :: mem_path
2085 character(len=*),
intent(in) :: name_target
2086 character(len=*),
intent(in) :: mem_path_target
2090 logical(LGP) :: found
2094 if (
size(adbl) > 0)
then
2100 mt%element_size = dp
2101 mt%isize =
size(adbl)
2102 write (mt%memtype,
"(a,' (',i0,')')")
'DOUBLE', mt%isize
2106 mt%mastername = name_target
2107 mt%masterPath = mem_path_target
2113 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: adbl
2114 character(len=*),
intent(in) :: name
2115 character(len=*),
intent(in) :: mem_path
2116 character(len=*),
intent(in) :: name_target
2117 character(len=*),
intent(in) :: mem_path_target
2121 logical(LGP) :: found
2122 integer(I4B) :: ncol
2123 integer(I4b) :: nrow
2127 if (
size(adbl) > 0)
then
2133 mt%element_size = dp
2134 mt%isize =
size(adbl)
2135 ncol =
size(adbl, dim=1)
2136 nrow =
size(adbl, dim=2)
2137 write (mt%memtype,
"(a,' (',i0,',',i0,')')")
'DOUBLE', ncol, nrow
2141 mt%mastername = name_target
2142 mt%masterPath = mem_path_target
2148 character(len=*),
pointer,
intent(inout) :: sclr
2149 character(len=*),
intent(in),
optional :: name
2150 character(len=*),
intent(in),
optional :: mem_path
2159 character(len=*),
dimension(:),
pointer,
contiguous,
intent(inout) :: astr1d
2160 character(len=*),
optional,
intent(in) :: name
2161 character(len=*),
optional,
intent(in) :: mem_path
2172 intent(inout) :: astr1d
2173 character(len=*),
optional,
intent(in) :: name
2174 character(len=*),
optional,
intent(in) :: mem_path
2182 logical(LGP),
pointer,
intent(inout) :: sclr
2190 integer(I4B),
pointer,
intent(inout) :: sclr
2198 real(DP),
pointer,
intent(inout) :: sclr
2206 logical(LGP),
dimension(:),
pointer,
contiguous,
intent(inout) :: alog
2207 character(len=*),
optional :: name
2208 character(len=*),
optional :: mem_path
2216 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: aint
2217 character(len=*),
optional :: name
2218 character(len=*),
optional :: mem_path
2226 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: aint
2227 character(len=*),
optional :: name
2228 character(len=*),
optional :: mem_path
2236 integer(I4B),
dimension(:, :, :),
pointer,
contiguous,
intent(inout) :: aint
2237 character(len=*),
optional :: name
2238 character(len=*),
optional :: mem_path
2246 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: adbl
2247 character(len=*),
optional :: name
2248 character(len=*),
optional :: mem_path
2256 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: adbl
2257 character(len=*),
optional :: name
2258 character(len=*),
optional :: mem_path
2266 real(DP),
dimension(:, :, :),
pointer,
contiguous,
intent(inout) :: adbl
2267 character(len=*),
optional :: name
2268 character(len=*),
optional :: mem_path
2276 integer(I4B),
intent(in) ::
iout
2277 character(len=*),
intent(in) :: keyword
2278 character(len=*),
intent(inout) :: error_msg
2282 select case (keyword)
2285 write (
iout,
'(4x, a)') &
2286 'LIMITED MEMORY INFORMATION WILL BE WRITTEN.'
2289 write (
iout,
'(4x, a)') &
2290 'A SUMMARY OF SIMULATION MEMORY INFORMATION WILL BE WRITTEN.'
2293 write (
iout,
'(4x, a)') &
2294 'ALL SIMULATION MEMORY INFORMATION WILL BE WRITTEN.'
2296 error_msg =
"Unknown memory print option '"//trim(keyword)//
"."
2303 integer(I4B),
intent(in) :: iout
2304 integer(I4B),
intent(in) :: nrows
2305 character(len=*),
intent(in) :: cunits
2307 character(len=LINELENGTH) :: title
2308 character(len=LINELENGTH) :: text
2309 integer(I4B) :: nterms
2315 title =
'SUMMARY INFORMATION ON VARIABLES STORED IN THE MEMORY MANAGER, '// &
2320 call memtab%table_df(nrows, nterms, iout)
2350 integer(I4B),
intent(in) :: iout
2351 integer(I4B),
intent(in) :: nrows
2353 character(len=LINELENGTH) :: title
2354 character(len=LINELENGTH) :: text
2355 integer(I4B) :: nterms
2361 title =
'DETAILED INFORMATION ON VARIABLES STORED IN THE MEMORY MANAGER'
2365 call memtab%table_df(nrows, nterms, iout)
2372 text =
'VARIABLE NAME'
2380 text =
'NUMBER OF ITEMS'
2384 text =
'ASSOCIATED VARIABLE'
2391 character(len=*),
intent(in) :: component
2392 real(DP),
intent(in) :: rchars
2393 real(DP),
intent(in) :: rlog
2394 real(DP),
intent(in) :: rint
2395 real(DP),
intent(in) :: rreal
2396 real(DP),
intent(in) :: bytes
2401 call memtab%add_term(component)
2402 call memtab%add_term(rchars)
2403 call memtab%add_term(rlog)
2404 call memtab%add_term(rint)
2405 call memtab%add_term(rreal)
2406 call memtab%add_term(bytes)
2413 real(DP),
intent(in) :: bytes
2414 real(DP),
intent(inout) :: fact
2415 character(len=*),
intent(inout) :: cunits
2425 if (bytes <
dep3)
then
2428 else if (bytes <
dep6)
then
2430 cunits =
'KILOBYTES'
2431 else if (bytes <
dep9)
then
2433 cunits =
'MEGABYTES'
2436 cunits =
'GIGABYTES'
2443 integer(I4B),
intent(in) :: iout
2444 real(DP),
intent(in) :: bytes
2446 character(len=LINELENGTH) :: title
2447 character(len=LINELENGTH) :: text
2448 character(LEN=10) :: cunits
2449 integer(I4B) :: nterms
2450 integer(I4B) :: nrows
2464 title =
'MEMORY MANAGER TOTAL STORAGE BY DATA TYPE, IN '//trim(cunits)
2468 call memtab%table_df(nrows, nterms, iout)
2475 text =
'ALLOCATED MEMORY'
2482 call memtab%add_term(
'Character')
2483 call memtab%add_term(smb)
2487 call memtab%add_term(
'Logical')
2488 call memtab%add_term(smb)
2492 call memtab%add_term(
'Integer')
2493 call memtab%add_term(smb)
2497 call memtab%add_term(
'Real')
2498 call memtab%add_term(smb)
2501 call memtab%print_separator()
2503 call memtab%add_term(
'Total')
2504 call memtab%add_term(smb)
2508 call memtab%add_term(
'Virtual')
2509 call memtab%add_term(smb)
2533 integer(I4B),
intent(in) ::
iout
2536 character(len=LENMEMADDRESS),
allocatable,
dimension(:) :: cunique
2538 character(len=LENMEMPATH) :: context
2539 character(len=LENCOMPONENTNAME) :: component
2540 character(len=LENCOMPONENTNAME) :: subcomponent
2541 character(len=LENMEMADDRESS) :: context_component
2542 character(LEN=10) :: cunits
2544 integer(I4B) :: icomp
2545 integer(I4B) :: ilen
2546 integer(I8B) :: nchars
2547 integer(I8B) :: nlog
2548 integer(I8B) :: nint
2549 integer(I8B) :: nreal
2550 real(dp) :: simbytes
2565 simbytes = real(simbytes, dp)
2576 do icomp = 1,
size(cunique)
2582 ilen = len_trim(cunique(icomp))
2584 do while (itr%has_next())
2589 context_component = trim(context)//component
2590 if (cunique(icomp) /= context_component(1:ilen)) cycle
2591 if (.not. mt%master) cycle
2592 if (mt%memtype(1:6) ==
'STRING')
then
2593 nchars = nchars + mt%isize * mt%element_size
2594 else if (mt%memtype(1:7) ==
'LOGICAL')
then
2595 nlog = nlog + mt%isize
2596 else if (mt%memtype(1:7) ==
'INTEGER')
then
2597 nint = nint + mt%isize
2598 else if (mt%memtype(1:6) ==
'DOUBLE')
then
2599 nreal = nreal + mt%isize
2604 rchars = real(nchars, dp) * fact
2605 rlog = real(nlog * lgp, dp) * fact
2606 rint = real(nint * i4b, dp) * fact
2607 rreal = real(nreal * dp, dp) * fact
2610 bytes = rchars + rlog + rint + rreal
2628 integer(I4B) ::
iout
2635 do while (itr%has_next())
2638 call mt%table_entry(
memtab)
2647 real(dp) :: vmem_size
2654 do while (itr%has_next())
2657 if (index(mt%path,
"__P") == 1)
then
2658 vmem_size = mt%element_size * mt%isize + vmem_size
2672 type(
memorytype),
pointer,
intent(inout) :: mt
2674 if (.not. mt%mt_associated())
return
2677 if (mt%memtype(1:6) ==
'STRING')
then
2681 if (mt%isize == 1)
then
2686 else if (mt%memtype(1:7) ==
'LOGICAL')
then
2688 else if (mt%memtype(1:7) ==
'INTEGER')
then
2690 else if (mt%memtype(1:6) ==
'DOUBLE')
then
2695 call mt%mt_deallocate()
2709 do while (itr%has_next())
2712 call mt%mt_deallocate()
2719 call store_error(
'Could not clear memory list.', terminate=.true.)
2729 character(len=LINELENGTH) :: error_msg
2730 character(len=LENVARNAME) :: ucname
2733 if (mt%mt_associated() .and. mt%element_size == -1)
then
2734 error_msg = trim(adjustl(mt%path))//
' '// &
2735 trim(adjustl(mt%name))//
' has invalid element size'
2740 if (mt%mt_associated() .and. mt%isize > 0)
then
2741 error_msg = trim(adjustl(mt%path))//
' '// &
2742 trim(adjustl(mt%name))//
' not deallocated'
2749 if (mt%name /= ucname)
then
2750 error_msg = trim(adjustl(mt%path))//
' '// &
2751 trim(adjustl(mt%name))//
' not upper case'
2763 character(len=LENMEMADDRESS),
allocatable,
dimension(:),
intent(inout) :: &
2767 character(len=LENMEMPATH) :: context
2768 character(len=LENCOMPONENTNAME) :: component
2769 character(len=LENCOMPONENTNAME) :: subcomponent
2770 character(len=LENMEMADDRESS) :: context_component
2776 allocate (cunique(0))
2780 do while (itr%has_next())
2785 context_component = trim(context)//component
2786 ipa =
ifind(cunique, context_component)
2789 cunique(
size(cunique)) = context_component
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
integer(i4b), parameter lencomponentname
maximum length of a component name
@ tabcenter
centered table column
@ tabright
right justified table column
@ tableft
left justified table column
integer(i4b), parameter lenmemaddress
maximum length of the full memory address, including variable name
real(dp), parameter dep3
real constant 1000
@ tabucstring
upper case string table data
@ tabstring
string table data
@ tabinteger
integer table data
real(dp), parameter dep6
real constant 1000000
integer(i4b), parameter lenmemseparator
maximum length of the memory path separator used, currently a '/'
real(dp), parameter dep9
real constant 1e9
integer(i4b), parameter lenvarname
maximum length of a variable name
integer(i4b), parameter, public lenmemtype
maximum length of a memory manager type
real(dp), parameter dem3
real constant 1e-3
real(dp), parameter dem6
real constant 1e-6
real(dp), parameter dzero
real constant zero
real(dp), parameter dem9
real constant 1e-9
integer(i4b), parameter lenmempath
maximum length of the memory path
real(dp), parameter done
real constant 1
This module defines variable data types.
character(len=lenmempath) function get_mem_path_context(mem_path)
Return the context from the memory path.
subroutine mem_check_length(name, max_length, description)
Generic routine to check the length of (parts of) the memory address.
subroutine strip_context_mem_path(mem_path, mem_path_no_context)
Remove the context from the memory path.
subroutine split_mem_path(mem_path, component, subcomponent)
Split the memory path into component(s).
subroutine reallocate_int2d(aint, ncol, nrow, name, mem_path)
Reallocate a 2-dimensional integer array.
subroutine allocate_logical(sclr, name, mem_path)
Allocate a logical scalar.
subroutine allocate_int2d(aint, ncol, nrow, name, mem_path)
Allocate a 2-dimensional integer array.
subroutine mem_summary_line(component, rchars, rlog, rint, rreal, bytes)
Write a row for the memory_print_option 'SUMMARY' table.
subroutine allocate_dbl3d(adbl, ncol, nrow, nlay, name, mem_path)
Allocate a 3-dimensional real array.
integer(i8b) nvalues_adbl
subroutine deallocate_str1d(astr1d, name, mem_path)
Deallocate an array of defined-length character strings.
subroutine deallocate_int(sclr)
DEPRECATED. The memory manager will handle the deallocation of the pointer.
subroutine deallocate_logical1d(alog, name, mem_path)
DEPRECATED. The memory manager will handle the deallocation of the pointer.
type(tabletype), pointer memtab
subroutine setptr_int3d(aint, name, mem_path)
Set pointer to 3d integer array.
subroutine mem_detailed_table(iout, nrows)
Create a table if memory_print_option is 'ALL'.
subroutine deallocate_charstr1d(astr1d, name, mem_path)
DEPRECATED. The memory manager will handle the deallocation of the pointer.
subroutine allocate_charstr1d(acharstr1d, ilen, nrow, name, mem_path)
Allocate a 1-dimensional array of deferred-length CharacterStringType.
subroutine reallocate_charstr1d(acharstr1d, ilen, nrow, name, mem_path)
Reallocate a 1-dimensional deferred length string array.
subroutine, public mem_write_usage(iout)
Write memory manager memory usage based on the user-specified memory_print_option.
subroutine reallocate_dbl2d(adbl, ncol, nrow, name, mem_path)
Reallocate a 2-dimensional real array.
integer(i8b) nvalues_aint
subroutine setptr_int(sclr, name, mem_path)
Set pointer to integer scalar.
subroutine checkin_charstr1d(acharstr1d, ilen, name, mem_path, name2, mem_path2)
Check in an existing 1d CharacterStringType array with a new address (name + path).
subroutine mem_cleanup_table()
Generic function to clean a memory manager table.
subroutine copyptr_int1d(aint, name, mem_path, mem_path_copy)
Make a copy of a 1-dimensional integer array.
subroutine deallocate_dbl1d(adbl, name, mem_path)
DEPRECATED. The memory manager will handle the deallocation of the pointer.
subroutine allocate_str1d(astr1d, ilen, nrow, name, mem_path)
Allocate a 1-dimensional defined length string array.
subroutine allocate_str(sclr, ilen, name, mem_path)
Allocate a character string.
subroutine, public get_mem_type(name, mem_path, var_type)
Get the variable memory type.
subroutine setptr_int2d(aint, name, mem_path)
Set pointer to 2d integer array.
subroutine, public mem_da()
Deallocate memory in the memory manager.
subroutine deallocate_int1d(aint, name, mem_path)
DEPRECATED. The memory manager will handle the deallocation of the pointer.
integer(i8b) nvalues_astr
subroutine deallocate_dbl(sclr)
DEPRECATED. The memory manager will handle the deallocation of the pointer.
subroutine copyptr_int2d(aint, name, mem_path, mem_path_copy)
Make a copy of a 2-dimensional integer array.
subroutine mem_da_check(mt)
subroutine allocate_dbl(sclr, name, mem_path)
Allocate a real scalar.
real(dp) function calc_virtual_mem()
Sum up virtual memory, i.e. memory.
subroutine copyptr_dbl2d(adbl, name, mem_path, mem_path_copy)
Make a copy of a 2-dimensional real array.
subroutine reassignptr_int2d(aint, name, mem_path, name_target, mem_path_target)
Set the pointer for a 2-dimensional integer array to.
subroutine reallocate_logical1d(alog, nrow, name, mem_path)
Reallocate a 1-dimensional logical array.
subroutine setptr_dbl(sclr, name, mem_path)
Set pointer to a real scalar.
subroutine deallocate_int3d(aint, name, mem_path)
DEPRECATED. The memory manager will handle the deallocation of the pointer.
subroutine deallocate_int2d(aint, name, mem_path)
DEPRECATED. The memory manager will handle the deallocation of the pointer.
subroutine reassignptr_dbl1d(adbl, name, mem_path, name_target, mem_path_target)
Set the pointer for a 1-dimensional real array to.
subroutine, public mem_release(mt)
Release a memory store entry: deallocate data and update counters.
subroutine allocate_int3d(aint, ncol, nrow, nlay, name, mem_path)
Allocate a 3-dimensional integer array.
subroutine, public get_mem_shape(name, mem_path, mem_shape)
Get the variable memory shape.
subroutine deallocate_dbl2d(adbl, name, mem_path)
DEPRECATED. The memory manager will handle the deallocation of the pointer.
subroutine mem_units(bytes, fact, cunits)
Determine appropriate memory unit and conversion factor.
subroutine setptr_int1d(aint, name, mem_path)
Set pointer to 1d integer array.
subroutine setptr_str1d(astr1d, name, mem_path)
Set pointer to a fixed-length string array.
subroutine checkin_int2d(aint2d, name, mem_path, name2, mem_path2)
Check in an existing 2d integer array with a new address (name + path).
type(memorystoretype), public memorystore
subroutine reallocate_dbl1d(adbl, nrow, name, mem_path)
Reallocate a 1-dimensional real array.
subroutine setptr_dbl2d(adbl, name, mem_path)
Set pointer to a 2d real array.
subroutine deallocate_logical(sclr)
DEPRECATED. The memory manager will handle the deallocation of the pointer.
subroutine setptr_logical1d(alog, name, mem_path)
Set pointer to 1d logical array.
subroutine checkin_dbl2d(adbl2d, name, mem_path, name2, mem_path2)
Check in an existing 2d double precision array with a new address (name + path).
subroutine deallocate_dbl3d(adbl, name, mem_path)
DEPRECATED. The memory manager will handle the deallocation of the pointer.
subroutine reallocate_int1d(aint, nrow, name, mem_path)
Reallocate a 1-dimensional integer array.
subroutine checkin_logical1d(alog, name, mem_path, name2, mem_path2)
Check in an existing 1d logical array with a new address (name + path).
subroutine, public get_from_memorystore(name, mem_path, mt, found, check)
Get a memory type entry from the memory list.
subroutine, public mem_print_detailed(iout)
subroutine reallocate_str1d(astr, ilen, nrow, name, mem_path)
Reallocate a 1-dimensional defined length string array.
subroutine copyptr_dbl1d(adbl, name, mem_path, mem_path_copy)
Make a copy of a 1-dimensional real array.
subroutine allocate_logical1d(alog, nrow, name, mem_path)
Allocate a 1-dimensional logical array.
subroutine reassignptr_dbl2d(adbl, name, mem_path, name_target, mem_path_target)
Set the pointer for a 2-dimensional real array to.
subroutine copyptr_logical1d(alog, name, mem_path, mem_path_copy)
Make a copy of a 1-dimensional logical array.
subroutine allocate_int1d(aint, nrow, name, mem_path)
Allocate a 1-dimensional integer array.
subroutine allocate_int(sclr, name, mem_path)
Allocate a integer scalar.
subroutine reassignptr_int1d(aint, name, mem_path, name_target, mem_path_target)
Set the pointer for a 1-dimensional integer array to.
subroutine mem_summary_total(iout, bytes)
Create and fill a table with the total allocated memory.
subroutine, public get_isize(name, mem_path, isize)
Get the number of elements for this variable.
subroutine allocate_dbl2d(adbl, ncol, nrow, name, mem_path)
Allocate a 2-dimensional real array.
subroutine deallocate_str(sclr, name, mem_path)
DEPRECATED. The memory manager will handle the deallocation of the pointer.
subroutine, public get_mem_rank(name, mem_path, rank)
Get the variable rank.
subroutine checkin_dbl1d(adbl, name, mem_path, name2, mem_path2)
Check in an existing 1d double precision array with a new address (name + path).
subroutine checkin_int1d(aint, name, mem_path, name2, mem_path2)
Check in an existing 1d integer array with a new address (name + path).
subroutine reassignptr_logical1d(alog, name, mem_path, name_target, mem_path_target)
Set the pointer for a 1-dimensional logical array to.
subroutine reassignptr_int(sclr, name, mem_path, name_target, mem_path_target)
Set the pointer for an integer scalar to.
subroutine, public copy_dbl1d(adbl, name, mem_path)
Copy values from a 1-dimensional real array in the memory.
subroutine setptr_dbl3d(adbl, name, mem_path)
Set pointer to a 3d real array.
subroutine, public get_mem_elem_size(name, mem_path, size)
Get the memory size of a single element of the stored variable.
subroutine setptr_dbl1d(adbl, name, mem_path)
Set pointer to a 1d real array.
subroutine setptr_str(asrt, name, mem_path)
Set pointer to a string (scalar).
integer(i8b) nvalues_alogical
subroutine setptr_charstr1d(acharstr1d, name, mem_path)
Set pointer to an array of CharacterStringType.
subroutine mem_unique_origins(cunique)
Create a array with unique first components from all memory paths. Only the first component of the me...
subroutine mem_summary_table(iout, nrows, cunits)
Create a table if memory_print_option is 'SUMMARY'.
subroutine setptr_logical(sclr, name, mem_path)
Set pointer to a logical scalar.
subroutine, public mem_set_print_option(iout, keyword, error_msg)
Set the memory print option.
subroutine allocate_dbl1d(adbl, nrow, name, mem_path)
Allocate a 1-dimensional real array.
subroutine allocate_error(varname, mem_path, istat, isize)
Issue allocation error message and stop program execution.
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
integer(i4b) function, public count_errors()
Return number of errors.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
integer(i4b) iout
file unit number for simulation output
subroutine, public table_cr(this, name, title)
This module contains version information.
integer(i4b), parameter idevelopmode
This class is used to store a single deferred-length character string. It was designed to work in an ...
An iterator used to iterate through a MemoryContainer.