MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
memorymanagermodule Module Reference

Data Types

interface  mem_allocate
interface  mem_checkin
interface  mem_reallocate
interface  mem_setptr
interface  mem_copyptr
interface  mem_reassignptr
interface  mem_deallocate

Functions/Subroutines

subroutine, public get_mem_type (name, mem_path, var_type)
 Get the variable memory type.
subroutine, public get_mem_rank (name, mem_path, rank)
 Get the variable rank.
subroutine, public get_mem_elem_size (name, mem_path, size)
 Get the memory size of a single element of the stored variable.
subroutine, public get_mem_shape (name, mem_path, mem_shape)
 Get the variable memory shape.
subroutine, public get_isize (name, mem_path, isize)
 Get the number of elements for this variable.
subroutine, public get_from_memorystore (name, mem_path, mt, found, check)
 Get a memory type entry from the memory list.
subroutine allocate_error (varname, mem_path, istat, isize)
 Issue allocation error message and stop program execution.
subroutine allocate_logical (sclr, name, mem_path)
 Allocate a logical scalar.
subroutine allocate_logical1d (alog, nrow, name, mem_path)
 Allocate a 1-dimensional logical array.
subroutine allocate_str (sclr, ilen, name, mem_path)
 Allocate a character string.
subroutine allocate_str1d (astr1d, ilen, nrow, name, mem_path)
 Allocate a 1-dimensional defined length string array.
subroutine allocate_charstr1d (acharstr1d, ilen, nrow, name, mem_path)
 Allocate a 1-dimensional array of deferred-length CharacterStringType.
subroutine allocate_int (sclr, name, mem_path)
 Allocate a integer scalar.
subroutine allocate_int1d (aint, nrow, name, mem_path)
 Allocate a 1-dimensional integer array.
subroutine allocate_int2d (aint, ncol, nrow, name, mem_path)
 Allocate a 2-dimensional integer array.
subroutine allocate_int3d (aint, ncol, nrow, nlay, name, mem_path)
 Allocate a 3-dimensional integer array.
subroutine allocate_dbl (sclr, name, mem_path)
 Allocate a real scalar.
subroutine allocate_dbl1d (adbl, nrow, name, mem_path)
 Allocate a 1-dimensional real array.
subroutine allocate_dbl2d (adbl, ncol, nrow, name, mem_path)
 Allocate a 2-dimensional real array.
subroutine allocate_dbl3d (adbl, ncol, nrow, nlay, name, mem_path)
 Allocate a 3-dimensional real 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 checkin_int1d (aint, name, mem_path, name2, mem_path2)
 Check in an existing 1d integer array with a new address (name + path).
subroutine checkin_int2d (aint2d, name, mem_path, name2, mem_path2)
 Check in an existing 2d integer array with a new address (name + path).
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_dbl2d (adbl2d, name, mem_path, name2, mem_path2)
 Check in an existing 2d double precision array with a new address (name + path).
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 reallocate_str1d (astr, ilen, nrow, name, mem_path)
 Reallocate a 1-dimensional defined length string array.
subroutine reallocate_charstr1d (acharstr1d, ilen, nrow, name, mem_path)
 Reallocate a 1-dimensional deferred length string array.
subroutine reallocate_logical1d (alog, nrow, name, mem_path)
 Reallocate a 1-dimensional logical array.
subroutine reallocate_int1d (aint, nrow, name, mem_path)
 Reallocate a 1-dimensional integer array.
subroutine reallocate_int2d (aint, ncol, nrow, name, mem_path)
 Reallocate a 2-dimensional integer array.
subroutine reallocate_dbl1d (adbl, nrow, name, mem_path)
 Reallocate a 1-dimensional real array.
subroutine reallocate_dbl2d (adbl, ncol, nrow, name, mem_path)
 Reallocate a 2-dimensional real array.
subroutine setptr_logical (sclr, name, mem_path)
 Set pointer to a logical scalar.
subroutine setptr_int (sclr, name, mem_path)
 Set pointer to integer scalar.
subroutine setptr_logical1d (alog, name, mem_path)
 Set pointer to 1d logical array.
subroutine setptr_int1d (aint, name, mem_path)
 Set pointer to 1d integer array.
subroutine setptr_int2d (aint, name, mem_path)
 Set pointer to 2d integer array.
subroutine setptr_int3d (aint, name, mem_path)
 Set pointer to 3d integer array.
subroutine setptr_dbl (sclr, name, mem_path)
 Set pointer to a real scalar.
subroutine setptr_dbl1d (adbl, name, mem_path)
 Set pointer to a 1d real array.
subroutine setptr_dbl2d (adbl, name, mem_path)
 Set pointer to a 2d real array.
subroutine setptr_dbl3d (adbl, name, mem_path)
 Set pointer to a 3d real array.
subroutine setptr_str (asrt, name, mem_path)
 Set pointer to a string (scalar).
subroutine setptr_str1d (astr1d, name, mem_path)
 Set pointer to a fixed-length string array.
subroutine setptr_charstr1d (acharstr1d, name, mem_path)
 Set pointer to an array of CharacterStringType.
subroutine copyptr_logical1d (alog, name, mem_path, mem_path_copy)
 Make a copy of a 1-dimensional logical array.
subroutine copyptr_int1d (aint, name, mem_path, mem_path_copy)
 Make a copy of a 1-dimensional integer array.
subroutine copyptr_int2d (aint, name, mem_path, mem_path_copy)
 Make a copy of a 2-dimensional integer array.
subroutine copyptr_dbl1d (adbl, name, mem_path, mem_path_copy)
 Make a copy of a 1-dimensional real array.
subroutine copyptr_dbl2d (adbl, name, mem_path, mem_path_copy)
 Make a copy of a 2-dimensional real array.
subroutine, public copy_dbl1d (adbl, name, mem_path)
 Copy values from a 1-dimensional real array in the memory.
subroutine reassignptr_int (sclr, name, mem_path, name_target, mem_path_target)
 Set the pointer for an integer scalar to.
subroutine reassignptr_logical1d (alog, name, mem_path, name_target, mem_path_target)
 Set the pointer for a 1-dimensional logical array to.
subroutine reassignptr_int1d (aint, name, mem_path, name_target, mem_path_target)
 Set the pointer for a 1-dimensional integer array to.
subroutine reassignptr_int2d (aint, name, mem_path, name_target, mem_path_target)
 Set the pointer for a 2-dimensional integer array to.
subroutine reassignptr_dbl1d (adbl, name, mem_path, name_target, mem_path_target)
 Set the pointer for a 1-dimensional real array to.
subroutine reassignptr_dbl2d (adbl, name, mem_path, name_target, mem_path_target)
 Set the pointer for a 2-dimensional real array to.
subroutine deallocate_str (sclr, name, mem_path)
 DEPRECATED. The memory manager will handle the deallocation of the pointer.
subroutine deallocate_str1d (astr1d, name, mem_path)
 Deallocate an array of defined-length character strings.
subroutine deallocate_charstr1d (astr1d, name, mem_path)
 DEPRECATED. The memory manager will handle the deallocation of the pointer.
subroutine deallocate_logical (sclr)
 DEPRECATED. The memory manager will handle the deallocation of the pointer.
subroutine deallocate_int (sclr)
 DEPRECATED. The memory manager will handle the deallocation of the pointer.
subroutine deallocate_dbl (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.
subroutine deallocate_int1d (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 deallocate_int3d (aint, name, mem_path)
 DEPRECATED. The memory manager will handle the deallocation of the pointer.
subroutine deallocate_dbl1d (adbl, name, mem_path)
 DEPRECATED. The memory manager will handle the deallocation of the pointer.
subroutine deallocate_dbl2d (adbl, name, mem_path)
 DEPRECATED. The memory manager will handle the deallocation of the pointer.
subroutine deallocate_dbl3d (adbl, name, mem_path)
 DEPRECATED. The memory manager will handle the deallocation of the pointer.
subroutine, public mem_set_print_option (iout, keyword, error_msg)
 Set the memory print option.
subroutine mem_summary_table (iout, nrows, cunits)
 Create a table if memory_print_option is 'SUMMARY'.
subroutine mem_detailed_table (iout, nrows)
 Create a table if memory_print_option is 'ALL'.
subroutine mem_summary_line (component, rchars, rlog, rint, rreal, bytes)
 Write a row for the memory_print_option 'SUMMARY' table.
subroutine mem_units (bytes, fact, cunits)
 Determine appropriate memory unit and conversion factor.
subroutine mem_summary_total (iout, bytes)
 Create and fill a table with the total allocated memory.
subroutine mem_cleanup_table ()
 Generic function to clean a memory manager table.
subroutine, public mem_write_usage (iout)
 Write memory manager memory usage based on the user-specified memory_print_option.
subroutine, public mem_print_detailed (iout)
real(dp) function calc_virtual_mem ()
 Sum up virtual memory, i.e. memory.
subroutine, public mem_release (mt)
 Release a memory store entry: deallocate data and update counters.
subroutine, public mem_da ()
 Deallocate memory in the memory manager.
subroutine mem_da_check (mt)
subroutine mem_unique_origins (cunique)
 Create a array with unique first components from all memory paths. Only the first component of the memory path is evaluated.

Variables

type(memorystoretype), public memorystore
type(tabletype), pointer memtab => null()
integer(i8b) nvalues_alogical = 0
integer(i8b) nvalues_astr = 0
integer(i8b) nvalues_aint = 0
integer(i8b) nvalues_adbl = 0
integer(i4b) iprmem = 0

Function/Subroutine Documentation

◆ allocate_charstr1d()

subroutine memorymanagermodule::allocate_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]acharstr1dvariable for allocation
[in]ilenstring length
[in]nrownumber of strings in array
[in]namevariable name
[in]mem_pathpath where the variable is stored

Definition at line 556 of file MemoryManager.f90.

557 type(CharacterStringType), dimension(:), &
558 pointer, contiguous, intent(inout) :: acharstr1d !< variable for allocation
559 integer(I4B), intent(in) :: ilen !< string length
560 integer(I4B), intent(in) :: nrow !< number of strings in array
561 character(len=*), intent(in) :: name !< variable name
562 character(len=*), intent(in) :: mem_path !< path where the variable is stored
563 ! -- local variables
564 character(len=ilen) :: string
565 type(MemoryType), pointer :: mt
566 integer(I4B) :: n
567 integer(I4B) :: istat
568 integer(I4B) :: isize
569 ! -- code
570 !
571 ! -- initialize string
572 string = ''
573 !
574 ! -- check variable name length
575 call mem_check_length(name, lenvarname, "variable")
576 !
577 ! -- calculate isize
578 isize = nrow
579 !
580 ! -- allocate deferred length string array
581 allocate (acharstr1d(nrow), stat=istat, errmsg=errmsg)
582 !
583 ! -- check for error condition
584 if (istat /= 0) then
585 call allocate_error(name, mem_path, istat, isize)
586 end if
587 !
588 ! -- fill deferred length string with empty string
589 do n = 1, nrow
590 acharstr1d(n) = string
591 end do
592 !
593 ! -- update counter
594 nvalues_astr = nvalues_astr + isize
595 !
596 ! -- allocate memory type
597 allocate (mt)
598 !
599 ! -- set memory type
600 mt%acharstr1d => acharstr1d
601 mt%element_size = ilen
602 mt%isize = isize
603 mt%name = name
604 mt%path = mem_path
605 write (mt%memtype, "(a,' LEN=',i0,' (',i0,')')") 'STRING', ilen, nrow
606 !
607 ! -- add deferred length character array to the memory manager list
608 call memorystore%add(mt)

◆ allocate_dbl()

subroutine memorymanagermodule::allocate_dbl ( real(dp), intent(inout), pointer sclr,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
[in,out]sclrvariable for allocation
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 784 of file MemoryManager.f90.

785 real(DP), pointer, intent(inout) :: sclr !< variable for allocation
786 character(len=*), intent(in) :: name !< variable name
787 character(len=*), intent(in) :: mem_path !< path where variable is stored
788 ! -- local
789 type(MemoryType), pointer :: mt
790 integer(I4B) :: istat
791 ! -- code
792 !
793 ! -- check variable name length
794 call mem_check_length(name, lenvarname, "variable")
795 !
796 ! -- allocate real scalar
797 allocate (sclr, stat=istat, errmsg=errmsg)
798 if (istat /= 0) then
799 call allocate_error(name, mem_path, istat, 1)
800 end if
801 !
802 ! -- update counter
803 nvalues_adbl = nvalues_adbl + 1
804 !
805 ! -- allocate memory type
806 allocate (mt)
807 !
808 ! -- set memory type
809 mt%dblsclr => sclr
810 mt%element_size = dp
811 mt%isize = 1
812 mt%name = name
813 mt%path = mem_path
814 write (mt%memtype, "(a)") 'DOUBLE'
815 !
816 ! -- add memory type to the memory list
817 call memorystore%add(mt)

◆ allocate_dbl1d()

subroutine memorymanagermodule::allocate_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]adblvariable for allocation
[in]nrownumber of rows
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 822 of file MemoryManager.f90.

823 real(DP), dimension(:), pointer, contiguous, intent(inout) :: adbl !< variable for allocation
824 integer(I4B), intent(in) :: nrow !< number of rows
825 character(len=*), intent(in) :: name !< variable name
826 character(len=*), intent(in) :: mem_path !< path where variable is stored
827 ! -- local
828 type(MemoryType), pointer :: mt
829 integer(I4B) :: istat
830 integer(I4B) :: isize
831 ! -- code
832 !
833 ! -- check the variable name length
834 call mem_check_length(name, lenvarname, "variable")
835 !
836 ! -- set isize
837 isize = nrow
838 !
839 ! -- allocate the real array
840 allocate (adbl(nrow), stat=istat, errmsg=errmsg)
841 if (istat /= 0) then
842 call allocate_error(name, mem_path, istat, isize)
843 end if
844 !
845 ! -- update counter
846 nvalues_adbl = nvalues_adbl + isize
847 !
848 ! -- allocate memory type
849 allocate (mt)
850 !
851 ! -- set memory type
852 mt%adbl1d => adbl
853 mt%element_size = dp
854 mt%isize = isize
855 mt%name = name
856 mt%path = mem_path
857 write (mt%memtype, "(a,' (',i0,')')") 'DOUBLE', isize
858 !
859 ! -- add memory type to the memory list
860 call memorystore%add(mt)
Here is the caller graph for this function:

◆ allocate_dbl2d()

subroutine memorymanagermodule::allocate_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]adblvariable for allocation
[in]ncolnumber of columns
[in]nrownumber of rows
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 865 of file MemoryManager.f90.

866 real(DP), dimension(:, :), pointer, contiguous, intent(inout) :: adbl !< variable for allocation
867 integer(I4B), intent(in) :: ncol !< number of columns
868 integer(I4B), intent(in) :: nrow !< number of rows
869 character(len=*), intent(in) :: name !< variable name
870 character(len=*), intent(in) :: mem_path !< path where variable is stored
871 ! -- local
872 type(MemoryType), pointer :: mt
873 integer(I4B) :: istat
874 integer(I4B) :: isize
875 ! -- code
876 !
877 ! -- check the variable name length
878 call mem_check_length(name, lenvarname, "variable")
879 !
880 ! -- set isize
881 isize = ncol * nrow
882 !
883 ! -- allocate the real array
884 allocate (adbl(ncol, nrow), stat=istat, errmsg=errmsg)
885 if (istat /= 0) then
886 call allocate_error(name, mem_path, istat, isize)
887 end if
888 !
889 ! -- update counter
890 nvalues_adbl = nvalues_adbl + isize
891 !
892 ! -- allocate memory type
893 allocate (mt)
894 !
895 ! -- set memory type
896 mt%adbl2d => adbl
897 mt%element_size = dp
898 mt%isize = isize
899 mt%name = name
900 mt%path = mem_path
901 write (mt%memtype, "(a,' (',i0,',',i0,')')") 'DOUBLE', ncol, nrow
902 !
903 ! -- add memory type to the memory list
904 call memorystore%add(mt)
Here is the caller graph for this function:

◆ allocate_dbl3d()

subroutine memorymanagermodule::allocate_dbl3d ( real(dp), dimension(:, :, :), intent(inout), pointer, contiguous adbl,
integer(i4b), intent(in) ncol,
integer(i4b), intent(in) nrow,
integer(i4b), intent(in) nlay,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
[in,out]adblvariable for allocation
[in]ncolnumber of columns
[in]nrownumber of rows
[in]nlaynumber of layers
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 909 of file MemoryManager.f90.

910 real(DP), dimension(:, :, :), pointer, contiguous, intent(inout) :: adbl !< variable for allocation
911 integer(I4B), intent(in) :: ncol !< number of columns
912 integer(I4B), intent(in) :: nrow !< number of rows
913 integer(I4B), intent(in) :: nlay !< number of layers
914 character(len=*), intent(in) :: name !< variable name
915 character(len=*), intent(in) :: mem_path !< path where variable is stored
916 ! -- local
917 type(MemoryType), pointer :: mt
918 integer(I4B) :: istat
919 integer(I4B) :: isize
920 ! -- code
921 !
922 ! -- check the variable name length
923 call mem_check_length(name, lenvarname, "variable")
924 !
925 ! -- set isize
926 isize = ncol * nrow * nlay
927 !
928 ! -- allocate the real array
929 allocate (adbl(ncol, nrow, nlay), stat=istat, errmsg=errmsg)
930 if (istat /= 0) then
931 call allocate_error(name, mem_path, istat, isize)
932 end if
933 !
934 ! -- update the counter
935 nvalues_adbl = nvalues_adbl + isize
936 !
937 ! -- allocate memory type
938 allocate (mt)
939 !
940 ! -- set memory type
941 mt%adbl3d => adbl
942 mt%element_size = dp
943 mt%isize = isize
944 mt%name = name
945 mt%path = mem_path
946 write (mt%memtype, "(a,' (',i0,',',i0,',',i0,')')") 'DOUBLE', ncol, &
947 nrow, nlay
948 !
949 ! -- add memory type to the memory list
950 call memorystore%add(mt)

◆ allocate_error()

subroutine memorymanagermodule::allocate_error ( character(len=*), intent(in) varname,
character(len=*), intent(in) mem_path,
integer(i4b), intent(in) istat,
integer(i4b), intent(in) isize )
private
Parameters
[in]varnamevariable name
[in]mem_pathpath where the variable is stored
[in]istatstatus code
[in]isizesize of allocation

Definition at line 336 of file MemoryManager.f90.

337 character(len=*), intent(in) :: varname !< variable name
338 character(len=*), intent(in) :: mem_path !< path where the variable is stored
339 integer(I4B), intent(in) :: istat !< status code
340 integer(I4B), intent(in) :: isize !< size of allocation
341 ! -- local
342 character(len=20) :: csize
343 character(len=20) :: cstat
344 ! -- code
345 !
346 ! -- initialize character variables
347 write (csize, '(i0)') isize
348 write (cstat, '(i0)') istat
349 !
350 ! -- create error message
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)//'.'
355 !
356 ! -- store error and stop program execution
357 call store_error(errmsg, terminate=.true.)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ allocate_int()

subroutine memorymanagermodule::allocate_int ( integer(i4b), intent(inout), pointer sclr,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
[in,out]sclrvariable for allocation
[in]namevariable name
[in]mem_pathpath where the variable is stored

Definition at line 613 of file MemoryManager.f90.

614 integer(I4B), pointer, intent(inout) :: sclr !< variable for allocation
615 character(len=*), intent(in) :: name !< variable name
616 character(len=*), intent(in) :: mem_path !< path where the variable is stored
617 ! -- local
618 type(MemoryType), pointer :: mt
619 integer(I4B) :: istat
620 ! -- code
621 !
622 ! -- check variable name length
623 call mem_check_length(name, lenvarname, "variable")
624 !
625 ! -- allocate integer scalar
626 allocate (sclr, stat=istat, errmsg=errmsg)
627 if (istat /= 0) then
628 call allocate_error(name, mem_path, istat, 1)
629 end if
630 !
631 ! -- update counter
632 nvalues_aint = nvalues_aint + 1
633 !
634 ! -- allocate memory type
635 allocate (mt)
636 !
637 ! -- set memory type
638 mt%intsclr => sclr
639 mt%element_size = i4b
640 mt%isize = 1
641 mt%name = name
642 mt%path = mem_path
643 write (mt%memtype, "(a)") 'INTEGER'
644 !
645 ! -- add memory type to the memory list
646 call memorystore%add(mt)

◆ allocate_int1d()

subroutine memorymanagermodule::allocate_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]aintvariable for allocation
[in]nrowinteger array number of rows
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 651 of file MemoryManager.f90.

652 integer(I4B), dimension(:), pointer, contiguous, intent(inout) :: aint !< variable for allocation
653 integer(I4B), intent(in) :: nrow !< integer array number of rows
654 character(len=*), intent(in) :: name !< variable name
655 character(len=*), intent(in) :: mem_path !< path where variable is stored
656 ! --local
657 type(MemoryType), pointer :: mt
658 integer(I4B) :: istat
659 integer(I4B) :: isize
660 ! -- code
661 !
662 ! -- check variable name length
663 call mem_check_length(name, lenvarname, "variable")
664 !
665 ! -- set isize
666 isize = nrow
667 !
668 ! -- allocate integer array
669 allocate (aint(nrow), stat=istat, errmsg=errmsg)
670 if (istat /= 0) then
671 call allocate_error(name, mem_path, istat, isize)
672 end if
673 !
674 ! -- update counter
675 nvalues_aint = nvalues_aint + isize
676 !
677 ! -- allocate memory type
678 allocate (mt)
679 !
680 ! -- set memory type
681 mt%aint1d => aint
682 mt%element_size = i4b
683 mt%isize = isize
684 mt%name = name
685 mt%path = mem_path
686 write (mt%memtype, "(a,' (',i0,')')") 'INTEGER', isize
687 !
688 ! -- add memory type to the memory list
689 call memorystore%add(mt)
Here is the caller graph for this function:

◆ allocate_int2d()

subroutine memorymanagermodule::allocate_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]aintvariable for allocation
[in]ncolnumber of columns
[in]nrownumber of rows
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 694 of file MemoryManager.f90.

695 integer(I4B), dimension(:, :), pointer, contiguous, intent(inout) :: aint !< variable for allocation
696 integer(I4B), intent(in) :: ncol !< number of columns
697 integer(I4B), intent(in) :: nrow !< number of rows
698 character(len=*), intent(in) :: name !< variable name
699 character(len=*), intent(in) :: mem_path !< path where variable is stored
700 ! -- local
701 type(MemoryType), pointer :: mt
702 integer(I4B) :: istat
703 integer(I4B) :: isize
704 ! -- code
705 !
706 ! -- check the variable name length
707 call mem_check_length(name, lenvarname, "variable")
708 !
709 ! -- set isize
710 isize = ncol * nrow
711 !
712 ! -- allocate the integer array
713 allocate (aint(ncol, nrow), stat=istat, errmsg=errmsg)
714 if (istat /= 0) then
715 call allocate_error(name, mem_path, istat, isize)
716 end if
717 !
718 ! -- update the counter
719 nvalues_aint = nvalues_aint + isize
720 !
721 ! -- allocate memory type
722 allocate (mt)
723 !
724 ! -- set memory type
725 mt%aint2d => aint
726 mt%element_size = i4b
727 mt%isize = isize
728 mt%name = name
729 mt%path = mem_path
730 write (mt%memtype, "(a,' (',i0,',',i0,')')") 'INTEGER', ncol, nrow
731 !
732 ! -- add memory type to the memory list
733 call memorystore%add(mt)
Here is the caller graph for this function:

◆ allocate_int3d()

subroutine memorymanagermodule::allocate_int3d ( integer(i4b), dimension(:, :, :), intent(inout), pointer, contiguous aint,
integer(i4b), intent(in) ncol,
integer(i4b), intent(in) nrow,
integer(i4b), intent(in) nlay,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
[in,out]aintvariable for allocation
[in]ncolnumber of columns
[in]nrownumber of rows
[in]nlaynumber of layers
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 738 of file MemoryManager.f90.

739 integer(I4B), dimension(:, :, :), pointer, contiguous, intent(inout) :: aint !< variable for allocation
740 integer(I4B), intent(in) :: ncol !< number of columns
741 integer(I4B), intent(in) :: nrow !< number of rows
742 integer(I4B), intent(in) :: nlay !< number of layers
743 character(len=*), intent(in) :: name !< variable name
744 character(len=*), intent(in) :: mem_path !< path where variable is stored
745 ! -- local
746 type(MemoryType), pointer :: mt
747 integer(I4B) :: istat
748 integer(I4B) :: isize
749 ! -- code
750 !
751 ! -- check variable name length
752 call mem_check_length(name, lenvarname, "variable")
753 !
754 ! -- set isize
755 isize = ncol * nrow * nlay
756 !
757 ! -- allocate integer array
758 allocate (aint(ncol, nrow, nlay), stat=istat, errmsg=errmsg)
759 if (istat /= 0) then
760 call allocate_error(name, mem_path, istat, isize)
761 end if
762 !
763 ! -- update counter
764 nvalues_aint = nvalues_aint + isize
765 !
766 ! -- allocate memory type
767 allocate (mt)
768 !
769 ! -- set memory type
770 mt%aint3d => aint
771 mt%element_size = i4b
772 mt%isize = isize
773 mt%name = name
774 mt%path = mem_path
775 write (mt%memtype, "(a,' (',i0,',',i0,',',i0,')')") 'INTEGER', ncol, &
776 nrow, nlay
777 !
778 ! -- add memory type to the memory list
779 call memorystore%add(mt)

◆ allocate_logical()

subroutine memorymanagermodule::allocate_logical ( logical(lgp), intent(inout), pointer sclr,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
[in,out]sclrvariable for allocation
[in]namevariable name
[in]mem_pathpath where the variable is stored

Definition at line 362 of file MemoryManager.f90.

363 logical(LGP), pointer, intent(inout) :: sclr !< variable for allocation
364 character(len=*), intent(in) :: name !< variable name
365 character(len=*), intent(in) :: mem_path !< path where the variable is stored
366 ! -- local
367 integer(I4B) :: istat
368 type(MemoryType), pointer :: mt
369 ! -- code
370 !
371 ! -- check variable name length
372 call mem_check_length(name, lenvarname, "variable")
373 !
374 ! -- allocate the logical scalar
375 allocate (sclr, stat=istat, errmsg=errmsg)
376 if (istat /= 0) then
377 call allocate_error(name, mem_path, istat, 1)
378 end if
379 !
380 ! -- update counter
381 nvalues_alogical = nvalues_alogical + 1
382 !
383 ! -- allocate memory type
384 allocate (mt)
385 !
386 ! -- set memory type
387 mt%logicalsclr => sclr
388 mt%element_size = lgp
389 mt%isize = 1
390 mt%name = name
391 mt%path = mem_path
392 write (mt%memtype, "(a)") 'LOGICAL'
393 !
394 ! -- add memory type to the memory list
395 call memorystore%add(mt)

◆ allocate_logical1d()

subroutine memorymanagermodule::allocate_logical1d ( logical(lgp), dimension(:), intent(inout), pointer, contiguous alog,
integer(i4b), intent(in) nrow,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
[in,out]alogvariable for allocation
[in]nrownumber of rows
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 400 of file MemoryManager.f90.

401 logical(LGP), dimension(:), pointer, contiguous, intent(inout) :: alog !< variable for allocation
402 integer(I4B), intent(in) :: nrow !< number of rows
403 character(len=*), intent(in) :: name !< variable name
404 character(len=*), intent(in) :: mem_path !< path where variable is stored
405 ! --local
406 type(MemoryType), pointer :: mt
407 integer(I4B) :: istat
408 integer(I4B) :: isize
409 ! -- code
410 !
411 ! -- check variable name length
412 call mem_check_length(name, lenvarname, "variable")
413 !
414 ! -- set isize
415 isize = nrow
416 !
417 ! -- allocate logical array
418 allocate (alog(nrow), stat=istat, errmsg=errmsg)
419 if (istat /= 0) then
420 call allocate_error(name, mem_path, istat, isize)
421 end if
422 !
423 ! -- update counter
424 nvalues_alogical = nvalues_alogical + isize
425 !
426 ! -- allocate memory type
427 allocate (mt)
428 !
429 ! -- set memory type
430 mt%alogical1d => alog
431 mt%element_size = lgp
432 mt%isize = isize
433 mt%name = name
434 mt%path = mem_path
435 write (mt%memtype, "(a,' (',i0,')')") 'LOGICAL', isize
436 !
437 ! -- add memory type to the memory list
438 call memorystore%add(mt)
Here is the caller graph for this function:

◆ allocate_str()

subroutine memorymanagermodule::allocate_str ( character(len=ilen), intent(inout), pointer sclr,
integer(i4b), intent(in) ilen,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
[in]ilenstring length
[in,out]sclrvariable for allocation
[in]namevariable name
[in]mem_pathpath where the variable is stored

Definition at line 443 of file MemoryManager.f90.

444 integer(I4B), intent(in) :: ilen !< string length
445 character(len=ilen), pointer, intent(inout) :: sclr !< variable for allocation
446 character(len=*), intent(in) :: name !< variable name
447 character(len=*), intent(in) :: mem_path !< path where the variable is stored
448 ! -- local
449 integer(I4B) :: istat
450 type(MemoryType), pointer :: mt
451 ! -- format
452 ! -- code
453 !
454 ! -- make sure ilen is greater than 0
455 if (ilen < 1) then
456 errmsg = 'Programming error in allocate_str. ILEN must be greater than 0.'
457 call store_error(errmsg, terminate=.true.)
458 end if
459 !
460 ! -- check variable name length
461 call mem_check_length(name, lenvarname, "variable")
462 !
463 ! -- allocate string
464 allocate (character(len=ilen) :: sclr, stat=istat, errmsg=errmsg)
465 if (istat /= 0) then
466 call allocate_error(name, mem_path, istat, 1)
467 end if
468 !
469 ! -- set sclr to a empty string
470 sclr = ' '
471 !
472 ! -- update counter
473 nvalues_astr = nvalues_astr + ilen
474 !
475 ! -- allocate memory type
476 allocate (mt)
477 !
478 ! -- set memory type
479 mt%strsclr => sclr
480 mt%element_size = ilen
481 mt%isize = 1
482 mt%name = name
483 mt%path = mem_path
484 write (mt%memtype, "(a,' LEN=',i0)") 'STRING', ilen
485 !
486 ! -- add defined length string to the memory manager list
487 call memorystore%add(mt)

◆ allocate_str1d()

subroutine memorymanagermodule::allocate_str1d ( character(len=ilen), dimension(:), intent(inout), pointer, contiguous astr1d,
integer(i4b), intent(in) ilen,
integer(i4b), intent(in) nrow,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
[in]ilenstring length
[in,out]astr1dvariable for allocation
[in]nrownumber of strings in array
[in]namevariable name
[in]mem_pathpath where the variable is stored

Definition at line 492 of file MemoryManager.f90.

493 integer(I4B), intent(in) :: ilen !< string length
494 character(len=ilen), dimension(:), &
495 pointer, contiguous, intent(inout) :: astr1d !< variable for allocation
496 integer(I4B), intent(in) :: nrow !< number of strings in array
497 character(len=*), intent(in) :: name !< variable name
498 character(len=*), intent(in) :: mem_path !< path where the variable is stored
499 ! -- local variables
500 type(MemoryType), pointer :: mt
501 character(len=ilen) :: string
502 integer(I4B) :: n
503 integer(I4B) :: istat
504 integer(I4B) :: isize
505 ! -- code
506 !
507 ! -- initialize string
508 string = ''
509 !
510 ! -- make sure ilen is greater than 0
511 if (ilen < 1) then
512 errmsg = 'Programming error in allocate_str1d. '// &
513 'ILEN must be greater than 0.'
514 call store_error(errmsg, terminate=.true.)
515 end if
516 !
517 ! -- check variable name length
518 call mem_check_length(name, lenvarname, "variable")
519 !
520 ! -- calculate isize
521 isize = nrow
522 !
523 ! -- allocate defined length string array
524 allocate (character(len=ilen) :: astr1d(nrow), stat=istat, errmsg=errmsg)
525 !
526 ! -- check for error condition
527 if (istat /= 0) then
528 call allocate_error(name, mem_path, istat, isize)
529 end if
530 !
531 ! -- fill deferred length string with empty string
532 do n = 1, nrow
533 astr1d(n) = string
534 end do
535 !
536 ! -- update counter
537 nvalues_astr = nvalues_astr + isize
538 !
539 ! -- allocate memory type
540 allocate (mt)
541 !
542 ! -- set memory type
543 mt%astr1d => astr1d
544 mt%element_size = ilen
545 mt%isize = isize
546 mt%name = name
547 mt%path = mem_path
548 write (mt%memtype, "(a,' LEN=',i0,' (',i0,')')") 'STRING', ilen, nrow
549 !
550 ! -- add deferred length character array to the memory manager list
551 call memorystore%add(mt)

◆ calc_virtual_mem()

real(dp) function memorymanagermodule::calc_virtual_mem
private

Definition at line 2646 of file MemoryManager.f90.

2647 real(DP) :: vmem_size
2648 ! local
2649 type(MemoryContainerIteratorType), allocatable :: itr
2650 type(MemoryType), pointer :: mt
2651
2652 vmem_size = dzero
2653 itr = memorystore%iterator()
2654 do while (itr%has_next())
2655 call itr%next()
2656 mt => itr%value()
2657 if (index(mt%path, "__P") == 1) then
2658 vmem_size = mt%element_size * mt%isize + vmem_size
2659 end if
2660 end do
2661
Here is the caller graph for this function:

◆ checkin_charstr1d()

subroutine memorymanagermodule::checkin_charstr1d ( type(characterstringtype), dimension(:), intent(inout), pointer, contiguous acharstr1d,
integer(i4b), intent(in) ilen,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
character(len=*), intent(in) name2,
character(len=*), intent(in) mem_path2 )
private
Parameters
[in,out]acharstr1dthe existing array
[in]namenew variable name
[in]mem_pathnew path where variable is stored
[in]name2existing variable name
[in]mem_path2existing path where variable is stored

Definition at line 1152 of file MemoryManager.f90.

1153 type(CharacterStringType), dimension(:), &
1154 pointer, contiguous, intent(inout) :: acharstr1d !< the existing array
1155 integer(I4B), intent(in) :: ilen
1156 character(len=*), intent(in) :: name !< new variable name
1157 character(len=*), intent(in) :: mem_path !< new path where variable is stored
1158 character(len=*), intent(in) :: name2 !< existing variable name
1159 character(len=*), intent(in) :: mem_path2 !< existing path where variable is stored
1160 ! --local
1161 type(MemoryType), pointer :: mt
1162 integer(I4B) :: isize
1163 ! -- code
1164 !
1165 ! -- check variable name length
1166 call mem_check_length(name, lenvarname, "variable")
1167 !
1168 ! -- set isize
1169 isize = size(acharstr1d)
1170 !
1171 ! -- allocate memory type
1172 allocate (mt)
1173 !
1174 ! -- set memory type
1175 mt%acharstr1d => acharstr1d
1176 mt%element_size = ilen
1177 mt%isize = isize
1178 mt%name = name
1179 mt%path = mem_path
1180 write (mt%memtype, "(a,' LEN=',i0,' (',i0,')')") 'STRING', ilen, isize
1181 !
1182 ! -- set master information
1183 mt%master = .false.
1184 mt%mastername = name2
1185 mt%masterPath = mem_path2
1186 !
1187 ! -- add memory type to the memory list
1188 call memorystore%add(mt)

◆ checkin_dbl1d()

subroutine memorymanagermodule::checkin_dbl1d ( real(dp), dimension(:), intent(inout), pointer, contiguous adbl,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
character(len=*), intent(in) name2,
character(len=*), intent(in) mem_path2 )
private
Parameters
[in,out]adblthe existing array
[in]namenew variable name
[in]mem_pathnew path where variable is stored
[in]name2existing variable name
[in]mem_path2existing path where variable is stored

Definition at line 1073 of file MemoryManager.f90.

1074 real(DP), dimension(:), pointer, contiguous, intent(inout) :: adbl !< the existing array
1075 character(len=*), intent(in) :: name !< new variable name
1076 character(len=*), intent(in) :: mem_path !< new path where variable is stored
1077 character(len=*), intent(in) :: name2 !< existing variable name
1078 character(len=*), intent(in) :: mem_path2 !< existing path where variable is stored
1079 ! -- local
1080 type(MemoryType), pointer :: mt
1081 integer(I4B) :: isize
1082 ! -- code
1083 !
1084 ! -- check the variable name length
1085 call mem_check_length(name, lenvarname, "variable")
1086 !
1087 ! -- set isize
1088 isize = size(adbl)
1089 !
1090 ! -- allocate memory type
1091 allocate (mt)
1092 !
1093 ! -- set memory type
1094 mt%adbl1d => adbl
1095 mt%element_size = dp
1096 mt%isize = isize
1097 mt%name = name
1098 mt%path = mem_path
1099 write (mt%memtype, "(a,' (',i0,')')") 'DOUBLE', isize
1100 !
1101 ! -- set master information
1102 mt%master = .false.
1103 mt%mastername = name2
1104 mt%masterPath = mem_path2
1105 !
1106 ! -- add memory type to the memory list
1107 call memorystore%add(mt)

◆ checkin_dbl2d()

subroutine memorymanagermodule::checkin_dbl2d ( real(dp), dimension(:, :), intent(inout), pointer, contiguous adbl2d,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
character(len=*), intent(in) name2,
character(len=*), intent(in) mem_path2 )
private
Parameters
[in,out]adbl2dthe existing 2d array
[in]namenew variable name
[in]mem_pathnew path where variable is stored
[in]name2existing variable name
[in]mem_path2existing path where variable is stored

Definition at line 1112 of file MemoryManager.f90.

1113 real(DP), dimension(:, :), pointer, contiguous, intent(inout) :: adbl2d !< the existing 2d array
1114 character(len=*), intent(in) :: name !< new variable name
1115 character(len=*), intent(in) :: mem_path !< new path where variable is stored
1116 character(len=*), intent(in) :: name2 !< existing variable name
1117 character(len=*), intent(in) :: mem_path2 !< existing path where variable is stored
1118 ! -- local
1119 type(MemoryType), pointer :: mt
1120 integer(I4B) :: ncol, nrow, isize
1121 ! -- code
1122 !
1123 ! -- check the variable name length
1124 call mem_check_length(name, lenvarname, "variable")
1125 !
1126 ! -- set isize
1127 ncol = size(adbl2d, dim=1)
1128 nrow = size(adbl2d, dim=2)
1129 isize = ncol * nrow
1130 !
1131 ! -- allocate memory type
1132 allocate (mt)
1133 !
1134 ! -- set memory type
1135 mt%adbl2d => adbl2d
1136 mt%isize = isize
1137 mt%name = name
1138 mt%path = mem_path
1139 write (mt%memtype, "(a,' (',i0,',',i0,')')") 'DOUBLE', ncol, nrow
1140 !
1141 ! -- set master information
1142 mt%master = .false.
1143 mt%mastername = name2
1144 mt%masterPath = mem_path2
1145 !
1146 ! -- add memory type to the memory list
1147 call memorystore%add(mt)

◆ checkin_int1d()

subroutine memorymanagermodule::checkin_int1d ( integer(i4b), dimension(:), intent(in), pointer, contiguous aint,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
character(len=*), intent(in) name2,
character(len=*), intent(in) mem_path2 )
private
Parameters
[in]aintthe existing array
[in]namenew variable name
[in]mem_pathnew path where variable is stored
[in]name2existing variable name
[in]mem_path2existing path where variable is stored

Definition at line 994 of file MemoryManager.f90.

995 integer(I4B), dimension(:), pointer, contiguous, intent(in) :: aint !< the existing array
996 character(len=*), intent(in) :: name !< new variable name
997 character(len=*), intent(in) :: mem_path !< new path where variable is stored
998 character(len=*), intent(in) :: name2 !< existing variable name
999 character(len=*), intent(in) :: mem_path2 !< existing path where variable is stored
1000 ! --local
1001 type(MemoryType), pointer :: mt
1002 integer(I4B) :: isize
1003 ! -- code
1004 !
1005 ! -- check variable name length
1006 call mem_check_length(name, lenvarname, "variable")
1007 !
1008 ! -- set isize
1009 isize = size(aint)
1010 !
1011 ! -- allocate memory type
1012 allocate (mt)
1013 !
1014 ! -- set memory type
1015 mt%aint1d => aint
1016 mt%element_size = i4b
1017 mt%isize = isize
1018 mt%name = name
1019 mt%path = mem_path
1020 write (mt%memtype, "(a,' (',i0,')')") 'INTEGER', isize
1021 !
1022 ! -- set master information
1023 mt%master = .false.
1024 mt%mastername = name2
1025 mt%masterPath = mem_path2
1026 !
1027 ! -- add memory type to the memory list
1028 call memorystore%add(mt)

◆ checkin_int2d()

subroutine memorymanagermodule::checkin_int2d ( integer(i4b), dimension(:, :), intent(inout), pointer, contiguous aint2d,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
character(len=*), intent(in) name2,
character(len=*), intent(in) mem_path2 )
private
Parameters
[in,out]aint2dthe existing 2d array
[in]namenew variable name
[in]mem_pathnew path where variable is stored
[in]name2existing variable name
[in]mem_path2existing path where variable is stored

Definition at line 1033 of file MemoryManager.f90.

1034 integer(I4B), dimension(:, :), pointer, contiguous, intent(inout) :: aint2d !< the existing 2d array
1035 character(len=*), intent(in) :: name !< new variable name
1036 character(len=*), intent(in) :: mem_path !< new path where variable is stored
1037 character(len=*), intent(in) :: name2 !< existing variable name
1038 character(len=*), intent(in) :: mem_path2 !< existing path where variable is stored
1039 ! -- local
1040 type(MemoryType), pointer :: mt
1041 integer(I4B) :: ncol, nrow, isize
1042 ! -- code
1043 !
1044 ! -- check the variable name length
1045 call mem_check_length(name, lenvarname, "variable")
1046 !
1047 ! -- set isize
1048 ncol = size(aint2d, dim=1)
1049 nrow = size(aint2d, dim=2)
1050 isize = ncol * nrow
1051 !
1052 ! -- allocate memory type
1053 allocate (mt)
1054 !
1055 ! -- set memory type
1056 mt%aint2d => aint2d
1057 mt%isize = isize
1058 mt%name = name
1059 mt%path = mem_path
1060 write (mt%memtype, "(a,' (',i0,',',i0,')')") 'INTEGER', ncol, nrow
1061 !
1062 ! -- set master information
1063 mt%master = .false.
1064 mt%mastername = name2
1065 mt%masterPath = mem_path2
1066 !
1067 ! -- add memory type to the memory list
1068 call memorystore%add(mt)

◆ checkin_logical1d()

subroutine memorymanagermodule::checkin_logical1d ( logical(lgp), dimension(:), intent(in), pointer, contiguous alog,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
character(len=*), intent(in) name2,
character(len=*), intent(in) mem_path2 )
private
Parameters
[in]alogthe existing array
[in]namenew variable name
[in]mem_pathnew path where variable is stored
[in]name2existing variable name
[in]mem_path2existing path where variable is stored

Definition at line 955 of file MemoryManager.f90.

956 logical(LGP), dimension(:), pointer, contiguous, intent(in) :: alog !< the existing array
957 character(len=*), intent(in) :: name !< new variable name
958 character(len=*), intent(in) :: mem_path !< new path where variable is stored
959 character(len=*), intent(in) :: name2 !< existing variable name
960 character(len=*), intent(in) :: mem_path2 !< existing path where variable is stored
961 ! --local
962 type(MemoryType), pointer :: mt
963 integer(I4B) :: isize
964 ! -- code
965 !
966 ! -- check variable name length
967 call mem_check_length(name, lenvarname, "variable")
968 !
969 ! -- set isize
970 isize = size(alog)
971 !
972 ! -- allocate memory type
973 allocate (mt)
974 !
975 ! -- set memory type
976 mt%alogical1d => alog
977 mt%element_size = lgp
978 mt%isize = isize
979 mt%name = name
980 mt%path = mem_path
981 write (mt%memtype, "(a,' (',i0,')')") 'LOGICAL', isize
982 !
983 ! -- set master information
984 mt%master = .false.
985 mt%mastername = name2
986 mt%masterPath = mem_path2
987 !
988 ! -- add memory type to the memory list
989 call memorystore%add(mt)

◆ copy_dbl1d()

subroutine, public memorymanagermodule::copy_dbl1d ( real(dp), dimension(:), intent(inout) adbl,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
Parameters
[in,out]adbltarget array
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 1935 of file MemoryManager.f90.

1936 real(DP), dimension(:), intent(inout) :: adbl !< target array
1937 character(len=*), intent(in) :: name !< variable name
1938 character(len=*), intent(in) :: mem_path !< path where variable is stored
1939 ! -- local
1940 type(MemoryType), pointer :: mt
1941 logical(LGP) :: found
1942 integer(I4B) :: n
1943 ! -- code
1944 call get_from_memorystore(name, mem_path, mt, found)
1945 do n = 1, size(mt%adbl1d)
1946 adbl(n) = mt%adbl1d(n)
1947 end do
Here is the call graph for this function:

◆ copyptr_dbl1d()

subroutine memorymanagermodule::copyptr_dbl1d ( real(dp), dimension(:), intent(inout), pointer, contiguous adbl,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
character(len=*), intent(in), optional mem_path_copy )
private
Parameters
[in,out]adblreturned copy of 1d real array
[in]namevariable name
[in]mem_pathpath where variable is stored
[in]mem_path_copyoptional path where the copy will be stored, if passed then the copy is added to the memory manager

Definition at line 1872 of file MemoryManager.f90.

1873 real(DP), dimension(:), pointer, contiguous, intent(inout) :: adbl !< returned copy of 1d real array
1874 character(len=*), intent(in) :: name !< variable name
1875 character(len=*), intent(in) :: mem_path !< path where variable is stored
1876 character(len=*), intent(in), optional :: mem_path_copy !< optional path where the copy will be stored,
1877 !! if passed then the copy is added to the
1878 !! memory manager
1879 ! -- local
1880 type(MemoryType), pointer :: mt
1881 logical(LGP) :: found
1882 integer(I4B) :: n
1883 ! -- code
1884 call get_from_memorystore(name, mem_path, mt, found)
1885 adbl => null()
1886 ! -- check the copy into the memory manager
1887 if (present(mem_path_copy)) then
1888 call allocate_dbl1d(adbl, size(mt%adbl1d), mt%name, mem_path_copy)
1889 ! -- create a local copy
1890 else
1891 allocate (adbl(size(mt%adbl1d)))
1892 end if
1893 do n = 1, size(mt%adbl1d)
1894 adbl(n) = mt%adbl1d(n)
1895 end do

◆ copyptr_dbl2d()

subroutine memorymanagermodule::copyptr_dbl2d ( real(dp), dimension(:, :), intent(inout), pointer, contiguous adbl,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
character(len=*), intent(in), optional mem_path_copy )
private
Parameters
[in,out]adblreturned copy of 2d real array
[in]namevariable name
[in]mem_pathpath where variable is stored
[in]mem_path_copyoptional path where the copy will be stored, if passed then the copy is added to the memory manager

Definition at line 1900 of file MemoryManager.f90.

1901 real(DP), dimension(:, :), pointer, contiguous, intent(inout) :: adbl !< returned copy of 2d real array
1902 character(len=*), intent(in) :: name !< variable name
1903 character(len=*), intent(in) :: mem_path !< path where variable is stored
1904 character(len=*), intent(in), optional :: mem_path_copy !< optional path where the copy will be stored,
1905 !! if passed then the copy is added to the
1906 !! memory manager
1907 ! -- local
1908 type(MemoryType), pointer :: mt
1909 logical(LGP) :: found
1910 integer(I4B) :: i
1911 integer(I4B) :: j
1912 integer(I4B) :: ncol
1913 integer(I4B) :: nrow
1914 ! -- code
1915 call get_from_memorystore(name, mem_path, mt, found)
1916 adbl => null()
1917 ncol = size(mt%adbl2d, dim=1)
1918 nrow = size(mt%adbl2d, dim=2)
1919 ! -- check the copy into the memory manager
1920 if (present(mem_path_copy)) then
1921 call allocate_dbl2d(adbl, ncol, nrow, mt%name, mem_path_copy)
1922 ! -- create a local copy
1923 else
1924 allocate (adbl(ncol, nrow))
1925 end if
1926 do i = 1, nrow
1927 do j = 1, ncol
1928 adbl(j, i) = mt%adbl2d(j, i)
1929 end do
1930 end do

◆ copyptr_int1d()

subroutine memorymanagermodule::copyptr_int1d ( integer(i4b), dimension(:), intent(inout), pointer, contiguous aint,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
character(len=*), intent(in), optional mem_path_copy )
private
Parameters
[in,out]aintreturned copy of 1d integer array
[in]namevariable name
[in]mem_pathpath where variable is stored
[in]mem_path_copyoptional path where the copy will be stored, if passed then the copy is added to the memory manager

Definition at line 1809 of file MemoryManager.f90.

1810 integer(I4B), dimension(:), pointer, contiguous, intent(inout) :: aint !< returned copy of 1d integer array
1811 character(len=*), intent(in) :: name !< variable name
1812 character(len=*), intent(in) :: mem_path !< path where variable is stored
1813 character(len=*), intent(in), optional :: mem_path_copy !< optional path where the copy will be stored,
1814 !! if passed then the copy is added to the
1815 !! memory manager
1816 ! -- local
1817 type(MemoryType), pointer :: mt
1818 logical(LGP) :: found
1819 integer(I4B) :: n
1820 ! -- code
1821 call get_from_memorystore(name, mem_path, mt, found)
1822 aint => null()
1823 ! -- check the copy into the memory manager
1824 if (present(mem_path_copy)) then
1825 call allocate_int1d(aint, size(mt%aint1d), mt%name, mem_path_copy)
1826 ! -- create a local copy
1827 else
1828 allocate (aint(size(mt%aint1d)))
1829 end if
1830 do n = 1, size(mt%aint1d)
1831 aint(n) = mt%aint1d(n)
1832 end do

◆ copyptr_int2d()

subroutine memorymanagermodule::copyptr_int2d ( integer(i4b), dimension(:, :), intent(inout), pointer, contiguous aint,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
character(len=*), intent(in), optional mem_path_copy )
private
Parameters
[in,out]aintreturned copy of 2d integer array
[in]namevariable name
[in]mem_pathpath where variable is stored
[in]mem_path_copyoptional path where the copy will be stored, if passed then the copy is added to the memory manager

Definition at line 1837 of file MemoryManager.f90.

1838 integer(I4B), dimension(:, :), pointer, contiguous, intent(inout) :: aint !< returned copy of 2d integer array
1839 character(len=*), intent(in) :: name !< variable name
1840 character(len=*), intent(in) :: mem_path !< path where variable is stored
1841 character(len=*), intent(in), optional :: mem_path_copy !< optional path where the copy will be stored,
1842 !! if passed then the copy is added to the
1843 !! memory manager
1844 ! -- local
1845 type(MemoryType), pointer :: mt
1846 logical(LGP) :: found
1847 integer(I4B) :: i
1848 integer(I4B) :: j
1849 integer(I4B) :: ncol
1850 integer(I4B) :: nrow
1851 ! -- code
1852 call get_from_memorystore(name, mem_path, mt, found)
1853 aint => null()
1854 ncol = size(mt%aint2d, dim=1)
1855 nrow = size(mt%aint2d, dim=2)
1856 ! -- check the copy into the memory manager
1857 if (present(mem_path_copy)) then
1858 call allocate_int2d(aint, ncol, nrow, mt%name, mem_path_copy)
1859 ! -- create a local copy
1860 else
1861 allocate (aint(ncol, nrow))
1862 end if
1863 do i = 1, nrow
1864 do j = 1, ncol
1865 aint(j, i) = mt%aint2d(j, i)
1866 end do
1867 end do

◆ copyptr_logical1d()

subroutine memorymanagermodule::copyptr_logical1d ( logical(lgp), dimension(:), intent(inout), pointer, contiguous alog,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
character(len=*), intent(in), optional mem_path_copy )
private
Parameters
[in,out]alogreturned copy of 1d logical array
[in]namevariable name
[in]mem_pathpath where variable is stored
[in]mem_path_copyoptional path where the copy will be stored, if passed then the copy is added to the memory manager

Definition at line 1781 of file MemoryManager.f90.

1782 logical(LGP), dimension(:), pointer, contiguous, intent(inout) :: alog !< returned copy of 1d logical array
1783 character(len=*), intent(in) :: name !< variable name
1784 character(len=*), intent(in) :: mem_path !< path where variable is stored
1785 character(len=*), intent(in), optional :: mem_path_copy !< optional path where the copy will be stored,
1786 !! if passed then the copy is added to the
1787 !! memory manager
1788 ! -- local
1789 type(MemoryType), pointer :: mt
1790 logical(LGP) :: found
1791 integer(I4B) :: n
1792 ! -- code
1793 call get_from_memorystore(name, mem_path, mt, found)
1794 alog => null()
1795 ! -- check the copy into the memory manager
1796 if (present(mem_path_copy)) then
1797 call allocate_logical1d(alog, size(mt%alogical1d), mt%name, mem_path_copy)
1798 ! -- create a local copy
1799 else
1800 allocate (alog(size(mt%alogical1d)))
1801 end if
1802 do n = 1, size(mt%alogical1d)
1803 alog(n) = mt%alogical1d(n)
1804 end do

◆ deallocate_charstr1d()

subroutine memorymanagermodule::deallocate_charstr1d ( type(characterstringtype), dimension(:), intent(inout), pointer, contiguous astr1d,
character(len=*), intent(in), optional name,
character(len=*), intent(in), optional mem_path )
private
Parameters
[in,out]astr1darray of strings
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 2170 of file MemoryManager.f90.

2171 type(CharacterStringType), dimension(:), pointer, contiguous, &
2172 intent(inout) :: astr1d !< array of strings
2173 character(len=*), optional, intent(in) :: name !< variable name
2174 character(len=*), optional, intent(in) :: mem_path !< path where variable is stored
2175 ! -- code
2176 return

◆ deallocate_dbl()

subroutine memorymanagermodule::deallocate_dbl ( real(dp), intent(inout), pointer sclr)
private
Parameters
[in,out]sclrreal variable to deallocate

Definition at line 2197 of file MemoryManager.f90.

2198 real(DP), pointer, intent(inout) :: sclr !< real variable to deallocate
2199 ! -- code
2200 return

◆ deallocate_dbl1d()

subroutine memorymanagermodule::deallocate_dbl1d ( real(dp), dimension(:), intent(inout), pointer, contiguous adbl,
character(len=*), optional name,
character(len=*), optional mem_path )
private
Parameters
[in,out]adbl1d real array to deallocate
namevariable name
mem_pathpath where variable is stored

Definition at line 2245 of file MemoryManager.f90.

2246 real(DP), dimension(:), pointer, contiguous, intent(inout) :: adbl !< 1d real array to deallocate
2247 character(len=*), optional :: name !< variable name
2248 character(len=*), optional :: mem_path !< path where variable is stored
2249 ! -- code
2250 return

◆ deallocate_dbl2d()

subroutine memorymanagermodule::deallocate_dbl2d ( real(dp), dimension(:, :), intent(inout), pointer, contiguous adbl,
character(len=*), optional name,
character(len=*), optional mem_path )
private
Parameters
[in,out]adbl2d real array to deallocate
namevariable name
mem_pathpath where variable is stored

Definition at line 2255 of file MemoryManager.f90.

2256 real(DP), dimension(:, :), pointer, contiguous, intent(inout) :: adbl !< 2d real array to deallocate
2257 character(len=*), optional :: name !< variable name
2258 character(len=*), optional :: mem_path !< path where variable is stored
2259 ! -- code
2260 return

◆ deallocate_dbl3d()

subroutine memorymanagermodule::deallocate_dbl3d ( real(dp), dimension(:, :, :), intent(inout), pointer, contiguous adbl,
character(len=*), optional name,
character(len=*), optional mem_path )
private
Parameters
[in,out]adbl3d real array to deallocate
namevariable name
mem_pathpath where variable is stored

Definition at line 2265 of file MemoryManager.f90.

2266 real(DP), dimension(:, :, :), pointer, contiguous, intent(inout) :: adbl !< 3d real array to deallocate
2267 character(len=*), optional :: name !< variable name
2268 character(len=*), optional :: mem_path !< path where variable is stored
2269 ! -- code
2270 return

◆ deallocate_int()

subroutine memorymanagermodule::deallocate_int ( integer(i4b), intent(inout), pointer sclr)
private
Parameters
[in,out]sclrinteger variable to deallocate

Definition at line 2189 of file MemoryManager.f90.

2190 integer(I4B), pointer, intent(inout) :: sclr !< integer variable to deallocate
2191 ! -- code
2192 return

◆ deallocate_int1d()

subroutine memorymanagermodule::deallocate_int1d ( integer(i4b), dimension(:), intent(inout), pointer, contiguous aint,
character(len=*), optional name,
character(len=*), optional mem_path )
private
Parameters
[in,out]aint1d integer array to deallocate
namevariable name
mem_pathpath where variable is stored

Definition at line 2215 of file MemoryManager.f90.

2216 integer(I4B), dimension(:), pointer, contiguous, intent(inout) :: aint !< 1d integer array to deallocate
2217 character(len=*), optional :: name !< variable name
2218 character(len=*), optional :: mem_path !< path where variable is stored
2219 ! -- code
2220 return

◆ deallocate_int2d()

subroutine memorymanagermodule::deallocate_int2d ( integer(i4b), dimension(:, :), intent(inout), pointer, contiguous aint,
character(len=*), optional name,
character(len=*), optional mem_path )
private
Parameters
[in,out]aint2d integer array to deallocate
namevariable name
mem_pathpath where variable is stored

Definition at line 2225 of file MemoryManager.f90.

2226 integer(I4B), dimension(:, :), pointer, contiguous, intent(inout) :: aint !< 2d integer array to deallocate
2227 character(len=*), optional :: name !< variable name
2228 character(len=*), optional :: mem_path !< path where variable is stored
2229 ! -- code
2230 return

◆ deallocate_int3d()

subroutine memorymanagermodule::deallocate_int3d ( integer(i4b), dimension(:, :, :), intent(inout), pointer, contiguous aint,
character(len=*), optional name,
character(len=*), optional mem_path )
private
Parameters
[in,out]aint3d integer array to deallocate
namevariable name
mem_pathpath where variable is stored

Definition at line 2235 of file MemoryManager.f90.

2236 integer(I4B), dimension(:, :, :), pointer, contiguous, intent(inout) :: aint !< 3d integer array to deallocate
2237 character(len=*), optional :: name !< variable name
2238 character(len=*), optional :: mem_path !< path where variable is stored
2239 ! -- code
2240 return

◆ deallocate_logical()

subroutine memorymanagermodule::deallocate_logical ( logical(lgp), intent(inout), pointer sclr)
private
Parameters
[in,out]sclrlogical scalar to deallocate

Definition at line 2181 of file MemoryManager.f90.

2182 logical(LGP), pointer, intent(inout) :: sclr !< logical scalar to deallocate
2183 ! -- code
2184 return

◆ deallocate_logical1d()

subroutine memorymanagermodule::deallocate_logical1d ( logical(lgp), dimension(:), intent(inout), pointer, contiguous alog,
character(len=*), optional name,
character(len=*), optional mem_path )
private
Parameters
[in,out]alog1d logical array to deallocate
namevariable name
mem_pathpath where variable is stored

Definition at line 2205 of file MemoryManager.f90.

2206 logical(LGP), dimension(:), pointer, contiguous, intent(inout) :: alog !< 1d logical array to deallocate
2207 character(len=*), optional :: name !< variable name
2208 character(len=*), optional :: mem_path !< path where variable is stored
2209 ! -- code
2210 return

◆ deallocate_str()

subroutine memorymanagermodule::deallocate_str ( character(len=*), intent(inout), pointer sclr,
character(len=*), intent(in), optional name,
character(len=*), intent(in), optional mem_path )
private
Parameters
[in,out]sclrpointer to string
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 2147 of file MemoryManager.f90.

2148 character(len=*), pointer, intent(inout) :: sclr !< pointer to string
2149 character(len=*), intent(in), optional :: name !< variable name
2150 character(len=*), intent(in), optional :: mem_path !< path where variable is stored
2151 ! -- code
2152 return

◆ deallocate_str1d()

subroutine memorymanagermodule::deallocate_str1d ( character(len=*), dimension(:), intent(inout), pointer, contiguous astr1d,
character(len=*), intent(in), optional name,
character(len=*), intent(in), optional mem_path )
private
Parameters
[in,out]astr1darray of strings
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 2158 of file MemoryManager.f90.

2159 character(len=*), dimension(:), pointer, contiguous, intent(inout) :: astr1d !< array of strings
2160 character(len=*), optional, intent(in) :: name !< variable name
2161 character(len=*), optional, intent(in) :: mem_path !< path where variable is stored
2162 ! -- code
2163 return
2164

◆ get_from_memorystore()

subroutine, public memorymanagermodule::get_from_memorystore ( character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
type(memorytype), intent(inout), pointer mt,
logical(lgp), intent(out) found,
logical(lgp), intent(in), optional check )

Default value for

check is .true. which means that this
routine will kill the program when the memory entry cannot be found.
Parameters
[in]namevariable name
[in]mem_pathpath where the variable is stored
[in,out]mtmemory type entry
[out]foundset to .true. when found
[in]checkto suppress aborting the program when not found, set check = .false.

Definition at line 307 of file MemoryManager.f90.

308 character(len=*), intent(in) :: name !< variable name
309 character(len=*), intent(in) :: mem_path !< path where the variable is stored
310 type(MemoryType), pointer, intent(inout) :: mt !< memory type entry
311 logical(LGP), intent(out) :: found !< set to .true. when found
312 logical(LGP), intent(in), optional :: check !< to suppress aborting the program when not found,
313 !! set check = .false.
314 ! -- local
315 logical(LGP) check_opt
316 ! -- code
317 mt => memorystore%get(name, mem_path)
318 found = associated(mt)
319
320 check_opt = .true.
321 if (present(check)) then
322 check_opt = check
323 end if
324 if (check_opt) 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."
329 call store_error(errmsg, terminate=.true.)
330 end if
331 end if
Here is the call graph for this function:

◆ get_isize()

subroutine, public memorymanagermodule::get_isize ( character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
integer(i4b), intent(out) isize )

Returns with isize = -1 when not found. Return 1 for scalars.

Parameters
[in]namevariable name
[in]mem_pathpath where the variable is stored
[out]isizenumber of elements (flattened)

Definition at line 276 of file MemoryManager.f90.

277 character(len=*), intent(in) :: name !< variable name
278 character(len=*), intent(in) :: mem_path !< path where the variable is stored
279 integer(I4B), intent(out) :: isize !< number of elements (flattened)
280 ! -- local
281 type(MemoryType), pointer :: mt => null()
282 logical(LGP) :: found
283 logical(LGP) :: terminate
284 ! -- code
285 !
286 ! -- initialize isize to a value to communicate failure
287 isize = -1
288 !
289 ! -- don't exit program if variable not found
290 terminate = .false.
291 !
292 ! -- get the entry from the memory manager
293 call get_from_memorystore(name, mem_path, mt, found, terminate)
294 !
295 ! -- set isize
296 if (found) then
297 isize = mt%isize
298 end if
Here is the call graph for this function:

◆ get_mem_elem_size()

subroutine, public memorymanagermodule::get_mem_elem_size ( character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
integer(i4b), intent(out) size )

Memory size in bytes, returns size = -1 when not found. This is

Parameters
[in]namevariable name
[in]mem_pathpath where the variable is stored
[out]sizesize of the variable in bytes

Definition at line 211 of file MemoryManager.f90.

212 character(len=*), intent(in) :: name !< variable name
213 character(len=*), intent(in) :: mem_path !< path where the variable is stored
214 integer(I4B), intent(out) :: size !< size of the variable in bytes
215 ! -- local
216 type(MemoryType), pointer :: mt => null()
217 logical(LGP) :: found
218 ! -- code
219 !
220 ! -- initialize size to a value to communicate failure
221 size = -1
222 !
223 ! -- get the entry from the memory manager
224 call get_from_memorystore(name, mem_path, mt, found)
225 !
226 ! -- set memory size
227 if (found) then
228 size = mt%element_size
229 end if
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_mem_rank()

subroutine, public memorymanagermodule::get_mem_rank ( character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
integer(i4b), intent(out) rank )

Returns rank = -1 when not found.

Parameters
[in]namevariable name

Definition at line 173 of file MemoryManager.f90.

174 character(len=*), intent(in) :: name !< variable name
175 character(len=*), intent(in) :: mem_path !< mem_path
176 integer(I4B), intent(out) :: rank !< rank
177 ! -- local
178 type(MemoryType), pointer :: mt => null()
179 logical(LGP) :: found
180 ! -- code
181 !
182 ! -- initialize rank to a value to communicate failure
183 rank = -1
184 !
185 ! -- get the entry from the memory manager; check=.false. so a missing
186 ! variable returns rank=-1 instead of terminating
187 call get_from_memorystore(name, mem_path, mt, found, check=.false.)
188 !
189 ! -- set rank
190 if (found) then
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
204 end if
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_mem_shape()

subroutine, public memorymanagermodule::get_mem_shape ( character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
integer(i4b), dimension(:), intent(out) mem_shape )

Returns an integer array with the shape (Fortran ordering), and set shape(1) = -1 when not found.

Parameters
[in]namevariable name
[in]mem_pathpath where the variable is stored
[out]mem_shapeshape of the variable

Definition at line 237 of file MemoryManager.f90.

238 character(len=*), intent(in) :: name !< variable name
239 character(len=*), intent(in) :: mem_path !< path where the variable is stored
240 integer(I4B), dimension(:), intent(out) :: mem_shape !< shape of the variable
241 ! -- local
242 type(MemoryType), pointer :: mt => null()
243 logical(LGP) :: found
244 ! -- code
245 !
246 ! -- get the entry from the memory manager
247 call get_from_memorystore(name, mem_path, mt, found)
248 !
249 ! -- set shape
250 if (found) then
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)
264 ! -- to communicate failure
265 else
266 mem_shape(1) = -1
267 end if
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_mem_type()

subroutine, public memorymanagermodule::get_mem_type ( character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
character(len=lenmemtype), intent(out) var_type )

Returns any of 'LOGICAL', 'INTEGER', 'DOUBLE', 'STRING'. returns 'UNKNOWN' when the variable is not found.

Parameters
[in]namevariable name
[in]mem_pathpath where the variable is stored
[out]var_typememory type

Definition at line 153 of file MemoryManager.f90.

154 character(len=*), intent(in) :: name !< variable name
155 character(len=*), intent(in) :: mem_path !< path where the variable is stored
156 character(len=LENMEMTYPE), intent(out) :: var_type !< memory type
157 ! -- local
158 type(MemoryType), pointer :: mt
159 logical(LGP) :: found
160 ! -- code
161 mt => null()
162 var_type = 'UNKNOWN'
163 call get_from_memorystore(name, mem_path, mt, found)
164 if (found) then
165 var_type = mt%memtype
166 end if
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mem_cleanup_table()

subroutine memorymanagermodule::mem_cleanup_table
private

Definition at line 2517 of file MemoryManager.f90.

2518 ! -- local
2519 ! -- formats
2520 ! -- code
2521 call memtab%table_da()
2522 deallocate (memtab)
2523 nullify (memtab)
Here is the caller graph for this function:

◆ mem_da()

subroutine, public memorymanagermodule::mem_da

Definition at line 2701 of file MemoryManager.f90.

2702 ! -- modules
2703 use versionmodule, only: idevelopmode
2704 ! -- local
2705 class(MemoryType), pointer :: mt
2706 type(MemoryContainerIteratorType), allocatable :: itr
2707 ! -- code
2708 itr = memorystore%iterator()
2709 do while (itr%has_next())
2710 call itr%next()
2711 mt => itr%value()
2712 call mt%mt_deallocate()
2713 if (idevelopmode == 1) call mem_da_check(mt)
2714 deallocate (mt)
2715 end do
2716
2717 call memorystore%clear()
2718 if (count_errors() > 0) then
2719 call store_error('Could not clear memory list.', terminate=.true.)
2720 end if
This module contains version information.
Definition version.f90:7
integer(i4b), parameter idevelopmode
Definition version.f90:19
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mem_da_check()

subroutine memorymanagermodule::mem_da_check ( class(memorytype), pointer mt)
private

Definition at line 2723 of file MemoryManager.f90.

2724 ! -- modules
2725 use inputoutputmodule, only: upcase
2726 ! -- dummy
2727 class(MemoryType), pointer :: mt
2728 ! -- local
2729 character(len=LINELENGTH) :: error_msg
2730 character(len=LENVARNAME) :: ucname
2731 !
2732 ! -- check if memory has been deallocated
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'
2736 call store_error(trim(error_msg))
2737 end if
2738 !
2739 ! -- check if memory has been deallocated
2740 if (mt%mt_associated() .and. mt%isize > 0) then
2741 error_msg = trim(adjustl(mt%path))//' '// &
2742 trim(adjustl(mt%name))//' not deallocated'
2743 call store_error(trim(error_msg))
2744 end if
2745 !
2746 ! -- check case of varname
2747 ucname = mt%name
2748 call upcase(ucname)
2749 if (mt%name /= ucname) then
2750 error_msg = trim(adjustl(mt%path))//' '// &
2751 trim(adjustl(mt%name))//' not upper case'
2752 call store_error(trim(error_msg))
2753 end if
subroutine, public upcase(word)
Convert to upper case.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mem_detailed_table()

subroutine memorymanagermodule::mem_detailed_table ( integer(i4b), intent(in) iout,
integer(i4b), intent(in) nrows )
private
Parameters
[in]ioutunit number for mfsim.lst
[in]nrowsnumber of table rows

Definition at line 2349 of file MemoryManager.f90.

2350 integer(I4B), intent(in) :: iout !< unit number for mfsim.lst
2351 integer(I4B), intent(in) :: nrows !< number of table rows
2352 ! -- local
2353 character(len=LINELENGTH) :: title
2354 character(len=LINELENGTH) :: text
2355 integer(I4B) :: nterms
2356 ! -- formats
2357 ! -- code
2358 nterms = 5
2359 !
2360 ! -- set up table title
2361 title = 'DETAILED INFORMATION ON VARIABLES STORED IN THE MEMORY MANAGER'
2362 !
2363 ! -- set up stage tableobj
2364 call table_cr(memtab, 'MEM DET', title)
2365 call memtab%table_df(nrows, nterms, iout)
2366 !
2367 ! -- origin
2368 text = 'ORIGIN'
2369 call memtab%initialize_column(text, lenmempath, alignment=tableft)
2370 !
2371 ! -- variable
2372 text = 'VARIABLE NAME'
2373 call memtab%initialize_column(text, lenvarname, alignment=tableft)
2374 !
2375 ! -- data type
2376 text = 'DATA TYPE'
2377 call memtab%initialize_column(text, 16, alignment=tableft)
2378 !
2379 ! -- size
2380 text = 'NUMBER OF ITEMS'
2381 call memtab%initialize_column(text, 20, alignment=tabright)
2382 !
2383 ! -- is it a pointer
2384 text = 'ASSOCIATED VARIABLE'
2385 call memtab%initialize_column(text, lenmemaddress, alignment=tableft)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mem_print_detailed()

subroutine, public memorymanagermodule::mem_print_detailed ( integer(i4b) iout)

Definition at line 2627 of file MemoryManager.f90.

2628 integer(I4B) :: iout
2629 ! local
2630 class(MemoryType), pointer :: mt
2631 type(MemoryContainerIteratorType), allocatable :: itr
2632
2633 call mem_detailed_table(iout, memorystore%count())
2634 itr = memorystore%iterator()
2635 do while (itr%has_next())
2636 call itr%next()
2637 mt => itr%value()
2638 call mt%table_entry(memtab)
2639 end do
2640 call mem_cleanup_table()
2641
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mem_release()

subroutine, public memorymanagermodule::mem_release ( type(memorytype), intent(inout), pointer mt)

Deallocates the data held by mt, zeroes mtisize, and decrements the appropriate nvalues_* counter for master entries. no-op when data has already been released. Primarily intended to support the release of input context memory prior to simulation runtime.

Definition at line 2671 of file MemoryManager.f90.

2672 type(MemoryType), pointer, intent(inout) :: mt
2673
2674 if (.not. mt%mt_associated()) return
2675
2676 if (mt%master) then
2677 if (mt%memtype(1:6) == 'STRING') then
2678 ! nvalues_astr increments differ: scalar adds element_size (ilen),
2679 ! arrays (str1d, charstr1d) add isize only. For IDM release the
2680 ! variables are arrays, so decrement by isize to match.
2681 if (mt%isize == 1) then
2682 nvalues_astr = nvalues_astr - mt%element_size
2683 else
2684 nvalues_astr = nvalues_astr - mt%isize
2685 end if
2686 else if (mt%memtype(1:7) == 'LOGICAL') then
2687 nvalues_alogical = nvalues_alogical - mt%isize
2688 else if (mt%memtype(1:7) == 'INTEGER') then
2689 nvalues_aint = nvalues_aint - mt%isize
2690 else if (mt%memtype(1:6) == 'DOUBLE') then
2691 nvalues_adbl = nvalues_adbl - mt%isize
2692 end if
2693 end if
2694
2695 call mt%mt_deallocate()
2696 mt%isize = 0
Here is the caller graph for this function:

◆ mem_set_print_option()

subroutine, public memorymanagermodule::mem_set_print_option ( integer(i4b), intent(in) iout,
character(len=*), intent(in) keyword,
character(len=*), intent(inout) error_msg )
Parameters
[in]ioutunit number for mfsim.lst
[in]keywordmemory print option
[in,out]error_msgreturned error message if keyword is not valid option

Definition at line 2275 of file MemoryManager.f90.

2276 integer(I4B), intent(in) :: iout !< unit number for mfsim.lst
2277 character(len=*), intent(in) :: keyword !< memory print option
2278 character(len=*), intent(inout) :: error_msg !< returned error message if keyword is not valid option
2279 ! -- local
2280 ! -- format
2281 ! -- code
2282 select case (keyword)
2283 case ('NONE')
2284 iprmem = 0
2285 write (iout, '(4x, a)') &
2286 'LIMITED MEMORY INFORMATION WILL BE WRITTEN.'
2287 case ('SUMMARY')
2288 iprmem = 1
2289 write (iout, '(4x, a)') &
2290 'A SUMMARY OF SIMULATION MEMORY INFORMATION WILL BE WRITTEN.'
2291 case ('ALL')
2292 iprmem = 2
2293 write (iout, '(4x, a)') &
2294 'ALL SIMULATION MEMORY INFORMATION WILL BE WRITTEN.'
2295 case default
2296 error_msg = "Unknown memory print option '"//trim(keyword)//"."
2297 end select
Here is the caller graph for this function:

◆ mem_summary_line()

subroutine memorymanagermodule::mem_summary_line ( character(len=*), intent(in) component,
real(dp), intent(in) rchars,
real(dp), intent(in) rlog,
real(dp), intent(in) rint,
real(dp), intent(in) rreal,
real(dp), intent(in) bytes )
private
Parameters
[in]componentcharacter defining the program component (e.g. solution)
[in]rcharsallocated size of characters (in common units)
[in]rlogallocated size of logical (in common units)
[in]rintallocated size of integer variables (in common units)
[in]rrealallocated size of real variables (in common units)
[in]bytestotal allocated memory in memory manager (in common units)

Definition at line 2390 of file MemoryManager.f90.

2391 character(len=*), intent(in) :: component !< character defining the program component (e.g. solution)
2392 real(DP), intent(in) :: rchars !< allocated size of characters (in common units)
2393 real(DP), intent(in) :: rlog !< allocated size of logical (in common units)
2394 real(DP), intent(in) :: rint !< allocated size of integer variables (in common units)
2395 real(DP), intent(in) :: rreal !< allocated size of real variables (in common units)
2396 real(DP), intent(in) :: bytes !< total allocated memory in memory manager (in common units)
2397 ! -- formats
2398 ! -- code
2399 !
2400 ! -- write line
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)
Here is the caller graph for this function:

◆ mem_summary_table()

subroutine memorymanagermodule::mem_summary_table ( integer(i4b), intent(in) iout,
integer(i4b), intent(in) nrows,
character(len=*), intent(in) cunits )
private
Parameters
[in]ioutunit number for mfsim.lst
[in]nrowsnumber of table rows
[in]cunitsmemory units (bytes, kilobytes, megabytes, or gigabytes)

Definition at line 2302 of file MemoryManager.f90.

2303 integer(I4B), intent(in) :: iout !< unit number for mfsim.lst
2304 integer(I4B), intent(in) :: nrows !< number of table rows
2305 character(len=*), intent(in) :: cunits !< memory units (bytes, kilobytes, megabytes, or gigabytes)
2306 ! -- local
2307 character(len=LINELENGTH) :: title
2308 character(len=LINELENGTH) :: text
2309 integer(I4B) :: nterms
2310 ! -- formats
2311 ! -- code
2312 nterms = 6
2313 !
2314 ! -- set up table title
2315 title = 'SUMMARY INFORMATION ON VARIABLES STORED IN THE MEMORY MANAGER, '// &
2316 'IN '//trim(cunits)
2317 !
2318 ! -- set up stage tableobj
2319 call table_cr(memtab, 'MEM SUM', title)
2320 call memtab%table_df(nrows, nterms, iout)
2321 !
2322 ! -- data type
2323 text = 'COMPONENT'
2324 call memtab%initialize_column(text, 20, alignment=tableft)
2325 !
2326 ! -- memory allocated for characters
2327 text = 'CHARACTER'
2328 call memtab%initialize_column(text, 15, alignment=tabcenter)
2329 !
2330 ! -- memory allocated for logical
2331 text = 'LOGICAL'
2332 call memtab%initialize_column(text, 15, alignment=tabcenter)
2333 !
2334 ! -- memory allocated for integers
2335 text = 'INTEGER'
2336 call memtab%initialize_column(text, 15, alignment=tabcenter)
2337 !
2338 ! -- memory allocated for reals
2339 text = 'REAL'
2340 call memtab%initialize_column(text, 15, alignment=tabcenter)
2341 !
2342 ! -- total memory allocated
2343 text = 'TOTAL'
2344 call memtab%initialize_column(text, 15, alignment=tabcenter)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mem_summary_total()

subroutine memorymanagermodule::mem_summary_total ( integer(i4b), intent(in) iout,
real(dp), intent(in) bytes )
private
Parameters
[in]ioutunit number for mfsim.lst
[in]bytestotal number of bytes allocated in the memory manager

Definition at line 2442 of file MemoryManager.f90.

2443 integer(I4B), intent(in) :: iout !< unit number for mfsim.lst
2444 real(DP), intent(in) :: bytes !< total number of bytes allocated in the memory manager
2445 ! -- local
2446 character(len=LINELENGTH) :: title
2447 character(len=LINELENGTH) :: text
2448 character(LEN=10) :: cunits
2449 integer(I4B) :: nterms
2450 integer(I4B) :: nrows
2451 real(DP) :: fact
2452 real(DP) :: smb
2453 ! -- formats
2454 ! -- code
2455 !
2456 ! -- calculate factor and memory units
2457 call mem_units(bytes, fact, cunits)
2458 !
2459 ! -- set table terms
2460 nterms = 2
2461 nrows = 6
2462 !
2463 ! -- set up table title
2464 title = 'MEMORY MANAGER TOTAL STORAGE BY DATA TYPE, IN '//trim(cunits)
2465 !
2466 ! -- set up stage tableobj
2467 call table_cr(memtab, 'MEM TOT', title)
2468 call memtab%table_df(nrows, nterms, iout)
2469 !
2470 ! -- data type
2471 text = 'DATA TYPE'
2472 call memtab%initialize_column(text, 15, alignment=tableft)
2473 !
2474 ! -- number of values
2475 text = 'ALLOCATED MEMORY'
2476 call memtab%initialize_column(text, 15, alignment=tabcenter)
2477 !
2478 ! -- write data
2479 !
2480 ! -- characters
2481 smb = real(nvalues_astr, dp) * fact
2482 call memtab%add_term('Character')
2483 call memtab%add_term(smb)
2484 !
2485 ! -- logicals
2486 smb = real(nvalues_alogical * lgp, dp) * fact
2487 call memtab%add_term('Logical')
2488 call memtab%add_term(smb)
2489 !
2490 ! -- integers
2491 smb = real(nvalues_aint * i4b, dp) * fact
2492 call memtab%add_term('Integer')
2493 call memtab%add_term(smb)
2494 !
2495 ! -- reals
2496 smb = real(nvalues_adbl * dp, dp) * fact
2497 call memtab%add_term('Real')
2498 call memtab%add_term(smb)
2499 !
2500 ! -- total memory usage
2501 call memtab%print_separator()
2502 smb = bytes * fact
2503 call memtab%add_term('Total')
2504 call memtab%add_term(smb)
2505 !
2506 ! -- Virtual memory
2507 smb = calc_virtual_mem() * fact
2508 call memtab%add_term('Virtual')
2509 call memtab%add_term(smb)
2510 !
2511 ! -- deallocate table
2512 call mem_cleanup_table()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mem_unique_origins()

subroutine memorymanagermodule::mem_unique_origins ( character(len=lenmemaddress), dimension(:), intent(inout), allocatable cunique)
private
Parameters
[in,out]cuniquearray with unique first components

Definition at line 2759 of file MemoryManager.f90.

2760 ! -- modules
2762 ! -- dummy
2763 character(len=LENMEMADDRESS), allocatable, dimension(:), intent(inout) :: &
2764 cunique !< array with unique first components
2765 ! -- local
2766 class(MemoryType), pointer :: mt
2767 character(len=LENMEMPATH) :: context
2768 character(len=LENCOMPONENTNAME) :: component
2769 character(len=LENCOMPONENTNAME) :: subcomponent
2770 character(len=LENMEMADDRESS) :: context_component
2771 type(MemoryContainerIteratorType), allocatable :: itr
2772 integer(I4B) :: ipa
2773 ! -- code
2774 !
2775 ! -- initialize cunique
2776 allocate (cunique(0))
2777 !
2778 ! -- find unique origins
2779 itr = memorystore%iterator()
2780 do while (itr%has_next())
2781 call itr%next()
2782 mt => itr%value()
2783 call split_mem_path(mt%path, component, subcomponent)
2784 context = get_mem_path_context(mt%path)
2785 context_component = trim(context)//component
2786 ipa = ifind(cunique, context_component)
2787 if (ipa < 1) then
2788 call expandarray(cunique, 1)
2789 cunique(size(cunique)) = context_component
2790 end if
2791 end do
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mem_units()

subroutine memorymanagermodule::mem_units ( real(dp), intent(in) bytes,
real(dp), intent(inout) fact,
character(len=*), intent(inout) cunits )
private
Parameters
[in]bytestotal nr. of bytes
[in,out]factconversion factor
[in,out]cunitsstring with memory unit

Definition at line 2411 of file MemoryManager.f90.

2412 ! -- dummy
2413 real(DP), intent(in) :: bytes !< total nr. of bytes
2414 real(DP), intent(inout) :: fact !< conversion factor
2415 character(len=*), intent(inout) :: cunits !< string with memory unit
2416 ! -- local
2417 ! -- formats
2418 ! -- code
2419 !
2420 ! -- initialize factor and unit string
2421 cunits = 'UNKNOWN'
2422 fact = done
2423 !
2424 ! -- set factor
2425 if (bytes < dep3) then
2426 fact = done
2427 cunits = 'BYTES'
2428 else if (bytes < dep6) then
2429 fact = dem3
2430 cunits = 'KILOBYTES'
2431 else if (bytes < dep9) then
2432 fact = dem6
2433 cunits = 'MEGABYTES'
2434 else
2435 fact = dem9
2436 cunits = 'GIGABYTES'
2437 end if
Here is the caller graph for this function:

◆ mem_write_usage()

subroutine, public memorymanagermodule::mem_write_usage ( integer(i4b), intent(in) iout)

The total memory usage by data types (int, real, etc.) is written for every simulation.

Parameters
[in]ioutunit number for mfsim.lst

Definition at line 2532 of file MemoryManager.f90.

2533 integer(I4B), intent(in) :: iout !< unit number for mfsim.lst
2534 ! -- local
2535 class(MemoryType), pointer :: mt
2536 character(len=LENMEMADDRESS), allocatable, dimension(:) :: cunique
2537 ! character(len=LENMEMPATH) :: mem_path
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
2543 type(MemoryContainerIteratorType), allocatable :: itr
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
2551 real(DP) :: fact
2552 real(DP) :: rchars
2553 real(DP) :: rlog
2554 real(DP) :: rint
2555 real(DP) :: rreal
2556 real(DP) :: bytes
2557 ! -- formats
2558 ! -- code
2559 !
2560 ! -- Calculate simulation memory allocation
2561 simbytes = (nvalues_astr + &
2562 nvalues_alogical * lgp + &
2563 nvalues_aint * i4b + &
2564 nvalues_adbl * dp)
2565 simbytes = real(simbytes, dp)
2566 !
2567 ! -- calculate factor and memory units
2568 call mem_units(simbytes, fact, cunits)
2569 !
2570 ! -- Write summary table for simulation components
2571 if (iprmem == 1) then
2572 !
2573 ! -- Find unique names of simulation components
2574 call mem_unique_origins(cunique)
2575 call mem_summary_table(iout, size(cunique), cunits)
2576 do icomp = 1, size(cunique)
2577 nchars = 0
2578 nlog = 0
2579 nint = 0
2580 nreal = 0
2581 bytes = dzero
2582 ilen = len_trim(cunique(icomp))
2583 itr = memorystore%iterator()
2584 do while (itr%has_next())
2585 call itr%next()
2586 mt => itr%value()
2587 call split_mem_path(mt%path, component, subcomponent)
2588 context = get_mem_path_context(mt%path)
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
2600 end if
2601 end do
2602 !
2603 ! -- calculate size of each data type in bytes
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
2608 !
2609 ! -- calculate total storage in bytes
2610 bytes = rchars + rlog + rint + rreal
2611 !
2612 ! -- write data
2613 call mem_summary_line(cunique(icomp), rchars, rlog, rint, rreal, bytes)
2614 end do
2615 call mem_cleanup_table()
2616 end if
2617 !
2618 ! -- Write table with all variables for iprmem == 2
2619 if (iprmem == 2) then
2620 call mem_print_detailed(iout)
2621 end if
2622 !
2623 ! -- Write total memory allocation
2624 call mem_summary_total(iout, simbytes)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reallocate_charstr1d()

subroutine memorymanagermodule::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]acharstr1dthe reallocated charstring array
[in]ilenstring length
[in]nrownumber of rows
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 1275 of file MemoryManager.f90.

1276 type(CharacterStringType), dimension(:), pointer, contiguous, &
1277 intent(inout) :: acharstr1d !< the reallocated charstring array
1278 integer(I4B), intent(in) :: ilen !< string length
1279 integer(I4B), intent(in) :: nrow !< number of rows
1280 character(len=*), intent(in) :: name !< variable name
1281 character(len=*), intent(in) :: mem_path !< path where variable is stored
1282 ! -- local
1283 type(MemoryType), pointer :: mt
1284 logical(LGP) :: found
1285 type(CharacterStringType), dimension(:), allocatable :: astrtemp
1286 character(len=ilen) :: string
1287 integer(I4B) :: istat
1288 integer(I4B) :: isize
1289 integer(I4B) :: isize_old
1290 integer(I4B) :: nrow_old
1291 integer(I4B) :: n
1292 !
1293 ! -- Initialize string
1294 string = ''
1295 !
1296 ! -- Find and assign mt
1297 call get_from_memorystore(name, mem_path, mt, found)
1298 !
1299 ! -- reallocate astr1d
1300 if (found) then
1301 isize_old = mt%isize
1302 if (isize_old > 0) then
1303 nrow_old = size(acharstr1d)
1304 else
1305 nrow_old = 0
1306 end if
1307 !
1308 ! -- calculate isize
1309 isize = nrow
1310 !
1311 ! -- allocate astrtemp
1312 allocate (astrtemp(nrow), stat=istat, errmsg=errmsg)
1313 if (istat /= 0) then
1314 call allocate_error(name, mem_path, istat, isize)
1315 end if
1316 !
1317 ! -- copy existing values (only up to the new size to handle shrinking)
1318 do n = 1, min(nrow_old, nrow)
1319 astrtemp(n) = acharstr1d(n)
1320 call acharstr1d(n)%destroy()
1321 end do
1322 !
1323 ! -- destroy remaining elements if shrinking
1324 do n = nrow + 1, nrow_old
1325 call acharstr1d(n)%destroy()
1326 end do
1327 !
1328 ! -- fill new values with missing values
1329 do n = nrow_old + 1, nrow
1330 astrtemp(n) = string
1331 end do
1332 !
1333 ! -- deallocate mt pointer, repoint, recalculate isize
1334 deallocate (acharstr1d)
1335 !
1336 ! -- allocate astr1d
1337 allocate (acharstr1d(nrow), stat=istat, errmsg=errmsg)
1338 if (istat /= 0) then
1339 call allocate_error(name, mem_path, istat, isize)
1340 end if
1341 !
1342 ! -- fill the reallocated character array
1343 do n = 1, nrow
1344 acharstr1d(n) = astrtemp(n)
1345 call astrtemp(n)%destroy()
1346 end do
1347 !
1348 ! -- deallocate temporary storage
1349 deallocate (astrtemp)
1350 !
1351 ! -- reset memory manager values
1352 mt%acharstr1d => acharstr1d
1353 mt%element_size = ilen
1354 mt%isize = isize
1355 mt%nrealloc = mt%nrealloc + 1
1356 mt%master = .true.
1357 nvalues_astr = nvalues_astr + isize - isize_old
1358 write (mt%memtype, "(a,' LEN=',i0,' (',i0,')')") 'STRING', ilen, nrow
1359 else
1360 errmsg = "Programming error, variable '"//trim(name)//"' from '"// &
1361 trim(mem_path)//"' is not defined in the memory manager. Use "// &
1362 "mem_allocate instead."
1363 call store_error(errmsg, terminate=.true.)
1364 end if

◆ reallocate_dbl1d()

subroutine memorymanagermodule::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]adblthe reallocated 1d real array
[in]nrownumber of rows
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 1501 of file MemoryManager.f90.

1502 real(DP), dimension(:), pointer, contiguous, intent(inout) :: adbl !< the reallocated 1d real array
1503 integer(I4B), intent(in) :: nrow !< number of rows
1504 character(len=*), intent(in) :: name !< variable name
1505 character(len=*), intent(in) :: mem_path !< path where variable is stored
1506 ! -- local
1507 type(MemoryType), pointer :: mt
1508 integer(I4B) :: istat
1509 integer(I4B) :: isize
1510 integer(I4B) :: i
1511 integer(I4B) :: isizeold
1512 integer(I4B) :: ifill
1513 logical(LGP) :: found
1514 ! -- code
1515 !
1516 ! -- Find and assign mt
1517 call get_from_memorystore(name, mem_path, mt, found)
1518 !
1519 ! -- Allocate adbl and then refill
1520 isize = nrow
1521 isizeold = size(mt%adbl1d)
1522 ifill = min(isizeold, isize)
1523 allocate (adbl(nrow), stat=istat, errmsg=errmsg)
1524 if (istat /= 0) then
1525 call allocate_error(name, mem_path, istat, isize)
1526 end if
1527 do i = 1, ifill
1528 adbl(i) = mt%adbl1d(i)
1529 end do
1530 !
1531 ! -- deallocate mt pointer, repoint, recalculate isize
1532 deallocate (mt%adbl1d)
1533 mt%adbl1d => adbl
1534 mt%element_size = dp
1535 mt%isize = isize
1536 mt%nrealloc = mt%nrealloc + 1
1537 mt%master = .true.
1538 nvalues_adbl = nvalues_adbl + isize - isizeold
1539 write (mt%memtype, "(a,' (',i0,')')") 'DOUBLE', isize

◆ reallocate_dbl2d()

subroutine memorymanagermodule::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]adblthe reallocated 2d real array
[in]ncolnumber of columns
[in]nrownumber of rows
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 1544 of file MemoryManager.f90.

1545 real(DP), dimension(:, :), pointer, contiguous, intent(inout) :: adbl !< the reallocated 2d real array
1546 integer(I4B), intent(in) :: ncol !< number of columns
1547 integer(I4B), intent(in) :: nrow !< number of rows
1548 character(len=*), intent(in) :: name !< variable name
1549 character(len=*), intent(in) :: mem_path !< path where variable is stored
1550 ! -- local
1551 type(MemoryType), pointer :: mt
1552 logical(LGP) :: found
1553 integer(I4B) :: istat
1554 integer(I4B), dimension(2) :: ishape
1555 integer(I4B) :: i
1556 integer(I4B) :: j
1557 integer(I4B) :: isize
1558 integer(I4B) :: isizeold
1559 ! -- code
1560 !
1561 ! -- Find and assign mt
1562 call get_from_memorystore(name, mem_path, mt, found)
1563 !
1564 ! -- Allocate adbl and then refill
1565 ishape = shape(mt%adbl2d)
1566 isize = nrow * ncol
1567 isizeold = ishape(1) * ishape(2)
1568 allocate (adbl(ncol, nrow), stat=istat, errmsg=errmsg)
1569 if (istat /= 0) then
1570 call allocate_error(name, mem_path, istat, isize)
1571 end if
1572 ! Copy only what fits in the new array to handle shrinking
1573 do i = 1, min(ishape(2), nrow)
1574 do j = 1, min(ishape(1), ncol)
1575 adbl(j, i) = mt%adbl2d(j, i)
1576 end do
1577 end do
1578 !
1579 ! -- deallocate mt pointer, repoint, recalculate isize
1580 deallocate (mt%adbl2d)
1581 mt%adbl2d => adbl
1582 mt%element_size = dp
1583 mt%isize = isize
1584 mt%nrealloc = mt%nrealloc + 1
1585 mt%master = .true.
1586 nvalues_adbl = nvalues_adbl + isize - isizeold
1587 write (mt%memtype, "(a,' (',i0,',',i0,')')") 'DOUBLE', ncol, nrow

◆ reallocate_int1d()

subroutine memorymanagermodule::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]aintthe reallocated integer array
[in]nrownumber of rows
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 1411 of file MemoryManager.f90.

1412 integer(I4B), dimension(:), pointer, contiguous, intent(inout) :: aint !< the reallocated integer array
1413 integer(I4B), intent(in) :: nrow !< number of rows
1414 character(len=*), intent(in) :: name !< variable name
1415 character(len=*), intent(in) :: mem_path !< path where variable is stored
1416 ! -- local
1417 type(MemoryType), pointer :: mt
1418 logical(LGP) :: found
1419 integer(I4B) :: istat
1420 integer(I4B) :: isize
1421 integer(I4B) :: i
1422 integer(I4B) :: isizeold
1423 integer(I4B) :: ifill
1424 ! -- code
1425 !
1426 ! -- Find and assign mt
1427 call get_from_memorystore(name, mem_path, mt, found)
1428 !
1429 ! -- Allocate aint and then refill
1430 isize = nrow
1431 isizeold = size(mt%aint1d)
1432 ifill = min(isizeold, isize)
1433 allocate (aint(nrow), stat=istat, errmsg=errmsg)
1434 if (istat /= 0) then
1435 call allocate_error(name, mem_path, istat, isize)
1436 end if
1437 do i = 1, ifill
1438 aint(i) = mt%aint1d(i)
1439 end do
1440 !
1441 ! -- deallocate mt pointer, repoint, recalculate isize
1442 deallocate (mt%aint1d)
1443 mt%aint1d => aint
1444 mt%element_size = i4b
1445 mt%isize = isize
1446 mt%nrealloc = mt%nrealloc + 1
1447 mt%master = .true.
1448 nvalues_aint = nvalues_aint + isize - isizeold

◆ reallocate_int2d()

subroutine memorymanagermodule::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]aintthe reallocated 2d integer array
[in]ncolnumber of columns
[in]nrownumber of rows
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 1453 of file MemoryManager.f90.

1454 integer(I4B), dimension(:, :), pointer, contiguous, intent(inout) :: aint !< the reallocated 2d integer array
1455 integer(I4B), intent(in) :: ncol !< number of columns
1456 integer(I4B), intent(in) :: nrow !< number of rows
1457 character(len=*), intent(in) :: name !< variable name
1458 character(len=*), intent(in) :: mem_path !< path where variable is stored
1459 ! -- local
1460 type(MemoryType), pointer :: mt
1461 logical(LGP) :: found
1462 integer(I4B) :: istat
1463 integer(I4B), dimension(2) :: ishape
1464 integer(I4B) :: i
1465 integer(I4B) :: j
1466 integer(I4B) :: isize
1467 integer(I4B) :: isizeold
1468 ! -- code
1469 !
1470 ! -- Find and assign mt
1471 call get_from_memorystore(name, mem_path, mt, found)
1472 !
1473 ! -- Allocate aint and then refill
1474 ishape = shape(mt%aint2d)
1475 isize = nrow * ncol
1476 isizeold = ishape(1) * ishape(2)
1477 allocate (aint(ncol, nrow), stat=istat, errmsg=errmsg)
1478 if (istat /= 0) then
1479 call allocate_error(name, mem_path, istat, isize)
1480 end if
1481 ! Copy only what fits in the new array to handle shrinking
1482 do i = 1, min(ishape(2), nrow)
1483 do j = 1, min(ishape(1), ncol)
1484 aint(j, i) = mt%aint2d(j, i)
1485 end do
1486 end do
1487 !
1488 ! -- deallocate mt pointer, repoint, recalculate isize
1489 deallocate (mt%aint2d)
1490 mt%aint2d => aint
1491 mt%element_size = i4b
1492 mt%isize = isize
1493 mt%nrealloc = mt%nrealloc + 1
1494 mt%master = .true.
1495 nvalues_aint = nvalues_aint + isize - isizeold
1496 write (mt%memtype, "(a,' (',i0,',',i0,')')") 'INTEGER', ncol, nrow

◆ reallocate_logical1d()

subroutine memorymanagermodule::reallocate_logical1d ( logical(lgp), dimension(:), intent(inout), pointer, contiguous alog,
integer(i4b), intent(in) nrow,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
[in,out]alogthe reallocated logical array
[in]nrownumber of rows
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 1369 of file MemoryManager.f90.

1370 logical(LGP), dimension(:), pointer, contiguous, intent(inout) :: alog !< the reallocated logical array
1371 integer(I4B), intent(in) :: nrow !< number of rows
1372 character(len=*), intent(in) :: name !< variable name
1373 character(len=*), intent(in) :: mem_path !< path where variable is stored
1374 ! -- local
1375 type(MemoryType), pointer :: mt
1376 logical(LGP) :: found
1377 integer(I4B) :: istat
1378 integer(I4B) :: isize
1379 integer(I4B) :: i
1380 integer(I4B) :: isizeold
1381 integer(I4B) :: ifill
1382 ! -- code
1383 !
1384 ! -- Find and assign mt
1385 call get_from_memorystore(name, mem_path, mt, found)
1386 !
1387 ! -- Allocate aint and then refill
1388 isize = nrow
1389 isizeold = size(mt%alogical1d)
1390 ifill = min(isizeold, isize)
1391 allocate (alog(nrow), stat=istat, errmsg=errmsg)
1392 if (istat /= 0) then
1393 call allocate_error(name, mem_path, istat, isize)
1394 end if
1395 do i = 1, ifill
1396 alog(i) = mt%alogical1d(i)
1397 end do
1398 !
1399 ! -- deallocate mt pointer, repoint, recalculate isize
1400 deallocate (mt%alogical1d)
1401 mt%alogical1d => alog
1402 mt%element_size = lgp
1403 mt%isize = isize
1404 mt%nrealloc = mt%nrealloc + 1
1405 mt%master = .true.
1406 nvalues_alogical = nvalues_alogical + isize - isizeold

◆ reallocate_str1d()

subroutine memorymanagermodule::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]ilenstring length
[in]nrownumber of rows
[in,out]astrthe reallocated string array
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 1193 of file MemoryManager.f90.

1194 integer(I4B), intent(in) :: ilen !< string length
1195 integer(I4B), intent(in) :: nrow !< number of rows
1196 character(len=ilen), dimension(:), pointer, contiguous, intent(inout) :: astr !< the reallocated string array
1197 character(len=*), intent(in) :: name !< variable name
1198 character(len=*), intent(in) :: mem_path !< path where variable is stored
1199 ! -- local
1200 type(MemoryType), pointer :: mt
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
1207 integer(I4B) :: n
1208 !
1209 ! -- Find and assign mt
1210 call get_from_memorystore(name, mem_path, mt, found)
1211 !
1212 ! -- reallocate astr1d
1213 if (found) then
1214 isize_old = mt%isize
1215 if (isize_old > 0) then
1216 nrow_old = size(astr)
1217 else
1218 nrow_old = 0
1219 end if
1220 !
1221 ! -- calculate isize
1222 isize = nrow
1223 !
1224 ! -- allocate astrtemp
1225 allocate (astrtemp(nrow), stat=istat, errmsg=errmsg)
1226 if (istat /= 0) then
1227 call allocate_error(name, mem_path, istat, isize)
1228 end if
1229 !
1230 ! -- copy existing values (only up to the new size to handle shrinking)
1231 do n = 1, min(nrow_old, nrow)
1232 astrtemp(n) = astr(n)
1233 end do
1234 !
1235 ! -- fill new values with missing values
1236 do n = nrow_old + 1, nrow
1237 astrtemp(n) = ''
1238 end do
1239 !
1240 ! -- deallocate mt pointer, repoint, recalculate isize
1241 deallocate (astr)
1242 !
1243 ! -- allocate astr1d
1244 allocate (astr(nrow), stat=istat, errmsg=errmsg)
1245 if (istat /= 0) then
1246 call allocate_error(name, mem_path, istat, isize)
1247 end if
1248 !
1249 ! -- fill the reallocate character array
1250 do n = 1, nrow
1251 astr(n) = astrtemp(n)
1252 end do
1253 !
1254 ! -- deallocate temporary storage
1255 deallocate (astrtemp)
1256 !
1257 ! -- reset memory manager values
1258 mt%astr1d => astr
1259 mt%element_size = ilen
1260 mt%isize = isize
1261 mt%nrealloc = mt%nrealloc + 1
1262 mt%master = .true.
1263 nvalues_astr = nvalues_astr + isize - isize_old
1264 write (mt%memtype, "(a,' LEN=',i0,' (',i0,')')") 'STRING', ilen, nrow
1265 else
1266 errmsg = "Programming error, variable '"//trim(name)//"' from '"// &
1267 trim(mem_path)//"' is not defined in the memory manager. Use "// &
1268 "mem_allocate instead."
1269 call store_error(errmsg, terminate=.true.)
1270 end if

◆ reassignptr_dbl1d()

subroutine memorymanagermodule::reassignptr_dbl1d ( real(dp), dimension(:), intent(inout), pointer, contiguous adbl,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
character(len=*), intent(in) name_target,
character(len=*), intent(in) mem_path_target )
private
Parameters
[in,out]adblpointer to 1d real array
[in]namevariable name
[in]mem_pathpath where variable is stored
[in]name_targetname of target variable
[in]mem_path_targetpath where target variable is stored

Definition at line 2081 of file MemoryManager.f90.

2082 real(DP), dimension(:), pointer, contiguous, intent(inout) :: adbl !< pointer to 1d real array
2083 character(len=*), intent(in) :: name !< variable name
2084 character(len=*), intent(in) :: mem_path !< path where variable is stored
2085 character(len=*), intent(in) :: name_target !< name of target variable
2086 character(len=*), intent(in) :: mem_path_target !< path where target variable is stored
2087 ! -- local
2088 type(MemoryType), pointer :: mt
2089 type(MemoryType), pointer :: mt2
2090 logical(LGP) :: found
2091 ! -- code
2092 call get_from_memorystore(name, mem_path, mt, found)
2093 call get_from_memorystore(name_target, mem_path_target, mt2, found)
2094 if (size(adbl) > 0) then
2095 nvalues_adbl = nvalues_adbl - size(adbl)
2096 deallocate (adbl)
2097 end if
2098 adbl => mt2%adbl1d
2099 mt%adbl1d => adbl
2100 mt%element_size = dp
2101 mt%isize = size(adbl)
2102 write (mt%memtype, "(a,' (',i0,')')") 'DOUBLE', mt%isize
2103 !
2104 ! -- set master information
2105 mt%master = .false.
2106 mt%mastername = name_target
2107 mt%masterPath = mem_path_target

◆ reassignptr_dbl2d()

subroutine memorymanagermodule::reassignptr_dbl2d ( real(dp), dimension(:, :), intent(inout), pointer, contiguous adbl,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
character(len=*), intent(in) name_target,
character(len=*), intent(in) mem_path_target )
private
Parameters
[in,out]adblpointer to 2d real array
[in]namevariable name
[in]mem_pathpath where variable is stored
[in]name_targetname of target variable
[in]mem_path_targetpath where target variable is stored

Definition at line 2112 of file MemoryManager.f90.

2113 real(DP), dimension(:, :), pointer, contiguous, intent(inout) :: adbl !< pointer to 2d real array
2114 character(len=*), intent(in) :: name !< variable name
2115 character(len=*), intent(in) :: mem_path !< path where variable is stored
2116 character(len=*), intent(in) :: name_target !< name of target variable
2117 character(len=*), intent(in) :: mem_path_target !< path where target variable is stored
2118 ! -- local
2119 type(MemoryType), pointer :: mt
2120 type(MemoryType), pointer :: mt2
2121 logical(LGP) :: found
2122 integer(I4B) :: ncol
2123 integer(I4b) :: nrow
2124 ! -- code
2125 call get_from_memorystore(name, mem_path, mt, found)
2126 call get_from_memorystore(name_target, mem_path_target, mt2, found)
2127 if (size(adbl) > 0) then
2128 nvalues_adbl = nvalues_adbl - size(adbl)
2129 deallocate (adbl)
2130 end if
2131 adbl => mt2%adbl2d
2132 mt%adbl2d => adbl
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
2138 !
2139 ! -- set master information
2140 mt%master = .false.
2141 mt%mastername = name_target
2142 mt%masterPath = mem_path_target

◆ reassignptr_int()

subroutine memorymanagermodule::reassignptr_int ( integer(i4b), intent(inout), pointer sclr,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
character(len=*), intent(in) name_target,
character(len=*), intent(in) mem_path_target )
private
Parameters
[in,out]sclrpointer to integer scalar
[in]namevariable name
[in]mem_pathpath where variable is stored
[in]name_targetname of target variable
[in]mem_path_targetpath where target variable is stored

Definition at line 1952 of file MemoryManager.f90.

1953 integer(I4B), pointer, intent(inout) :: sclr !< pointer to integer scalar
1954 character(len=*), intent(in) :: name !< variable name
1955 character(len=*), intent(in) :: mem_path !< path where variable is stored
1956 character(len=*), intent(in) :: name_target !< name of target variable
1957 character(len=*), intent(in) :: mem_path_target !< path where target variable is stored
1958 ! -- local
1959 type(MemoryType), pointer :: mt
1960 type(MemoryType), pointer :: mt2
1961 logical(LGP) :: found
1962 ! -- code
1963 call get_from_memorystore(name, mem_path, mt, found)
1964 call get_from_memorystore(name_target, mem_path_target, mt2, found)
1965 if (associated(sclr)) then
1966 nvalues_aint = nvalues_aint - 1
1967 deallocate (sclr)
1968 end if
1969 sclr => mt2%intsclr
1970 mt%intsclr => sclr
1971 mt%element_size = i4b
1972 mt%isize = 1
1973 write (mt%memtype, "(a,' (',i0,')')") 'INTEGER', mt%isize
1974 !
1975 ! -- set master information
1976 mt%master = .false.
1977 mt%mastername = name_target
1978 mt%masterPath = mem_path_target

◆ reassignptr_int1d()

subroutine memorymanagermodule::reassignptr_int1d ( integer(i4b), dimension(:), intent(inout), pointer, contiguous aint,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
character(len=*), intent(in) name_target,
character(len=*), intent(in) mem_path_target )
private
Parameters
[in,out]aintpointer to 1d integer array
[in]namevariable name
[in]mem_pathpath where variable is stored
[in]name_targetname of target variable
[in]mem_path_targetpath where target variable is stored

Definition at line 2015 of file MemoryManager.f90.

2016 integer(I4B), dimension(:), pointer, contiguous, intent(inout) :: aint !< pointer to 1d integer array
2017 character(len=*), intent(in) :: name !< variable name
2018 character(len=*), intent(in) :: mem_path !< path where variable is stored
2019 character(len=*), intent(in) :: name_target !< name of target variable
2020 character(len=*), intent(in) :: mem_path_target !< path where target variable is stored
2021 ! -- local
2022 type(MemoryType), pointer :: mt
2023 type(MemoryType), pointer :: mt2
2024 logical(LGP) :: found
2025 ! -- code
2026 call get_from_memorystore(name, mem_path, mt, found)
2027 call get_from_memorystore(name_target, mem_path_target, mt2, found)
2028 if (size(aint) > 0) then
2029 nvalues_aint = nvalues_aint - size(aint)
2030 deallocate (aint)
2031 end if
2032 aint => mt2%aint1d
2033 mt%aint1d => aint
2034 mt%element_size = i4b
2035 mt%isize = size(aint)
2036 write (mt%memtype, "(a,' (',i0,')')") 'INTEGER', mt%isize
2037 !
2038 ! -- set master information
2039 mt%master = .false.
2040 mt%mastername = name_target
2041 mt%masterPath = mem_path_target

◆ reassignptr_int2d()

subroutine memorymanagermodule::reassignptr_int2d ( integer(i4b), dimension(:, :), intent(inout), pointer, contiguous aint,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
character(len=*), intent(in) name_target,
character(len=*), intent(in) mem_path_target )
private
Parameters
[in,out]aintpointer to 2d integer array
[in]namevariable name
[in]mem_pathpath where variable is stored
[in]name_targetname of target variable
[in]mem_path_targetpath where target variable is stored

Definition at line 2046 of file MemoryManager.f90.

2047 integer(I4B), dimension(:, :), pointer, contiguous, intent(inout) :: aint !< pointer to 2d integer array
2048 character(len=*), intent(in) :: name !< variable name
2049 character(len=*), intent(in) :: mem_path !< path where variable is stored
2050 character(len=*), intent(in) :: name_target !< name of target variable
2051 character(len=*), intent(in) :: mem_path_target !< path where target variable is stored
2052 ! -- local
2053 type(MemoryType), pointer :: mt
2054 type(MemoryType), pointer :: mt2
2055 logical(LGP) :: found
2056 integer(I4B) :: ncol
2057 integer(I4B) :: nrow
2058 ! -- code
2059 call get_from_memorystore(name, mem_path, mt, found)
2060 call get_from_memorystore(name_target, mem_path_target, mt2, found)
2061 if (size(aint) > 0) then
2062 nvalues_aint = nvalues_aint - size(aint)
2063 deallocate (aint)
2064 end if
2065 aint => mt2%aint2d
2066 mt%aint2d => aint
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
2072 !
2073 ! -- set master information
2074 mt%master = .false.
2075 mt%mastername = name_target
2076 mt%masterPath = mem_path_target

◆ reassignptr_logical1d()

subroutine memorymanagermodule::reassignptr_logical1d ( logical(lgp), dimension(:), intent(inout), pointer, contiguous alog,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path,
character(len=*), intent(in) name_target,
character(len=*), intent(in) mem_path_target )
private
Parameters
[in,out]alogarray pointer
[in]namevariable name
[in]mem_pathpath where variable is stored
[in]name_targetname of target variable
[in]mem_path_targetpath where target variable is stored

Definition at line 1983 of file MemoryManager.f90.

1985 logical(LGP), dimension(:), pointer, contiguous, intent(inout) :: alog !< array pointer
1986 character(len=*), intent(in) :: name !< variable name
1987 character(len=*), intent(in) :: mem_path !< path where variable is stored
1988 character(len=*), intent(in) :: name_target !< name of target variable
1989 character(len=*), intent(in) :: mem_path_target !< path where target variable is stored
1990 ! -- local
1991 type(MemoryType), pointer :: mt
1992 type(MemoryType), pointer :: mt2
1993 logical(LGP) :: found
1994 ! -- code
1995 call get_from_memorystore(name, mem_path, mt, found)
1996 call get_from_memorystore(name_target, mem_path_target, mt2, found)
1997 if (size(alog) > 0) then
1998 nvalues_alogical = nvalues_alogical - size(alog)
1999 deallocate (alog)
2000 end if
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
2006 !
2007 ! -- set master information
2008 mt%master = .false.
2009 mt%mastername = name_target
2010 mt%masterPath = mem_path_target

◆ setptr_charstr1d()

subroutine memorymanagermodule::setptr_charstr1d ( type(characterstringtype), dimension(:), intent(inout), pointer, contiguous acharstr1d,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
[in,out]acharstr1dthe reallocated charstring array
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 1766 of file MemoryManager.f90.

1767 type(CharacterStringType), dimension(:), pointer, contiguous, &
1768 intent(inout) :: acharstr1d !< the reallocated charstring array
1769 character(len=*), intent(in) :: name !< variable name
1770 character(len=*), intent(in) :: mem_path !< path where variable is stored
1771 ! -- local
1772 type(MemoryType), pointer :: mt
1773 logical(LGP) :: found
1774 ! -- code
1775 call get_from_memorystore(name, mem_path, mt, found)
1776 acharstr1d => mt%acharstr1d

◆ setptr_dbl()

subroutine memorymanagermodule::setptr_dbl ( real(dp), intent(inout), pointer sclr,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
[in,out]sclrpointer to a real scalar
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 1676 of file MemoryManager.f90.

1677 real(DP), pointer, intent(inout) :: sclr !< pointer to a real scalar
1678 character(len=*), intent(in) :: name !< variable name
1679 character(len=*), intent(in) :: mem_path !< path where variable is stored
1680 ! -- local
1681 type(MemoryType), pointer :: mt
1682 logical(LGP) :: found
1683 ! -- code
1684 call get_from_memorystore(name, mem_path, mt, found)
1685 sclr => mt%dblsclr

◆ setptr_dbl1d()

subroutine memorymanagermodule::setptr_dbl1d ( real(dp), dimension(:), intent(inout), pointer, contiguous adbl,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
[in,out]adblpointer to 1d real array
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 1690 of file MemoryManager.f90.

1691 real(DP), dimension(:), pointer, contiguous, intent(inout) :: adbl !< pointer to 1d real array
1692 character(len=*), intent(in) :: name !< variable name
1693 character(len=*), intent(in) :: mem_path !< path where variable is stored
1694 ! -- local
1695 type(MemoryType), pointer :: mt
1696 logical(LGP) :: found
1697 ! -- code
1698 call get_from_memorystore(name, mem_path, mt, found)
1699 adbl => mt%adbl1d

◆ setptr_dbl2d()

subroutine memorymanagermodule::setptr_dbl2d ( real(dp), dimension(:, :), intent(inout), pointer, contiguous adbl,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
[in,out]adblpointer to 2d real array
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 1704 of file MemoryManager.f90.

1705 real(DP), dimension(:, :), pointer, contiguous, intent(inout) :: adbl !< pointer to 2d real array
1706 character(len=*), intent(in) :: name !< variable name
1707 character(len=*), intent(in) :: mem_path !< path where variable is stored
1708 ! -- local
1709 type(MemoryType), pointer :: mt
1710 logical(LGP) :: found
1711 ! -- code
1712 call get_from_memorystore(name, mem_path, mt, found)
1713 adbl => mt%adbl2d

◆ setptr_dbl3d()

subroutine memorymanagermodule::setptr_dbl3d ( real(dp), dimension(:, :, :), intent(inout), pointer, contiguous adbl,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
[in,out]adblpointer to 3d real array
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 1718 of file MemoryManager.f90.

1719 real(DP), dimension(:, :, :), pointer, contiguous, intent(inout) :: adbl !< pointer to 3d real array
1720 character(len=*), intent(in) :: name !< variable name
1721 character(len=*), intent(in) :: mem_path !< path where variable is stored
1722 ! -- local
1723 type(MemoryType), pointer :: mt
1724 logical(LGP) :: found
1725 ! -- code
1726 call get_from_memorystore(name, mem_path, mt, found)
1727 adbl => mt%adbl3d

◆ setptr_int()

subroutine memorymanagermodule::setptr_int ( integer(i4b), intent(inout), pointer sclr,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
[in,out]sclrpointer to integer scalar
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 1606 of file MemoryManager.f90.

1607 integer(I4B), pointer, intent(inout) :: sclr !< pointer to integer scalar
1608 character(len=*), intent(in) :: name !< variable name
1609 character(len=*), intent(in) :: mem_path !< path where variable is stored
1610 ! -- local
1611 type(MemoryType), pointer :: mt
1612 logical(LGP) :: found
1613 ! -- code
1614 call get_from_memorystore(name, mem_path, mt, found)
1615 sclr => mt%intsclr

◆ setptr_int1d()

subroutine memorymanagermodule::setptr_int1d ( integer(i4b), dimension(:), intent(inout), pointer, contiguous aint,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
[in,out]aintpointer to 1d integer array
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 1634 of file MemoryManager.f90.

1635 integer(I4B), dimension(:), pointer, contiguous, intent(inout) :: aint !< pointer to 1d integer array
1636 character(len=*), intent(in) :: name !< variable name
1637 character(len=*), intent(in) :: mem_path !< path where variable is stored
1638 ! -- local
1639 type(MemoryType), pointer :: mt
1640 logical(LGP) :: found
1641 ! -- code
1642 call get_from_memorystore(name, mem_path, mt, found)
1643 aint => mt%aint1d

◆ setptr_int2d()

subroutine memorymanagermodule::setptr_int2d ( integer(i4b), dimension(:, :), intent(inout), pointer, contiguous aint,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
[in,out]aintpointer to 2d integer array
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 1648 of file MemoryManager.f90.

1649 integer(I4B), dimension(:, :), pointer, contiguous, intent(inout) :: aint !< pointer to 2d integer array
1650 character(len=*), intent(in) :: name !< variable name
1651 character(len=*), intent(in) :: mem_path !< path where variable is stored
1652 ! -- local
1653 type(MemoryType), pointer :: mt
1654 logical(LGP) :: found
1655 ! -- code
1656 call get_from_memorystore(name, mem_path, mt, found)
1657 aint => mt%aint2d

◆ setptr_int3d()

subroutine memorymanagermodule::setptr_int3d ( integer(i4b), dimension(:, :, :), intent(inout), pointer, contiguous aint,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
[in,out]aintpointer to 3d integer array
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 1662 of file MemoryManager.f90.

1663 integer(I4B), dimension(:, :, :), pointer, contiguous, intent(inout) :: aint !< pointer to 3d integer array
1664 character(len=*), intent(in) :: name !< variable name
1665 character(len=*), intent(in) :: mem_path !< path where variable is stored
1666 ! -- local
1667 type(MemoryType), pointer :: mt
1668 logical(LGP) :: found
1669 ! -- code
1670 call get_from_memorystore(name, mem_path, mt, found)
1671 aint => mt%aint3d

◆ setptr_logical()

subroutine memorymanagermodule::setptr_logical ( logical(lgp), intent(inout), pointer sclr,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
[in,out]sclrpointer to logical scalar
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 1592 of file MemoryManager.f90.

1593 logical(LGP), pointer, intent(inout) :: sclr !< pointer to logical scalar
1594 character(len=*), intent(in) :: name !< variable name
1595 character(len=*), intent(in) :: mem_path !< path where variable is stored
1596 ! -- local
1597 type(MemoryType), pointer :: mt
1598 logical(LGP) :: found
1599 ! -- code
1600 call get_from_memorystore(name, mem_path, mt, found)
1601 sclr => mt%logicalsclr

◆ setptr_logical1d()

subroutine memorymanagermodule::setptr_logical1d ( logical(lgp), dimension(:), intent(inout), pointer, contiguous alog,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
[in,out]alogpointer to 1d logical array
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 1620 of file MemoryManager.f90.

1621 logical(LGP), dimension(:), pointer, contiguous, intent(inout) :: alog !< pointer to 1d logical array
1622 character(len=*), intent(in) :: name !< variable name
1623 character(len=*), intent(in) :: mem_path !< path where variable is stored
1624 ! -- local
1625 type(MemoryType), pointer :: mt
1626 logical(LGP) :: found
1627 ! -- code
1628 call get_from_memorystore(name, mem_path, mt, found)
1629 alog => mt%alogical1d

◆ setptr_str()

subroutine memorymanagermodule::setptr_str ( character(len=:), pointer asrt,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
asrtpointer to the character string
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 1732 of file MemoryManager.f90.

1733 character(len=:), pointer :: asrt !< pointer to the character string
1734 character(len=*), intent(in) :: name !< variable name
1735 character(len=*), intent(in) :: mem_path !< path where variable is stored
1736 ! -- local
1737 type(MemoryType), pointer :: mt
1738 logical(LGP) :: found
1739 ! -- code
1740 call get_from_memorystore(name, mem_path, mt, found)
1741 asrt => mt%strsclr

◆ setptr_str1d()

subroutine memorymanagermodule::setptr_str1d ( character(len=:), dimension(:), intent(inout), pointer, contiguous astr1d,
character(len=*), intent(in) name,
character(len=*), intent(in) mem_path )
private
Parameters
[in,out]astr1dpointer to the string array
[in]namevariable name
[in]mem_pathpath where variable is stored

Definition at line 1746 of file MemoryManager.f90.

1747 character(len=:), dimension(:), &
1748 pointer, contiguous, intent(inout) :: astr1d !< pointer to the string array
1749 character(len=*), intent(in) :: name !< variable name
1750 character(len=*), intent(in) :: mem_path !< path where variable is stored
1751 ! -- local
1752 type(MemoryType), pointer :: mt
1753 logical(LGP) :: found
1754 ! -- code
1755 call get_from_memorystore(name, mem_path, mt, found)
1756 select type (item => mt%astr1d)
1757 type is (character(*))
1758 astr1d => item
1759 class default
1760 astr1d => null()
1761 end select

Variable Documentation

◆ iprmem

integer(i4b) memorymanagermodule::iprmem = 0
private

Definition at line 53 of file MemoryManager.f90.

◆ memorystore

type(memorystoretype), public memorymanagermodule::memorystore

Definition at line 47 of file MemoryManager.f90.

47 type(MemoryStoreType) :: memorystore

◆ memtab

type(tabletype), pointer memorymanagermodule::memtab => null()
private

Definition at line 48 of file MemoryManager.f90.

◆ nvalues_adbl

integer(i8b) memorymanagermodule::nvalues_adbl = 0
private

Definition at line 52 of file MemoryManager.f90.

◆ nvalues_aint

integer(i8b) memorymanagermodule::nvalues_aint = 0
private

Definition at line 51 of file MemoryManager.f90.

◆ nvalues_alogical

integer(i8b) memorymanagermodule::nvalues_alogical = 0
private

Definition at line 49 of file MemoryManager.f90.

◆ nvalues_astr

integer(i8b) memorymanagermodule::nvalues_astr = 0
private

Definition at line 50 of file MemoryManager.f90.