MODFLOW 6  version 6.6.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 2003 of file MemoryManager.f90.

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

2109  real(DP), pointer, intent(inout) :: sclr !< real variable to deallocate
2110  ! -- local
2111  class(MemoryType), pointer :: mt
2112  logical(LGP) :: found
2113  type(MemoryContainerIteratorType), allocatable :: itr
2114  ! -- code
2115  found = .false.
2116  itr = memorystore%iterator()
2117  do while (itr%has_next())
2118  call itr%next()
2119  mt => itr%value()
2120  if (associated(mt%dblsclr, sclr)) then
2121  nullify (mt%dblsclr)
2122  found = .true.
2123  exit
2124  end if
2125  end do
2126  if (.not. found) then
2127  call store_error('Programming error in deallocate_dbl.', terminate=.true.)
2128  else
2129  if (mt%master) then
2130  deallocate (sclr)
2131  else
2132  nullify (sclr)
2133  end if
2134  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 2259 of file MemoryManager.f90.

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

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

2340  real(DP), dimension(:, :, :), pointer, contiguous, intent(inout) :: adbl !< 3d real array to deallocate
2341  character(len=*), optional :: name !< variable name
2342  character(len=*), optional :: mem_path !< path where variable is stored
2343  ! -- local
2344  type(MemoryType), pointer :: mt
2345  logical(LGP) :: found
2346  type(MemoryContainerIteratorType), allocatable :: itr
2347  ! -- code
2348  !
2349  ! -- process optional variables
2350  found = .false.
2351  if (present(name) .and. present(mem_path)) then
2352  call get_from_memorystore(name, mem_path, mt, found)
2353  nullify (mt%adbl3d)
2354  else
2355  itr = memorystore%iterator()
2356  do while (itr%has_next())
2357  call itr%next()
2358  mt => itr%value()
2359  if (associated(mt%adbl3d, adbl)) then
2360  nullify (mt%adbl3d)
2361  found = .true.
2362  exit
2363  end if
2364  end do
2365  end if
2366  if (.not. found .and. size(adbl) > 0) then
2367  call store_error('programming error in deallocate_dbl3d', terminate=.true.)
2368  else
2369  if (mt%master) then
2370  deallocate (adbl)
2371  else
2372  nullify (adbl)
2373  end if
2374  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 2077 of file MemoryManager.f90.

2078  integer(I4B), pointer, intent(inout) :: sclr !< integer variable to deallocate
2079  ! -- local
2080  class(MemoryType), pointer :: mt
2081  logical(LGP) :: found
2082  type(MemoryContainerIteratorType), allocatable :: itr
2083  ! -- code
2084  found = .false.
2085  itr = memorystore%iterator()
2086  do while (itr%has_next())
2087  call itr%next()
2088  mt => itr%value()
2089  if (associated(mt%intsclr, sclr)) then
2090  nullify (mt%intsclr)
2091  found = .true.
2092  exit
2093  end if
2094  end do
2095  if (.not. found) then
2096  call store_error('Programming error in deallocate_int.', terminate=.true.)
2097  else
2098  if (mt%master) then
2099  deallocate (sclr)
2100  else
2101  nullify (sclr)
2102  end if
2103  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 2139 of file MemoryManager.f90.

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

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

2220  integer(I4B), dimension(:, :, :), pointer, contiguous, intent(inout) :: aint !< 3d integer array to deallocate
2221  character(len=*), optional :: name !< variable name
2222  character(len=*), optional :: mem_path !< path where variable is stored
2223  ! -- local
2224  type(MemoryType), pointer :: mt
2225  logical(LGP) :: found
2226  type(MemoryContainerIteratorType), allocatable :: itr
2227  ! -- code
2228  !
2229  ! -- process optional variables
2230  found = .false.
2231  if (present(name) .and. present(mem_path)) then
2232  call get_from_memorystore(name, mem_path, mt, found)
2233  nullify (mt%aint3d)
2234  else
2235  itr = memorystore%iterator()
2236  do while (itr%has_next())
2237  call itr%next()
2238  mt => itr%value()
2239  if (associated(mt%aint3d, aint)) then
2240  nullify (mt%aint3d)
2241  found = .true.
2242  exit
2243  end if
2244  end do
2245  end if
2246  if (.not. found .and. size(aint) > 0) then
2247  call store_error('programming error in deallocate_int3d', terminate=.true.)
2248  else
2249  if (mt%master) then
2250  deallocate (aint)
2251  else
2252  nullify (aint)
2253  end if
2254  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 2045 of file MemoryManager.f90.

2046  logical(LGP), pointer, intent(inout) :: sclr !< logical scalar to deallocate
2047  ! -- local
2048  class(MemoryType), pointer :: mt
2049  logical(LGP) :: found
2050  type(MemoryContainerIteratorType), allocatable :: itr
2051  ! -- code
2052  found = .false.
2053  itr = memorystore%iterator()
2054  do while (itr%has_next())
2055  call itr%next()
2056  mt => itr%value()
2057  if (associated(mt%logicalsclr, sclr)) then
2058  nullify (mt%logicalsclr)
2059  found = .true.
2060  exit
2061  end if
2062  end do
2063  if (.not. found) then
2064  call store_error('programming error in deallocate_logical', &
2065  terminate=.true.)
2066  else
2067  if (mt%master) then
2068  deallocate (sclr)
2069  else
2070  nullify (sclr)
2071  end if
2072  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 1923 of file MemoryManager.f90.

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

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

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