32 integer(I4B) :: tas_active
34 pointer :: aux_tasnames
36 pointer :: param_tasnames
56 subroutine ainit(this, mf6_input, component_name, &
57 component_input_name, input_name, &
58 iperblock, parser, iout)
64 character(len=*),
intent(in) :: component_name
65 character(len=*),
intent(in) :: component_input_name
66 character(len=*),
intent(in) :: input_name
67 integer(I4B),
intent(in) :: iperblock
69 integer(I4B),
intent(in) :: iout
72 contiguous :: tas_fnames
73 character(len=LINELENGTH) :: fname
74 integer(I4B) :: tas6_size, n
77 call this%DynamicPkgLoadType%init(mf6_input, component_name, &
78 component_input_name, &
79 input_name, iperblock, iout)
81 nullify (this%aux_tasnames)
82 nullify (this%param_tasnames)
87 call loader%load(parser, mf6_input, this%nc_vars, this%input_name, iout)
90 allocate (this%tasmanager)
91 call tasmanager_cr(this%tasmanager, modelname=this%mf6_input%component_name, &
95 call get_isize(
'TAS6_FILENAME', this%mf6_input%mempath, tas6_size)
96 if (tas6_size > 0)
then
98 call mem_setptr(tas_fnames,
'TAS6_FILENAME', this%mf6_input%mempath)
100 do n = 1,
size(tas_fnames)
101 fname = tas_fnames(n)
102 call this%tasmanager%add_tasfile(fname)
107 call this%ctx%init(mf6_input)
110 call this%params_alloc()
113 call this%tas_arrays_alloc()
118 call this%tasmanager%tasmanager_df()
123 call this%tasmanager%ad()
126 subroutine rp(this, parser)
136 logical(LGP) :: endOfBlock, netcdf
137 character(len=LINELENGTH) :: keyword, param_tag
139 integer(I4B) :: iaux, iparam
140 character(len=LENTIMESERIESNAME) :: tas_name
141 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
148 this%mf6_input%subcomponent_name, this%iout)
157 call parser%GetNextLine(endofblock)
160 call parser%GetStringCaps(param_tag)
165 if (iaux > 0) param_tag =
'AUX'
169 this%mf6_input%component_type, &
170 this%mf6_input%subcomponent_type, &
171 'PERIOD', param_tag, this%input_name)
173 call parser%GetStringCaps(keyword)
174 if (keyword ==
'TIMEARRAYSERIES')
then
175 if (this%tas_active /= 0)
then
176 call parser%GetStringCaps(tas_name)
177 if (param_tag ==
'AUX')
then
178 this%aux_tasnames(iaux) = tas_name
180 iparam =
ifind(this%param_names, param_tag)
181 this%param_tasnames(iparam) = tas_name
182 this%param_reads(iparam)%invar = 2
185 call idm_log_var(param_tag, this%mf6_input%mempath, this%iout, .true., &
192 else if (keyword ==
'NETCDF')
then
197 call this%param_load(parser, idt, this%mf6_input%mempath, netcdf, iaux)
203 if (this%param_reads(1)%invar == 0)
then
204 if (this%param_names(1) == &
205 'I'//trim(this%mf6_input%subcomponent_type(1:3)))
then
207 this%mf6_input%component_type, &
208 this%mf6_input%subcomponent_type, &
209 'PERIOD', this%param_names(1), &
212 call mem_setptr(int1d, idt%mf6varname, this%mf6_input%mempath)
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 = 0
260 character(len=*),
intent(in) :: varname
261 character(len=*),
intent(in) :: input_name
263 contiguous :: charstr1d
265 call mem_setptr(charstr1d, varname, this%mf6_input%mempath)
266 do n = 1,
size(charstr1d)
273 character(len=LENVARNAME) :: rs_varname
274 integer(I4B),
pointer :: intvar
275 integer(I4B) :: iparam
278 call this%ctx%tags(this%param_names, this%nparam, this%input_name, &
280 call this%ctx%allocate_arrays()
283 allocate (this%param_reads(this%nparam))
286 do iparam = 1, this%nparam
288 rs_varname = this%ctx%rsv_alloc(this%param_names(iparam))
289 call mem_setptr(intvar, rs_varname, this%mf6_input%mempath)
290 this%param_reads(iparam)%invar => intvar
291 this%param_reads(iparam)%invar = 0
295 subroutine param_load(this, parser, idt, mempath, netcdf, iaux)
309 character(len=*),
intent(in) :: mempath
310 logical(LGP),
intent(in) :: netcdf
311 integer(I4B),
intent(in) :: iaux
312 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
313 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
314 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
315 integer(I4B) :: iparam, n
317 select case (idt%datatype)
319 call mem_setptr(int1d, idt%mf6varname, mempath)
322 this%mf6_input, this%nc_vars, this%input_name, &
325 call read_int1d(parser, int1d, idt%mf6varname)
327 call idm_log_var(int1d, idt%tagname, mempath, this%iout)
329 call mem_setptr(dbl1d, idt%mf6varname, mempath)
332 this%mf6_input, this%nc_vars, this%input_name, &
335 call read_dbl1d(parser, dbl1d, idt%mf6varname)
337 call idm_log_var(dbl1d, idt%tagname, mempath, this%iout)
339 call mem_setptr(dbl2d, idt%mf6varname, mempath)
340 allocate (dbl1d(this%ctx%ncpl))
343 this%mf6_input, this%nc_vars, this%input_name, &
344 this%iout,
kper, iaux)
346 call read_dbl1d(parser, dbl1d, idt%mf6varname)
348 do n = 1, this%ctx%ncpl
349 dbl2d(iaux, n) = dbl1d(n)
351 call idm_log_var(dbl1d, idt%tagname, mempath, this%iout)
354 errmsg =
'IDM unimplemented. LayerArrayLoad::param_load &
355 &datatype='//trim(idt%datatype)
361 iparam =
ifind(this%param_names, idt%tagname)
363 this%param_reads(iparam)%invar = 1
372 if (this%tas_active /= 0)
then
374 this%ctx%naux,
'AUXTASNAME', &
375 this%mf6_input%mempath)
377 'PARAMTASNAME', this%mf6_input%mempath)
378 call this%init_charstr1d(
'AUXTASNAME', this%input_name)
379 call this%init_charstr1d(
'PARAMTASNAME', this%input_name)
382 'AUXTASNAME', this%mf6_input%mempath)
384 'PARAMTASNAME', this%mf6_input%mempath)
393 integer(I4B),
intent(in) :: inunit
396 real(DP),
dimension(:),
pointer :: auxArrayPtr, bndArrayPtr
397 real(DP),
dimension(:),
pointer,
contiguous :: bound
398 integer(I4B),
dimension(:),
pointer,
contiguous :: nodelist
399 character(len=LENTIMESERIESNAME) :: tas_name
400 character(len=LENAUXNAME) :: aux_name
401 logical :: convertFlux
405 nullify (auxarrayptr)
406 nullify (bndarrayptr)
408 convertflux = .false.
411 do n = 1, this%ctx%naux
412 tas_name = this%aux_tasnames(n)
413 if (tas_name /=
'')
then
415 auxarrayptr => this%ctx%auxvar(n, :)
416 aux_name = this%ctx%auxname_cst(n)
417 call this%tasmanager%MakeTasLink(this%mf6_input%subcomponent_name, &
418 auxarrayptr, this%ctx%iprpak, &
419 tas_name, aux_name, convertflux, &
425 do n = 1, this%nparam
428 this%mf6_input%component_type, &
429 this%mf6_input%subcomponent_type, &
430 'PERIOD', this%param_names(n), &
432 if (idt%timeseries)
then
433 if (this%param_reads(n)%invar == 2)
then
434 tas_name = this%param_tasnames(n)
435 call mem_setptr(bound, idt%mf6varname, this%mf6_input%mempath)
437 bndarrayptr => bound(:)
438 call this%tasmanager%MakeTasLink(this%mf6_input%subcomponent_name, &
441 tas_name, idt%mf6varname, &
442 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)
@ 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 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)
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
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.
derived type for boundary package input context
Pointer type for read state variable.
Static parser based input loader.