405 class(StructArrayType) :: this
406 integer(I4B),
intent(in) :: icol
407 integer(I4B) :: i, j, isize
408 integer(I4B),
dimension(:),
pointer,
contiguous :: p_int1d
409 integer(I4B),
dimension(:, :),
pointer,
contiguous :: p_int2d
410 real(DP),
dimension(:),
pointer,
contiguous :: p_dbl1d
411 type(CharacterStringType),
dimension(:),
pointer,
contiguous :: p_charstr1d
412 character(len=LENVARNAME) :: varname
413 logical(LGP) :: overwrite
416 if (this%struct_vectors(icol)%idt%blockname ==
'SOLUTIONGROUP') &
420 varname = this%struct_vectors(icol)%idt%mf6varname
422 call get_isize(varname, this%mempath, isize)
425 select case (this%struct_vectors(icol)%memtype)
429 call mem_setptr(p_int1d, varname, this%mempath)
433 if (this%nrow > isize)
then
440 p_int1d(i) = this%struct_vectors(icol)%int1d(i)
443 if (isize > this%nrow)
then
445 do i = this%nrow + 1, isize
451 call mem_reallocate(p_int1d, this%nrow + isize, varname, this%mempath)
455 p_int1d(isize + i) = this%struct_vectors(icol)%int1d(i)
460 call mem_allocate(p_int1d, this%nrow, varname, this%mempath)
464 p_int1d(i) = this%struct_vectors(icol)%int1d(i)
469 deallocate (this%struct_vectors(icol)%int1d)
472 this%struct_vectors(icol)%int1d => p_int1d
473 this%struct_vectors(icol)%size = this%nrow
476 call mem_setptr(p_dbl1d, varname, this%mempath)
479 if (this%nrow > isize)
then
484 p_dbl1d(i) = this%struct_vectors(icol)%dbl1d(i)
487 if (isize > this%nrow)
then
488 do i = this%nrow + 1, isize
496 p_dbl1d(isize + i) = this%struct_vectors(icol)%dbl1d(i)
500 call mem_allocate(p_dbl1d, this%nrow, varname, this%mempath)
503 p_dbl1d(i) = this%struct_vectors(icol)%dbl1d(i)
507 deallocate (this%struct_vectors(icol)%dbl1d)
509 this%struct_vectors(icol)%dbl1d => p_dbl1d
510 this%struct_vectors(icol)%size = this%nrow
514 call mem_setptr(p_charstr1d, varname, this%mempath)
517 if (this%nrow > isize)
then
518 call mem_reallocate(p_charstr1d, linelength, this%nrow, varname, &
523 p_charstr1d(i) = this%struct_vectors(icol)%charstr1d(i)
526 if (isize > this%nrow)
then
527 do i = this%nrow + 1, isize
533 varname, this%mempath)
535 p_charstr1d(isize + i) = this%struct_vectors(icol)%charstr1d(i)
539 call mem_allocate(p_charstr1d, linelength, this%nrow, varname, &
542 p_charstr1d(i) = this%struct_vectors(icol)%charstr1d(i)
543 call this%struct_vectors(icol)%charstr1d(i)%destroy()
547 deallocate (this%struct_vectors(icol)%charstr1d)
549 this%struct_vectors(icol)%charstr1d => p_charstr1d
550 this%struct_vectors(icol)%size = this%nrow
552 errmsg =
'StructArray::load_deferred_vector &
553 &intvector reallocate unimplemented.'
554 call store_error(errmsg, terminate=.true.)
557 errmsg =
'StructArray::load_deferred_vector &
558 &int2d reallocate unimplemented.'
559 call store_error(errmsg, terminate=.true.)
561 call mem_allocate(p_int2d, this%struct_vectors(icol)%intshape, &
562 this%nrow, varname, this%mempath)
564 do j = 1, this%struct_vectors(icol)%intshape
565 p_int2d(j, i) = this%struct_vectors(icol)%int2d(j, i)
570 deallocate (this%struct_vectors(icol)%int2d)
572 this%struct_vectors(icol)%int2d => p_int2d
573 this%struct_vectors(icol)%size = this%nrow
575 errmsg =
'StructArray::load_deferred_vector &
576 &dbl2d reallocate unimplemented.'
577 call store_error(errmsg, terminate=.true.)