31 integer(I4B),
dimension(:),
pointer,
contiguous :: nodeulist
32 logical(LGP),
dimension(:),
allocatable :: active
33 logical(LGP) :: nodeulist_set = .false.
34 integer(I4B),
dimension(:),
pointer,
contiguous :: aux_reads => null()
49 subroutine ainit(this, mf6_input, component_name, &
50 component_input_name, input_name, &
51 iperblock, parser, iout)
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
62 integer(I4B),
intent(in) :: iout
65 integer(I4B),
pointer :: maxbound
68 call this%DynamicPkgLoadType%init(mf6_input, component_name, &
69 component_input_name, &
70 input_name, iperblock, iout)
75 call loader%load(parser, mf6_input, this%nc_vars, this%input_name, iout)
78 call get_isize(
'MAXBOUND', mf6_input%mempath, isize)
81 call mem_allocate(maxbound,
'MAXBOUND', mf6_input%mempath)
82 maxbound = product(loader%mshape)
86 call this%ctx%init(mf6_input)
89 call this%set_active()
93 'NODEULIST', mf6_input%mempath)
96 call this%params_alloc()
107 subroutine rp(this, parser)
116 logical(LGP) :: endOfBlock, netcdf, layered
117 character(len=LINELENGTH) :: keyword, param_tag
126 this%mf6_input%subcomponent_name, this%iout)
136 call parser%GetNextLine(endofblock)
139 call parser%GetStringCaps(param_tag)
145 if (iaux > 0) param_tag =
'AUX'
149 this%mf6_input%component_type, &
150 this%mf6_input%subcomponent_type, &
151 'PERIOD', param_tag, this%input_name)
153 call parser%GetStringCaps(keyword)
154 if (keyword ==
'LAYERED' .and. idt%layered)
then
156 else if (keyword ==
'NETCDF')
then
161 call this%param_load(parser, idt, this%mf6_input%mempath, layered, &
167 this%mf6_input%subcomponent_name, this%iout)
174 if (
allocated(this%active))
deallocate (this%active)
188 character(len=LENMEMPATH) :: model_mempath, dis_mempath
189 integer(I4B),
pointer :: disenum
190 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
191 integer(I4B),
dimension(:, :),
pointer,
contiguous :: int2d
192 integer(I4B),
dimension(:, :, :),
pointer,
contiguous :: int3d
193 integer(I4B) :: isize
195 allocate (this%active(this%ctx%nodes))
199 model_mempath =
create_mem_path(component=this%mf6_input%component_name, &
201 call mem_setptr(disenum,
'DISENUM', model_mempath)
202 select case (disenum)
218 call get_isize(
'IDOMAIN', dis_mempath, isize)
219 if (isize /= this%ctx%nodes)
return
221 select case (disenum)
223 call mem_setptr(int3d,
'IDOMAIN', dis_mempath)
224 this%active = reshape(int3d, [this%ctx%nodes]) > 0
226 call mem_setptr(int2d,
'IDOMAIN', dis_mempath)
227 this%active = reshape(int2d, [this%ctx%nodes]) > 0
229 call mem_setptr(int1d,
'IDOMAIN', dis_mempath)
230 this%active = int1d > 0
239 this%nodeulist_set = .false.
241 do n = 1, this%nparam
243 this%param_reads(n)%invar =
rs_none
250 character(len=LENVARNAME) :: rs_varname
251 integer(I4B),
pointer :: intvar
252 integer(I4B) :: iparam
255 this%param_names = this%ctx%params
256 this%nparam =
size(this%ctx%params)
257 call this%ctx%allocate_params()
258 call this%ctx%check_developmode(this%input_name)
259 call this%ctx%allocate_arrays()
262 allocate (this%param_reads(this%nparam))
265 do iparam = 1, this%nparam
267 rs_varname = this%ctx%rsv_alloc(this%param_names(iparam))
268 call mem_setptr(intvar, rs_varname, this%mf6_input%mempath)
269 this%param_reads(iparam)%invar => intvar
270 this%param_reads(iparam)%invar =
rs_none
274 call mem_allocate(this%aux_reads, this%ctx%naux,
'INAUXVARS', &
275 this%mf6_input%mempath)
279 subroutine param_load(this, parser, idt, mempath, layered, netcdf, iaux)
290 type(blockparsertype),
intent(in) :: parser
292 character(len=*),
intent(in) :: mempath
293 logical(LGP),
intent(in) :: layered
294 logical(LGP),
intent(in) :: netcdf
295 integer(I4B),
intent(in) :: iaux
296 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d, nodes
297 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
298 integer(I4B),
dimension(:),
allocatable :: layer_shape
299 integer(I4B) :: iparam, n, nlay, nnode
303 select case (idt%datatype)
305 call mem_setptr(dbl1d, idt%mf6varname, mempath)
306 allocate (nodes(this%ctx%nodes))
309 this%mf6_input, this%nc_vars, this%input_name, &
311 else if (layered)
then
315 call read_dbl1d(parser, nodes, idt%mf6varname)
318 call idm_log_var(nodes, idt%tagname, mempath, this%iout)
320 if (this%nodeulist_set)
then
322 do n = 1, this%ctx%nbound
323 dbl1d(n) = nodes(this%nodeulist(n))
327 do n = 1, this%ctx%nodes
328 if (nodes(n) /=
dnodata .and. this%active(n))
then
330 if (nnode > this%ctx%maxbound)
then
331 write (errmsg,
'(a,i0,a)') &
332 'Input error: number of defined (non-DNODATA) active cells &
333 &exceeds MAXBOUND=', this%ctx%maxbound,
'.'
337 dbl1d(nnode) = nodes(n)
338 this%nodeulist(nnode) = n
341 this%ctx%nbound = nnode
342 this%nodeulist_set = .true.
346 call mem_setptr(dbl2d, idt%mf6varname, mempath)
347 allocate (nodes(this%ctx%nodes))
351 this%mf6_input, this%nc_vars, this%input_name, &
352 this%iout,
kper, iaux)
353 else if (layered)
then
357 call read_dbl1d(parser, nodes, idt%mf6varname)
360 call idm_log_var(nodes, idt%tagname, mempath, this%iout)
362 if (this%nodeulist_set)
then
364 do n = 1, this%ctx%nbound
365 dbl2d(iaux, n) = nodes(this%nodeulist(n))
369 do n = 1, this%ctx%nodes
370 if (nodes(n) /=
dnodata .and. this%active(n))
then
372 if (nnode > this%ctx%maxbound)
then
373 write (errmsg,
'(a,i0,a)') &
374 'Input error: number of defined (non-DNODATA) active cells &
375 &exceeds MAXBOUND=', this%ctx%maxbound,
'.'
379 dbl2d(iaux, nnode) = nodes(n)
380 this%nodeulist(nnode) = n
383 this%ctx%nbound = nnode
384 this%nodeulist_set = .true.
389 errmsg =
'IDM unimplemented. GridArrayLoad::param_load &
390 &datatype='//trim(idt%datatype)
396 iparam =
ifind(this%param_names, idt%tagname)
This module contains block parser methods.
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
real(dp), parameter dnodata
real no data constant
@ disu
DISV6 discretization.
@ dis
DIS6 discretization.
@ disv
DISU6 discretization.
integer(i4b), parameter lenvarname
maximum length of a variable name
integer(i4b), parameter lenmempath
maximum length of the memory path
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)
This module contains the GridArrayLoadModule.
subroutine param_load(this, parser, idt, mempath, layered, netcdf, iaux)
subroutine rp(this, parser)
subroutine set_active(this)
Set active user nodes from discretization IDOMAIN input.
subroutine ts_advance(this)
subroutine ainit(this, mf6_input, component_name, component_input_name, input_name, iperblock, parser, iout)
subroutine params_alloc(this)
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
This module defines variable data types.
subroutine, public read_dbl1d_layered(parser, dbl1d, aname, nlay, layer_shape)
Load context for IDM generic dynamic loaders.
@ 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
subroutine destroy(this)
destroy input context object
This module contains the LoadMf6FileModule.
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
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
character(len=linelength) idm_context
This module contains the SourceCommonModule.
subroutine, public get_layered_shape(mshape, nlay, layer_shape)
integer(i4b) function, public ifind_charstr(array, str)
integer(i4b), pointer, public kper
current stress period number
Ascii grid based 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.