MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
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 121 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 2167 of file MemoryManager.f90.

2168  type(CharacterStringType), dimension(:), pointer, contiguous, &
2169  intent(inout) :: astr1d !< array of strings
2170  character(len=*), optional, intent(in) :: name !< variable name
2171  character(len=*), optional, intent(in) :: mem_path !< path where variable is stored
2172  ! -- local
2173  type(MemoryType), pointer :: mt
2174  logical(LGP) :: found
2175  integer(I4B) :: ipos
2176  ! -- code
2177  !
2178  ! -- process optional variables
2179  found = .false.
2180  if (present(name) .and. present(mem_path)) then
2181  call get_from_memorylist(name, mem_path, mt, found)
2182  nullify (mt%acharstr1d)
2183  else
2184  do ipos = 1, memorylist%count()
2185  mt => memorylist%Get(ipos)
2186  if (associated(mt%acharstr1d, astr1d)) then
2187  nullify (mt%acharstr1d)
2188  found = .true.
2189  exit
2190  end if
2191  end do
2192  end if
2193  if (.not. found .and. size(astr1d) > 0) then
2194  call store_error('programming error in deallocate_charstr1d', &
2195  terminate=.true.)
2196  else
2197  if (mt%master) then
2198  deallocate (astr1d)
2199  else
2200  nullify (astr1d)
2201  end if
2202  end if
2203  !
2204  ! -- return
2205  return
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 2275 of file MemoryManager.f90.

2276  real(DP), pointer, intent(inout) :: sclr !< real variable to deallocate
2277  ! -- local
2278  class(MemoryType), pointer :: mt
2279  logical(LGP) :: found
2280  integer(I4B) :: ipos
2281  ! -- code
2282  found = .false.
2283  do ipos = 1, memorylist%count()
2284  mt => memorylist%Get(ipos)
2285  if (associated(mt%dblsclr, sclr)) then
2286  nullify (mt%dblsclr)
2287  found = .true.
2288  exit
2289  end if
2290  end do
2291  if (.not. found) then
2292  call store_error('Programming error in deallocate_dbl.', terminate=.true.)
2293  else
2294  if (mt%master) then
2295  deallocate (sclr)
2296  else
2297  nullify (sclr)
2298  end if
2299  end if
2300  !
2301  ! -- return
2302  return
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 2430 of file MemoryManager.f90.

2431  real(DP), dimension(:), pointer, contiguous, intent(inout) :: adbl !< 1d real array to deallocate
2432  character(len=*), optional :: name !< variable name
2433  character(len=*), optional :: mem_path !< path where variable is stored
2434  ! -- local
2435  type(MemoryType), pointer :: mt
2436  logical(LGP) :: found
2437  integer(I4B) :: ipos
2438  ! -- code
2439  !
2440  ! -- process optional variables
2441  found = .false.
2442  if (present(name) .and. present(mem_path)) then
2443  call get_from_memorylist(name, mem_path, mt, found)
2444  nullify (mt%adbl1d)
2445  else
2446  do ipos = 1, memorylist%count()
2447  mt => memorylist%Get(ipos)
2448  if (associated(mt%adbl1d, adbl)) then
2449  nullify (mt%adbl1d)
2450  found = .true.
2451  exit
2452  end if
2453  end do
2454  end if
2455  if (.not. found .and. size(adbl) > 0) then
2456  call store_error('programming error in deallocate_dbl1d', terminate=.true.)
2457  else
2458  if (mt%master) then
2459  deallocate (adbl)
2460  else
2461  nullify (adbl)
2462  end if
2463  end if
2464  !
2465  ! -- return
2466  return
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 2471 of file MemoryManager.f90.

2472  real(DP), dimension(:, :), pointer, contiguous, intent(inout) :: adbl !< 2d real array to deallocate
2473  character(len=*), optional :: name !< variable name
2474  character(len=*), optional :: mem_path !< path where variable is stored
2475  ! -- local
2476  type(MemoryType), pointer :: mt
2477  logical(LGP) :: found
2478  integer(I4B) :: ipos
2479  ! -- code
2480  !
2481  ! -- process optional variables
2482  found = .false.
2483  if (present(name) .and. present(mem_path)) then
2484  call get_from_memorylist(name, mem_path, mt, found)
2485  nullify (mt%adbl2d)
2486  else
2487  do ipos = 1, memorylist%count()
2488  mt => memorylist%Get(ipos)
2489  if (associated(mt%adbl2d, adbl)) then
2490  nullify (mt%adbl2d)
2491  found = .true.
2492  exit
2493  end if
2494  end do
2495  end if
2496  if (.not. found .and. size(adbl) > 0) then
2497  call store_error('programming error in deallocate_dbl2d', terminate=.true.)
2498  else
2499  if (mt%master) then
2500  deallocate (adbl)
2501  else
2502  nullify (adbl)
2503  end if
2504  end if
2505  !
2506  ! -- return
2507  return
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 2512 of file MemoryManager.f90.

2513  real(DP), dimension(:, :, :), pointer, contiguous, intent(inout) :: adbl !< 3d real array to deallocate
2514  character(len=*), optional :: name !< variable name
2515  character(len=*), optional :: mem_path !< path where variable is stored
2516  ! -- local
2517  type(MemoryType), pointer :: mt
2518  logical(LGP) :: found
2519  integer(I4B) :: ipos
2520  ! -- code
2521  !
2522  ! -- process optional variables
2523  found = .false.
2524  if (present(name) .and. present(mem_path)) then
2525  call get_from_memorylist(name, mem_path, mt, found)
2526  nullify (mt%adbl3d)
2527  else
2528  do ipos = 1, memorylist%count()
2529  mt => memorylist%Get(ipos)
2530  if (associated(mt%adbl3d, adbl)) then
2531  nullify (mt%adbl3d)
2532  found = .true.
2533  exit
2534  end if
2535  end do
2536  end if
2537  if (.not. found .and. size(adbl) > 0) then
2538  call store_error('programming error in deallocate_dbl3d', terminate=.true.)
2539  else
2540  if (mt%master) then
2541  deallocate (adbl)
2542  else
2543  nullify (adbl)
2544  end if
2545  end if
2546  !
2547  ! -- return
2548  return
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 2243 of file MemoryManager.f90.

2244  integer(I4B), pointer, intent(inout) :: sclr !< integer variable to deallocate
2245  ! -- local
2246  class(MemoryType), pointer :: mt
2247  logical(LGP) :: found
2248  integer(I4B) :: ipos
2249  ! -- code
2250  found = .false.
2251  do ipos = 1, memorylist%count()
2252  mt => memorylist%Get(ipos)
2253  if (associated(mt%intsclr, sclr)) then
2254  nullify (mt%intsclr)
2255  found = .true.
2256  exit
2257  end if
2258  end do
2259  if (.not. found) then
2260  call store_error('Programming error in deallocate_int.', terminate=.true.)
2261  else
2262  if (mt%master) then
2263  deallocate (sclr)
2264  else
2265  nullify (sclr)
2266  end if
2267  end if
2268  !
2269  ! -- return
2270  return
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 2307 of file MemoryManager.f90.

2308  integer(I4B), dimension(:), pointer, contiguous, intent(inout) :: aint !< 1d integer array to deallocate
2309  character(len=*), optional :: name !< variable name
2310  character(len=*), optional :: mem_path !< path where variable is stored
2311  ! -- local
2312  type(MemoryType), pointer :: mt
2313  logical(LGP) :: found
2314  integer(I4B) :: ipos
2315  ! -- code
2316  !
2317  ! -- process optional variables
2318  found = .false.
2319  if (present(name) .and. present(mem_path)) then
2320  call get_from_memorylist(name, mem_path, mt, found)
2321  nullify (mt%aint1d)
2322  else
2323  do ipos = 1, memorylist%count()
2324  mt => memorylist%Get(ipos)
2325  if (associated(mt%aint1d, aint)) then
2326  nullify (mt%aint1d)
2327  found = .true.
2328  exit
2329  end if
2330  end do
2331  end if
2332  if (.not. found .and. size(aint) > 0) then
2333  call store_error('programming error in deallocate_int1d', terminate=.true.)
2334  else
2335  if (mt%master) then
2336  deallocate (aint)
2337  else
2338  nullify (aint)
2339  end if
2340  end if
2341  !
2342  ! -- return
2343  return
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 2348 of file MemoryManager.f90.

2349  integer(I4B), dimension(:, :), pointer, contiguous, intent(inout) :: aint !< 2d integer array to deallocate
2350  character(len=*), optional :: name !< variable name
2351  character(len=*), optional :: mem_path !< path where variable is stored
2352  ! -- local
2353  type(MemoryType), pointer :: mt
2354  logical(LGP) :: found
2355  integer(I4B) :: ipos
2356  ! -- code
2357  !
2358  ! -- process optional variables
2359  found = .false.
2360  if (present(name) .and. present(mem_path)) then
2361  call get_from_memorylist(name, mem_path, mt, found)
2362  nullify (mt%aint2d)
2363  else
2364  do ipos = 1, memorylist%count()
2365  mt => memorylist%Get(ipos)
2366  if (associated(mt%aint2d, aint)) then
2367  nullify (mt%aint2d)
2368  found = .true.
2369  exit
2370  end if
2371  end do
2372  end if
2373  if (.not. found .and. size(aint) > 0) then
2374  call store_error('programming error in deallocate_int2d', terminate=.true.)
2375  else
2376  if (mt%master) then
2377  deallocate (aint)
2378  else
2379  nullify (aint)
2380  end if
2381  end if
2382  !
2383  ! -- return
2384  return
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 2389 of file MemoryManager.f90.

2390  integer(I4B), dimension(:, :, :), pointer, contiguous, intent(inout) :: aint !< 3d integer array to deallocate
2391  character(len=*), optional :: name !< variable name
2392  character(len=*), optional :: mem_path !< path where variable is stored
2393  ! -- local
2394  type(MemoryType), pointer :: mt
2395  logical(LGP) :: found
2396  integer(I4B) :: ipos
2397  ! -- code
2398  !
2399  ! -- process optional variables
2400  found = .false.
2401  if (present(name) .and. present(mem_path)) then
2402  call get_from_memorylist(name, mem_path, mt, found)
2403  nullify (mt%aint3d)
2404  else
2405  do ipos = 1, memorylist%count()
2406  mt => memorylist%Get(ipos)
2407  if (associated(mt%aint3d, aint)) then
2408  nullify (mt%aint3d)
2409  found = .true.
2410  exit
2411  end if
2412  end do
2413  end if
2414  if (.not. found .and. size(aint) > 0) then
2415  call store_error('programming error in deallocate_int3d', terminate=.true.)
2416  else
2417  if (mt%master) then
2418  deallocate (aint)
2419  else
2420  nullify (aint)
2421  end if
2422  end if
2423  !
2424  ! -- return
2425  return
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 2210 of file MemoryManager.f90.

2211  logical(LGP), pointer, intent(inout) :: sclr !< logical scalar to deallocate
2212  ! -- local
2213  class(MemoryType), pointer :: mt
2214  logical(LGP) :: found
2215  integer(I4B) :: ipos
2216  ! -- code
2217  found = .false.
2218  do ipos = 1, memorylist%count()
2219  mt => memorylist%Get(ipos)
2220  if (associated(mt%logicalsclr, sclr)) then
2221  nullify (mt%logicalsclr)
2222  found = .true.
2223  exit
2224  end if
2225  end do
2226  if (.not. found) then
2227  call store_error('programming error in deallocate_logical', &
2228  terminate=.true.)
2229  else
2230  if (mt%master) then
2231  deallocate (sclr)
2232  else
2233  nullify (sclr)
2234  end if
2235  end if
2236  !
2237  ! -- return
2238  return
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 2085 of file MemoryManager.f90.

2086  character(len=*), pointer, intent(inout) :: sclr !< pointer to string
2087  character(len=*), intent(in), optional :: name !< variable name
2088  character(len=*), intent(in), optional :: mem_path !< path where variable is stored
2089  ! -- local
2090  type(MemoryType), pointer :: mt
2091  logical(LGP) :: found
2092  integer(I4B) :: ipos
2093  ! -- code
2094  found = .false.
2095  if (present(name) .and. present(mem_path)) then
2096  call get_from_memorylist(name, mem_path, mt, found)
2097  nullify (mt%strsclr)
2098  else
2099  do ipos = 1, memorylist%count()
2100  mt => memorylist%Get(ipos)
2101  if (associated(mt%strsclr, sclr)) then
2102  nullify (mt%strsclr)
2103  found = .true.
2104  exit
2105  end if
2106  end do
2107  end if
2108  if (.not. found) then
2109  call store_error('Programming error in deallocate_str.', terminate=.true.)
2110  else
2111  if (mt%master) then
2112  deallocate (sclr)
2113  else
2114  nullify (sclr)
2115  end if
2116  end if
2117  !
2118  ! -- return
2119  return
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 2125 of file MemoryManager.f90.

2126  character(len=*), dimension(:), pointer, contiguous, intent(inout) :: astr1d !< array of strings
2127  character(len=*), optional, intent(in) :: name !< variable name
2128  character(len=*), optional, intent(in) :: mem_path !< path where variable is stored
2129  ! -- local
2130  type(MemoryType), pointer :: mt
2131  logical(LGP) :: found
2132  integer(I4B) :: ipos
2133  ! -- code
2134  !
2135  ! -- process optional variables
2136  found = .false.
2137  if (present(name) .and. present(mem_path)) then
2138  call get_from_memorylist(name, mem_path, mt, found)
2139  nullify (mt%astr1d)
2140  else
2141  do ipos = 1, memorylist%count()
2142  mt => memorylist%Get(ipos)
2143  if (associated(mt%astr1d, astr1d)) then
2144  nullify (mt%astr1d)
2145  found = .true.
2146  exit
2147  end if
2148  end do
2149  end if
2150  if (.not. found .and. size(astr1d) > 0) then
2151  call store_error('programming error in deallocate_str1d', terminate=.true.)
2152  else
2153  if (mt%master) then
2154  deallocate (astr1d)
2155  else
2156  nullify (astr1d)
2157  end if
2158  end if
2159  !
2160  ! -- return
2161  return
Here is the call graph for this function:

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