MODFLOW 6  version 6.6.0.dev0
USGS Modular Hydrologic Model
memorystoremodule Module Reference

Data Types

type  memorystoretype
 

Functions/Subroutines

type(memorycontaineriteratortype) function iterator (this)
 An iterator used to iterate through a MemoryContainer. More...
 
subroutine add (this, mt)
 Add a MemoryType to the container. More...
 
type(memorytype) function, pointer get (this, name, path)
 Get a MemoryType using a key. More...
 
integer(i4b) function count (this)
 The nummer of items in the container. More...
 
subroutine clear (this)
 Clears the memory container. More...
 

Function/Subroutine Documentation

◆ add()

subroutine memorystoremodule::add ( class(memorystoretype this,
type(memorytype), intent(in), pointer  mt 
)
private

The MemoryType is stored together with a key for easy lookup The key is constructed using the memory type's path and name

Definition at line 44 of file MemoryStore.f90.

45  class(MemoryStoreType) :: this
46  type(MemoryType), pointer, intent(in) :: mt
47  ! -- local
48  class(*), pointer :: obj => null()
49  character(len=LENMEMADDRESS) :: key
50 
51  key = create_mem_address(mt%path, mt%name)
52  obj => mt
53  call this%container%add(key, obj)
Here is the call graph for this function:

◆ clear()

subroutine memorystoremodule::clear ( class(memorystoretype this)
private

Definition at line 94 of file MemoryStore.f90.

95  class(MemoryStoreType) :: this
96 
97  call this%container%clear()

◆ count()

integer(i4b) function memorystoremodule::count ( class(memorystoretype this)
private

Definition at line 84 of file MemoryStore.f90.

85  class(MemoryStoreType) :: this
86  integer(I4B) :: cnt
87 
88  cnt = this%container%count()

◆ get()

type(memorytype) function, pointer memorystoremodule::get ( class(memorystoretype this,
character(len=*), intent(in)  name,
character(len=*), intent(in)  path 
)
private

If the key can't be found the return value will be a null pointer

Definition at line 60 of file MemoryStore.f90.

61  class(MemoryStoreType) :: this
62  character(len=*), intent(in) :: name
63  character(len=*), intent(in) :: path
64  type(MemoryType), pointer :: mt
65  ! -- local
66  character(len=LENMEMADDRESS) :: key
67  class(*), pointer :: obj
68 
69  key = create_mem_address(path, name)
70  obj => this%container%get(key)
71 
72  select type (obj)
73  type is (memorytype)
74  mt => obj
75  class default
76  mt => null()
77  end select
78 
Here is the call graph for this function:

◆ iterator()

type(memorycontaineriteratortype) function memorystoremodule::iterator ( class(memorystoretype this)
private

Definition at line 29 of file MemoryStore.f90.

30  class(MemoryStoreType) :: this
31  type(MemoryContainerIteratorType) :: itr
32  ! -- local
33  class(IteratorType), allocatable :: container_iterator
34 
35  allocate (container_iterator, source=this%container%iterator())
36  itr = memorycontaineriteratortype(container_iterator)