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)
534 if (tagname ==
'BAREA')
in_scope = this%option_check(
'NCOL', 3)
538 errmsg =
'LoadContext in_scope needs new case for: '// &
539 trim(this%mf6_input%subcomponent_type)//
'/'//trim(tagname)
551 character(len=*),
intent(in) :: tagname
552 character(len=LENVARNAME),
intent(out) :: dimname
553 character(len=LENVARNAME),
intent(out) :: subindex_tagname
554 logical(LGP) :: found
558 subindex_tagname =
''
559 select case (this%mf6_input%subcomponent_type)
561 if (tagname ==
'DIVFLOW')
then
563 subindex_tagname =
'IDV'
574 character(len=*),
intent(in) :: varname
575 integer(I4B),
intent(in) :: threshold
577 integer(I4B) :: isize
578 integer(I4B),
pointer :: intptr
580 call get_isize(varname, this%mf6_input%mempath, isize)
582 call mem_setptr(intptr, varname, this%mf6_input%mempath)
594 integer(I4B) :: icol, k, padj, nfeatures, nkeystring_items
595 character(len=LENVARNAME) :: dimname, subindex_tagname
596 logical(LGP) :: found, node
597 character(len=LINELENGTH),
allocatable :: item_names(:)
598 integer(I4B),
allocatable :: head_nbody(:)
599 logical(LGP),
allocatable :: item_is_body(:)
600 character(len=LENVARNAME) :: cur_head
602 if (.not. this%has_setting_dispatch)
return
605 call this%keystring_item_names(item_names, head_nbody, item_is_body, &
607 if (nkeystring_items < 1)
return
611 if (this%keystring_by_feature)
then
613 this%mf6_input%component_type, &
614 this%mf6_input%subcomponent_type, &
615 this%blockname, this%params(1),
'')
616 this%feature_id_varname = trim(idt%mf6varname)
620 node = this%keystring_by_node
622 allocate (this%keystring_items(nkeystring_items))
623 nfeatures = this%resolve_nfeatures()
626 do icol = this%nleading + 1,
size(this%params)
627 k = icol - this%nleading
629 this%mf6_input%component_type, &
630 this%mf6_input%subcomponent_type, &
631 this%blockname, this%params(icol),
'')
632 this%keystring_items(k)%idt => idt
633 this%keystring_items(k)%sa_icol = icol + padj
634 this%keystring_items(k)%is_body = item_is_body(k)
635 this%keystring_items(k)%head_nbody = head_nbody(k)
640 if (.not. this%keystring_items(k)%is_body)
then
641 if (this%keystring_items(k)%head_nbody > 0)
then
642 cur_head = trim(idt%mf6varname)
647 this%keystring_items(k)%head_setting_varname = trim(cur_head)
652 this%keystring_items(k)%idm_managed = &
653 (idt%datatype ==
'DOUBLE' .and. idt%timeseries .and. &
654 .not. this%keystring_items(k)%is_body)
656 if (this%keystring_items(k)%idm_managed)
then
658 this%keystring_items(k)%addr_mode =
addr_node
659 this%keystring_items(k)%init_value =
dnodata
660 if (
associated(this%nodes)) &
661 this%keystring_items(k)%nfeatures = this%nodes
664 this%keystring_items(k)%init_value =
dzero
665 this%keystring_items(k)%nfeatures = &
666 this%resolve_item_nfeatures(idt%tagname, idt%shape, nfeatures)
672 if (this%is_advanced .and. this%keystring_items(k)%is_body)
then
673 found = this%subindex_dependency(idt%tagname, dimname, &
677 this%keystring_items(k)%idm_managed = .true.
693 integer(I4B) :: nfeatures
694 integer(I4B) :: isize, nkeystring_items, nrow, ndim
695 integer(I4B),
pointer :: dimval
696 logical(LGP) :: have_dim, have_nrow
697 character(len=LINELENGTH) ::
errmsg
705 call mem_set_value(dimval, this%named_bound, this%mf6_input%mempath, &
706 have_dim, release=.false.)
707 if (have_dim) ndim = dimval
710 call get_isize(
'PACKAGEDATA_IFNO', this%mf6_input%mempath, isize)
711 have_nrow = (isize > 0)
714 if (have_dim .and. have_nrow .and. ndim /= nrow)
then
715 write (
errmsg,
'(a,1x,a,1x,i0,1x,a,1x,i0,a)') &
716 'IDM dimension mismatch:', trim(this%named_bound), ndim, &
717 'does not match the PACKAGEDATA row count', nrow,
'.'
724 else if (have_nrow)
then
732 nkeystring_items = this%nkeystring_items
733 if (nkeystring_items > 0 .and.
associated(this%maxbound))
then
734 if (this%maxbound > 0) nfeatures = this%maxbound / nkeystring_items
742 default_nfeatures)
result(nfeatures)
746 character(len=*),
intent(in) :: item_tagname
747 character(len=*),
intent(in) :: dimname
748 integer(I4B),
intent(in) :: default_nfeatures
749 integer(I4B) :: nfeatures
750 integer(I4B),
pointer :: shape_val => null()
751 integer(I4B),
dimension(:),
pointer,
contiguous :: shape_arr => null()
752 integer(I4B) :: isize
753 character(len=LINELENGTH) ::
errmsg
755 nfeatures = default_nfeatures
756 if (dimname ==
'')
return
757 call get_isize(trim(dimname), this%mf6_input%mempath, isize)
761 else if (isize == 0)
then
762 write (
errmsg,
'(a,1x,a,1x,a)') &
763 'item', trim(item_tagname)//
': DIMENSION', &
764 trim(dimname)//
' is not defined.'
768 else if (.not. this%shape_param_is_array(trim(dimname)))
then
769 call mem_setptr(shape_val, trim(dimname), this%mf6_input%mempath)
770 nfeatures = shape_val
772 call mem_setptr(shape_arr, trim(dimname), this%mf6_input%mempath)
773 nfeatures = sum(shape_arr)
782 character(len=*),
intent(in) :: shape_varname
783 logical(LGP) :: is_array
787 do i = 1,
size(this%mf6_input%param_dfns)
788 if (this%mf6_input%param_dfns(i)%component_type == &
789 this%mf6_input%component_type .and. &
790 this%mf6_input%param_dfns(i)%subcomponent_type == &
791 this%mf6_input%subcomponent_type .and. &
792 trim(this%mf6_input%param_dfns(i)%mf6varname) == &
793 trim(shape_varname))
then
795 (trim(this%mf6_input%param_dfns(i)%blockname) ==
'PACKAGEDATA')
810 character(len=LINELENGTH),
dimension(:),
allocatable :: param_buf
811 character(len=LINELENGTH),
dimension(:),
allocatable :: cols
812 character(len=LINELENGTH),
allocatable :: item_names(:)
813 integer(I4B),
allocatable :: head_nbody(:)
814 logical(LGP),
allocatable :: item_is_body(:)
815 integer(I4B) :: keepcnt, iparam, nparam, nkeystring_items, n
816 logical(LGP) :: keep, tag_found
821 if (this%loadtype ==
list .or. &
826 this%mf6_input%component_type, &
827 this%mf6_input%subcomponent_type, &
832 nparam =
size(this%mf6_input%param_dfns)
836 do iparam = 1, nparam
837 if (this%loadtype ==
list .or. &
841 this%mf6_input%component_type, &
842 this%mf6_input%subcomponent_type, &
843 this%blockname, cols(iparam),
'', &
847 idt => this%mf6_input%param_dfns(iparam)
850 if (.not. tag_found)
then
852 else if (idt%blockname /= this%blockname)
then
855 keep = this%in_scope(idt%tagname)
859 keepcnt = keepcnt + 1
861 param_buf(keepcnt) = trim(idt%tagname)
866 if (this%loadtype ==
list .or. &
867 this%loadtype ==
keystring) this%nleading = keepcnt
872 call this%keystring_item_names(item_names, head_nbody, &
873 item_is_body, nkeystring_items)
874 this%nkeystring_items = nkeystring_items
875 do n = 1, nkeystring_items
876 keepcnt = keepcnt + 1
878 param_buf(keepcnt) = trim(item_names(n))
886 allocate (this%params(nparam))
887 do iparam = 1, nparam
888 this%params(iparam) = trim(param_buf(iparam))
892 if (
allocated(param_buf))
deallocate (param_buf)
909 character(len=*),
intent(in) :: mf6varname
910 character(len=LENVARNAME) :: varname
911 integer(I4B),
pointer :: intvar
913 call mem_allocate(intvar, varname, this%mf6_input%mempath)
922 if (
associated(this%setting_idt))
then
923 deallocate (this%setting_idt)
924 nullify (this%setting_idt)
927 if (this%set_scalars)
then
929 deallocate (this%naux)
930 deallocate (this%ncpl)
931 deallocate (this%nodes)
932 deallocate (this%maxbound)
933 deallocate (this%boundnames)
934 deallocate (this%iprpak)
939 nullify (this%nbound)
942 nullify (this%maxbound)
943 nullify (this%boundnames)
944 nullify (this%iprpak)
945 nullify (this%auxname_cst)
946 nullify (this%boundname_cst)
947 nullify (this%auxvar)
948 nullify (this%mshape)
957 character(len=LINELENGTH),
intent(in) :: rec_cols(:)
958 integer(I4B),
intent(in) :: nrec_col
960 character(len=LINELENGTH) :: token, tagname
961 integer(I4B) :: m, n, ilen
964 token = trim(rec_cols(m))
966 ilen = len_trim(token)
969 if (token(ilen - 6:ilen) /=
'SETTING') cycle
970 do n = 1,
size(mf6_input%aggregate_dfns)
971 tagname = mf6_input%aggregate_dfns(n)%tagname
973 if (trim(tagname) == trim(token))
then
974 ks_aidt => mf6_input%aggregate_dfns(n)
975 if (
idt_datatype(ks_aidt) /=
'KEYSTRING') ks_aidt => null()
991 character(len=LINELENGTH),
allocatable,
intent(inout) :: item_names(:)
992 integer(I4B),
intent(inout) :: nkeystring_items
994 character(len=LINELENGTH),
allocatable :: sub_cols(:)
995 character(len=LINELENGTH) :: token, tagname
996 integer(I4B) :: k, j, nsub_col
999 token = trim(sub_cols(k))
1001 do j = 1,
size(mf6_input%param_dfns)
1002 sub_idt => mf6_input%param_dfns(j)
1003 if (sub_idt%blockname /=
'PERIOD') cycle
1004 tagname = sub_idt%tagname
1006 if (trim(tagname) /= trim(token)) cycle
1008 nkeystring_items = nkeystring_items + 1
1010 item_names(nkeystring_items) = trim(sub_idt%tagname)
1014 if (
allocated(sub_cols))
deallocate (sub_cols)
1023 logical(LGP) :: res, has_period
1025 character(len=LINELENGTH),
allocatable :: cols(:)
1026 integer(I4B) :: n, ncol
1028 has_period = .false.
1029 do n = 1,
size(mf6_input%block_dfns)
1030 if (mf6_input%block_dfns(n)%blockname ==
'PERIOD')
then
1034 if (.not. has_period)
return
1036 mf6_input%component_type, &
1037 mf6_input%subcomponent_type, &
1042 if (
associated(ks_aidt)) res = .true.
1044 if (
allocated(cols))
deallocate (cols)
1057 character(len=LINELENGTH),
allocatable :: cols(:)
1058 integer(I4B) :: ncol
1062 mf6_input%component_type, &
1063 mf6_input%subcomponent_type, &
1067 if (
allocated(cols))
deallocate (cols)
1075 character(len=*),
intent(in) :: tagname
1077 select case (tagname)
1078 case (
'IFNO',
'NUMBER',
'BNDNO',
'RNO',
'LAKENO',
'MAWNO',
'UZFNO')
1090 res =
idm_is_advanced(mf6_input%component_type, mf6_input%subcomponent_type)
1098 item_is_body, nkeystring_items)
1104 character(len=LINELENGTH),
allocatable,
intent(out) :: item_names(:)
1105 integer(I4B),
allocatable,
intent(out) :: head_nbody(:)
1106 logical(LGP),
allocatable,
intent(out) :: item_is_body(:)
1107 integer(I4B),
intent(out) :: nkeystring_items
1109 character(len=LINELENGTH),
allocatable :: rec_cols(:), ks_cols(:)
1110 character(len=LINELENGTH) :: rec_token, tagname
1111 integer(I4B) :: m, n, nrec_col, nks_col, nitems0, k
1113 nkeystring_items = 0
1117 this%mf6_input%component_type, &
1118 this%mf6_input%subcomponent_type, &
1124 if (
allocated(rec_cols))
deallocate (rec_cols)
1125 if (.not.
associated(ks_aidt))
return
1132 rec_token = trim(ks_cols(m))
1136 do n = 1,
size(this%mf6_input%param_dfns)
1137 if (this%mf6_input%param_dfns(n)%blockname /= this%blockname) cycle
1138 tagname = this%mf6_input%param_dfns(n)%tagname
1140 if (trim(tagname) /= trim(rec_token)) cycle
1142 idt => this%mf6_input%param_dfns(n)
1145 nitems0 = nkeystring_items
1149 do k = nitems0 + 1, nkeystring_items
1152 if (k == nitems0 + 1)
then
1153 head_nbody(k) = nkeystring_items - nitems0 - 1
1154 item_is_body(k) = .false.
1157 item_is_body(k) = .true.
1162 nkeystring_items = nkeystring_items + 1
1166 item_names(nkeystring_items) = &
1167 trim(this%mf6_input%param_dfns(n)%tagname)
1168 head_nbody(nkeystring_items) = 0
1169 item_is_body(nkeystring_items) = .false.
1175 if (
allocated(ks_cols))
deallocate (ks_cols)
1185 character(len=*),
intent(in) :: input_name
1187 character(len=LINELENGTH) :: dev_msg
1190 do n = 1,
size(this%params)
1192 this%mf6_input%component_type, &
1193 this%mf6_input%subcomponent_type, &
1194 this%blockname, this%params(n),
'')
1195 if (idt%developmode)
then
1196 dev_msg =
'Input tag "'//trim(idt%tagname)// &
1197 &
'" read from file "'//trim(input_name)// &
1198 &
'" is still under development. Install the &
1199 &nightly build or compile from source with IDEVELOPMODE = 1.'
1209 character(len=*),
intent(in) :: mf6varname
1210 character(len=LENVARNAME) :: varname
1211 integer(I4B) :: ilen
1212 character(len=2) :: prefix =
'IN'
1213 ilen = len_trim(mf6varname)
1215 varname = prefix//mf6varname(1:(
lenvarname - len(prefix)))
1217 varname = prefix//trim(mf6varname)
1225 integer(I4B),
intent(in) :: nrow
1226 character(len=*),
intent(in) :: varname
1227 character(len=*),
intent(in) :: mempath
1228 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
1240 integer(I4B),
intent(in) :: nrow
1241 character(len=*),
intent(in) :: varname
1242 character(len=*),
intent(in) :: mempath
1243 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
1255 integer(I4B),
intent(in) :: ncol
1256 integer(I4B),
intent(in) :: nrow
1257 character(len=*),
intent(in) :: varname
1258 character(len=*),
intent(in) :: mempath
1259 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
1260 integer(I4B) :: n, m
1274 integer(I4B),
pointer,
intent(inout) :: intptr
1275 character(len=*),
intent(in) :: varname
1276 character(len=*),
intent(in) :: mempath
1277 logical(LGP) :: found
1280 call mem_set_value(intptr, varname, mempath, found, release=.false.)
1288 integer(I4B),
pointer,
intent(inout) :: intptr
1289 character(len=*),
intent(in) :: varname
1290 character(len=*),
intent(in) :: mempath
1291 integer(I4B) :: isize
1293 if (isize > -1)
then
1306 contiguous,
intent(inout) :: charstr1d
1307 character(len=*),
intent(in) :: varname
1308 character(len=*),
intent(in) :: mempath
1309 integer(I4B),
intent(in) :: strlen
1310 integer(I4B) :: isize
1312 if (isize > -1)
then
1315 call mem_allocate(charstr1d, strlen, 0, varname, mempath)
1324 real(DP),
dimension(:, :),
pointer, &
1325 contiguous,
intent(inout) :: auxvar
1326 character(len=*),
intent(in) :: mempath
1327 integer(I4B) :: isize
1328 call get_isize(
'AUXVAR', mempath, isize)
1329 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.