MODFLOW 6  version 6.8.0.dev0
USGS Modular Hydrologic Model
listloadmodule Module Reference

This module contains the ListLoadModule. More...

Data Types

type  listloadtype
 list input loader for dynamic packages. More...
 

Functions/Subroutines

subroutine ainit (this, mf6_input, component_name, component_input_name, input_name, iperblock, parser, iout)
 
subroutine df (this)
 
subroutine ad (this)
 
subroutine reset (this)
 
subroutine rp (this, parser)
 
subroutine destroy (this)
 
subroutine create_structarray (this)
 

Detailed Description

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

Function/Subroutine Documentation

◆ ad()

subroutine listloadmodule::ad ( class(listloadtype), intent(inout)  this)

Definition at line 128 of file Mf6FileList.f90.

129  class(ListLoadType), intent(inout) :: this
130  ! advance timeseries
131  call this%tsmanager%ad()

◆ ainit()

subroutine listloadmodule::ainit ( class(listloadtype), 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 49 of file Mf6FileList.f90.

51  use inputoutputmodule, only: getunit
55  class(ListLoadType), intent(inout) :: this
56  type(ModflowInputType), intent(in) :: mf6_input
57  character(len=*), intent(in) :: component_name
58  character(len=*), intent(in) :: component_input_name
59  character(len=*), intent(in) :: input_name
60  integer(I4B), intent(in) :: iperblock
61  type(BlockParserType), pointer, intent(inout) :: parser
62  integer(I4B), intent(in) :: iout
63  type(CharacterStringType), dimension(:), pointer, contiguous :: ts_fnames
64  character(len=LINELENGTH) :: fname
65  integer(I4B) :: ts6_size, n
66 
67  ! init loader
68  call this%DynamicPkgLoadType%init(mf6_input, component_name, &
69  component_input_name, input_name, &
70  iperblock, iout)
71  ! initialize scalars
72  this%ts_active = .false.
73 
74  ! create tsmanager
75  allocate (this%tsmanager)
76  call tsmanager_cr(this%tsmanager, iout)
77 
78  ! load static input (TS6_FILENAME tag sets static_loader%ts_active)
79  call this%static_loader%load(parser, mf6_input, this%nc_vars, &
80  this%input_name, iout)
81 
82  ! if TS files were declared, add them to our tsmanager now
83  if (this%static_loader%ts_active) then
84  this%ts_active = .true.
85  call get_isize('TS6_FILENAME', mf6_input%mempath, ts6_size)
86  if (ts6_size > 0) then
87  call mem_setptr(ts_fnames, 'TS6_FILENAME', mf6_input%mempath)
88  do n = 1, size(ts_fnames)
89  fname = ts_fnames(n)
90  call this%tsmanager%add_tsfile(fname, getunit())
91  end do
92  end if
93  end if
94 
95  ! initialize package input context
96  call this%ctx%init(mf6_input)
97 
98  ! store in scope SA cols for list input
99  call this%ctx%tags(this%param_names, this%nparam, this%input_name)
100 
101  ! construct and set up the struct array object
102  call this%create_structarray()
103 
104  ! finalize input context setup
105  call this%ctx%allocate_arrays()
This module contains block parser methods.
Definition: BlockParser.f90:7
integer(i4b) function, public getunit()
Get a free unit number.
subroutine, public get_isize(name, mem_path, isize)
@ brief Get the number of elements for this variable
This class is used to store a single deferred-length character string. It was designed to work in an ...
Definition: CharString.f90:23
Here is the call graph for this function:

◆ create_structarray()

subroutine listloadmodule::create_structarray ( class(listloadtype), intent(inout)  this)
private

Definition at line 213 of file Mf6FileList.f90.

216  class(ListLoadType), intent(inout) :: this
217  type(InputParamDefinitionType), pointer :: idt
218  integer(I4B) :: icol
219 
220  ! construct and set up the struct array object
221  this%structarray => constructstructarray(this%mf6_input, this%nparam, &
222  this%ctx%maxbound, 0, &
223  this%mf6_input%mempath, &
224  this%mf6_input%component_mempath)
225  ! set up struct array
226  do icol = 1, this%nparam
227  idt => get_param_definition_type(this%mf6_input%param_dfns, &
228  this%mf6_input%component_type, &
229  this%mf6_input%subcomponent_type, &
230  'PERIOD', &
231  this%param_names(icol), this%input_name)
232  ! allocate variable in memory manager
233  call this%structarray%mem_create_vector(icol, idt)
234  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, found)
Return parameter definition.
Input definition module.
Input parameter definition. Describes an input parameter.
Here is the call graph for this function:

◆ destroy()

subroutine listloadmodule::destroy ( class(listloadtype), intent(inout)  this)

Definition at line 197 of file Mf6FileList.f90.

198  class(ListLoadType), intent(inout) :: this
199  !
200  ! clean up saved static structarrays
201  call this%static_loader%cleanup()
202  !
203  ! deallocate tsmanager
204  call this%tsmanager%da()
205  deallocate (this%tsmanager)
206  nullify (this%tsmanager)
207  !
208  ! deallocate StructArray
209  call destructstructarray(this%structarray)
210  call this%ctx%destroy()
Here is the call graph for this function:

◆ df()

subroutine listloadmodule::df ( class(listloadtype), intent(inout)  this)

Definition at line 108 of file Mf6FileList.f90.

110  class(ListLoadType), intent(inout) :: this
111  type(StructArrayType), pointer :: sa
112  integer(I4B) :: n
113  ! define tsmanager (TDIS is now available)
114  call this%tsmanager%tsmanager_df()
115  ! link static TS strlocs; preserve for re-registration after reset()
116  do n = 1, this%static_loader%ts_sa_count()
117  sa => this%static_loader%get_ts_sa(n)
118  if (associated(sa)) then
119  call sa%ts_update(this%tsmanager, &
120  this%mf6_input%subcomponent_name, &
121  this%ctx%iprpak, this%input_name, &
122  this%ctx%auxname_cst, &
123  clear_strlocs=.false.)
124  end if
125  end do
This module contains the StructArrayModule.
Definition: StructArray.f90:8
type for structured array
Definition: StructArray.f90:41

◆ reset()

subroutine listloadmodule::reset ( class(listloadtype), intent(inout)  this)
private

Definition at line 134 of file Mf6FileList.f90.

136  class(ListLoadType), intent(inout) :: this
137  type(StructArrayType), pointer :: sa
138  integer(I4B) :: n
139  ! clear TS links
140  call this%tsmanager%reset(this%mf6_input%subcomponent_name)
141  ! re-register static TS links (strlocs preserved in df)
142  if (this%ts_active) then
143  do n = 1, this%static_loader%ts_sa_count()
144  sa => this%static_loader%get_ts_sa(n)
145  if (associated(sa)) then
146  call sa%ts_update(this%tsmanager, &
147  this%mf6_input%subcomponent_name, &
148  this%ctx%iprpak, this%input_name, &
149  this%ctx%auxname_cst, &
150  clear_strlocs=.false.)
151  end if
152  end do
153  end if

◆ rp()

subroutine listloadmodule::rp ( class(listloadtype), intent(inout)  this,
type(blockparsertype), intent(inout), pointer  parser 
)

Definition at line 156 of file Mf6FileList.f90.

161  class(ListLoadType), intent(inout) :: this
162  type(BlockParserType), pointer, intent(inout) :: parser
163  integer(I4B) :: ibinary
164  integer(I4B) :: oc_inunit
165 
166  call this%reset()
167  ibinary = read_control_record(parser, oc_inunit, this%iout)
168 
169  ! log lst file header
170  call idm_log_header(this%mf6_input%component_name, &
171  this%mf6_input%subcomponent_name, this%iout)
172 
173  if (ibinary == 1) then
174  this%ctx%nbound = &
175  this%structarray%read_from_binary(oc_inunit, this%iout)
176  call parser%terminateblock()
177  close (oc_inunit)
178  else
179  this%ctx%nbound = &
180  this%structarray%read_from_parser(parser, this%ts_active, this%iout, &
181  this%input_name)
182  end if
183 
184  ! update ts links
185  if (this%ts_active) then
186  call this%structarray%ts_update(this%tsmanager, &
187  this%mf6_input%subcomponent_name, &
188  this%ctx%iprpak, this%input_name, &
189  this%ctx%auxname_cst)
190  end if
191 
192  ! close logging statement
193  call idm_log_close(this%mf6_input%component_name, &
194  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
This module contains the LoadMf6FileModule.
Definition: LoadMf6File.f90:8
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: