MODFLOW 6  version 6.7.0.dev0
USGS Modular Hydrologic Model
memorymanagermodule::mem_deallocate Interface Reference
Collaboration diagram for memorymanagermodule::mem_deallocate:
Collaboration graph

Private Member Functions

subroutine deallocate_logical (sclr)
 Deallocate a logical scalar. More...
 
subroutine deallocate_str (sclr, name, mem_path)
 Deallocate a variable-length character string. More...
 
subroutine deallocate_str1d (astr1d, name, mem_path)
 Deallocate an array of defined-length character strings. More...
 
subroutine deallocate_charstr1d (astr1d, name, mem_path)
 Deallocate an array of deferred-length character strings. More...
 
subroutine deallocate_int (sclr)
 Deallocate a integer scalar. More...
 
subroutine deallocate_int1d (aint, name, mem_path)
 Deallocate a 1-dimensional integer array. More...
 
subroutine deallocate_int2d (aint, name, mem_path)
 Deallocate a 2-dimensional integer array. More...
 
subroutine deallocate_int3d (aint, name, mem_path)
 Deallocate a 3-dimensional integer array. More...
 
subroutine deallocate_dbl (sclr)
 Deallocate a real scalar. More...
 
subroutine deallocate_dbl1d (adbl, name, mem_path)
 Deallocate a 1-dimensional real array. More...
 
subroutine deallocate_dbl2d (adbl, name, mem_path)
 Deallocate a 2-dimensional real array. More...
 
subroutine deallocate_dbl3d (adbl, name, mem_path)
 Deallocate a 3-dimensional real array. More...
 

Detailed Description

Definition at line 122 of file MemoryManager.f90.

Member Function/Subroutine Documentation

◆ deallocate_charstr1d()

subroutine memorymanagermodule::mem_deallocate::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 2005 of file MemoryManager.f90.

2006  type(CharacterStringType), dimension(:), pointer, contiguous, &
2007  intent(inout) :: astr1d !< array of strings
2008  character(len=*), optional, intent(in) :: name !< variable name
2009  character(len=*), optional, intent(in) :: mem_path !< path where variable is stored
2010  ! -- local
2011  type(MemoryType), pointer :: mt
2012  logical(LGP) :: found
2013  type(MemoryContainerIteratorType), allocatable :: itr
2014  integer(I4B) :: n
2015  ! -- code
2016  !
2017  ! -- process optional variables
2018  found = .false.
2019  if (present(name) .and. present(mem_path)) then
2020  call get_from_memorystore(name, mem_path, mt, found)
2021  nullify (mt%acharstr1d)
2022  else
2023  itr = memorystore%iterator()
2024  do while (itr%has_next())
2025  call itr%next()
2026  mt => itr%value()
2027  if (associated(mt%acharstr1d, astr1d)) then
2028  nullify (mt%acharstr1d)
2029  found = .true.
2030  exit
2031  end if
2032  end do
2033  end if
2034  if (.not. found .and. size(astr1d) > 0) then
2035  call store_error('programming error in deallocate_charstr1d', &
2036  terminate=.true.)
2037  else
2038  if (mt%master) then
2039  do n = 1, size(astr1d)
2040  call astr1d(n)%destroy()
2041  end do
2042  deallocate (astr1d)
2043  else
2044  nullify (astr1d)
2045  end if
2046  end if
Here is the call graph for this function:

◆ deallocate_dbl()

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

Definition at line 2114 of file MemoryManager.f90.

2115  real(DP), pointer, intent(inout) :: sclr !< real variable to deallocate
2116  ! -- local
2117  class(MemoryType), pointer :: mt
2118  logical(LGP) :: found
2119  type(MemoryContainerIteratorType), allocatable :: itr
2120  ! -- code
2121  found = .false.
2122  itr = memorystore%iterator()
2123  do while (itr%has_next())
2124  call itr%next()
2125  mt => itr%value()
2126  if (associated(mt%dblsclr, sclr)) then
2127  nullify (mt%dblsclr)
2128  found = .true.
2129  exit
2130  end if
2131  end do
2132  if (.not. found) then
2133  call store_error('Programming error in deallocate_dbl.', terminate=.true.)
2134  else
2135  if (mt%master) then
2136  deallocate (sclr)
2137  else
2138  nullify (sclr)
2139  end if
2140  end if
Here is the call graph for this function:

◆ deallocate_dbl1d()

subroutine memorymanagermodule::mem_deallocate::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 2265 of file MemoryManager.f90.

2266  real(DP), dimension(:), pointer, contiguous, intent(inout) :: adbl !< 1d real array to deallocate
2267  character(len=*), optional :: name !< variable name
2268  character(len=*), optional :: mem_path !< path where variable is stored
2269  ! -- local
2270  type(MemoryType), pointer :: mt
2271  logical(LGP) :: found
2272  type(MemoryContainerIteratorType), allocatable :: itr
2273  ! -- code
2274  !
2275  ! -- process optional variables
2276  found = .false.
2277  if (present(name) .and. present(mem_path)) then
2278  call get_from_memorystore(name, mem_path, mt, found)
2279  nullify (mt%adbl1d)
2280  else
2281  itr = memorystore%iterator()
2282  do while (itr%has_next())
2283  call itr%next()
2284  mt => itr%value()
2285  if (associated(mt%adbl1d, adbl)) then
2286  nullify (mt%adbl1d)
2287  found = .true.
2288  exit
2289  end if
2290  end do
2291  end if
2292  if (.not. found .and. size(adbl) > 0) then
2293  call store_error('programming error in deallocate_dbl1d', terminate=.true.)
2294  else
2295  if (mt%master) then
2296  deallocate (adbl)
2297  else
2298  nullify (adbl)
2299  end if
2300  end if
Here is the call graph for this function:

◆ deallocate_dbl2d()

subroutine memorymanagermodule::mem_deallocate::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 2305 of file MemoryManager.f90.

2306  real(DP), dimension(:, :), pointer, contiguous, intent(inout) :: adbl !< 2d real array to deallocate
2307  character(len=*), optional :: name !< variable name
2308  character(len=*), optional :: mem_path !< path where variable is stored
2309  ! -- local
2310  type(MemoryType), pointer :: mt
2311  logical(LGP) :: found
2312  type(MemoryContainerIteratorType), allocatable :: itr
2313  ! -- code
2314  !
2315  ! -- process optional variables
2316  found = .false.
2317  if (present(name) .and. present(mem_path)) then
2318  call get_from_memorystore(name, mem_path, mt, found)
2319  nullify (mt%adbl2d)
2320  else
2321  itr = memorystore%iterator()
2322  do while (itr%has_next())
2323  call itr%next()
2324  mt => itr%value()
2325  if (associated(mt%adbl2d, adbl)) then
2326  nullify (mt%adbl2d)
2327  found = .true.
2328  exit
2329  end if
2330  end do
2331  end if
2332  if (.not. found .and. size(adbl) > 0) then
2333  call store_error('programming error in deallocate_dbl2d', terminate=.true.)
2334  else
2335  if (mt%master) then
2336  deallocate (adbl)
2337  else
2338  nullify (adbl)
2339  end if
2340  end if
Here is the call graph for this function:

◆ deallocate_dbl3d()

subroutine memorymanagermodule::mem_deallocate::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 2345 of file MemoryManager.f90.

2346  real(DP), dimension(:, :, :), pointer, contiguous, intent(inout) :: adbl !< 3d real array to deallocate
2347  character(len=*), optional :: name !< variable name
2348  character(len=*), optional :: mem_path !< path where variable is stored
2349  ! -- local
2350  type(MemoryType), pointer :: mt
2351  logical(LGP) :: found
2352  type(MemoryContainerIteratorType), allocatable :: itr
2353  ! -- code
2354  !
2355  ! -- process optional variables
2356  found = .false.
2357  if (present(name) .and. present(mem_path)) then
2358  call get_from_memorystore(name, mem_path, mt, found)
2359  nullify (mt%adbl3d)
2360  else
2361  itr = memorystore%iterator()
2362  do while (itr%has_next())
2363  call itr%next()
2364  mt => itr%value()
2365  if (associated(mt%adbl3d, adbl)) then
2366  nullify (mt%adbl3d)
2367  found = .true.
2368  exit
2369  end if
2370  end do
2371  end if
2372  if (.not. found .and. size(adbl) > 0) then
2373  call store_error('programming error in deallocate_dbl3d', terminate=.true.)
2374  else
2375  if (mt%master) then
2376  deallocate (adbl)
2377  else
2378  nullify (adbl)
2379  end if
2380  end if
Here is the call graph for this function:

◆ deallocate_int()

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

Definition at line 2083 of file MemoryManager.f90.

2084  integer(I4B), pointer, intent(inout) :: sclr !< integer variable to deallocate
2085  ! -- local
2086  class(MemoryType), pointer :: mt
2087  logical(LGP) :: found
2088  type(MemoryContainerIteratorType), allocatable :: itr
2089  ! -- code
2090  found = .false.
2091  itr = memorystore%iterator()
2092  do while (itr%has_next())
2093  call itr%next()
2094  mt => itr%value()
2095  if (associated(mt%intsclr, sclr)) then
2096  nullify (mt%intsclr)
2097  found = .true.
2098  exit
2099  end if
2100  end do
2101  if (.not. found) then
2102  call store_error('Programming error in deallocate_int.', terminate=.true.)
2103  else
2104  if (mt%master) then
2105  deallocate (sclr)
2106  else
2107  nullify (sclr)
2108  end if
2109  end if
Here is the call graph for this function:

◆ deallocate_int1d()

subroutine memorymanagermodule::mem_deallocate::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 2145 of file MemoryManager.f90.

2146  integer(I4B), dimension(:), pointer, contiguous, intent(inout) :: aint !< 1d integer array to deallocate
2147  character(len=*), optional :: name !< variable name
2148  character(len=*), optional :: mem_path !< path where variable is stored
2149  ! -- local
2150  type(MemoryType), pointer :: mt
2151  logical(LGP) :: found
2152  type(MemoryContainerIteratorType), allocatable :: itr
2153  ! -- code
2154  !
2155  ! -- process optional variables
2156  found = .false.
2157  if (present(name) .and. present(mem_path)) then
2158  call get_from_memorystore(name, mem_path, mt, found)
2159  nullify (mt%aint1d)
2160  else
2161  itr = memorystore%iterator()
2162  do while (itr%has_next())
2163  call itr%next()
2164  mt => itr%value()
2165  if (associated(mt%aint1d, aint)) then
2166  nullify (mt%aint1d)
2167  found = .true.
2168  exit
2169  end if
2170  end do
2171  end if
2172  if (.not. found .and. size(aint) > 0) then
2173  call store_error('programming error in deallocate_int1d', terminate=.true.)
2174  else
2175  if (mt%master) then
2176  deallocate (aint)
2177  else
2178  nullify (aint)
2179  end if
2180  end if
Here is the call graph for this function:

◆ deallocate_int2d()

subroutine memorymanagermodule::mem_deallocate::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 2185 of file MemoryManager.f90.

2186  integer(I4B), dimension(:, :), pointer, contiguous, intent(inout) :: aint !< 2d integer array to deallocate
2187  character(len=*), optional :: name !< variable name
2188  character(len=*), optional :: mem_path !< path where variable is stored
2189  ! -- local
2190  type(MemoryType), pointer :: mt
2191  logical(LGP) :: found
2192  type(MemoryContainerIteratorType), allocatable :: itr
2193  ! -- code
2194  !
2195  ! -- process optional variables
2196  found = .false.
2197  if (present(name) .and. present(mem_path)) then
2198  call get_from_memorystore(name, mem_path, mt, found)
2199  nullify (mt%aint2d)
2200  else
2201  itr = memorystore%iterator()
2202  do while (itr%has_next())
2203  call itr%next()
2204  mt => itr%value()
2205  if (associated(mt%aint2d, aint)) then
2206  nullify (mt%aint2d)
2207  found = .true.
2208  exit
2209  end if
2210  end do
2211  end if
2212  if (.not. found .and. size(aint) > 0) then
2213  call store_error('programming error in deallocate_int2d', terminate=.true.)
2214  else
2215  if (mt%master) then
2216  deallocate (aint)
2217  else
2218  nullify (aint)
2219  end if
2220  end if
Here is the call graph for this function:

◆ deallocate_int3d()

subroutine memorymanagermodule::mem_deallocate::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 2225 of file MemoryManager.f90.

2226  integer(I4B), dimension(:, :, :), pointer, contiguous, intent(inout) :: aint !< 3d integer array to deallocate
2227  character(len=*), optional :: name !< variable name
2228  character(len=*), optional :: mem_path !< path where variable is stored
2229  ! -- local
2230  type(MemoryType), pointer :: mt
2231  logical(LGP) :: found
2232  type(MemoryContainerIteratorType), allocatable :: itr
2233  ! -- code
2234  !
2235  ! -- process optional variables
2236  found = .false.
2237  if (present(name) .and. present(mem_path)) then
2238  call get_from_memorystore(name, mem_path, mt, found)
2239  nullify (mt%aint3d)
2240  else
2241  itr = memorystore%iterator()
2242  do while (itr%has_next())
2243  call itr%next()
2244  mt => itr%value()
2245  if (associated(mt%aint3d, aint)) then
2246  nullify (mt%aint3d)
2247  found = .true.
2248  exit
2249  end if
2250  end do
2251  end if
2252  if (.not. found .and. size(aint) > 0) then
2253  call store_error('programming error in deallocate_int3d', terminate=.true.)
2254  else
2255  if (mt%master) then
2256  deallocate (aint)
2257  else
2258  nullify (aint)
2259  end if
2260  end if
Here is the call graph for this function:

◆ deallocate_logical()

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

Definition at line 2051 of file MemoryManager.f90.

2052  logical(LGP), pointer, intent(inout) :: sclr !< logical scalar to deallocate
2053  ! -- local
2054  class(MemoryType), pointer :: mt
2055  logical(LGP) :: found
2056  type(MemoryContainerIteratorType), allocatable :: itr
2057  ! -- code
2058  found = .false.
2059  itr = memorystore%iterator()
2060  do while (itr%has_next())
2061  call itr%next()
2062  mt => itr%value()
2063  if (associated(mt%logicalsclr, sclr)) then
2064  nullify (mt%logicalsclr)
2065  found = .true.
2066  exit
2067  end if
2068  end do
2069  if (.not. found) then
2070  call store_error('programming error in deallocate_logical', &
2071  terminate=.true.)
2072  else
2073  if (mt%master) then
2074  deallocate (sclr)
2075  else
2076  nullify (sclr)
2077  end if
2078  end if
Here is the call graph for this function:

◆ deallocate_str()

subroutine memorymanagermodule::mem_deallocate::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 1925 of file MemoryManager.f90.

1926  character(len=*), pointer, intent(inout) :: sclr !< pointer to string
1927  character(len=*), intent(in), optional :: name !< variable name
1928  character(len=*), intent(in), optional :: mem_path !< path where variable is stored
1929  ! -- local
1930  type(MemoryType), pointer :: mt
1931  logical(LGP) :: found
1932  type(MemoryContainerIteratorType), allocatable :: itr
1933  ! -- code
1934  found = .false.
1935  if (present(name) .and. present(mem_path)) then
1936  call get_from_memorystore(name, mem_path, mt, found)
1937  nullify (mt%strsclr)
1938  else
1939  itr = memorystore%iterator()
1940  do while (itr%has_next())
1941  call itr%next()
1942  mt => itr%value()
1943  if (associated(mt%strsclr, sclr)) then
1944  nullify (mt%strsclr)
1945  found = .true.
1946  exit
1947  end if
1948  end do
1949  end if
1950  if (.not. found) then
1951  call store_error('Programming error in deallocate_str.', terminate=.true.)
1952  else
1953  if (mt%master) then
1954  deallocate (sclr)
1955  else
1956  nullify (sclr)
1957  end if
1958  end if
Here is the call graph for this function:

◆ deallocate_str1d()

subroutine memorymanagermodule::mem_deallocate::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 1964 of file MemoryManager.f90.

1965  character(len=*), dimension(:), pointer, contiguous, intent(inout) :: astr1d !< array of strings
1966  character(len=*), optional, intent(in) :: name !< variable name
1967  character(len=*), optional, intent(in) :: mem_path !< path where variable is stored
1968  ! -- local
1969  type(MemoryType), pointer :: mt
1970  logical(LGP) :: found
1971  type(MemoryContainerIteratorType), allocatable :: itr
1972  ! -- code
1973  !
1974  ! -- process optional variables
1975  found = .false.
1976  if (present(name) .and. present(mem_path)) then
1977  call get_from_memorystore(name, mem_path, mt, found)
1978  nullify (mt%astr1d)
1979  else
1980  itr = memorystore%iterator()
1981  do while (itr%has_next())
1982  call itr%next()
1983  mt => itr%value()
1984  if (associated(mt%astr1d, astr1d)) then
1985  nullify (mt%astr1d)
1986  found = .true.
1987  exit
1988  end if
1989  end do
1990  end if
1991  if (.not. found .and. size(astr1d) > 0) then
1992  call store_error('programming error in deallocate_str1d', terminate=.true.)
1993  else
1994  if (mt%master) then
1995  deallocate (astr1d)
1996  else
1997  nullify (astr1d)
1998  end if
1999  end if
Here is the call graph for this function:

The documentation for this interface was generated from the following file: