42 integer(I4B),
pointer :: invar
61 integer(I4B) :: sa_icol = 0
62 logical(LGP) :: is_body = .false.
63 integer(I4B) :: head_nbody = 0
64 character(len=LENVARNAME) :: head_setting_varname =
''
65 logical(LGP) :: idm_managed = .false.
68 integer(I4B) :: nfeatures = 0
77 integer(I4B),
pointer :: naux => null()
78 integer(I4B),
pointer :: maxbound => null()
79 integer(I4B),
pointer :: boundnames => null()
80 integer(I4B),
pointer :: iprpak => null()
81 integer(I4B),
pointer :: nbound => null()
82 integer(I4B),
pointer :: ncpl => null()
83 integer(I4B),
pointer :: nodes => null()
84 integer(I4B),
dimension(:),
pointer,
contiguous :: mshape => null()
86 contiguous :: auxname_cst => null()
88 contiguous :: boundname_cst => null()
89 real(dp),
dimension(:, :),
pointer, &
90 contiguous :: auxvar => null()
92 integer(I4B) :: loadtype
93 logical(LGP) :: set_scalars = .false.
94 logical(LGP) :: set_mshape = .false.
95 logical(LGP) :: is_exchange = .false.
98 character(len=LENVARNAME) :: blockname
99 character(len=LENVARNAME) :: named_bound
100 integer(I4B) :: nleading = 0
101 character(len=LINELENGTH),
dimension(:),
allocatable :: params
104 logical(LGP) :: keystring_by_feature = .false.
105 logical(LGP) :: keystring_by_node = .false.
106 logical(LGP) :: has_setting_dispatch = .false.
108 integer(I4B) :: nkeystring_items = 0
110 character(len=LENVARNAME) :: feature_id_varname =
''
143 subroutine init(this, mf6_input, blockname, named_bound)
147 character(len=*),
optional,
intent(in) :: blockname
148 character(len=*),
optional,
intent(in) :: named_bound
150 this%mf6_input = mf6_input
152 if (
present(blockname))
then
153 this%blockname = blockname
154 call upcase(this%blockname)
156 this%blockname =
'PERIOD'
159 if (
present(named_bound))
then
160 this%named_bound = named_bound
161 call upcase(this%named_bound)
163 this%named_bound =
'MAXBOUND'
166 call this%resolve_context()
167 call this%resolve_loadtype()
168 call this%set_params()
169 call this%resolve_dimensions()
171 if (this%loadtype ==
keystring)
call this%build_keystring_items()
179 this%set_scalars = .false.
180 this%set_mshape = .false.
181 this%is_exchange = .false.
183 select case (this%mf6_input%load_scope)
188 if (this%mf6_input%component_type ==
'EXG')
then
189 this%set_scalars = .true.
190 this%is_exchange = .true.
193 this%set_scalars = .true.
195 if (this%mf6_input%subcomponent_type /=
'OC' .and. &
196 this%mf6_input%subcomponent_type /=
'STO')
then
197 this%set_mshape = .true.
200 errmsg =
'LoadContext unrecognized load_scope for mempath: '// &
201 trim(this%mf6_input%mempath)
213 character(len=LINELENGTH),
dimension(:),
allocatable :: cols
214 integer(I4B) :: n, nparam
219 do n = 1,
size(this%mf6_input%block_dfns)
220 if (this%mf6_input%block_dfns(n)%blockname == this%blockname)
then
221 if (this%mf6_input%block_dfns(n)%aggregate)
then
222 if (this%blockname ==
'PERIOD' .and. &
239 this%mf6_input%component_type, &
240 this%mf6_input%subcomponent_type, &
244 this%keystring_by_feature = .true.
245 else if (cols(1) ==
'CELLID')
then
246 this%keystring_by_node = .true.
248 if (
allocated(cols))
deallocate (cols)
249 this%has_setting_dispatch = &
250 this%keystring_by_feature .or. this%keystring_by_node
251 if (this%has_setting_dispatch)
then
252 this%setting_idt => &
254 this%mf6_input%subcomponent_type, &
255 this%blockname,
'SETTING',
'SETTING',
'STRING')
261 do n = 1,
size(this%mf6_input%param_dfns)
262 idt => this%mf6_input%param_dfns(n)
263 if (idt%blockname ==
'OPTIONS')
then
264 select case (idt%tagname)
265 case (
'READASARRAYS')
267 case (
'READARRAYGRID')
283 if (this%set_scalars)
then
285 call setptr(this%nbound,
'NBOUND', this%mf6_input%mempath)
286 call setval(this%naux,
'NAUX', this%mf6_input%mempath)
287 call setval(this%ncpl,
'NCPL', this%mf6_input%mempath)
288 call setval(this%nodes,
'NODES', this%mf6_input%mempath)
289 call setval(this%boundnames,
'BOUNDNAMES', this%mf6_input%mempath)
290 call setval(this%iprpak,
'IPRPAK', this%mf6_input%mempath)
291 call setval(this%maxbound, this%named_bound, this%mf6_input%mempath)
297 if (this%set_mshape .and. &
298 this%blockname ==
'PERIOD')
then
300 this%mf6_input%component_mempath)
302 if (this%ncpl == 0)
then
303 if (
size(this%mshape) == 2)
then
304 this%ncpl = this%mshape(2)
305 else if (
size(this%mshape) == 3)
then
306 this%ncpl = this%mshape(2) * this%mshape(3)
310 if (this%nodes == 0) this%nodes = product(this%mshape)
311 if (this%loadtype ==
keystring)
call this%scale_keystring_maxbound()
321 integer(I4B) :: nkeystring_items
323 nkeystring_items = this%nkeystring_items
325 if (nkeystring_items > 0)
then
326 if (this%maxbound == 0)
then
327 if (.not. this%keystring_by_feature)
then
328 this%maxbound = this%nodes * nkeystring_items
332 this%maxbound = this%maxbound * nkeystring_items
346 integer(I4B),
dimension(:, :),
pointer,
contiguous :: cellid
347 integer(I4B),
dimension(:),
pointer,
contiguous :: nodeulist
349 if (this%set_mshape .and. &
350 this%blockname ==
'PERIOD')
then
354 call mem_allocate(cellid, 0, 0,
'CELLID', this%mf6_input%mempath)
361 call mem_allocate(nodeulist, 0,
'NODEULIST', this%mf6_input%mempath)
367 call setptr(this%auxname_cst,
'AUXILIARY', &
369 call setptr(this%boundname_cst,
'BOUNDNAME', &
371 call setptr(this%auxvar, this%mf6_input%mempath)
374 else if (this%is_exchange)
then
376 call setptr(this%auxname_cst,
'AUXILIARY', &
378 call setptr(this%boundname_cst,
'BOUNDNAME', &
380 call setptr(this%auxvar, this%mf6_input%mempath)
393 integer(I4B) :: dimsize
400 select case (idt%shape)
401 case (
'NCPL',
'NAUX NCPL')
403 case (
'NODES',
'NAUX NODES')
404 dimsize = this%maxbound
409 select case (idt%datatype)
414 this%mf6_input%mempath)
417 if (idt%shape ==
'NAUX')
then
419 idt%mf6varname, this%mf6_input%mempath)
423 this%mf6_input%mempath)
429 this%mf6_input%mempath)
446 do n = 1,
size(this%params)
448 this%mf6_input%component_type, &
449 this%mf6_input%subcomponent_type, &
450 this%blockname, this%params(n),
'')
451 call this%allocate_param(idt)
463 character(len=*),
intent(in) :: tagname
466 character(len=LINELENGTH) :: datatype
469 this%mf6_input%component_type, &
470 this%mf6_input%subcomponent_type, &
471 this%blockname, tagname,
'')
473 if (idt%required)
then
482 if (datatype ==
'KEYSTRING' .or. &
483 datatype ==
'RECARRAY' .or. &
484 datatype ==
'RECORD')
return
487 if (this%is_advanced)
then
493 if (tagname ==
'AUXVAR' .or. tagname ==
'AUX')
then
494 in_scope = this%option_check(
'NAUX', 0)
498 if (tagname ==
'BOUNDNAME')
then
499 in_scope = this%option_check(
'BOUNDNAMES', 0)
504 if (tagname ==
'I'//trim(this%mf6_input%subcomponent_type(1:3)))
then
510 select case (this%mf6_input%subcomponent_type)
512 if (tagname ==
'PXDP' .or. tagname ==
'PETM')
then
513 in_scope = this%option_check(
'NSEG', 1)
514 else if (tagname ==
'PETM0')
then
515 in_scope = this%option_check(
'SURFRATESPEC', 0)
517 case (
'MVR',
'MVT',
'MVE')
518 if (tagname ==
'MNAME' .or. &
519 tagname ==
'MNAME1' .or. &
520 tagname ==
'MNAME2')
then
521 in_scope = this%option_check(
'MODELNAMES', 0)
526 if (tagname ==
'MIXED')
in_scope = .true.
531 if (tagname ==
'MANFRACTION')
in_scope = this%option_check(
'NCOL', 2)
535 errmsg =
'LoadContext in_scope needs new case for: '// &
536 trim(this%mf6_input%subcomponent_type)//
'/'//trim(tagname)
548 character(len=*),
intent(in) :: tagname
549 character(len=LENVARNAME),
intent(out) :: dimname
550 character(len=LENVARNAME),
intent(out) :: subindex_tagname
551 logical(LGP) :: found
555 subindex_tagname =
''
556 select case (this%mf6_input%subcomponent_type)
558 if (tagname ==
'DIVFLOW')
then
560 subindex_tagname =
'IDV'
571 character(len=*),
intent(in) :: varname
572 integer(I4B),
intent(in) :: threshold
574 integer(I4B) :: isize
575 integer(I4B),
pointer :: intptr
577 call get_isize(varname, this%mf6_input%mempath, isize)
579 call mem_setptr(intptr, varname, this%mf6_input%mempath)
591 integer(I4B) :: icol, k, padj, nfeatures, nkeystring_items
592 character(len=LENVARNAME) :: dimname, subindex_tagname
593 logical(LGP) :: found, node
594 character(len=LINELENGTH),
allocatable :: item_names(:)
595 integer(I4B),
allocatable :: head_nbody(:)
596 logical(LGP),
allocatable :: item_is_body(:)
597 character(len=LENVARNAME) :: cur_head
599 if (.not. this%has_setting_dispatch)
return
602 call this%keystring_item_names(item_names, head_nbody, item_is_body, &
604 if (nkeystring_items < 1)
return
608 if (this%keystring_by_feature)
then
610 this%mf6_input%component_type, &
611 this%mf6_input%subcomponent_type, &
612 this%blockname, this%params(1),
'')
613 this%feature_id_varname = trim(idt%mf6varname)
617 node = this%keystring_by_node
619 allocate (this%keystring_items(nkeystring_items))
620 nfeatures = this%resolve_nfeatures()
623 do icol = this%nleading + 1,
size(this%params)
624 k = icol - this%nleading
626 this%mf6_input%component_type, &
627 this%mf6_input%subcomponent_type, &
628 this%blockname, this%params(icol),
'')
629 this%keystring_items(k)%idt => idt
630 this%keystring_items(k)%sa_icol = icol + padj
631 this%keystring_items(k)%is_body = item_is_body(k)
632 this%keystring_items(k)%head_nbody = head_nbody(k)
637 if (.not. this%keystring_items(k)%is_body)
then
638 if (this%keystring_items(k)%head_nbody > 0)
then
639 cur_head = trim(idt%mf6varname)
644 this%keystring_items(k)%head_setting_varname = trim(cur_head)
649 this%keystring_items(k)%idm_managed = &
650 (idt%datatype ==
'DOUBLE' .and. idt%timeseries .and. &
651 .not. this%keystring_items(k)%is_body)
653 if (this%keystring_items(k)%idm_managed)
then
655 this%keystring_items(k)%addr_mode =
addr_node
656 this%keystring_items(k)%init_value =
dnodata
657 if (
associated(this%nodes)) &
658 this%keystring_items(k)%nfeatures = this%nodes
661 this%keystring_items(k)%init_value =
dzero
662 this%keystring_items(k)%nfeatures = &
663 this%resolve_item_nfeatures(idt%tagname, idt%shape, nfeatures)
669 if (this%is_advanced .and. this%keystring_items(k)%is_body)
then
670 found = this%subindex_dependency(idt%tagname, dimname, &
674 this%keystring_items(k)%idm_managed = .true.
690 integer(I4B) :: nfeatures
691 integer(I4B) :: isize, nkeystring_items, nrow, ndim
692 integer(I4B),
pointer :: dimval
693 logical(LGP) :: have_dim, have_nrow
694 character(len=LINELENGTH) ::
errmsg
702 call mem_set_value(dimval, this%named_bound, this%mf6_input%mempath, &
703 have_dim, release=.false.)
704 if (have_dim) ndim = dimval
707 call get_isize(
'PACKAGEDATA_IFNO', this%mf6_input%mempath, isize)
708 have_nrow = (isize > 0)
711 if (have_dim .and. have_nrow .and. ndim /= nrow)
then
712 write (
errmsg,
'(a,1x,a,1x,i0,1x,a,1x,i0,a)') &
713 'IDM dimension mismatch:', trim(this%named_bound), ndim, &
714 'does not match the PACKAGEDATA row count', nrow,
'.'
721 else if (have_nrow)
then
729 nkeystring_items = this%nkeystring_items
730 if (nkeystring_items > 0 .and.
associated(this%maxbound))
then
731 if (this%maxbound > 0) nfeatures = this%maxbound / nkeystring_items
739 default_nfeatures)
result(nfeatures)
743 character(len=*),
intent(in) :: item_tagname
744 character(len=*),
intent(in) :: dimname
745 integer(I4B),
intent(in) :: default_nfeatures
746 integer(I4B) :: nfeatures
747 integer(I4B),
pointer :: shape_val => null()
748 integer(I4B),
dimension(:),
pointer,
contiguous :: shape_arr => null()
749 integer(I4B) :: isize
750 character(len=LINELENGTH) ::
errmsg
752 nfeatures = default_nfeatures
753 if (dimname ==
'')
return
754 call get_isize(trim(dimname), this%mf6_input%mempath, isize)
758 else if (isize == 0)
then
759 write (
errmsg,
'(a,1x,a,1x,a)') &
760 'item', trim(item_tagname)//
': DIMENSION', &
761 trim(dimname)//
' is not defined.'
765 else if (.not. this%shape_param_is_array(trim(dimname)))
then
766 call mem_setptr(shape_val, trim(dimname), this%mf6_input%mempath)
767 nfeatures = shape_val
769 call mem_setptr(shape_arr, trim(dimname), this%mf6_input%mempath)
770 nfeatures = sum(shape_arr)
779 character(len=*),
intent(in) :: shape_varname
780 logical(LGP) :: is_array
784 do i = 1,
size(this%mf6_input%param_dfns)
785 if (this%mf6_input%param_dfns(i)%component_type == &
786 this%mf6_input%component_type .and. &
787 this%mf6_input%param_dfns(i)%subcomponent_type == &
788 this%mf6_input%subcomponent_type .and. &
789 trim(this%mf6_input%param_dfns(i)%mf6varname) == &
790 trim(shape_varname))
then
792 (trim(this%mf6_input%param_dfns(i)%blockname) ==
'PACKAGEDATA')
807 character(len=LINELENGTH),
dimension(:),
allocatable :: param_buf
808 character(len=LINELENGTH),
dimension(:),
allocatable :: cols
809 character(len=LINELENGTH),
allocatable :: item_names(:)
810 integer(I4B),
allocatable :: head_nbody(:)
811 logical(LGP),
allocatable :: item_is_body(:)
812 integer(I4B) :: keepcnt, iparam, nparam, nkeystring_items, n
813 logical(LGP) :: keep, tag_found
818 if (this%loadtype ==
list .or. &
823 this%mf6_input%component_type, &
824 this%mf6_input%subcomponent_type, &
829 nparam =
size(this%mf6_input%param_dfns)
833 do iparam = 1, nparam
834 if (this%loadtype ==
list .or. &
838 this%mf6_input%component_type, &
839 this%mf6_input%subcomponent_type, &
840 this%blockname, cols(iparam),
'', &
844 idt => this%mf6_input%param_dfns(iparam)
847 if (.not. tag_found)
then
849 else if (idt%blockname /= this%blockname)
then
852 keep = this%in_scope(idt%tagname)
856 keepcnt = keepcnt + 1
858 param_buf(keepcnt) = trim(idt%tagname)
863 if (this%loadtype ==
list .or. &
864 this%loadtype ==
keystring) this%nleading = keepcnt
869 call this%keystring_item_names(item_names, head_nbody, &
870 item_is_body, nkeystring_items)
871 this%nkeystring_items = nkeystring_items
872 do n = 1, nkeystring_items
873 keepcnt = keepcnt + 1
875 param_buf(keepcnt) = trim(item_names(n))
883 allocate (this%params(nparam))
884 do iparam = 1, nparam
885 this%params(iparam) = trim(param_buf(iparam))
889 if (
allocated(param_buf))
deallocate (param_buf)
906 character(len=*),
intent(in) :: mf6varname
907 character(len=LENVARNAME) :: varname
908 integer(I4B),
pointer :: intvar
910 call mem_allocate(intvar, varname, this%mf6_input%mempath)
919 if (
associated(this%setting_idt))
then
920 deallocate (this%setting_idt)
921 nullify (this%setting_idt)
924 if (this%set_scalars)
then
926 deallocate (this%naux)
927 deallocate (this%ncpl)
928 deallocate (this%nodes)
929 deallocate (this%maxbound)
930 deallocate (this%boundnames)
931 deallocate (this%iprpak)
936 nullify (this%nbound)
939 nullify (this%maxbound)
940 nullify (this%boundnames)
941 nullify (this%iprpak)
942 nullify (this%auxname_cst)
943 nullify (this%boundname_cst)
944 nullify (this%auxvar)
945 nullify (this%mshape)
954 character(len=LINELENGTH),
intent(in) :: rec_cols(:)
955 integer(I4B),
intent(in) :: nrec_col
957 character(len=LINELENGTH) :: token, tagname
958 integer(I4B) :: m, n, ilen
961 token = trim(rec_cols(m))
963 ilen = len_trim(token)
966 if (token(ilen - 6:ilen) /=
'SETTING') cycle
967 do n = 1,
size(mf6_input%aggregate_dfns)
968 tagname = mf6_input%aggregate_dfns(n)%tagname
970 if (trim(tagname) == trim(token))
then
971 ks_aidt => mf6_input%aggregate_dfns(n)
972 if (
idt_datatype(ks_aidt) /=
'KEYSTRING') ks_aidt => null()
988 character(len=LINELENGTH),
allocatable,
intent(inout) :: item_names(:)
989 integer(I4B),
intent(inout) :: nkeystring_items
991 character(len=LINELENGTH),
allocatable :: sub_cols(:)
992 character(len=LINELENGTH) :: token, tagname
993 integer(I4B) :: k, j, nsub_col
996 token = trim(sub_cols(k))
998 do j = 1,
size(mf6_input%param_dfns)
999 sub_idt => mf6_input%param_dfns(j)
1000 if (sub_idt%blockname /=
'PERIOD') cycle
1001 tagname = sub_idt%tagname
1003 if (trim(tagname) /= trim(token)) cycle
1005 nkeystring_items = nkeystring_items + 1
1007 item_names(nkeystring_items) = trim(sub_idt%tagname)
1011 if (
allocated(sub_cols))
deallocate (sub_cols)
1020 logical(LGP) :: res, has_period
1022 character(len=LINELENGTH),
allocatable :: cols(:)
1023 integer(I4B) :: n, ncol
1025 has_period = .false.
1026 do n = 1,
size(mf6_input%block_dfns)
1027 if (mf6_input%block_dfns(n)%blockname ==
'PERIOD')
then
1031 if (.not. has_period)
return
1033 mf6_input%component_type, &
1034 mf6_input%subcomponent_type, &
1039 if (
associated(ks_aidt)) res = .true.
1041 if (
allocated(cols))
deallocate (cols)
1054 character(len=LINELENGTH),
allocatable :: cols(:)
1055 integer(I4B) :: ncol
1059 mf6_input%component_type, &
1060 mf6_input%subcomponent_type, &
1064 if (
allocated(cols))
deallocate (cols)
1072 character(len=*),
intent(in) :: tagname
1074 select case (tagname)
1075 case (
'IFNO',
'NUMBER',
'BNDNO',
'RNO',
'LAKENO',
'MAWNO',
'UZFNO')
1087 res =
idm_is_advanced(mf6_input%component_type, mf6_input%subcomponent_type)
1095 item_is_body, nkeystring_items)
1101 character(len=LINELENGTH),
allocatable,
intent(out) :: item_names(:)
1102 integer(I4B),
allocatable,
intent(out) :: head_nbody(:)
1103 logical(LGP),
allocatable,
intent(out) :: item_is_body(:)
1104 integer(I4B),
intent(out) :: nkeystring_items
1106 character(len=LINELENGTH),
allocatable :: rec_cols(:), ks_cols(:)
1107 character(len=LINELENGTH) :: rec_token, tagname
1108 integer(I4B) :: m, n, nrec_col, nks_col, nitems0, k
1110 nkeystring_items = 0
1114 this%mf6_input%component_type, &
1115 this%mf6_input%subcomponent_type, &
1121 if (
allocated(rec_cols))
deallocate (rec_cols)
1122 if (.not.
associated(ks_aidt))
return
1129 rec_token = trim(ks_cols(m))
1133 do n = 1,
size(this%mf6_input%param_dfns)
1134 if (this%mf6_input%param_dfns(n)%blockname /= this%blockname) cycle
1135 tagname = this%mf6_input%param_dfns(n)%tagname
1137 if (trim(tagname) /= trim(rec_token)) cycle
1139 idt => this%mf6_input%param_dfns(n)
1142 nitems0 = nkeystring_items
1146 do k = nitems0 + 1, nkeystring_items
1149 if (k == nitems0 + 1)
then
1150 head_nbody(k) = nkeystring_items - nitems0 - 1
1151 item_is_body(k) = .false.
1154 item_is_body(k) = .true.
1159 nkeystring_items = nkeystring_items + 1
1163 item_names(nkeystring_items) = &
1164 trim(this%mf6_input%param_dfns(n)%tagname)
1165 head_nbody(nkeystring_items) = 0
1166 item_is_body(nkeystring_items) = .false.
1172 if (
allocated(ks_cols))
deallocate (ks_cols)
1182 character(len=*),
intent(in) :: input_name
1184 character(len=LINELENGTH) :: dev_msg
1187 do n = 1,
size(this%params)
1189 this%mf6_input%component_type, &
1190 this%mf6_input%subcomponent_type, &
1191 this%blockname, this%params(n),
'')
1192 if (idt%developmode)
then
1193 dev_msg =
'Input tag "'//trim(idt%tagname)// &
1194 &
'" read from file "'//trim(input_name)// &
1195 &
'" is still under development. Install the &
1196 &nightly build or compile from source with IDEVELOPMODE = 1.'
1206 character(len=*),
intent(in) :: mf6varname
1207 character(len=LENVARNAME) :: varname
1208 integer(I4B) :: ilen
1209 character(len=2) :: prefix =
'IN'
1210 ilen = len_trim(mf6varname)
1212 varname = prefix//mf6varname(1:(
lenvarname - len(prefix)))
1214 varname = prefix//trim(mf6varname)
1222 integer(I4B),
intent(in) :: nrow
1223 character(len=*),
intent(in) :: varname
1224 character(len=*),
intent(in) :: mempath
1225 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
1237 integer(I4B),
intent(in) :: nrow
1238 character(len=*),
intent(in) :: varname
1239 character(len=*),
intent(in) :: mempath
1240 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
1252 integer(I4B),
intent(in) :: ncol
1253 integer(I4B),
intent(in) :: nrow
1254 character(len=*),
intent(in) :: varname
1255 character(len=*),
intent(in) :: mempath
1256 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
1257 integer(I4B) :: n, m
1271 integer(I4B),
pointer,
intent(inout) :: intptr
1272 character(len=*),
intent(in) :: varname
1273 character(len=*),
intent(in) :: mempath
1274 logical(LGP) :: found
1277 call mem_set_value(intptr, varname, mempath, found, release=.false.)
1285 integer(I4B),
pointer,
intent(inout) :: intptr
1286 character(len=*),
intent(in) :: varname
1287 character(len=*),
intent(in) :: mempath
1288 integer(I4B) :: isize
1290 if (isize > -1)
then
1303 contiguous,
intent(inout) :: charstr1d
1304 character(len=*),
intent(in) :: varname
1305 character(len=*),
intent(in) :: mempath
1306 integer(I4B),
intent(in) :: strlen
1307 integer(I4B) :: isize
1309 if (isize > -1)
then
1312 call mem_allocate(charstr1d, strlen, 0, varname, mempath)
1321 real(DP),
dimension(:, :),
pointer, &
1322 contiguous,
intent(inout) :: auxvar
1323 character(len=*),
intent(in) :: mempath
1324 integer(I4B) :: isize
1325 call get_isize(
'AUXVAR', mempath, isize)
1326 if (isize > -1)
then
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
integer(i4b), parameter lenauxname
maximum length of a aux variable
integer(i4b), parameter lenboundname
maximum length of a bound name
integer(i4b), parameter izero
integer constant zero
real(dp), parameter dzero
real constant zero
This module contains the DefinitionSelectModule.
type(inputparamdefinitiontype) function, pointer, public idt_default(component_type, subcomponent_type, blockname, tagname, mf6varname, datatype)
return allocated input definition type
type(inputparamdefinitiontype) function, pointer, public get_aggregate_definition_type(input_definition_types, component_type, subcomponent_type, blockname)
Return aggregate definition.
subroutine, public idt_parse_rectype(idt, cols, ncol)
allocate and set RECARRAY, KEYSTRING or RECORD param list
character(len=linelength) function, public idt_datatype(idt)
return input definition type datatype
type(inputparamdefinitiontype) function, pointer, public get_param_definition_type(input_definition_types, component_type, subcomponent_type, blockname, tagname, filename, found)
Return parameter definition.
Disable development features in release mode.
subroutine, public developmode(errmsg, iunit)
Terminate if in release mode (guard development features)
logical function, public idm_is_advanced(component, subcomponent)
This module defines variable data types.
Load context for IDM generic dynamic loaders.
subroutine set_params(this)
set set of in scope parameters for package
subroutine expand_record_body(mf6_input, rec_idt, item_names, nkeystring_items)
Append body column names from a RECORD compound entry to item_names.
subroutine allocate_dbl2d(ncol, nrow, varname, mempath)
allocate dbl2d
subroutine build_keystring_items(this)
Build the per-item descriptor table, the single source of truth for how each keystring item is alloca...
subroutine setptr_auxvar(auxvar, mempath)
set auxvar pointer
logical(lgp) function option_check(this, varname, threshold)
Return .true. if a memory-manager integer option variable exceeds a threshold.
integer(i4b), parameter, public addr_feature
addressed by leading id (IFNO/BNDNO)
subroutine check_developmode(this, input_name)
Check whether any in-scope parameter is a development-mode feature.
integer(i4b), parameter, public addr_none
not an applied setting
logical(lgp) function, public is_feature_keystring(mf6_input)
.true. if mf6_input's PERIOD block is feature-addressed (see is_feature_tag). Block-independent,...
subroutine allocate_params(this)
Allocate each in-scope parameter in the memory manager.
logical(lgp) function shape_param_is_array(this, shape_varname)
Is shape_varname a per-feature array (PACKAGEDATA) rather than a package-wide scalar (DIMENSIONS)?
subroutine resolve_loadtype(this)
Determine loadtype from block and param definitions.
subroutine allocate_int1d(nrow, varname, mempath)
allocate int1d
subroutine keystring_item_names(this, item_names, head_nbody, item_is_body, nkeystring_items)
Return keystring item column names, per-head body counts, and body flags. A RECORD group's trailing c...
integer(i4b), parameter, public addr_subindex
addressed by (id, subindex)
@ load_undef
undefined load type
@ gridarray
readarraygrid load
@ keystring
keystring period block load
@ layerarray
readasarrays load
type(inputparamdefinitiontype) function, pointer find_setting_aggregate(mf6_input, rec_cols, nrec_col)
Return the KEYSTRING aggregate for the SETTING token in rec_cols, or null().
subroutine allocate_dbl1d(nrow, varname, mempath)
allocate dbl1d
logical(lgp) function is_feature_tag(tagname)
.true. if tagname is a record's leading id column (IFNO and its legacy package-specific aliases)....
integer(i4b) function resolve_item_nfeatures(this, item_tagname, dimname, default_nfeatures)
Per-item feature count from a named dimension, falling back to default_nfeatures if unset....
subroutine setval(intptr, varname, mempath)
allocate intptr and update from input context
subroutine allocate_param(this, idt)
allocate a package dynamic input parameter
subroutine resolve_dimensions(this)
Resolve dimension scalars and scale keystring maxbound.
logical(lgp) function, public is_advanced(mf6_input)
Return .true. if mf6_input is an advanced package.
subroutine allocate_arrays(this)
allocate arrays
subroutine setptr_int(intptr, varname, mempath)
set intptr to varname
integer(i4b) function resolve_nfeatures(this)
Resolve the permanent array's feature count. The explicit DIMENSIONS dimension (named_bound) is autho...
subroutine destroy(this)
destroy input context object
subroutine scale_keystring_maxbound(this)
Scale maxbound (a feature or node count) by the number of KEYSTRING items, so every feature can use e...
subroutine resolve_context(this)
Set context flags from input load_scope and component metadata.
logical(lgp) function subindex_dependency(this, tagname, dimname, subindex_tagname)
Hardcoded per-package dependency for a subindex param with no SHAPE of its own – same category of spe...
character(len=lenvarname) function, public rsv_name(mf6varname)
create read state variable name
character(len=lenvarname) function rsv_alloc(this, mf6varname)
allocate a read state variable
logical(lgp) function in_scope(this, tagname)
Return .true. if an optional parameter is active for this load. Required/structural params are handle...
subroutine setptr_charstr1d(charstr1d, varname, mempath, strlen)
set charstr1d pointer to varname
logical(lgp) function, public is_keystring_period(mf6_input)
Return .true. if mf6_input's PERIOD block uses keystring dispatch.
integer(i4b), parameter, public addr_node
addressed by CELLID
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.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
integer(i4b) iout
file unit number for simulation output
This class is used to store a single deferred-length character string. It was designed to work in an ...
One descriptor per expanded keystring item, so loaders iterate uniformly instead of re-deriving per-m...
Input load context for generic dynamic loaders and StructArray based static loads....
Pointer type for read state variable.