31 integer(I4B) :: tas_active
33 pointer :: aux_tasnames
35 pointer :: param_tasnames
56 component_input_name, input_name, &
57 iperblock, parser, iout)
63 character(len=*),
intent(in) :: component_name
64 character(len=*),
intent(in) :: component_input_name
65 character(len=*),
intent(in) :: input_name
66 integer(I4B),
intent(in) :: iperblock
68 integer(I4B),
intent(in) :: iout
71 contiguous :: tas_fnames
72 character(len=LINELENGTH) :: fname
73 integer(I4B) :: tas6_size, n
76 call this%DynamicPkgLoadType%init(mf6_input, component_name, &
77 component_input_name, &
78 input_name, iperblock, iout)
80 nullify (this%aux_tasnames)
81 nullify (this%param_tasnames)
86 call loader%load(parser, mf6_input, this%nc_vars, this%input_name, iout)
89 allocate (this%tasmanager)
90 call tasmanager_cr(this%tasmanager, modelname=this%mf6_input%component_name, &
94 call get_isize(
'TAS6_FILENAME', this%mf6_input%mempath, tas6_size)
95 if (tas6_size > 0)
then
97 call mem_setptr(tas_fnames,
'TAS6_FILENAME', this%mf6_input%mempath)
99 do n = 1,
size(tas_fnames)
100 fname = tas_fnames(n)
101 call this%tasmanager%add_tasfile(fname)
106 call this%bound_context%create(mf6_input, this%readasarrays)
109 call this%params_alloc()
112 call this%tas_arrays_alloc()
117 call this%tasmanager%tasmanager_df()
122 call this%tasmanager%ad()
135 logical(LGP) :: endOfBlock, netcdf
136 character(len=LINELENGTH) :: keyword, param_tag
138 integer(I4B) :: iaux, iparam
139 character(len=LENTIMESERIESNAME) :: tas_name
140 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
147 this%mf6_input%subcomponent_name, this%iout)
156 call parser%GetNextLine(endofblock)
159 call parser%GetStringCaps(param_tag)
162 iaux =
ifind_charstr(this%bound_context%auxname_cst, param_tag)
164 if (iaux > 0) param_tag =
'AUX'
168 this%mf6_input%component_type, &
169 this%mf6_input%subcomponent_type, &
170 'PERIOD', param_tag, this%input_name)
172 call parser%GetStringCaps(keyword)
173 if (keyword ==
'TIMEARRAYSERIES')
then
174 if (this%tas_active /= 0)
then
175 call parser%GetStringCaps(tas_name)
176 if (param_tag ==
'AUX')
then
177 this%aux_tasnames(iaux) = tas_name
179 iparam =
ifind(this%param_names, param_tag)
180 this%param_tasnames(iparam) = tas_name
181 this%param_reads(iparam)%invar = 2
184 call idm_log_var(param_tag, this%mf6_input%mempath, this%iout, .true.)
190 else if (keyword ==
'NETCDF')
then
195 call this%param_load(parser, idt, this%mf6_input%mempath, netcdf, iaux)
200 if (this%param_reads(1)%invar == 0)
then
203 this%mf6_input%component_type, &
204 this%mf6_input%subcomponent_type, &
205 'PERIOD', this%param_names(1), &
207 call mem_setptr(int1d, idt%mf6varname, this%mf6_input%mempath)
211 if (this%tas_active /= 0)
then
212 call this%tas_links_create(parser%iuactive)
217 this%mf6_input%subcomponent_name, this%iout)
224 call this%tasmanager%da()
225 deallocate (this%tasmanager)
226 nullify (this%tasmanager)
233 if (this%tas_active /= 0)
then
235 call this%tasmanager%reset(this%mf6_input%subcomponent_name)
237 call this%init_charstr1d(
'AUXTASNAME', this%input_name)
238 call this%init_charstr1d(
'PARAMTASNAME', this%input_name)
241 do n = 1, this%nparam
243 this%param_reads(n)%invar = 0
247 do m = 1, this%bound_context%ncpl
248 do n = 1, this%bound_context%naux
249 this%bound_context%auxvar(n, m) =
dzero
257 character(len=*),
intent(in) :: varname
258 character(len=*),
intent(in) :: input_name
260 contiguous :: charstr1d
262 call mem_setptr(charstr1d, varname, this%mf6_input%mempath)
263 do n = 1,
size(charstr1d)
270 character(len=LENVARNAME) :: rs_varname
271 integer(I4B),
pointer :: intvar
272 integer(I4B) :: iparam
275 call this%bound_context%bound_params(this%param_names, this%nparam, &
277 call this%bound_context%allocate_arrays()
280 allocate (this%param_reads(this%nparam))
283 do iparam = 1, this%nparam
285 rs_varname = this%bound_context%rsv_alloc(this%param_names(iparam))
286 call mem_setptr(intvar, rs_varname, this%mf6_input%mempath)
287 this%param_reads(iparam)%invar => intvar
288 this%param_reads(iparam)%invar = 0
306 character(len=*),
intent(in) :: mempath
307 logical(LGP),
intent(in) :: netcdf
308 integer(I4B),
intent(in) :: iaux
309 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
310 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
311 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
312 integer(I4B) :: iparam, n
314 select case (idt%datatype)
316 call mem_setptr(int1d, idt%mf6varname, mempath)
319 this%mf6_input, this%nc_vars, this%input_name, &
322 call read_int1d(parser, int1d, idt%mf6varname)
324 call idm_log_var(int1d, idt%tagname, mempath, this%iout)
326 call mem_setptr(dbl1d, idt%mf6varname, mempath)
329 this%mf6_input, this%nc_vars, this%input_name, &
332 call read_dbl1d(parser, dbl1d, idt%mf6varname)
334 call idm_log_var(dbl1d, idt%tagname, mempath, this%iout)
336 call mem_setptr(dbl2d, idt%mf6varname, mempath)
337 allocate (dbl1d(this%bound_context%ncpl))
340 this%mf6_input, this%nc_vars, this%input_name, &
341 this%iout,
kper, iaux)
343 call read_dbl1d(parser, dbl1d, idt%mf6varname)
345 do n = 1, this%bound_context%ncpl
346 dbl2d(iaux, n) = dbl1d(n)
348 call idm_log_var(dbl1d, idt%tagname, mempath, this%iout)
351 errmsg =
'IDM unimplemented. Mf6FileGridInput::param_load &
352 &datatype='//trim(idt%datatype)
358 iparam =
ifind(this%param_names, idt%tagname)
360 this%param_reads(iparam)%invar = 1
369 if (this%tas_active /= 0)
then
371 this%bound_context%naux,
'AUXTASNAME', &
372 this%mf6_input%mempath)
374 'PARAMTASNAME', this%mf6_input%mempath)
375 call this%init_charstr1d(
'AUXTASNAME', this%input_name)
376 call this%init_charstr1d(
'PARAMTASNAME', this%input_name)
379 'AUXTASNAME', this%mf6_input%mempath)
381 'PARAMTASNAME', this%mf6_input%mempath)
390 integer(I4B),
intent(in) :: inunit
393 real(DP),
dimension(:),
pointer :: auxArrayPtr, bndArrayPtr
394 real(DP),
dimension(:),
pointer,
contiguous :: bound
395 integer(I4B),
dimension(:),
pointer,
contiguous :: nodelist
396 character(len=LENTIMESERIESNAME) :: tas_name
397 character(len=LENAUXNAME) :: aux_name
398 logical :: convertFlux
402 nullify (auxarrayptr)
403 nullify (bndarrayptr)
405 convertflux = .false.
408 do n = 1, this%bound_context%naux
409 tas_name = this%aux_tasnames(n)
410 if (tas_name /=
'')
then
412 auxarrayptr => this%bound_context%auxvar(n, :)
413 aux_name = this%bound_context%auxname_cst(n)
414 call this%tasmanager%MakeTasLink(this%mf6_input%subcomponent_name, &
415 auxarrayptr, this%bound_context%iprpak, &
416 tas_name, aux_name, convertflux, &
422 do n = 1, this%nparam
425 this%mf6_input%component_type, &
426 this%mf6_input%subcomponent_type, &
427 'PERIOD', this%param_names(n), &
429 if (idt%timeseries)
then
430 if (this%param_reads(n)%invar == 2)
then
431 tas_name = this%param_tasnames(n)
432 call mem_setptr(bound, idt%mf6varname, this%mf6_input%mempath)
434 bndarrayptr => bound(:)
435 call this%tasmanager%MakeTasLink(this%mf6_input%subcomponent_name, &
437 this%bound_context%iprpak, &
438 tas_name, idt%mf6varname, &
439 convertflux, nodelist, inunit)
This module contains block parser methods.
This module contains the BoundInputContextModule.
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
integer(i4b), parameter lentimeseriesname
maximum length of a time series name
integer(i4b), parameter lenvarname
maximum length of a variable name
integer(i4b), parameter lenauxname
maximum length of a aux variable
integer(i4b), parameter izero
integer constant zero
real(dp), parameter dzero
real constant zero
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.
subroutine, public read_dbl1d(parser, dbl1d, aname)
subroutine, public read_dbl2d(parser, dbl2d, aname)
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
subroutine, public read_int1d(parser, int1d, aname)
This module defines variable data types.
This module contains the LoadMf6FileModule.
subroutine, public get_isize(name, mem_path, isize)
@ brief Get the number of elements for this variable
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
This module contains the SourceCommonModule.
integer(i4b) function, public ifind_charstr(array, str)
integer(i4b), pointer, public kper
current stress period number
subroutine, public tasmanager_cr(this, dis, modelname, iout)
Create the time-array series manager.
derived type for boundary package input context
Pointer type for read state variable.
This class is used to store a single deferred-length character string. It was designed to work in an ...
Static parser based input loader.