30 integer(I4B),
dimension(:),
pointer,
contiguous :: nodeulist
44 subroutine ainit(this, mf6_input, component_name, &
45 component_input_name, input_name, &
46 iperblock, parser, iout)
52 character(len=*),
intent(in) :: component_name
53 character(len=*),
intent(in) :: component_input_name
54 character(len=*),
intent(in) :: input_name
55 integer(I4B),
intent(in) :: iperblock
57 integer(I4B),
intent(in) :: iout
60 integer(I4B),
pointer :: maxbound
63 call this%DynamicPkgLoadType%init(mf6_input, component_name, &
64 component_input_name, &
65 input_name, iperblock, iout)
70 call loader%load(parser, mf6_input, this%nc_vars, this%input_name, iout)
73 call get_isize(
'MAXBOUND', mf6_input%mempath, isize)
76 call mem_allocate(maxbound,
'MAXBOUND', mf6_input%mempath)
77 maxbound = product(loader%mshape)
81 call this%ctx%init(mf6_input)
85 'NODEULIST', mf6_input%mempath)
88 call this%params_alloc()
99 subroutine rp(this, parser)
108 logical(LGP) :: endOfBlock, netcdf, layered
109 character(len=LINELENGTH) :: keyword, param_tag
118 this%mf6_input%subcomponent_name, this%iout)
128 call parser%GetNextLine(endofblock)
131 call parser%GetStringCaps(param_tag)
137 if (iaux > 0) param_tag =
'AUX'
141 this%mf6_input%component_type, &
142 this%mf6_input%subcomponent_type, &
143 'PERIOD', param_tag, this%input_name)
145 call parser%GetStringCaps(keyword)
146 if (keyword ==
'LAYERED' .and. idt%layered)
then
148 else if (keyword ==
'NETCDF')
then
153 call this%param_load(parser, idt, this%mf6_input%mempath, layered, &
159 this%mf6_input%subcomponent_name, this%iout)
174 do n = 1, this%nparam
176 this%param_reads(n)%invar = 0
182 character(len=LENVARNAME) :: rs_varname
183 integer(I4B),
pointer :: intvar
184 integer(I4B) :: iparam
187 this%param_names = this%ctx%params
188 this%nparam =
size(this%ctx%params)
189 call this%ctx%allocate_params()
190 call this%ctx%check_developmode(this%input_name)
191 call this%ctx%allocate_arrays()
194 allocate (this%param_reads(this%nparam))
197 do iparam = 1, this%nparam
199 rs_varname = this%ctx%rsv_alloc(this%param_names(iparam))
200 call mem_setptr(intvar, rs_varname, this%mf6_input%mempath)
201 this%param_reads(iparam)%invar => intvar
202 this%param_reads(iparam)%invar = 0
206 subroutine param_load(this, parser, idt, mempath, layered, netcdf, iaux)
219 character(len=*),
intent(in) :: mempath
220 logical(LGP),
intent(in) :: layered
221 logical(LGP),
intent(in) :: netcdf
222 integer(I4B),
intent(in) :: iaux
223 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d, nodes
224 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
225 integer(I4B),
dimension(:),
allocatable :: layer_shape
226 integer(I4B) :: iparam, n, nlay, nnode
230 select case (idt%datatype)
232 call mem_setptr(dbl1d, idt%mf6varname, mempath)
233 allocate (nodes(this%ctx%nodes))
236 this%mf6_input, this%nc_vars, this%input_name, &
238 else if (layered)
then
242 call read_dbl1d(parser, nodes, idt%mf6varname)
245 call idm_log_var(nodes, idt%tagname, mempath, this%iout)
247 if (this%ctx%nbound > 0)
then
249 do n = 1, this%ctx%nbound
250 dbl1d(n) = nodes(this%nodeulist(n))
254 do n = 1, this%ctx%nodes
257 if (nnode > this%ctx%maxbound)
then
258 write (
errmsg,
'(a,i0,a)') &
259 'Input error: number of defined (non-DNODATA) cells &
260 &exceeds MAXBOUND=', this%ctx%maxbound,
'.'
264 dbl1d(nnode) = nodes(n)
265 this%nodeulist(nnode) = n
268 this%ctx%nbound = nnode
272 call mem_setptr(dbl2d, idt%mf6varname, mempath)
273 allocate (nodes(this%ctx%nodes))
277 this%mf6_input, this%nc_vars, this%input_name, &
278 this%iout,
kper, iaux)
279 else if (layered)
then
283 call read_dbl1d(parser, nodes, idt%mf6varname)
286 call idm_log_var(nodes, idt%tagname, mempath, this%iout)
288 if (this%ctx%nbound > 0)
then
290 do n = 1, this%ctx%nbound
291 dbl2d(iaux, n) = nodes(this%nodeulist(n))
295 do n = 1, this%ctx%nodes
298 if (nnode > this%ctx%maxbound)
then
299 write (
errmsg,
'(a,i0,a)') &
300 'Input error: number of defined (non-DNODATA) cells &
301 &exceeds MAXBOUND=', this%ctx%maxbound,
'.'
305 dbl2d(iaux, nnode) = nodes(n)
306 this%nodeulist(nnode) = n
309 this%ctx%nbound = nnode
313 errmsg =
'IDM unimplemented. GridArrayLoad::param_load &
314 &datatype='//trim(idt%datatype)
320 iparam =
ifind(this%param_names, idt%tagname)
322 this%param_reads(iparam)%invar = 1
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
integer(i4b), parameter lenvarname
maximum length of a variable name
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 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)
@ brief log the closing message
subroutine, public idm_log_header(component, subcomponent, iout)
@ brief 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.
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.
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.