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
190 if (
associated(mt%logicalsclr)) rank = 0
191 if (
associated(mt%intsclr)) rank = 0
192 if (
associated(mt%dblsclr)) rank = 0
193 if (
associated(mt%alogical1d)) rank = 1
194 if (
associated(mt%aint1d)) rank = 1
195 if (
associated(mt%aint2d)) rank = 2
196 if (
associated(mt%aint3d)) rank = 3
197 if (
associated(mt%adbl1d)) rank = 1
198 if (
associated(mt%adbl2d)) rank = 2
199 if (
associated(mt%adbl3d)) rank = 3
200 if (
associated(mt%strsclr)) rank = 0
201 if (
associated(mt%astr1d)) rank = 1
202 if (
associated(mt%acharstr1d)) rank = 1
211 character(len=*),
intent(in) :: name
212 character(len=*),
intent(in) :: mem_path
213 integer(I4B),
intent(out) :: size
216 logical(LGP) :: found
227 size = mt%element_size
237 character(len=*),
intent(in) :: name
238 character(len=*),
intent(in) :: mem_path
239 integer(I4B),
dimension(:),
intent(out) :: mem_shape
242 logical(LGP) :: found
250 if (
associated(mt%logicalsclr)) mem_shape = shape(mt%logicalsclr)
251 if (
associated(mt%intsclr)) mem_shape = shape(mt%logicalsclr)
252 if (
associated(mt%dblsclr)) mem_shape = shape(mt%dblsclr)
253 if (
associated(mt%alogical1d)) mem_shape = shape(mt%alogical1d)
254 if (
associated(mt%aint1d)) mem_shape = shape(mt%aint1d)
255 if (
associated(mt%aint2d)) mem_shape = shape(mt%aint2d)
256 if (
associated(mt%aint3d)) mem_shape = shape(mt%aint3d)
257 if (
associated(mt%adbl1d)) mem_shape = shape(mt%adbl1d)
258 if (
associated(mt%adbl2d)) mem_shape = shape(mt%adbl2d)
259 if (
associated(mt%adbl3d)) mem_shape = shape(mt%adbl3d)
260 if (
associated(mt%strsclr)) mem_shape = shape(mt%strsclr)
261 if (
associated(mt%astr1d)) mem_shape = shape(mt%astr1d)
262 if (
associated(mt%acharstr1d)) mem_shape = shape(mt%acharstr1d)
275 character(len=*),
intent(in) :: name
276 character(len=*),
intent(in) :: mem_path
277 integer(I4B),
intent(out) :: isize
280 logical(LGP) :: found
281 logical(LGP) :: terminate
305 character(len=*),
intent(in) :: name
306 character(len=*),
intent(in) :: mem_path
307 type(
memorytype),
pointer,
intent(inout) :: mt
308 logical(LGP),
intent(out) :: found
309 logical(LGP),
intent(in),
optional :: check
312 logical(LGP) check_opt
315 found =
associated(mt)
318 if (
present(check))
then
322 if (.not. found)
then
323 errmsg =
"Programming error in memory manager. Variable '"// &
324 trim(name)//
"' in '"//trim(mem_path)//
"' cannot be "// &
325 "assigned because it does not exist in memory manager."
334 character(len=*),
intent(in) :: varname
335 character(len=*),
intent(in) :: mem_path
336 integer(I4B),
intent(in) :: istat
337 integer(I4B),
intent(in) :: isize
339 character(len=20) :: csize
340 character(len=20) :: cstat
344 write (csize,
'(i0)') isize
345 write (cstat,
'(i0)') istat
348 errmsg =
"Error trying to allocate memory. Path '"//trim(mem_path)// &
349 "' variable name '"//trim(varname)//
"' size '"//trim(csize)// &
350 "'. Error message is '"//trim(adjustl(
errmsg))// &
351 "'. Status code is "//trim(cstat)//
'.'
360 logical(LGP),
pointer,
intent(inout) :: sclr
361 character(len=*),
intent(in) :: name
362 character(len=*),
intent(in) :: mem_path
364 integer(I4B) :: istat
384 mt%logicalsclr => sclr
385 mt%element_size = lgp
389 write (mt%memtype,
"(a)")
'LOGICAL'
398 logical(LGP),
dimension(:),
pointer,
contiguous,
intent(inout) :: alog
399 integer(I4B),
intent(in) :: nrow
400 character(len=*),
intent(in) :: name
401 character(len=*),
intent(in) :: mem_path
404 integer(I4B) :: istat
405 integer(I4B) :: isize
427 mt%alogical1d => alog
428 mt%element_size = lgp
432 write (mt%memtype,
"(a,' (',i0,')')")
'LOGICAL', isize
441 integer(I4B),
intent(in) :: ilen
442 character(len=ilen),
pointer,
intent(inout) :: sclr
443 character(len=*),
intent(in) :: name
444 character(len=*),
intent(in) :: mem_path
446 integer(I4B) :: istat
453 errmsg =
'Programming error in allocate_str. ILEN must be greater than 0.'
461 allocate (
character(len=ilen) :: sclr, stat=istat,
errmsg=
errmsg)
477 mt%element_size = ilen
481 write (mt%memtype,
"(a,' LEN=',i0)")
'STRING', ilen
490 integer(I4B),
intent(in) :: ilen
491 character(len=ilen),
dimension(:), &
492 pointer,
contiguous,
intent(inout) :: astr1d
493 integer(I4B),
intent(in) :: nrow
494 character(len=*),
intent(in) :: name
495 character(len=*),
intent(in) :: mem_path
498 character(len=ilen) :: string
500 integer(I4B) :: istat
501 integer(I4B) :: isize
509 errmsg =
'Programming error in allocate_str1d. '// &
510 'ILEN must be greater than 0.'
521 allocate (
character(len=ilen) :: astr1d(nrow), stat=istat,
errmsg=
errmsg)
541 mt%element_size = ilen
545 write (mt%memtype,
"(a,' LEN=',i0,' (',i0,')')")
'STRING', ilen, nrow
555 pointer,
contiguous,
intent(inout) :: acharstr1d
556 integer(I4B),
intent(in) :: ilen
557 integer(I4B),
intent(in) :: nrow
558 character(len=*),
intent(in) :: name
559 character(len=*),
intent(in) :: mem_path
561 character(len=ilen) :: string
564 integer(I4B) :: istat
565 integer(I4B) :: isize
587 acharstr1d(n) = string
597 mt%acharstr1d => acharstr1d
598 mt%element_size = ilen
602 write (mt%memtype,
"(a,' LEN=',i0,' (',i0,')')")
'STRING', ilen, nrow
611 integer(I4B),
pointer,
intent(inout) :: sclr
612 character(len=*),
intent(in) :: name
613 character(len=*),
intent(in) :: mem_path
616 integer(I4B) :: istat
636 mt%element_size = i4b
640 write (mt%memtype,
"(a)")
'INTEGER'
649 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: aint
650 integer(I4B),
intent(in) :: nrow
651 character(len=*),
intent(in) :: name
652 character(len=*),
intent(in) :: mem_path
655 integer(I4B) :: istat
656 integer(I4B) :: isize
679 mt%element_size = i4b
683 write (mt%memtype,
"(a,' (',i0,')')")
'INTEGER', isize
692 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: aint
693 integer(I4B),
intent(in) :: ncol
694 integer(I4B),
intent(in) :: nrow
695 character(len=*),
intent(in) :: name
696 character(len=*),
intent(in) :: mem_path
699 integer(I4B) :: istat
700 integer(I4B) :: isize
723 mt%element_size = i4b
727 write (mt%memtype,
"(a,' (',i0,',',i0,')')")
'INTEGER', ncol, nrow
736 integer(I4B),
dimension(:, :, :),
pointer,
contiguous,
intent(inout) :: aint
737 integer(I4B),
intent(in) :: ncol
738 integer(I4B),
intent(in) :: nrow
739 integer(I4B),
intent(in) :: nlay
740 character(len=*),
intent(in) :: name
741 character(len=*),
intent(in) :: mem_path
744 integer(I4B) :: istat
745 integer(I4B) :: isize
752 isize = ncol * nrow * nlay
755 allocate (aint(ncol, nrow, nlay), stat=istat,
errmsg=
errmsg)
768 mt%element_size = i4b
772 write (mt%memtype,
"(a,' (',i0,',',i0,',',i0,')')")
'INTEGER', ncol, &
782 real(DP),
pointer,
intent(inout) :: sclr
783 character(len=*),
intent(in) :: name
784 character(len=*),
intent(in) :: mem_path
787 integer(I4B) :: istat
811 write (mt%memtype,
"(a)")
'DOUBLE'
820 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: adbl
821 integer(I4B),
intent(in) :: nrow
822 character(len=*),
intent(in) :: name
823 character(len=*),
intent(in) :: mem_path
826 integer(I4B) :: istat
827 integer(I4B) :: isize
854 write (mt%memtype,
"(a,' (',i0,')')")
'DOUBLE', isize
863 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: adbl
864 integer(I4B),
intent(in) :: ncol
865 integer(I4B),
intent(in) :: nrow
866 character(len=*),
intent(in) :: name
867 character(len=*),
intent(in) :: mem_path
870 integer(I4B) :: istat
871 integer(I4B) :: isize
898 write (mt%memtype,
"(a,' (',i0,',',i0,')')")
'DOUBLE', ncol, nrow
907 real(DP),
dimension(:, :, :),
pointer,
contiguous,
intent(inout) :: adbl
908 integer(I4B),
intent(in) :: ncol
909 integer(I4B),
intent(in) :: nrow
910 integer(I4B),
intent(in) :: nlay
911 character(len=*),
intent(in) :: name
912 character(len=*),
intent(in) :: mem_path
915 integer(I4B) :: istat
916 integer(I4B) :: isize
923 isize = ncol * nrow * nlay
926 allocate (adbl(ncol, nrow, nlay), stat=istat,
errmsg=
errmsg)
943 write (mt%memtype,
"(a,' (',i0,',',i0,',',i0,')')")
'DOUBLE', ncol, &
953 logical(LGP),
dimension(:),
pointer,
contiguous,
intent(in) :: alog
954 character(len=*),
intent(in) :: name
955 character(len=*),
intent(in) :: mem_path
956 character(len=*),
intent(in) :: name2
957 character(len=*),
intent(in) :: mem_path2
960 integer(I4B) :: isize
973 mt%alogical1d => alog
974 mt%element_size = lgp
978 write (mt%memtype,
"(a,' (',i0,')')")
'LOGICAL', isize
982 mt%mastername = name2
983 mt%masterPath = mem_path2
992 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: aint
993 character(len=*),
intent(in) :: name
994 character(len=*),
intent(in) :: mem_path
995 character(len=*),
intent(in) :: name2
996 character(len=*),
intent(in) :: mem_path2
999 integer(I4B) :: isize
1013 mt%element_size = i4b
1017 write (mt%memtype,
"(a,' (',i0,')')")
'INTEGER', isize
1021 mt%mastername = name2
1022 mt%masterPath = mem_path2
1031 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: aint2d
1032 character(len=*),
intent(in) :: name
1033 character(len=*),
intent(in) :: mem_path
1034 character(len=*),
intent(in) :: name2
1035 character(len=*),
intent(in) :: mem_path2
1038 integer(I4B) :: ncol, nrow, isize
1045 ncol =
size(aint2d, dim=1)
1046 nrow =
size(aint2d, dim=2)
1057 write (mt%memtype,
"(a,' (',i0,',',i0,')')")
'INTEGER', ncol, nrow
1061 mt%mastername = name2
1062 mt%masterPath = mem_path2
1071 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: adbl
1072 character(len=*),
intent(in) :: name
1073 character(len=*),
intent(in) :: mem_path
1074 character(len=*),
intent(in) :: name2
1075 character(len=*),
intent(in) :: mem_path2
1078 integer(I4B) :: isize
1092 mt%element_size = dp
1096 write (mt%memtype,
"(a,' (',i0,')')")
'DOUBLE', isize
1100 mt%mastername = name2
1101 mt%masterPath = mem_path2
1110 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: adbl2d
1111 character(len=*),
intent(in) :: name
1112 character(len=*),
intent(in) :: mem_path
1113 character(len=*),
intent(in) :: name2
1114 character(len=*),
intent(in) :: mem_path2
1117 integer(I4B) :: ncol, nrow, isize
1124 ncol =
size(adbl2d, dim=1)
1125 nrow =
size(adbl2d, dim=2)
1136 write (mt%memtype,
"(a,' (',i0,',',i0,')')")
'DOUBLE', ncol, nrow
1140 mt%mastername = name2
1141 mt%masterPath = mem_path2
1151 pointer,
contiguous,
intent(inout) :: acharstr1d
1152 integer(I4B),
intent(in) :: ilen
1153 character(len=*),
intent(in) :: name
1154 character(len=*),
intent(in) :: mem_path
1155 character(len=*),
intent(in) :: name2
1156 character(len=*),
intent(in) :: mem_path2
1159 integer(I4B) :: isize
1166 isize =
size(acharstr1d)
1172 mt%acharstr1d => acharstr1d
1173 mt%element_size = ilen
1177 write (mt%memtype,
"(a,' LEN=',i0,' (',i0,')')")
'STRING', ilen, isize
1181 mt%mastername = name2
1182 mt%masterPath = mem_path2
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
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
1211 isize_old = mt%isize
1212 if (isize_old > 0)
then
1213 nrow_old =
size(astr)
1223 if (istat /= 0)
then
1229 astrtemp(n) = astr(n)
1233 do n = nrow_old + 1, nrow
1242 if (istat /= 0)
then
1248 astr(n) = astrtemp(n)
1252 deallocate (astrtemp)
1256 mt%element_size = ilen
1258 mt%nrealloc = mt%nrealloc + 1
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."
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
1281 logical(LGP) :: found
1283 character(len=ilen) :: string
1284 integer(I4B) :: istat
1285 integer(I4B) :: isize
1286 integer(I4B) :: isize_old
1287 integer(I4B) :: nrow_old
1298 isize_old = mt%isize
1299 if (isize_old > 0)
then
1300 nrow_old =
size(acharstr1d)
1310 if (istat /= 0)
then
1316 astrtemp(n) = acharstr1d(n)
1317 call acharstr1d(n)%destroy()
1321 do n = nrow_old + 1, nrow
1322 astrtemp(n) = string
1326 deallocate (acharstr1d)
1330 if (istat /= 0)
then
1336 acharstr1d(n) = astrtemp(n)
1337 call astrtemp(n)%destroy()
1341 deallocate (astrtemp)
1344 mt%acharstr1d => acharstr1d
1345 mt%element_size = ilen
1347 mt%nrealloc = mt%nrealloc + 1
1350 write (mt%memtype,
"(a,' LEN=',i0,' (',i0,')')")
'STRING', ilen, nrow
1352 errmsg =
"Programming error, variable '"//trim(name)//
"' from '"// &
1353 trim(mem_path)//
"' is not defined in the memory manager. Use "// &
1354 "mem_allocate instead."
1362 logical(LGP),
dimension(:),
pointer,
contiguous,
intent(inout) :: alog
1363 integer(I4B),
intent(in) :: nrow
1364 character(len=*),
intent(in) :: name
1365 character(len=*),
intent(in) :: mem_path
1368 logical(LGP) :: found
1369 integer(I4B) :: istat
1370 integer(I4B) :: isize
1372 integer(I4B) :: isizeold
1373 integer(I4B) :: ifill
1381 isizeold =
size(mt%alogical1d)
1382 ifill = min(isizeold, isize)
1384 if (istat /= 0)
then
1388 alog(i) = mt%alogical1d(i)
1392 deallocate (mt%alogical1d)
1393 mt%alogical1d => alog
1394 mt%element_size = lgp
1396 mt%nrealloc = mt%nrealloc + 1
1404 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: aint
1405 integer(I4B),
intent(in) :: nrow
1406 character(len=*),
intent(in) :: name
1407 character(len=*),
intent(in) :: mem_path
1410 logical(LGP) :: found
1411 integer(I4B) :: istat
1412 integer(I4B) :: isize
1414 integer(I4B) :: isizeold
1415 integer(I4B) :: ifill
1423 isizeold =
size(mt%aint1d)
1424 ifill = min(isizeold, isize)
1426 if (istat /= 0)
then
1430 aint(i) = mt%aint1d(i)
1434 deallocate (mt%aint1d)
1436 mt%element_size = i4b
1438 mt%nrealloc = mt%nrealloc + 1
1446 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: aint
1447 integer(I4B),
intent(in) :: ncol
1448 integer(I4B),
intent(in) :: nrow
1449 character(len=*),
intent(in) :: name
1450 character(len=*),
intent(in) :: mem_path
1453 logical(LGP) :: found
1454 integer(I4B) :: istat
1455 integer(I4B),
dimension(2) :: ishape
1458 integer(I4B) :: isize
1459 integer(I4B) :: isizeold
1466 ishape = shape(mt%aint2d)
1468 isizeold = ishape(1) * ishape(2)
1470 if (istat /= 0)
then
1475 aint(j, i) = mt%aint2d(j, i)
1480 deallocate (mt%aint2d)
1482 mt%element_size = i4b
1484 mt%nrealloc = mt%nrealloc + 1
1487 write (mt%memtype,
"(a,' (',i0,',',i0,')')")
'INTEGER', ncol, nrow
1493 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: adbl
1494 integer(I4B),
intent(in) :: nrow
1495 character(len=*),
intent(in) :: name
1496 character(len=*),
intent(in) :: mem_path
1499 integer(I4B) :: istat
1500 integer(I4B) :: isize
1502 integer(I4B) :: isizeold
1503 integer(I4B) :: ifill
1504 logical(LGP) :: found
1512 isizeold =
size(mt%adbl1d)
1513 ifill = min(isizeold, isize)
1515 if (istat /= 0)
then
1519 adbl(i) = mt%adbl1d(i)
1523 deallocate (mt%adbl1d)
1525 mt%element_size = dp
1527 mt%nrealloc = mt%nrealloc + 1
1530 write (mt%memtype,
"(a,' (',i0,')')")
'DOUBLE', isize
1536 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: adbl
1537 integer(I4B),
intent(in) :: ncol
1538 integer(I4B),
intent(in) :: nrow
1539 character(len=*),
intent(in) :: name
1540 character(len=*),
intent(in) :: mem_path
1543 logical(LGP) :: found
1544 integer(I4B) :: istat
1545 integer(I4B),
dimension(2) :: ishape
1548 integer(I4B) :: isize
1549 integer(I4B) :: isizeold
1556 ishape = shape(mt%adbl2d)
1558 isizeold = ishape(1) * ishape(2)
1560 if (istat /= 0)
then
1565 adbl(j, i) = mt%adbl2d(j, i)
1570 deallocate (mt%adbl2d)
1572 mt%element_size = dp
1574 mt%nrealloc = mt%nrealloc + 1
1577 write (mt%memtype,
"(a,' (',i0,',',i0,')')")
'DOUBLE', ncol, nrow
1583 logical(LGP),
pointer,
intent(inout) :: sclr
1584 character(len=*),
intent(in) :: name
1585 character(len=*),
intent(in) :: mem_path
1588 logical(LGP) :: found
1591 sclr => mt%logicalsclr
1597 integer(I4B),
pointer,
intent(inout) :: sclr
1598 character(len=*),
intent(in) :: name
1599 character(len=*),
intent(in) :: mem_path
1602 logical(LGP) :: found
1611 logical(LGP),
dimension(:),
pointer,
contiguous,
intent(inout) :: alog
1612 character(len=*),
intent(in) :: name
1613 character(len=*),
intent(in) :: mem_path
1616 logical(LGP) :: found
1619 alog => mt%alogical1d
1625 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: aint
1626 character(len=*),
intent(in) :: name
1627 character(len=*),
intent(in) :: mem_path
1630 logical(LGP) :: found
1639 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: aint
1640 character(len=*),
intent(in) :: name
1641 character(len=*),
intent(in) :: mem_path
1644 logical(LGP) :: found
1653 integer(I4B),
dimension(:, :, :),
pointer,
contiguous,
intent(inout) :: aint
1654 character(len=*),
intent(in) :: name
1655 character(len=*),
intent(in) :: mem_path
1658 logical(LGP) :: found
1667 real(DP),
pointer,
intent(inout) :: sclr
1668 character(len=*),
intent(in) :: name
1669 character(len=*),
intent(in) :: mem_path
1672 logical(LGP) :: found
1681 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: adbl
1682 character(len=*),
intent(in) :: name
1683 character(len=*),
intent(in) :: mem_path
1686 logical(LGP) :: found
1695 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: adbl
1696 character(len=*),
intent(in) :: name
1697 character(len=*),
intent(in) :: mem_path
1700 logical(LGP) :: found
1709 real(DP),
dimension(:, :, :),
pointer,
contiguous,
intent(inout) :: adbl
1710 character(len=*),
intent(in) :: name
1711 character(len=*),
intent(in) :: mem_path
1714 logical(LGP) :: found
1723 character(len=:),
pointer :: asrt
1724 character(len=*),
intent(in) :: name
1725 character(len=*),
intent(in) :: mem_path
1728 logical(LGP) :: found
1737 character(len=:),
dimension(:), &
1738 pointer,
contiguous,
intent(inout) :: astr1d
1739 character(len=*),
intent(in) :: name
1740 character(len=*),
intent(in) :: mem_path
1743 logical(LGP) :: found
1746 select type (item => mt%astr1d)
1747 type is (
character(*))
1758 intent(inout) :: acharstr1d
1759 character(len=*),
intent(in) :: name
1760 character(len=*),
intent(in) :: mem_path
1763 logical(LGP) :: found
1766 acharstr1d => mt%acharstr1d
1772 logical(LGP),
dimension(:),
pointer,
contiguous,
intent(inout) :: alog
1773 character(len=*),
intent(in) :: name
1774 character(len=*),
intent(in) :: mem_path
1775 character(len=*),
intent(in),
optional :: mem_path_copy
1780 logical(LGP) :: found
1786 if (
present(mem_path_copy))
then
1790 allocate (alog(
size(mt%alogical1d)))
1792 do n = 1,
size(mt%alogical1d)
1793 alog(n) = mt%alogical1d(n)
1800 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: aint
1801 character(len=*),
intent(in) :: name
1802 character(len=*),
intent(in) :: mem_path
1803 character(len=*),
intent(in),
optional :: mem_path_copy
1808 logical(LGP) :: found
1814 if (
present(mem_path_copy))
then
1815 call allocate_int1d(aint,
size(mt%aint1d), mt%name, mem_path_copy)
1818 allocate (aint(
size(mt%aint1d)))
1820 do n = 1,
size(mt%aint1d)
1821 aint(n) = mt%aint1d(n)
1828 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: aint
1829 character(len=*),
intent(in) :: name
1830 character(len=*),
intent(in) :: mem_path
1831 character(len=*),
intent(in),
optional :: mem_path_copy
1836 logical(LGP) :: found
1839 integer(I4B) :: ncol
1840 integer(I4B) :: nrow
1844 ncol =
size(mt%aint2d, dim=1)
1845 nrow =
size(mt%aint2d, dim=2)
1847 if (
present(mem_path_copy))
then
1851 allocate (aint(ncol, nrow))
1855 aint(j, i) = mt%aint2d(j, i)
1863 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: adbl
1864 character(len=*),
intent(in) :: name
1865 character(len=*),
intent(in) :: mem_path
1866 character(len=*),
intent(in),
optional :: mem_path_copy
1871 logical(LGP) :: found
1877 if (
present(mem_path_copy))
then
1878 call allocate_dbl1d(adbl,
size(mt%adbl1d), mt%name, mem_path_copy)
1881 allocate (adbl(
size(mt%adbl1d)))
1883 do n = 1,
size(mt%adbl1d)
1884 adbl(n) = mt%adbl1d(n)
1891 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: adbl
1892 character(len=*),
intent(in) :: name
1893 character(len=*),
intent(in) :: mem_path
1894 character(len=*),
intent(in),
optional :: mem_path_copy
1899 logical(LGP) :: found
1902 integer(I4B) :: ncol
1903 integer(I4B) :: nrow
1907 ncol =
size(mt%adbl2d, dim=1)
1908 nrow =
size(mt%adbl2d, dim=2)
1910 if (
present(mem_path_copy))
then
1914 allocate (adbl(ncol, nrow))
1918 adbl(j, i) = mt%adbl2d(j, i)
1926 real(dp),
dimension(:),
intent(inout) :: adbl
1927 character(len=*),
intent(in) :: name
1928 character(len=*),
intent(in) :: mem_path
1931 logical(LGP) :: found
1935 do n = 1,
size(mt%adbl1d)
1936 adbl(n) = mt%adbl1d(n)
1943 integer(I4B),
pointer,
intent(inout) :: sclr
1944 character(len=*),
intent(in) :: name
1945 character(len=*),
intent(in) :: mem_path
1946 character(len=*),
intent(in) :: name_target
1947 character(len=*),
intent(in) :: mem_path_target
1951 logical(LGP) :: found
1955 if (
associated(sclr))
then
1961 mt%element_size = i4b
1963 write (mt%memtype,
"(a,' (',i0,')')")
'INTEGER', mt%isize
1967 mt%mastername = name_target
1968 mt%masterPath = mem_path_target
1975 logical(LGP),
dimension(:),
pointer,
contiguous,
intent(inout) :: alog
1976 character(len=*),
intent(in) :: name
1977 character(len=*),
intent(in) :: mem_path
1978 character(len=*),
intent(in) :: name_target
1979 character(len=*),
intent(in) :: mem_path_target
1983 logical(LGP) :: found
1987 if (
size(alog) > 0)
then
1991 alog => mt2%alogical1d
1992 mt%alogical1d => alog
1993 mt%element_size = lgp
1994 mt%isize =
size(alog)
1995 write (mt%memtype,
"(a,' (',i0,')')")
'LOGICAL', mt%isize
1999 mt%mastername = name_target
2000 mt%masterPath = mem_path_target
2006 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: aint
2007 character(len=*),
intent(in) :: name
2008 character(len=*),
intent(in) :: mem_path
2009 character(len=*),
intent(in) :: name_target
2010 character(len=*),
intent(in) :: mem_path_target
2014 logical(LGP) :: found
2018 if (
size(aint) > 0)
then
2024 mt%element_size = i4b
2025 mt%isize =
size(aint)
2026 write (mt%memtype,
"(a,' (',i0,')')")
'INTEGER', mt%isize
2030 mt%mastername = name_target
2031 mt%masterPath = mem_path_target
2037 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: aint
2038 character(len=*),
intent(in) :: name
2039 character(len=*),
intent(in) :: mem_path
2040 character(len=*),
intent(in) :: name_target
2041 character(len=*),
intent(in) :: mem_path_target
2045 logical(LGP) :: found
2046 integer(I4B) :: ncol
2047 integer(I4B) :: nrow
2051 if (
size(aint) > 0)
then
2057 mt%element_size = i4b
2058 mt%isize =
size(aint)
2059 ncol =
size(aint, dim=1)
2060 nrow =
size(aint, dim=2)
2061 write (mt%memtype,
"(a,' (',i0,',',i0,')')")
'INTEGER', ncol, nrow
2065 mt%mastername = name_target
2066 mt%masterPath = mem_path_target
2072 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: adbl
2073 character(len=*),
intent(in) :: name
2074 character(len=*),
intent(in) :: mem_path
2075 character(len=*),
intent(in) :: name_target
2076 character(len=*),
intent(in) :: mem_path_target
2080 logical(LGP) :: found
2084 if (
size(adbl) > 0)
then
2090 mt%element_size = dp
2091 mt%isize =
size(adbl)
2092 write (mt%memtype,
"(a,' (',i0,')')")
'DOUBLE', mt%isize
2096 mt%mastername = name_target
2097 mt%masterPath = mem_path_target
2103 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(inout) :: adbl
2104 character(len=*),
intent(in) :: name
2105 character(len=*),
intent(in) :: mem_path
2106 character(len=*),
intent(in) :: name_target
2107 character(len=*),
intent(in) :: mem_path_target
2111 logical(LGP) :: found
2112 integer(I4B) :: ncol
2113 integer(I4b) :: nrow
2117 if (
size(adbl) > 0)
then
2123 mt%element_size = dp
2124 mt%isize =
size(adbl)
2125 ncol =
size(adbl, dim=1)
2126 nrow =
size(adbl, dim=2)
2127 write (mt%memtype,
"(a,' (',i0,',',i0,')')")
'DOUBLE', ncol, nrow
2131 mt%mastername = name_target
2132 mt%masterPath = mem_path_target
2138 character(len=*),
pointer,
intent(inout) :: sclr
2139 character(len=*),
intent(in),
optional :: name
2140 character(len=*),
intent(in),
optional :: mem_path
2149 character(len=*),
dimension(:),
pointer,
contiguous,
intent(inout) :: astr1d
2150 character(len=*),
optional,
intent(in) :: name
2151 character(len=*),
optional,
intent(in) :: mem_path
2162 intent(inout) :: astr1d
2163 character(len=*),
optional,
intent(in) :: name
2164 character(len=*),
optional,
intent(in) :: mem_path
2172 logical(LGP),
pointer,
intent(inout) :: sclr
2180 integer(I4B),
pointer,
intent(inout) :: sclr
2188 real(DP),
pointer,
intent(inout) :: sclr
2196 logical(LGP),
dimension(:),
pointer,
contiguous,
intent(inout) :: alog
2197 character(len=*),
optional :: name
2198 character(len=*),
optional :: mem_path
2206 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: aint
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 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: adbl
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 integer(I4B),
intent(in) :: iout
2267 character(len=*),
intent(in) :: keyword
2268 character(len=*),
intent(inout) :: error_msg
2272 select case (keyword)
2275 write (iout,
'(4x, a)') &
2276 'LIMITED MEMORY INFORMATION WILL BE WRITTEN.'
2279 write (iout,
'(4x, a)') &
2280 'A SUMMARY OF SIMULATION MEMORY INFORMATION WILL BE WRITTEN.'
2283 write (iout,
'(4x, a)') &
2284 'ALL SIMULATION MEMORY INFORMATION WILL BE WRITTEN.'
2286 error_msg =
"Unknown memory print option '"//trim(keyword)//
"."
2293 integer(I4B),
intent(in) :: iout
2294 integer(I4B),
intent(in) :: nrows
2295 character(len=*),
intent(in) :: cunits
2297 character(len=LINELENGTH) :: title
2298 character(len=LINELENGTH) :: text
2299 integer(I4B) :: nterms
2305 title =
'SUMMARY INFORMATION ON VARIABLES STORED IN THE MEMORY MANAGER, '// &
2310 call memtab%table_df(nrows, nterms, iout)
2340 integer(I4B),
intent(in) :: iout
2341 integer(I4B),
intent(in) :: nrows
2343 character(len=LINELENGTH) :: title
2344 character(len=LINELENGTH) :: text
2345 integer(I4B) :: nterms
2351 title =
'DETAILED INFORMATION ON VARIABLES STORED IN THE MEMORY MANAGER'
2355 call memtab%table_df(nrows, nterms, iout)
2362 text =
'VARIABLE NAME'
2370 text =
'NUMBER OF ITEMS'
2374 text =
'ASSOCIATED VARIABLE'
2381 character(len=*),
intent(in) :: component
2382 real(DP),
intent(in) :: rchars
2383 real(DP),
intent(in) :: rlog
2384 real(DP),
intent(in) :: rint
2385 real(DP),
intent(in) :: rreal
2386 real(DP),
intent(in) :: bytes
2391 call memtab%add_term(component)
2392 call memtab%add_term(rchars)
2393 call memtab%add_term(rlog)
2394 call memtab%add_term(rint)
2395 call memtab%add_term(rreal)
2396 call memtab%add_term(bytes)
2403 real(DP),
intent(in) :: bytes
2404 real(DP),
intent(inout) :: fact
2405 character(len=*),
intent(inout) :: cunits
2415 if (bytes <
dep3)
then
2418 else if (bytes <
dep6)
then
2420 cunits =
'KILOBYTES'
2421 else if (bytes <
dep9)
then
2423 cunits =
'MEGABYTES'
2426 cunits =
'GIGABYTES'
2433 integer(I4B),
intent(in) :: iout
2434 real(DP),
intent(in) :: bytes
2436 character(len=LINELENGTH) :: title
2437 character(len=LINELENGTH) :: text
2438 character(LEN=10) :: cunits
2439 integer(I4B) :: nterms
2440 integer(I4B) :: nrows
2454 title =
'MEMORY MANAGER TOTAL STORAGE BY DATA TYPE, IN '//trim(cunits)
2458 call memtab%table_df(nrows, nterms, iout)
2465 text =
'ALLOCATED MEMORY'
2472 call memtab%add_term(
'Character')
2473 call memtab%add_term(smb)
2477 call memtab%add_term(
'Logical')
2478 call memtab%add_term(smb)
2482 call memtab%add_term(
'Integer')
2483 call memtab%add_term(smb)
2487 call memtab%add_term(
'Real')
2488 call memtab%add_term(smb)
2491 call memtab%print_separator()
2493 call memtab%add_term(
'Total')
2494 call memtab%add_term(smb)
2498 call memtab%add_term(
'Virtual')
2499 call memtab%add_term(smb)
2523 integer(I4B),
intent(in) :: iout
2526 character(len=LENMEMADDRESS),
allocatable,
dimension(:) :: cunique
2528 character(len=LENMEMPATH) :: context
2529 character(len=LENCOMPONENTNAME) :: component
2530 character(len=LENCOMPONENTNAME) :: subcomponent
2531 character(len=LENMEMADDRESS) :: context_component
2532 character(LEN=10) :: cunits
2534 integer(I4B) :: icomp
2535 integer(I4B) :: ilen
2536 integer(I8B) :: nchars
2537 integer(I8B) :: nlog
2538 integer(I8B) :: nint
2539 integer(I8B) :: nreal
2540 real(dp) :: simbytes
2555 simbytes = real(simbytes, dp)
2566 do icomp = 1,
size(cunique)
2572 ilen = len_trim(cunique(icomp))
2574 do while (itr%has_next())
2579 context_component = trim(context)//component
2580 if (cunique(icomp) /= context_component(1:ilen)) cycle
2581 if (.not. mt%master) cycle
2582 if (mt%memtype(1:6) ==
'STRING')
then
2583 nchars = nchars + mt%isize * mt%element_size
2584 else if (mt%memtype(1:7) ==
'LOGICAL')
then
2585 nlog = nlog + mt%isize
2586 else if (mt%memtype(1:7) ==
'INTEGER')
then
2587 nint = nint + mt%isize
2588 else if (mt%memtype(1:6) ==
'DOUBLE')
then
2589 nreal = nreal + mt%isize
2594 rchars = real(nchars, dp) * fact
2595 rlog = real(nlog * lgp, dp) * fact
2596 rint = real(nint * i4b, dp) * fact
2597 rreal = real(nreal * dp, dp) * fact
2600 bytes = rchars + rlog + rint + rreal
2618 integer(I4B) :: iout
2625 do while (itr%has_next())
2628 call mt%table_entry(
memtab)
2637 real(dp) :: vmem_size
2644 do while (itr%has_next())
2647 if (index(mt%path,
"__P") == 1)
then
2648 vmem_size = mt%element_size * mt%isize + vmem_size
2662 type(
memorytype),
pointer,
intent(inout) :: mt
2664 if (.not. mt%mt_associated())
return
2667 if (mt%memtype(1:6) ==
'STRING')
then
2671 if (mt%isize == 1)
then
2676 else if (mt%memtype(1:7) ==
'LOGICAL')
then
2678 else if (mt%memtype(1:7) ==
'INTEGER')
then
2680 else if (mt%memtype(1:6) ==
'DOUBLE')
then
2685 call mt%mt_deallocate()
2699 do while (itr%has_next())
2702 call mt%mt_deallocate()
2709 call store_error(
'Could not clear memory list.', terminate=.true.)
2719 character(len=LINELENGTH) :: error_msg
2720 character(len=LENVARNAME) :: ucname
2723 if (mt%mt_associated() .and. mt%element_size == -1)
then
2724 error_msg = trim(adjustl(mt%path))//
' '// &
2725 trim(adjustl(mt%name))//
' has invalid element size'
2730 if (mt%mt_associated() .and. mt%isize > 0)
then
2731 error_msg = trim(adjustl(mt%path))//
' '// &
2732 trim(adjustl(mt%name))//
' not deallocated'
2739 if (mt%name /= ucname)
then
2740 error_msg = trim(adjustl(mt%path))//
' '// &
2741 trim(adjustl(mt%name))//
' not upper case'
2753 character(len=LENMEMADDRESS),
allocatable,
dimension(:),
intent(inout) :: &
2757 character(len=LENMEMPATH) :: context
2758 character(len=LENCOMPONENTNAME) :: component
2759 character(len=LENCOMPONENTNAME) :: subcomponent
2760 character(len=LENMEMADDRESS) :: context_component
2766 allocate (cunique(0))
2770 do while (itr%has_next())
2775 context_component = trim(context)//component
2776 ipa =
ifind(cunique, context_component)
2779 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)
@ brief 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)
@ brief 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)
@ brief 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)
@ brief 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)
@ brief 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)
@ brief 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
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.