MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
arrayhandlersmodule::expandarraywrapper Interface Reference
Collaboration diagram for arrayhandlersmodule::expandarraywrapper:
Collaboration graph

Public Member Functions

subroutine expand_integer_wrapper (nsize, array, minvalue, loginc)

Detailed Description

Definition at line 13 of file ArrayHandlers.f90.

Member Function/Subroutine Documentation

◆ expand_integer_wrapper()

subroutine arrayhandlersmodule::expandarraywrapper::expand_integer_wrapper ( integer(i4b), intent(in) nsize,
integer(i4b), dimension(:), intent(inout), allocatable array,
integer(i4b), intent(in), optional minvalue,
logical(lgp), intent(in), optional loginc )

Definition at line 50 of file ArrayHandlers.f90.

51 ! -- dummy
52 integer(I4B), intent(in) :: nsize
53 integer(I4B), allocatable, intent(inout) :: array(:)
54 integer(I4B), intent(in), optional :: minvalue
55 logical(LGP), intent(in), optional :: loginc
56 ! -- local
57 logical(LGP) :: log_increment
58 integer(I4B) :: minimum_increment
59 integer(I4B) :: increment
60 integer(I4B) :: isize
61 integer(I4B) :: n
62 !
63 ! -- process optional variables
64 if (present(minvalue)) then
65 minimum_increment = minvalue
66 else
67 minimum_increment = 100
68 end if
69 if (present(loginc)) then
70 log_increment = loginc
71 else
72 log_increment = .false.
73 end if
74 !
75 ! -- determine current size of the array
76 isize = size(array)
77 !
78 ! -- expand the array if necessary
79 if (nsize > isize) then
80 !
81 ! -- increase array size by 1, 10, 100, 1000, etc.
82 ! from 1 to 9, 10 to 99, 100 to 999, 1000 to 10000, etc.
83 if (loginc) then
84 increment = int(log10(real(nsize, dp)), i4b)
85 increment = int(dten**increment, i4b)
86 !
87 ! -- increase increment by a multiplier and a value no
88 ! smaller than a default or specified minimum size
89 else
90 increment = int(nsize * 0.2_dp)
91 increment = max(minimum_increment, increment)
92 end if
93 !
94 ! -- expand the array
95 call expandarray(array, increment)
96 !
97 ! -- initialize expanded array elements
98 do n = isize + 1, size(array)
99 array(n) = 0
100 end do
101 end if
102

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