MODFLOW 6  version 6.6.0.dev0
USGS Modular Hydrologic Model
mf6filelistinputmodule Module Reference

This module contains the Mf6FileListInputModule. More...

Data Types

type  boundlistinputtype
 Boundary package list loader. More...
 

Functions/Subroutines

subroutine bndlist_init (this, mf6_input, component_name, component_input_name, input_name, iperblock, parser, iout)
 
subroutine bndlist_df (this)
 
subroutine bndlist_ad (this)
 
subroutine bndlist_reset (this)
 
subroutine bndlist_rp (this, parser)
 
subroutine bndlist_destroy (this)
 
subroutine bndlist_ts_link_bnd (this, structvector, ts_strloc)
 
subroutine bndlist_ts_link_aux (this, structvector, ts_strloc)
 
subroutine bndlist_ts_update (this, structarray)
 
subroutine bndlist_ts_link (this, structvector, ts_strloc)
 
subroutine bndlist_create_structarray (this)
 

Detailed Description

This module contains the routines for reading period block list based input.

Function/Subroutine Documentation

◆ bndlist_ad()

subroutine mf6filelistinputmodule::bndlist_ad ( class(boundlistinputtype), intent(inout)  this)
private
Parameters
[in,out]thisListInputType

Definition at line 127 of file Mf6FileListInput.f90.

128  ! -- modules
129  class(BoundListInputType), intent(inout) :: this !< ListInputType
130  !
131  ! -- advance timeseries
132  call this%tsmanager%ad()

◆ bndlist_create_structarray()

subroutine mf6filelistinputmodule::bndlist_create_structarray ( class(boundlistinputtype), intent(inout)  this)

Definition at line 343 of file Mf6FileListInput.f90.

344  ! -- modules
347  ! -- dummy
348  class(BoundListInputType), intent(inout) :: this
349  ! -- local
350  type(InputParamDefinitionType), pointer :: idt
351  integer(I4B) :: icol
352  !
353  ! -- construct and set up the struct array object
354  this%structarray => constructstructarray(this%mf6_input, this%nparam, &
355  this%bound_context%maxbound, 0, &
356  this%mf6_input%mempath, &
357  this%mf6_input%component_mempath)
358  !
359  ! -- set up struct array
360  do icol = 1, this%nparam
361  !
362  idt => get_param_definition_type(this%mf6_input%param_dfns, &
363  this%mf6_input%component_type, &
364  this%mf6_input%subcomponent_type, &
365  'PERIOD', &
366  this%param_names(icol), this%input_name)
367  !
368  ! -- allocate variable in memory manager
369  call this%structarray%mem_create_vector(icol, idt)
370  !
371  ! -- store boundname index when found
372  if (idt%mf6varname == 'BOUNDNAME') this%iboundname = icol
373  !
374  end do
This module contains the DefinitionSelectModule.
type(inputparamdefinitiontype) function, pointer, public get_param_definition_type(input_definition_types, component_type, subcomponent_type, blockname, tagname, filename)
Return parameter definition.
This module contains the InputDefinitionModule.
Here is the call graph for this function:

◆ bndlist_destroy()

subroutine mf6filelistinputmodule::bndlist_destroy ( class(boundlistinputtype), intent(inout)  this)
Parameters
[in,out]thisBoundListInputType

Definition at line 192 of file Mf6FileListInput.f90.

193  ! -- modules
194  class(BoundListInputType), intent(inout) :: this !< BoundListInputType
195  !
196  deallocate (this%tsmanager)
197  !
198  ! -- deallocate StructArray
199  call destructstructarray(this%structarray)
200  !
201  call this%bound_context%destroy()
Here is the call graph for this function:

◆ bndlist_df()

subroutine mf6filelistinputmodule::bndlist_df ( class(boundlistinputtype), intent(inout)  this)
Parameters
[in,out]thisListInputType

Definition at line 118 of file Mf6FileListInput.f90.

119  ! -- modules
120  ! -- dummy
121  class(BoundListInputType), intent(inout) :: this !< ListInputType
122  !
123  ! -- define tsmanager
124  call this%tsmanager%tsmanager_df()

◆ bndlist_init()

subroutine mf6filelistinputmodule::bndlist_init ( class(boundlistinputtype), intent(inout)  this,
type(modflowinputtype), intent(in)  mf6_input,
character(len=*), intent(in)  component_name,
character(len=*), intent(in)  component_input_name,
character(len=*), intent(in)  input_name,
integer(i4b), intent(in)  iperblock,
type(blockparsertype), intent(inout), pointer  parser,
integer(i4b), intent(in)  iout 
)
private

Definition at line 54 of file Mf6FileListInput.f90.

56  use inputoutputmodule, only: getunit
60  class(BoundListInputType), intent(inout) :: this
61  type(ModflowInputType), intent(in) :: mf6_input
62  character(len=*), intent(in) :: component_name
63  character(len=*), intent(in) :: component_input_name
64  character(len=*), intent(in) :: input_name
65  integer(I4B), intent(in) :: iperblock
66  type(BlockParserType), pointer, intent(inout) :: parser
67  integer(I4B), intent(in) :: iout
68  type(LoadMf6FileType) :: loader
69  type(CharacterStringType), dimension(:), pointer, &
70  contiguous :: ts_fnames
71  character(len=LINELENGTH) :: fname
72  integer(I4B) :: ts6_size, n
73  !
74  ! -- init loader
75  call this%DynamicPkgLoadType%init(mf6_input, component_name, &
76  component_input_name, input_name, &
77  iperblock, iout)
78  ! -- initialize scalars
79  this%iboundname = 0
80  this%ts_active = 0
81  !
82  ! -- load static input
83  call loader%load(parser, mf6_input, this%nc_vars, this%input_name, iout)
84  !
85  ! -- create tsmanager
86  allocate (this%tsmanager)
87  call tsmanager_cr(this%tsmanager, iout)
88  !
89  ! -- determine if TS6 files were provided in OPTIONS block
90  call get_isize('TS6_FILENAME', this%mf6_input%mempath, ts6_size)
91  !
92  if (ts6_size > 0) then
93  !
94  this%ts_active = 1
95  call mem_setptr(ts_fnames, 'TS6_FILENAME', this%mf6_input%mempath)
96  !
97  do n = 1, size(ts_fnames)
98  fname = ts_fnames(n)
99  call this%tsmanager%add_tsfile(fname, getunit())
100  end do
101  !
102  end if
103  !
104  ! -- initialize package input context
105  call this%bound_context%create(mf6_input, this%readasarrays)
106  !
107  ! -- store in scope SA cols for list input
108  call this%bound_context%bound_params(this%param_names, this%nparam, &
109  this%input_name, create=.false.)
110  !
111  ! -- construct and set up the struct array object
112  call this%create_structarray()
113  !
114  ! -- finalize input context setup
115  call this%bound_context%allocate_arrays()
This module contains block parser methods.
Definition: BlockParser.f90:7
integer(i4b) function, public getunit()
Get a free unit number.
This module contains the LoadMf6FileModule.
Definition: LoadMf6File.f90:8
subroutine, public get_isize(name, mem_path, isize)
@ brief Get the number of elements for this variable
Static parser based input loader.
Definition: LoadMf6File.f90:48
Here is the call graph for this function:

◆ bndlist_reset()

subroutine mf6filelistinputmodule::bndlist_reset ( class(boundlistinputtype), intent(inout)  this)
private
Parameters
[in,out]thisListInputType

Definition at line 135 of file Mf6FileListInput.f90.

136  ! -- modules
137  class(BoundListInputType), intent(inout) :: this !< ListInputType
138  !
139  ! -- reset tsmanager
140  call this%tsmanager%reset(this%mf6_input%subcomponent_name)

◆ bndlist_rp()

subroutine mf6filelistinputmodule::bndlist_rp ( class(boundlistinputtype), intent(inout)  this,
type(blockparsertype), intent(inout), pointer  parser 
)
private

Definition at line 143 of file Mf6FileListInput.f90.

144  ! -- modules
149  ! -- dummy
150  class(BoundListInputType), intent(inout) :: this
151  type(BlockParserType), pointer, intent(inout) :: parser
152  ! -- local
153  integer(I4B) :: ibinary
154  integer(I4B) :: oc_inunit
155  logical(LGP) :: ts_active
156  !
157  call this%reset()
158  !
159  ibinary = read_control_record(parser, oc_inunit, this%iout)
160  !
161  ! -- log lst file header
162  call idm_log_header(this%mf6_input%component_name, &
163  this%mf6_input%subcomponent_name, this%iout)
164  !
165  if (ibinary == 1) then
166  !
167  this%bound_context%nbound = &
168  this%structarray%read_from_binary(oc_inunit, this%iout)
169  !
170  call parser%terminateblock()
171  !
172  close (oc_inunit)
173  !
174  else
175  !
176  ts_active = (this%ts_active /= 0)
177  !
178  this%bound_context%nbound = &
179  this%structarray%read_from_parser(parser, ts_active, this%iout)
180  end if
181  !
182  ! update ts links
183  if (this%ts_active /= 0) then
184  call this%ts_update(this%structarray)
185  end if
186  !
187  ! -- close logging statement
188  call idm_log_close(this%mf6_input%component_name, &
189  this%mf6_input%subcomponent_name, this%iout)
This module contains the Input Data Model Logger Module.
Definition: IdmLogger.f90:7
subroutine, public idm_log_close(component, subcomponent, iout)
@ brief log the closing message
Definition: IdmLogger.f90:57
subroutine, public idm_log_header(component, subcomponent, iout)
@ brief log a header message
Definition: IdmLogger.f90:44
integer(i4b) function, public read_control_record(parser, oc_inunit, iout)
This module contains the StructVectorModule.
Definition: StructVector.f90:7
derived type for generic vector
Here is the call graph for this function:

◆ bndlist_ts_link()

subroutine mf6filelistinputmodule::bndlist_ts_link ( class(boundlistinputtype), intent(inout)  this,
type(structvectortype), intent(in), pointer  structvector,
type(tsstringloctype), intent(in), pointer  ts_strloc 
)

Definition at line 321 of file Mf6FileListInput.f90.

322  ! -- modules
324  ! -- dummy
325  class(BoundListInputType), intent(inout) :: this
326  type(StructVectorType), pointer, intent(in) :: structvector
327  type(TSStringLocType), pointer, intent(in) :: ts_strloc
328  ! -- local
329  !
330  select case (structvector%memtype)
331  case (2) ! -- dbl1d
332  !
333  call this%ts_link_bnd(structvector, ts_strloc)
334  !
335  case (6) ! -- dbl2d
336  !
337  call this%ts_link_aux(structvector, ts_strloc)
338  !
339  case default
340  end select
derived type which describes time series string field

◆ bndlist_ts_link_aux()

subroutine mf6filelistinputmodule::bndlist_ts_link_aux ( class(boundlistinputtype), intent(inout)  this,
type(structvectortype), intent(in), pointer  structvector,
type(tsstringloctype), intent(in), pointer  ts_strloc 
)

Definition at line 245 of file Mf6FileListInput.f90.

246  ! -- modules
250  ! -- dummy
251  class(BoundListInputType), intent(inout) :: this
252  type(StructVectorType), pointer, intent(in) :: structvector
253  type(TSStringLocType), pointer, intent(in) :: ts_strloc
254  ! -- local
255  real(DP), pointer :: bndElem
256  type(TimeSeriesLinkType), pointer :: tsLinkAux
257  type(StructVectorType), pointer :: sv_bound
258  character(len=LENBOUNDNAME) :: boundname
259  !
260  nullify (tslinkaux)
261  !
262  ! -- set bound element
263  bndelem => structvector%dbl2d(ts_strloc%col, ts_strloc%row)
264  !
265  ! -- set link
266  call read_value_or_time_series(ts_strloc%token, ts_strloc%row, &
267  ts_strloc%structarray_col, bndelem, &
268  this%mf6_input%subcomponent_name, &
269  'AUX', this%tsmanager, &
270  this%bound_context%iprpak, tslinkaux)
271 
272  if (associated(tslinkaux)) then
273  !
274  ! -- set variable name
275  tslinkaux%Text = this%bound_context%auxname_cst(ts_strloc%col)
276  !
277  ! -- set boundname if provided
278  if (this%bound_context%inamedbound > 0) then
279  sv_bound => this%structarray%get(this%iboundname)
280  boundname = sv_bound%charstr1d(ts_strloc%row)
281  tslinkaux%BndName = boundname
282  end if
283  !
284  end if
subroutine, public read_value_or_time_series(textInput, ii, jj, bndElem, pkgName, auxOrBnd, tsManager, iprpak, tsLink)
Call this subroutine if the time-series link is available or needed.
Here is the call graph for this function:

◆ bndlist_ts_link_bnd()

subroutine mf6filelistinputmodule::bndlist_ts_link_bnd ( class(boundlistinputtype), intent(inout)  this,
type(structvectortype), intent(in), pointer  structvector,
type(tsstringloctype), intent(in), pointer  ts_strloc 
)
private

Definition at line 204 of file Mf6FileListInput.f90.

205  ! -- modules
209  ! -- dummy
210  class(BoundListInputType), intent(inout) :: this
211  type(StructVectorType), pointer, intent(in) :: structvector
212  type(TSStringLocType), pointer, intent(in) :: ts_strloc
213  ! -- local
214  real(DP), pointer :: bndElem
215  type(TimeSeriesLinkType), pointer :: tsLinkBnd
216  type(StructVectorType), pointer :: sv_bound
217  character(len=LENBOUNDNAME) :: boundname
218  !
219  nullify (tslinkbnd)
220  !
221  ! -- set bound element
222  bndelem => structvector%dbl1d(ts_strloc%row)
223  !
224  ! -- set link
225  call read_value_or_time_series(ts_strloc%token, ts_strloc%row, &
226  ts_strloc%structarray_col, bndelem, &
227  this%mf6_input%subcomponent_name, &
228  'BND', this%tsmanager, &
229  this%bound_context%iprpak, tslinkbnd)
230  !
231  if (associated(tslinkbnd)) then
232  !
233  ! -- set variable name
234  tslinkbnd%Text = structvector%idt%mf6varname
235  !
236  ! -- set boundname if provided
237  if (this%bound_context%inamedbound > 0) then
238  sv_bound => this%structarray%get(this%iboundname)
239  boundname = sv_bound%charstr1d(ts_strloc%row)
240  tslinkbnd%BndName = boundname
241  end if
242  end if
Here is the call graph for this function:

◆ bndlist_ts_update()

subroutine mf6filelistinputmodule::bndlist_ts_update ( class(boundlistinputtype), intent(inout)  this,
type(structarraytype), intent(inout), pointer  structarray 
)

Definition at line 287 of file Mf6FileListInput.f90.

288  ! -- modules
292  ! -- dummy
293  class(BoundListInputType), intent(inout) :: this
294  type(StructArrayType), pointer, intent(inout) :: structarray
295  ! -- local
296  integer(I4B) :: n, m
297  type(TSStringLocType), pointer :: ts_strloc
298  type(StructVectorType), pointer :: sv
299  !
300  do m = 1, structarray%count()
301 
302  sv => structarray%get(m)
303 
304  if (sv%idt%timeseries) then
305  !
306  do n = 1, sv%ts_strlocs%count()
307  ts_strloc => sv%get_ts_strloc(n)
308  call this%ts_link(sv, ts_strloc)
309  end do
310  !
311  call sv%clear()
312  end if
313  end do
314  !
315  ! -- terminate if errors were detected
316  if (count_errors() > 0) then
317  call store_error_filename(this%input_name)
318  end if
This module contains simulation methods.
Definition: Sim.f90:10
integer(i4b) function, public count_errors()
Return number of errors.
Definition: Sim.f90:59
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
Definition: Sim.f90:203
Here is the call graph for this function: