33 integer(I4B) :: tas_active
35 pointer :: aux_tasnames
37 pointer :: param_tasnames
39 integer(I4B),
dimension(:),
pointer,
contiguous :: aux_reads => null()
58 subroutine ainit(this, mf6_input, component_name, &
59 component_input_name, input_name, &
60 iperblock, parser, iout)
67 character(len=*),
intent(in) :: component_name
68 character(len=*),
intent(in) :: component_input_name
69 character(len=*),
intent(in) :: input_name
70 integer(I4B),
intent(in) :: iperblock
72 integer(I4B),
intent(in) :: iout
75 contiguous :: tas_fnames
77 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
78 character(len=LINELENGTH) :: fname
79 integer(I4B) :: tas6_size, n
82 call this%DynamicPkgLoadType%init(mf6_input, component_name, &
83 component_input_name, &
84 input_name, iperblock, iout)
86 nullify (this%aux_tasnames)
87 nullify (this%param_tasnames)
92 call loader%load(parser, mf6_input, this%nc_vars, this%input_name, iout)
95 allocate (this%tasmanager)
96 call tasmanager_cr(this%tasmanager, modelname=this%mf6_input%component_name, &
100 call get_isize(
'TAS6_FILENAME', this%mf6_input%mempath, tas6_size)
101 if (tas6_size > 0)
then
103 call mem_setptr(tas_fnames,
'TAS6_FILENAME', this%mf6_input%mempath)
105 do n = 1,
size(tas_fnames)
106 fname = tas_fnames(n)
107 call this%tasmanager%add_tasfile(fname)
112 call this%ctx%init(mf6_input)
115 call this%params_alloc()
118 call this%tas_arrays_alloc()
121 if (this%param_names(1) == &
122 'I'//trim(this%mf6_input%subcomponent_type(1:3)))
then
124 this%mf6_input%component_type, &
125 this%mf6_input%subcomponent_type, &
126 'PERIOD', this%param_names(1), &
128 call mem_setptr(int1d, idt%mf6varname, this%mf6_input%mempath)
135 call this%tasmanager%tasmanager_df()
140 call this%tasmanager%ad()
143 subroutine rp(this, parser)
153 logical(LGP) :: endOfBlock, netcdf
154 character(len=LINELENGTH) :: keyword, param_tag
156 integer(I4B) :: iaux, iparam
157 character(len=LENTIMESERIESNAME) :: tas_name
164 this%mf6_input%subcomponent_name, this%iout)
173 call parser%GetNextLine(endofblock)
176 call parser%GetStringCaps(param_tag)
181 if (iaux > 0) param_tag =
'AUX'
185 this%mf6_input%component_type, &
186 this%mf6_input%subcomponent_type, &
187 'PERIOD', param_tag, this%input_name)
189 call parser%GetStringCaps(keyword)
190 if (keyword ==
'TIMEARRAYSERIES')
then
191 if (this%tas_active /= 0)
then
192 call parser%GetStringCaps(tas_name)
193 if (param_tag ==
'AUX')
then
194 this%aux_tasnames(iaux) = tas_name
197 iparam =
ifind(this%param_names, param_tag)
198 this%param_tasnames(iparam) = tas_name
199 this%param_reads(iparam)%invar =
rs_series
202 call idm_log_var(param_tag, this%mf6_input%mempath, this%iout, .true., &
209 else if (keyword ==
'NETCDF')
then
214 call this%param_load(parser, idt, this%mf6_input%mempath, netcdf, iaux)
217 if (this%tas_active /= 0)
then
218 call this%tas_links_create(parser%iuactive)
223 this%mf6_input%subcomponent_name, this%iout)
230 call this%ctx%destroy()
233 call this%tasmanager%da()
234 deallocate (this%tasmanager)
235 nullify (this%tasmanager)
242 if (this%tas_active /= 0)
then
244 call this%tasmanager%reset(this%mf6_input%subcomponent_name)
246 call this%init_charstr1d(
'AUXTASNAME', this%input_name)
247 call this%init_charstr1d(
'PARAMTASNAME', this%input_name)
250 do n = 1, this%nparam
252 this%param_reads(n)%invar =
rs_none
261 character(len=*),
intent(in) :: varname
262 character(len=*),
intent(in) :: input_name
264 contiguous :: charstr1d
266 call mem_setptr(charstr1d, varname, this%mf6_input%mempath)
267 do n = 1,
size(charstr1d)
274 character(len=LENVARNAME) :: rs_varname
275 integer(I4B),
pointer :: intvar
276 integer(I4B) :: iparam
279 this%param_names = this%ctx%params
280 this%nparam =
size(this%ctx%params)
281 call this%ctx%allocate_params()
282 call this%ctx%check_developmode(this%input_name)
283 call this%ctx%allocate_arrays()
286 allocate (this%param_reads(this%nparam))
289 do iparam = 1, this%nparam
291 rs_varname = this%ctx%rsv_alloc(this%param_names(iparam))
292 call mem_setptr(intvar, rs_varname, this%mf6_input%mempath)
293 this%param_reads(iparam)%invar => intvar
294 this%param_reads(iparam)%invar =
rs_none
298 call mem_allocate(this%aux_reads, this%ctx%naux,
'INAUXVARS', &
299 this%mf6_input%mempath)
303 subroutine param_load(this, parser, idt, mempath, netcdf, iaux)
315 type(blockparsertype),
intent(in) :: parser
317 character(len=*),
intent(in) :: mempath
318 logical(LGP),
intent(in) :: netcdf
319 integer(I4B),
intent(in) :: iaux
320 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
321 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
322 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
323 integer(I4B) :: iparam, n
325 select case (idt%datatype)
327 call mem_setptr(int1d, idt%mf6varname, mempath)
330 this%mf6_input, this%nc_vars, this%input_name, &
333 call read_int1d(parser, int1d, idt%mf6varname)
335 call idm_log_var(int1d, idt%tagname, mempath, this%iout)
337 call mem_setptr(dbl1d, idt%mf6varname, mempath)
340 this%mf6_input, this%nc_vars, this%input_name, &
343 call read_dbl1d(parser, dbl1d, idt%mf6varname)
345 call idm_log_var(dbl1d, idt%tagname, mempath, this%iout)
347 call mem_setptr(dbl2d, idt%mf6varname, mempath)
348 allocate (dbl1d(this%ctx%ncpl))
351 this%mf6_input, this%nc_vars, this%input_name, &
352 this%iout,
kper, iaux)
354 call read_dbl1d(parser, dbl1d, idt%mf6varname)
356 do n = 1, this%ctx%ncpl
357 dbl2d(iaux, n) = dbl1d(n)
359 call idm_log_var(dbl1d, idt%tagname, mempath, this%iout)
363 errmsg =
'IDM unimplemented. LayerArrayLoad::param_load &
364 &datatype='//trim(idt%datatype)
370 iparam =
ifind(this%param_names, idt%tagname)
381 if (this%tas_active /= 0)
then
383 this%ctx%naux,
'AUXTASNAME', &
384 this%mf6_input%mempath)
386 'PARAMTASNAME', this%mf6_input%mempath)
387 call this%init_charstr1d(
'AUXTASNAME', this%input_name)
388 call this%init_charstr1d(
'PARAMTASNAME', this%input_name)
391 'AUXTASNAME', this%mf6_input%mempath)
393 'PARAMTASNAME', this%mf6_input%mempath)
402 integer(I4B),
intent(in) :: inunit
405 real(DP),
dimension(:),
pointer :: auxArrayPtr, bndArrayPtr
406 real(DP),
dimension(:),
pointer,
contiguous :: bound
407 integer(I4B),
dimension(:),
pointer,
contiguous :: nodelist
408 character(len=LENTIMESERIESNAME) :: tas_name
409 character(len=LENAUXNAME) :: aux_name
410 logical :: convertFlux
414 nullify (auxarrayptr)
415 nullify (bndarrayptr)
417 convertflux = .false.
420 do n = 1, this%ctx%naux
421 tas_name = this%aux_tasnames(n)
422 if (tas_name /=
'')
then
424 auxarrayptr => this%ctx%auxvar(n, :)
425 aux_name = this%ctx%auxname_cst(n)
426 call this%tasmanager%MakeTasLink(this%mf6_input%subcomponent_name, &
427 auxarrayptr, this%ctx%iprpak, &
428 tas_name, aux_name, convertflux, &
434 do n = 1, this%nparam
437 this%mf6_input%component_type, &
438 this%mf6_input%subcomponent_type, &
439 'PERIOD', this%param_names(n), &
441 if (idt%timeseries)
then
442 if (this%param_reads(n)%invar ==
rs_series)
then
443 tas_name = this%param_tasnames(n)
444 call mem_setptr(bound, idt%mf6varname, this%mf6_input%mempath)
446 bndarrayptr => bound(:)
447 call this%tasmanager%MakeTasLink(this%mf6_input%subcomponent_name, &
450 tas_name, idt%mf6varname, &
451 convertflux, nodelist, inunit)
This module contains block parser methods.
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, found)
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)
log the closing message
subroutine, public idm_log_header(component, subcomponent, iout)
log a header message
subroutine, public read_int1d(parser, int1d, aname)
This module defines variable data types.
This module contains the LayerArrayLoadModule.
subroutine param_load(this, parser, idt, mempath, netcdf, iaux)
subroutine ts_advance(this)
subroutine tas_arrays_alloc(this)
subroutine tas_links_create(this, inunit)
subroutine ainit(this, mf6_input, component_name, component_input_name, input_name, iperblock, parser, iout)
subroutine rp(this, parser)
subroutine init_charstr1d(this, varname, input_name)
subroutine params_alloc(this)
Load context for IDM generic dynamic loaders.
@ rs_series
time-array series given in the most recent period block
@ rs_netcdf
values read from NetCDF in the most recent period block
@ rs_values
values given in the most recent period block
@ rs_none
not given in the most recent period block
This module contains the LoadMf6FileModule.
subroutine, public get_isize(name, mem_path, isize)
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.
This class is used to store a single deferred-length character string. It was designed to work in an ...
Ascii array layer dynamic loader type.
Input load context for generic dynamic loaders and StructArray based static loads....
Pointer type for read state variable.
Static parser based input loader.