289 class(GridArrayLoadType), intent(inout) :: this
290 type(BlockParserType), intent(in) :: parser
291 type(InputParamDefinitionType), intent(in) :: idt
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
300
301 nnode = 0
302
303 select case (idt%datatype)
304 case ('DOUBLE1D')
305 call mem_setptr(dbl1d, idt%mf6varname, mempath)
306 allocate (nodes(this%ctx%nodes))
307 if (netcdf) then
309 this%mf6_input, this%nc_vars, this%input_name, &
311 else if (layered) then
314 else
315 call read_dbl1d(parser, nodes, idt%mf6varname)
316 end if
317
318 call idm_log_var(nodes, idt%tagname, mempath, this%iout)
319
320 if (this%nodeulist_set) then
321
322 do n = 1, this%ctx%nbound
323 dbl1d(n) = nodes(this%nodeulist(n))
324 end do
325 else
326
327 do n = 1, this%ctx%nodes
328 if (nodes(n) /=
dnodata .and. this%active(n))
then
329 nnode = nnode + 1
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, '.'
334 call store_error(errmsg)
335 call store_error_filename(this%input_name)
336 end if
337 dbl1d(nnode) = nodes(n)
338 this%nodeulist(nnode) = n
339 end if
340 end do
341 this%ctx%nbound = nnode
342 this%nodeulist_set = .true.
343 end if
344 deallocate (nodes)
345 case ('DOUBLE2D')
346 call mem_setptr(dbl2d, idt%mf6varname, mempath)
347 allocate (nodes(this%ctx%nodes))
348
349 if (netcdf) then
351 this%mf6_input, this%nc_vars, this%input_name, &
352 this%iout,
kper, iaux)
353 else if (layered) then
356 else
357 call read_dbl1d(parser, nodes, idt%mf6varname)
358 end if
359
360 call idm_log_var(nodes, idt%tagname, mempath, this%iout)
361
362 if (this%nodeulist_set) then
363
364 do n = 1, this%ctx%nbound
365 dbl2d(iaux, n) = nodes(this%nodeulist(n))
366 end do
367 else
368
369 do n = 1, this%ctx%nodes
370 if (nodes(n) /=
dnodata .and. this%active(n))
then
371 nnode = nnode + 1
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, '.'
376 call store_error(errmsg)
377 call store_error_filename(this%input_name)
378 end if
379 dbl2d(iaux, nnode) = nodes(n)
380 this%nodeulist(nnode) = n
381 end if
382 end do
383 this%ctx%nbound = nnode
384 this%nodeulist_set = .true.
385 end if
386 deallocate (nodes)
387 this%aux_reads(iaux) = merge(rs_netcdf, rs_values, netcdf)
388 case default
389 errmsg = 'IDM unimplemented. GridArrayLoad::param_load &
390 &datatype='//trim(idt%datatype)
391 call store_error(errmsg)
392 call store_error_filename(this%input_name)
393 end select
394
395
396 iparam =
ifind(this%param_names, idt%tagname)
397 if (iparam > 0) then
398 this%param_reads(iparam)%invar = merge(rs_netcdf, rs_values, netcdf)
399 end if
This module contains simulation constants.
real(dp), parameter dnodata
real no data constant
subroutine, public read_dbl1d(parser, dbl1d, aname)
This module contains the Input Data Model Logger Module.
subroutine, public read_dbl1d_layered(parser, dbl1d, aname, nlay, layer_shape)
This module contains the SourceCommonModule.
subroutine, public get_layered_shape(mshape, nlay, layer_shape)
integer(i4b), pointer, public kper
current stress period number