MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
dynamicpackageparamsmodule Module Reference

This module contains the DynamicPackageParamsModule.

Data Types

type  dynamicpackageparamstype
 dynamic parameter filter type More...
 

Functions/Subroutines

subroutine init (this, mf6_input, readasarrays, naux, inamedbound)
 initialize dynamic param filter More...
 
subroutine destroy (this)
 destroy More...
 
subroutine set_filtered_grid (this)
 array based input dynamic param filter More...
 
subroutine set_filtered_list (this)
 create array of in scope list input columns More...
 
subroutine package_params (this, params, nparam)
 allocate and set input array to filtered param set More...
 
subroutine, public allocate_param_charstr (strlen, nrow, varname, mempath)
 allocate character string type array More...
 
subroutine, public allocate_param_int1d (nrow, varname, mempath)
 allocate int1d More...
 
subroutine, public allocate_param_int2d (ncol, nrow, varname, mempath)
 allocate int2d More...
 
subroutine, public allocate_param_dbl1d (nrow, varname, mempath)
 allocate dbl1d More...
 
subroutine, public allocate_param_dbl2d (ncol, nrow, varname, mempath)
 allocate dbl2d More...
 
logical(lgp) function pkg_param_in_scope (mf6_input, tagname)
 determine if input param is in scope for a package More...
 

Function/Subroutine Documentation

◆ allocate_param_charstr()

subroutine, public dynamicpackageparamsmodule::allocate_param_charstr ( integer(i4b), intent(in)  strlen,
integer(i4b), intent(in)  nrow,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath 
)
Parameters
[in]strlenstring number of characters
[in]nrowinteger array number of rows
[in]varnamevariable name
[in]mempathvariable mempath

Definition at line 250 of file DynamicPackageParams.f90.

251  integer(I4B), intent(in) :: strlen !< string number of characters
252  integer(I4B), intent(in) :: nrow !< integer array number of rows
253  character(len=*), intent(in) :: varname !< variable name
254  character(len=*), intent(in) :: mempath !< variable mempath
255  type(CharacterStringType), dimension(:), pointer, &
256  contiguous :: charstr1d
257  integer(I4B) :: n
258  !
259  call mem_allocate(charstr1d, strlen, nrow, varname, mempath)
260  do n = 1, nrow
261  charstr1d(n) = ''
262  end do
Here is the caller graph for this function:

◆ allocate_param_dbl1d()

subroutine, public dynamicpackageparamsmodule::allocate_param_dbl1d ( integer(i4b), intent(in)  nrow,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath 
)
Parameters
[in]nrowinteger array number of rows
[in]varnamevariable name
[in]mempathvariable mempath

Definition at line 300 of file DynamicPackageParams.f90.

301  integer(I4B), intent(in) :: nrow !< integer array number of rows
302  character(len=*), intent(in) :: varname !< variable name
303  character(len=*), intent(in) :: mempath !< variable mempath
304  real(DP), dimension(:), pointer, contiguous :: dbl1d
305  integer(I4B) :: n
306  !
307  call mem_allocate(dbl1d, nrow, varname, mempath)
308  do n = 1, nrow
309  dbl1d(n) = dzero
310  end do
Here is the caller graph for this function:

◆ allocate_param_dbl2d()

subroutine, public dynamicpackageparamsmodule::allocate_param_dbl2d ( integer(i4b), intent(in)  ncol,
integer(i4b), intent(in)  nrow,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath 
)
Parameters
[in]ncolinteger array number of cols
[in]nrowinteger array number of rows
[in]varnamevariable name
[in]mempathvariable mempath

Definition at line 315 of file DynamicPackageParams.f90.

316  integer(I4B), intent(in) :: ncol !< integer array number of cols
317  integer(I4B), intent(in) :: nrow !< integer array number of rows
318  character(len=*), intent(in) :: varname !< variable name
319  character(len=*), intent(in) :: mempath !< variable mempath
320  real(DP), dimension(:, :), pointer, contiguous :: dbl2d
321  integer(I4B) :: n, m
322  !
323  call mem_allocate(dbl2d, ncol, nrow, varname, mempath)
324  do m = 1, nrow
325  do n = 1, ncol
326  dbl2d(n, m) = dzero
327  end do
328  end do
Here is the caller graph for this function:

◆ allocate_param_int1d()

subroutine, public dynamicpackageparamsmodule::allocate_param_int1d ( integer(i4b), intent(in)  nrow,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath 
)
Parameters
[in]nrowinteger array number of rows
[in]varnamevariable name
[in]mempathvariable mempath

Definition at line 267 of file DynamicPackageParams.f90.

268  integer(I4B), intent(in) :: nrow !< integer array number of rows
269  character(len=*), intent(in) :: varname !< variable name
270  character(len=*), intent(in) :: mempath !< variable mempath
271  integer(I4B), dimension(:), pointer, contiguous :: int1d
272  integer(I4B) :: n
273  !
274  call mem_allocate(int1d, nrow, varname, mempath)
275  do n = 1, nrow
276  int1d(n) = izero
277  end do
Here is the caller graph for this function:

◆ allocate_param_int2d()

subroutine, public dynamicpackageparamsmodule::allocate_param_int2d ( integer(i4b), intent(in)  ncol,
integer(i4b), intent(in)  nrow,
character(len=*), intent(in)  varname,
character(len=*), intent(in)  mempath 
)
Parameters
[in]ncolinteger array number of cols
[in]nrowinteger array number of rows
[in]varnamevariable name
[in]mempathvariable mempath

Definition at line 282 of file DynamicPackageParams.f90.

283  integer(I4B), intent(in) :: ncol !< integer array number of cols
284  integer(I4B), intent(in) :: nrow !< integer array number of rows
285  character(len=*), intent(in) :: varname !< variable name
286  character(len=*), intent(in) :: mempath !< variable mempath
287  integer(I4B), dimension(:, :), pointer, contiguous :: int2d
288  integer(I4B) :: n, m
289  !
290  call mem_allocate(int2d, ncol, nrow, varname, mempath)
291  do m = 1, nrow
292  do n = 1, ncol
293  int2d(n, m) = izero
294  end do
295  end do
Here is the caller graph for this function:

◆ destroy()

subroutine dynamicpackageparamsmodule::destroy ( class(dynamicpackageparamstype this)
private

Definition at line 79 of file DynamicPackageParams.f90.

80  ! -- modules
81  ! -- dummy
82  class(DynamicPackageParamsType) :: this
83  !
84  ! -- deallocate
85  if (allocated(this%params)) deallocate (this%params)
86  !
87  ! --return
88  return

◆ init()

subroutine dynamicpackageparamsmodule::init ( class(dynamicpackageparamstype this,
type(modflowinputtype), intent(in)  mf6_input,
logical(lgp), intent(in)  readasarrays,
integer(i4b), intent(in)  naux,
integer(i4b), intent(in)  inamedbound 
)
private

Definition at line 50 of file DynamicPackageParams.f90.

51  ! -- modules
52  ! -- dummy
53  class(DynamicPackageParamsType) :: this
54  type(ModflowInputType), intent(in) :: mf6_input
55  logical(LGP), intent(in) :: readasarrays
56  integer(I4B), intent(in) :: naux
57  integer(I4B), intent(in) :: inamedbound
58  ! -- local
59  !
60  this%mf6_input = mf6_input
61  this%nparam = 0
62  this%naux = naux
63  this%inamedbound = inamedbound
64  !
65  ! -- determine in scope input params
66  if (readasarrays) then
67  call this%set_filtered_grid()
68  else
69  call this%set_filtered_list()
70  end if
71  !
72  ! --return
73  return

◆ package_params()

subroutine dynamicpackageparamsmodule::package_params ( class(dynamicpackageparamstype this,
character(len=linelength), dimension(:), intent(inout), allocatable  params,
integer(i4b), intent(inout)  nparam 
)
private

Definition at line 225 of file DynamicPackageParams.f90.

226  ! -- modules
227  ! -- dummy
228  class(DynamicPackageParamsType) :: this
229  character(len=LINELENGTH), dimension(:), allocatable, &
230  intent(inout) :: params
231  integer(I4B), intent(inout) :: nparam
232  integer(I4B) :: n
233  !
234  if (allocated(params)) deallocate (params)
235  !
236  nparam = this%nparam
237  !
238  allocate (params(nparam))
239  !
240  do n = 1, nparam
241  params(n) = this%params(n)
242  end do
243  !
244  ! -- return
245  return

◆ pkg_param_in_scope()

logical(lgp) function dynamicpackageparamsmodule::pkg_param_in_scope ( type(modflowinputtype), intent(in)  mf6_input,
character(len=*), intent(in)  tagname 
)
private

Definition at line 334 of file DynamicPackageParams.f90.

335  ! -- modules
337  ! -- dummy
338  type(ModflowInputType), intent(in) :: mf6_input
339  character(len=*), intent(in) :: tagname
340  ! -- return
341  logical(LGP) :: in_scope
342  ! -- local
343  type(InputParamDefinitionType), pointer :: idt
344  integer(I4B) :: pdim_isize, popt_isize
345  integer(I4B), pointer :: pdim
346  !
347  ! -- initialize
348  in_scope = .false.
349  !
350  idt => get_param_definition_type(mf6_input%param_dfns, &
351  mf6_input%component_type, &
352  mf6_input%subcomponent_type, &
353  'PERIOD', tagname, '')
354  !
355  if (idt%required) then
356  ! -- required params always included
357  in_scope = .true.
358  else
359  !
360  ! -- package specific logic to determine if input params to be read
361  select case (mf6_input%subcomponent_type)
362  case ('EVT')
363  !
364  if (tagname == 'PXDP' .or. tagname == 'PETM') then
365  call get_isize('NSEG', mf6_input%mempath, pdim_isize)
366  if (pdim_isize > 0) then
367  call mem_setptr(pdim, 'NSEG', mf6_input%mempath)
368  if (pdim > 1) then
369  in_scope = .true.
370  end if
371  end if
372  else if (tagname == 'PETM0') then
373  call get_isize('SURFRATESPEC', mf6_input%mempath, popt_isize)
374  if (popt_isize > 0) then
375  in_scope = .true.
376  end if
377  end if
378  !
379  case default
380  errmsg = 'IDM unimplemented. DynamicPackageParamsType::pkg_param_in_scope &
381  &add case tagname='//trim(idt%tagname)
382  call store_error(errmsg, .true.)
383  !call store_error_filename(sourcename)
384  end select
385  end if
386  !
387  ! -- return
388  return
subroutine, public get_isize(name, mem_path, isize)
@ brief Get the number of elements for this variable
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_filtered_grid()

subroutine dynamicpackageparamsmodule::set_filtered_grid ( class(dynamicpackageparamstype this)
private

Definition at line 94 of file DynamicPackageParams.f90.

95  ! -- modules
96  ! -- dummy
97  class(DynamicPackageParamsType) :: this
98  ! -- local
99  type(InputParamDefinitionType), pointer :: idt
100  integer(I4B), dimension(:), allocatable :: idt_idxs
101  integer(I4B) :: keepcnt, iparam
102  logical(LGP) :: keep
103  !
104  ! -- initialize
105  keepcnt = 0
106  !
107  ! -- allocate dfn input params
108  do iparam = 1, size(this%mf6_input%param_dfns)
109  !
110  keep = .true.
111  !
112  ! -- assign param definition pointer
113  idt => this%mf6_input%param_dfns(iparam)
114  !
115  if (idt%blockname /= 'PERIOD') then
116  keep = .false.
117  end if
118  !
119  if (idt%tagname == 'AUX') then
120  if (this%naux == 0) then
121  keep = .false.
122  end if
123  end if
124  !
125  if (keep) then
126  keepcnt = keepcnt + 1
127  call expandarray(idt_idxs)
128  idt_idxs(keepcnt) = iparam
129  end if
130  end do
131  !
132  ! -- update nparam
133  this%nparam = keepcnt
134  !
135  ! -- allocate filtcols
136  allocate (this%params(this%nparam))
137  !
138  ! -- set filtcols
139  do iparam = 1, this%nparam
140  idt => this%mf6_input%param_dfns(idt_idxs(iparam))
141  this%params(iparam) = trim(idt%tagname)
142  end do
143  !
144  ! -- cleanup
145  deallocate (idt_idxs)
146  !
147  ! -- return
148  return

◆ set_filtered_list()

subroutine dynamicpackageparamsmodule::set_filtered_list ( class(dynamicpackageparamstype this)
private

Filter the recarray description of list input parameters to determine which columns are to be read in this run.

Definition at line 156 of file DynamicPackageParams.f90.

157  ! -- modules
158  ! -- dummy
159  class(DynamicPackageParamsType) :: this
160  ! -- local
161  type(InputParamDefinitionType), pointer :: ra_idt, idt
162  character(len=LINELENGTH), dimension(:), allocatable :: ra_cols
163  integer(I4B) :: ra_ncol, icol, keepcnt
164  logical(LGP) :: keep
165  !
166  ! -- initialize
167  keepcnt = 0
168  !
169  ! -- get aggregate param definition for period block
170  ra_idt => &
171  get_aggregate_definition_type(this%mf6_input%aggregate_dfns, &
172  this%mf6_input%component_type, &
173  this%mf6_input%subcomponent_type, &
174  'PERIOD')
175  !
176  ! -- split recarray definition
177  call idt_parse_rectype(ra_idt, ra_cols, ra_ncol)
178  !
179  ! -- determine which columns are in scope
180  do icol = 1, ra_ncol
181  !
182  keep = .false.
183  !
184  ! -- set dfn pointer to recarray parameter
185  idt => get_param_definition_type(this%mf6_input%param_dfns, &
186  this%mf6_input%component_type, &
187  this%mf6_input%subcomponent_type, &
188  'PERIOD', ra_cols(icol), '')
189  !
190  if (ra_cols(icol) == 'RECARRAY') then
191  ! no-op
192  else if (ra_cols(icol) == 'AUX') then
193  if (this%naux > 0) then
194  keep = .true.
195  end if
196  else if (ra_cols(icol) == 'BOUNDNAME') then
197  if (this%inamedbound /= 0) then
198  keep = .true.
199  end if
200  else
201  ! -- determine if the param is scope
202  keep = pkg_param_in_scope(this%mf6_input, ra_cols(icol))
203  end if
204  !
205  if (keep) then
206  keepcnt = keepcnt + 1
207  call expandarray(this%params)
208  this%params(keepcnt) = trim(ra_cols(icol))
209  end if
210  end do
211  !
212  ! -- update nparam
213  this%nparam = keepcnt
214  !
215  ! -- cleanup
216  deallocate (ra_cols)
217  !
218  ! -- return
219  return
Here is the call graph for this function: