45 logical(LGP) :: ts_active
46 integer(I4B) :: nleading
59 subroutine ainit(this, mf6_input, component_name, component_input_name, &
60 input_name, iperblock, parser, iout)
68 character(len=*),
intent(in) :: component_name
69 character(len=*),
intent(in) :: component_input_name
70 character(len=*),
intent(in) :: input_name
71 integer(I4B),
intent(in) :: iperblock
73 integer(I4B),
intent(in) :: iout
75 character(len=LINELENGTH) :: fname
76 character(len=LENVARNAME),
allocatable :: named_bound(:)
77 character(len=LINELENGTH),
dimension(:),
allocatable :: member_names
78 integer(I4B) :: n, nmembers, isize
80 call this%DynamicPkgLoadType%init(mf6_input, component_name, &
81 component_input_name, input_name, &
83 this%ts_active = .false.
86 allocate (this%tsmanager)
90 call this%static_loader%load(parser, mf6_input, this%nc_vars, &
91 this%input_name, iout)
94 if (this%static_loader%ts_active)
then
95 this%ts_active = .true.
96 call get_isize(
'TS6_FILENAME', mf6_input%mempath, isize)
98 call mem_setptr(ts_fnames,
'TS6_FILENAME', mf6_input%mempath)
99 do n = 1,
size(ts_fnames)
101 call this%tsmanager%add_tsfile(fname,
getunit())
108 do n = 1,
size(mf6_input%param_dfns)
109 if (mf6_input%param_dfns(n)%blockname ==
'DIMENSIONS')
then
111 named_bound(
size(named_bound)) = trim(mf6_input%param_dfns(n)%mf6varname)
116 if (
allocated(named_bound))
then
117 call this%ctx%init(mf6_input, named_bound=named_bound)
119 call this%ctx%init(mf6_input)
122 call this%ctx%tags(this%param_names, this%nparam, this%input_name)
123 this%nleading = this%ctx%nleading
126 call this%ctx%keystring_member_names(member_names, nmembers)
128 this%nparam = this%nparam + 1
130 this%param_names(this%nparam) = trim(member_names(n))
134 call this%ctx%allocate_arrays()
137 call this%create_structarray()
146 call this%tsmanager%tsmanager_df()
148 do n = 1, this%static_loader%ts_sa_count()
149 sa => this%static_loader%get_ts_sa(n)
150 if (
associated(sa))
then
151 call sa%ts_update(this%tsmanager, &
152 this%mf6_input%subcomponent_name, &
153 this%ctx%iprpak, this%input_name, &
154 clear_strlocs=.false.)
161 call this%tsmanager%ad()
164 subroutine rp(this, parser)
172 this%mf6_input%subcomponent_name, this%iout)
175 this%structarray%read_from_parser_keystring(parser, this%ts_active, &
176 this%nleading, this%iout, &
179 if (this%ts_active)
then
180 call this%structarray%ts_update(this%tsmanager, &
181 this%mf6_input%subcomponent_name, &
182 this%ctx%iprpak, this%input_name)
186 this%mf6_input%subcomponent_name, this%iout)
195 call this%tsmanager%reset(this%mf6_input%subcomponent_name)
197 if (this%ts_active)
then
198 do n = 1, this%static_loader%ts_sa_count()
199 sa => this%static_loader%get_ts_sa(n)
200 if (
associated(sa))
then
201 call sa%ts_update(this%tsmanager, &
202 this%mf6_input%subcomponent_name, &
203 this%ctx%iprpak, this%input_name, &
204 clear_strlocs=.false.)
213 call this%static_loader%cleanup()
215 call this%tsmanager%da()
216 deallocate (this%tsmanager)
217 nullify (this%tsmanager)
219 if (
associated(this%structarray))
then
223 call this%ctx%destroy()
224 call this%DynamicPkgLoadType%destroy()
233 character(len=LINELENGTH),
allocatable :: rec_cols(:)
234 character(len=LINELENGTH) :: kwname, first_col
235 integer(I4B) :: icol, nrow_prealloc, jparam, nrec_col, nsub
239 if (
associated(this%ctx%maxbound) .and. this%ctx%maxbound > 0)
then
240 nrow_prealloc = this%ctx%maxbound
247 this%mf6_input%mempath, &
248 this%mf6_input%component_mempath)
249 do icol = 1, this%nparam
251 this%mf6_input%component_type, &
252 this%mf6_input%subcomponent_type, &
254 this%param_names(icol), this%input_name)
255 call this%structarray%mem_create_vector(icol, idt)
260 if (trim(idt%datatype) ==
'KEYWORD' .and. icol > this%nleading)
then
261 kwname = trim(idt%tagname)
264 do jparam = 1,
size(this%mf6_input%param_dfns)
265 pidt => this%mf6_input%param_dfns(jparam)
266 if (pidt%blockname /=
'PERIOD') cycle
267 if (pidt%datatype(1:6) /=
'RECORD') cycle
269 if (nrec_col >= 1)
then
270 first_col = trim(rec_cols(1))
272 if (trim(first_col) == trim(kwname))
then
274 if (
allocated(rec_cols))
deallocate (rec_cols)
278 if (
allocated(rec_cols))
deallocate (rec_cols)
280 this%structarray%struct_vectors(icol)%nsubmembers = nsub
This module contains block parser methods.
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
integer(i4b), parameter lenvarname
maximum length of a variable name
This module contains the DefinitionSelectModule.
subroutine, public idt_parse_rectype(idt, cols, ncol)
allocate and set RECARRAY, KEYSTRING or RECORD param list
type(inputparamdefinitiontype) function, pointer, public get_param_definition_type(input_definition_types, component_type, subcomponent_type, blockname, tagname, filename, found)
Return parameter definition.
This module contains the Input Data Model Logger Module.
subroutine, public idm_log_close(component, subcomponent, iout)
@ brief log the closing message
subroutine, public idm_log_header(component, subcomponent, iout)
@ brief log a header message
This module defines variable data types.
This module contains the LoadContextModule.
This module contains the LoadMf6FileModule.
subroutine, public get_isize(name, mem_path, isize)
@ brief Get the number of elements for this variable
Period block keystring-based input loader.
subroutine ainit(this, mf6_input, component_name, component_input_name, input_name, iperblock, parser, iout)
subroutine create_structarray(this)
subroutine rp(this, parser)
This module contains the StructArrayModule.
type(structarraytype) function, pointer, public constructstructarray(mf6_input, ncol, nrow, blocknum, mempath, component_mempath)
constructor for a struct_array
subroutine, public destructstructarray(struct_array)
destructor for a struct_array
subroutine, public tsmanager_cr(this, iout, removeTsLinksOnCompletion, extendTsToEndOfSimulation)
Create the tsmanager.
This class is used to store a single deferred-length character string. It was designed to work in an ...
derived type for boundary package input context
Static parser based input loader.
Keystring period block loader.
type for structured array