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 119 of file Mf6FileListInput.f90.

120  class(BoundListInputType), intent(inout) :: this !< ListInputType
121  ! advance timeseries
122  call this%tsmanager%ad()

◆ bndlist_create_structarray()

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

Definition at line 294 of file Mf6FileListInput.f90.

297  class(BoundListInputType), intent(inout) :: this
298  type(InputParamDefinitionType), pointer :: idt
299  integer(I4B) :: icol
300 
301  ! construct and set up the struct array object
302  this%structarray => constructstructarray(this%mf6_input, this%nparam, &
303  this%bound_context%maxbound, 0, &
304  this%mf6_input%mempath, &
305  this%mf6_input%component_mempath)
306  ! set up struct array
307  do icol = 1, this%nparam
308  idt => get_param_definition_type(this%mf6_input%param_dfns, &
309  this%mf6_input%component_type, &
310  this%mf6_input%subcomponent_type, &
311  'PERIOD', &
312  this%param_names(icol), this%input_name)
313  ! allocate variable in memory manager
314  call this%structarray%mem_create_vector(icol, idt)
315  ! store boundname index when found
316  if (idt%mf6varname == 'BOUNDNAME') this%iboundname = icol
317  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 170 of file Mf6FileListInput.f90.

171  class(BoundListInputType), intent(inout) :: this !< BoundListInputType
172  !
173  ! deallocate tsmanager
174  call this%tsmanager%da()
175  deallocate (this%tsmanager)
176  nullify (this%tsmanager)
177  !
178  ! deallocate StructArray
179  call destructstructarray(this%structarray)
180  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 113 of file Mf6FileListInput.f90.

114  class(BoundListInputType), intent(inout) :: this !< ListInputType
115  ! define tsmanager
116  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  if (ts6_size > 0) then
92  this%ts_active = 1
93  call mem_setptr(ts_fnames, 'TS6_FILENAME', this%mf6_input%mempath)
94  do n = 1, size(ts_fnames)
95  fname = ts_fnames(n)
96  call this%tsmanager%add_tsfile(fname, getunit())
97  end do
98  end if
99 
100  ! initialize package input context
101  call this%bound_context%create(mf6_input, this%readasarrays)
102 
103  ! store in scope SA cols for list input
104  call this%bound_context%bound_params(this%param_names, this%nparam, &
105  this%input_name, create=.false.)
106  ! construct and set up the struct array object
107  call this%create_structarray()
108 
109  ! finalize input context setup
110  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 125 of file Mf6FileListInput.f90.

126  class(BoundListInputType), intent(inout) :: this !< ListInputType
127  ! reset tsmanager
128  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 131 of file Mf6FileListInput.f90.

136  class(BoundListInputType), intent(inout) :: this
137  type(BlockParserType), pointer, intent(inout) :: parser
138  integer(I4B) :: ibinary
139  integer(I4B) :: oc_inunit
140  logical(LGP) :: ts_active
141 
142  call this%reset()
143  ibinary = read_control_record(parser, oc_inunit, this%iout)
144 
145  ! log lst file header
146  call idm_log_header(this%mf6_input%component_name, &
147  this%mf6_input%subcomponent_name, this%iout)
148 
149  if (ibinary == 1) then
150  this%bound_context%nbound = &
151  this%structarray%read_from_binary(oc_inunit, this%iout)
152  call parser%terminateblock()
153  close (oc_inunit)
154  else
155  ts_active = (this%ts_active /= 0)
156  this%bound_context%nbound = &
157  this%structarray%read_from_parser(parser, ts_active, this%iout)
158  end if
159 
160  ! update ts links
161  if (this%ts_active /= 0) then
162  call this%ts_update(this%structarray)
163  end if
164 
165  ! close logging statement
166  call idm_log_close(this%mf6_input%component_name, &
167  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:56
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 280 of file Mf6FileListInput.f90.

282  class(BoundListInputType), intent(inout) :: this
283  type(StructVectorType), pointer, intent(in) :: structvector
284  type(TSStringLocType), pointer, intent(in) :: ts_strloc
285  select case (structvector%memtype)
286  case (2) ! dbl1d
287  call this%ts_link_bnd(structvector, ts_strloc)
288  case (6) ! dbl2d
289  call this%ts_link_aux(structvector, ts_strloc)
290  case default
291  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 218 of file Mf6FileListInput.f90.

222  class(BoundListInputType), intent(inout) :: this
223  type(StructVectorType), pointer, intent(in) :: structvector
224  type(TSStringLocType), pointer, intent(in) :: ts_strloc
225  real(DP), pointer :: bndElem
226  type(TimeSeriesLinkType), pointer :: tsLinkAux
227  type(StructVectorType), pointer :: sv_bound
228  character(len=LENBOUNDNAME) :: boundname
229 
230  nullify (tslinkaux)
231 
232  ! set bound element
233  bndelem => structvector%dbl2d(ts_strloc%col, ts_strloc%row)
234 
235  ! set link
236  call read_value_or_time_series(ts_strloc%token, ts_strloc%row, &
237  ts_strloc%structarray_col, bndelem, &
238  this%mf6_input%subcomponent_name, &
239  'AUX', this%tsmanager, &
240  this%bound_context%iprpak, tslinkaux)
241  if (associated(tslinkaux)) then
242  ! set variable name
243  tslinkaux%Text = this%bound_context%auxname_cst(ts_strloc%col)
244  ! set boundname if provided
245  if (this%bound_context%inamedbound > 0) then
246  sv_bound => this%structarray%get(this%iboundname)
247  boundname = sv_bound%charstr1d(ts_strloc%row)
248  tslinkaux%BndName = boundname
249  end if
250  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 183 of file Mf6FileListInput.f90.

187  class(BoundListInputType), intent(inout) :: this
188  type(StructVectorType), pointer, intent(in) :: structvector
189  type(TSStringLocType), pointer, intent(in) :: ts_strloc
190  real(DP), pointer :: bndElem
191  type(TimeSeriesLinkType), pointer :: tsLinkBnd
192  type(StructVectorType), pointer :: sv_bound
193  character(len=LENBOUNDNAME) :: boundname
194 
195  nullify (tslinkbnd)
196 
197  ! set bound element
198  bndelem => structvector%dbl1d(ts_strloc%row)
199 
200  ! set link
201  call read_value_or_time_series(ts_strloc%token, ts_strloc%row, &
202  ts_strloc%structarray_col, bndelem, &
203  this%mf6_input%subcomponent_name, &
204  'BND', this%tsmanager, &
205  this%bound_context%iprpak, tslinkbnd)
206  if (associated(tslinkbnd)) then
207  ! set variable name
208  tslinkbnd%Text = structvector%idt%mf6varname
209  ! set boundname if provided
210  if (this%bound_context%inamedbound > 0) then
211  sv_bound => this%structarray%get(this%iboundname)
212  boundname = sv_bound%charstr1d(ts_strloc%row)
213  tslinkbnd%BndName = boundname
214  end if
215  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 253 of file Mf6FileListInput.f90.

257  class(BoundListInputType), intent(inout) :: this
258  type(StructArrayType), pointer, intent(inout) :: structarray
259  integer(I4B) :: n, m
260  type(TSStringLocType), pointer :: ts_strloc
261  type(StructVectorType), pointer :: sv
262 
263  do m = 1, structarray%count()
264  sv => structarray%get(m)
265  if (sv%idt%timeseries) then
266  do n = 1, sv%ts_strlocs%count()
267  ts_strloc => sv%get_ts_strloc(n)
268  call this%ts_link(sv, ts_strloc)
269  end do
270  call sv%clear()
271  end if
272  end do
273 
274  ! terminate if errors were detected
275  if (count_errors() > 0) then
276  call store_error_filename(this%input_name)
277  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: