56 integer(I4B),
pointer :: invar
75 integer(I4B) :: sa_icol = 0
76 logical(LGP) :: is_body = .false.
77 integer(I4B) :: head_nbody = 0
78 character(len=LENVARNAME) :: head_setting_varname =
''
79 logical(LGP) :: idm_managed = .false.
82 integer(I4B) :: nfeatures = 0
91 integer(I4B),
pointer :: naux => null()
92 integer(I4B),
pointer :: maxbound => null()
93 integer(I4B),
pointer :: boundnames => null()
94 integer(I4B),
pointer :: iprpak => null()
95 integer(I4B),
pointer :: nbound => null()
96 integer(I4B),
pointer :: ncpl => null()
97 integer(I4B),
pointer :: nodes => null()
98 integer(I4B),
dimension(:),
pointer,
contiguous :: mshape => null()
100 contiguous :: auxname_cst => null()
102 contiguous :: boundname_cst => null()
103 real(dp),
dimension(:, :),
pointer, &
104 contiguous :: auxvar => null()
106 integer(I4B) :: loadtype
107 logical(LGP) :: set_scalars = .false.
108 logical(LGP) :: set_mshape = .false.
109 logical(LGP) :: is_exchange = .false.
112 character(len=LENVARNAME) :: blockname
113 character(len=LENVARNAME) :: named_bound
114 integer(I4B) :: nleading = 0
115 character(len=LINELENGTH),
dimension(:),
allocatable :: params
118 logical(LGP) :: keystring_by_feature = .false.
119 logical(LGP) :: keystring_by_node = .false.
120 logical(LGP) :: has_setting_dispatch = .false.
122 integer(I4B) :: nkeystring_items = 0
124 character(len=LENVARNAME) :: feature_id_varname =
''
157 subroutine init(this, mf6_input, blockname, named_bound)
161 character(len=*),
optional,
intent(in) :: blockname
162 character(len=*),
optional,
intent(in) :: named_bound
164 this%mf6_input = mf6_input
166 if (
present(blockname))
then
167 this%blockname = blockname
168 call upcase(this%blockname)
170 this%blockname =
'PERIOD'
173 if (
present(named_bound))
then
174 this%named_bound = named_bound
175 call upcase(this%named_bound)
177 this%named_bound =
'MAXBOUND'
180 call this%resolve_context()
181 call this%resolve_loadtype()
182 call this%set_params()
183 call this%resolve_dimensions()
185 if (this%loadtype ==
keystring)
call this%build_keystring_items()
193 this%set_scalars = .false.
194 this%set_mshape = .false.
195 this%is_exchange = .false.
197 select case (this%mf6_input%load_scope)
202 if (this%mf6_input%component_type ==
'EXG')
then
203 this%set_scalars = .true.
204 this%is_exchange = .true.
207 this%set_scalars = .true.
209 if (this%mf6_input%subcomponent_type /=
'OC' .and. &
210 this%mf6_input%subcomponent_type /=
'STO')
then
211 this%set_mshape = .true.
214 errmsg =
'LoadContext unrecognized load_scope for mempath: '// &
215 trim(this%mf6_input%mempath)
227 character(len=LINELENGTH),
dimension(:),
allocatable :: cols
228 integer(I4B) :: n, nparam
233 do n = 1,
size(this%mf6_input%block_dfns)
234 if (this%mf6_input%block_dfns(n)%blockname == this%blockname)
then
235 if (this%mf6_input%block_dfns(n)%aggregate)
then
236 if (this%blockname ==
'PERIOD' .and. &
253 this%mf6_input%component_type, &
254 this%mf6_input%subcomponent_type, &
258 this%keystring_by_feature = .true.
259 else if (cols(1) ==
'CELLID')
then
260 this%keystring_by_node = .true.
262 if (
allocated(cols))
deallocate (cols)
263 this%has_setting_dispatch = &
264 this%keystring_by_feature .or. this%keystring_by_node
265 if (this%has_setting_dispatch)
then
266 this%setting_idt => &
268 this%mf6_input%subcomponent_type, &
269 this%blockname,
'SETTING',
'SETTING',
'STRING')
275 do n = 1,
size(this%mf6_input%param_dfns)
276 idt => this%mf6_input%param_dfns(n)
277 if (idt%blockname ==
'OPTIONS')
then
278 select case (idt%tagname)
279 case (
'READASARRAYS')
281 case (
'READARRAYGRID')
297 if (this%set_scalars)
then
299 call setptr(this%nbound,
'NBOUND', this%mf6_input%mempath)
300 call setval(this%naux,
'NAUX', this%mf6_input%mempath)
301 call setval(this%ncpl,
'NCPL', this%mf6_input%mempath)
302 call setval(this%nodes,
'NODES', this%mf6_input%mempath)
303 call setval(this%boundnames,
'BOUNDNAMES', this%mf6_input%mempath)
304 call setval(this%iprpak,
'IPRPAK', this%mf6_input%mempath)
305 call setval(this%maxbound, this%named_bound, this%mf6_input%mempath)
311 if (this%set_mshape .and. &
312 this%blockname ==
'PERIOD')
then
314 this%mf6_input%component_mempath)
316 if (this%ncpl == 0)
then
317 if (
size(this%mshape) == 2)
then
318 this%ncpl = this%mshape(2)
319 else if (
size(this%mshape) == 3)
then
320 this%ncpl = this%mshape(2) * this%mshape(3)
324 if (this%nodes == 0) this%nodes = product(this%mshape)
325 if (this%loadtype ==
keystring)
call this%scale_keystring_maxbound()
335 integer(I4B) :: nkeystring_items
337 nkeystring_items = this%nkeystring_items
339 if (nkeystring_items > 0)
then
340 if (this%maxbound == 0)
then
341 if (.not. this%keystring_by_feature)
then
342 this%maxbound = this%nodes * nkeystring_items
346 this%maxbound = this%maxbound * nkeystring_items
360 integer(I4B),
dimension(:, :),
pointer,
contiguous :: cellid
361 integer(I4B),
dimension(:),
pointer,
contiguous :: nodeulist
363 if (this%set_mshape .and. &
364 this%blockname ==
'PERIOD')
then
368 call mem_allocate(cellid, 0, 0,
'CELLID', this%mf6_input%mempath)
375 call mem_allocate(nodeulist, 0,
'NODEULIST', this%mf6_input%mempath)
381 call setptr(this%auxname_cst,
'AUXILIARY', &
383 call setptr(this%boundname_cst,
'BOUNDNAME', &
385 call setptr(this%auxvar, this%mf6_input%mempath)
388 else if (this%is_exchange)
then
390 call setptr(this%auxname_cst,
'AUXILIARY', &
392 call setptr(this%boundname_cst,
'BOUNDNAME', &
394 call setptr(this%auxvar, this%mf6_input%mempath)
407 integer(I4B) :: dimsize
414 select case (idt%shape)
415 case (
'NCPL',
'NAUX NCPL')
417 case (
'NODES',
'NAUX NODES')
418 dimsize = this%maxbound
423 select case (idt%datatype)
428 this%mf6_input%mempath)
431 if (idt%shape ==
'NAUX')
then
433 idt%mf6varname, this%mf6_input%mempath)
437 this%mf6_input%mempath)
443 this%mf6_input%mempath)
458 type(inputparamdefinitiontype),
pointer :: idt
460 do n = 1,
size(this%params)
462 this%mf6_input%component_type, &
463 this%mf6_input%subcomponent_type, &
464 this%blockname, this%params(n),
'')
465 call this%allocate_param(idt)
477 character(len=*),
intent(in) :: tagname
479 type(inputparamdefinitiontype),
pointer :: idt
480 character(len=LINELENGTH) :: datatype
483 this%mf6_input%component_type, &
484 this%mf6_input%subcomponent_type, &
485 this%blockname, tagname,
'')
487 if (idt%required)
then
496 if (datatype ==
'KEYSTRING' .or. &
497 datatype ==
'RECARRAY' .or. &
498 datatype ==
'RECORD')
return
501 if (this%is_advanced)
then
507 if (tagname ==
'AUXVAR' .or. tagname ==
'AUX')
then
508 in_scope = this%option_check(
'NAUX', 0)
512 if (tagname ==
'BOUNDNAME')
then
513 in_scope = this%option_check(
'BOUNDNAMES', 0)
518 if (tagname ==
'I'//trim(this%mf6_input%subcomponent_type(1:3)))
then
524 select case (this%mf6_input%subcomponent_type)
526 if (tagname ==
'PXDP' .or. tagname ==
'PETM')
then
527 in_scope = this%option_check(
'NSEG', 1)
528 else if (tagname ==
'PETM0')
then
529 in_scope = this%option_check(
'SURFRATESPEC', 0)
531 case (
'MVR',
'MVT',
'MVE')
532 if (tagname ==
'MNAME' .or. &
533 tagname ==
'MNAME1' .or. &
534 tagname ==
'MNAME2')
then
535 in_scope = this%option_check(
'MODELNAMES', 0)
540 if (tagname ==
'MIXED')
in_scope = .true.
545 if (tagname ==
'MANFRACTION')
in_scope = this%option_check(
'NCOL', 2)
548 if (tagname ==
'BAREA')
in_scope = this%option_check(
'NCOL', 3)
552 errmsg =
'LoadContext in_scope needs new case for: '// &
553 trim(this%mf6_input%subcomponent_type)//
'/'//trim(tagname)
565 character(len=*),
intent(in) :: tagname
566 character(len=LENVARNAME),
intent(out) :: dimname
567 character(len=LENVARNAME),
intent(out) :: subindex_tagname
568 logical(LGP) :: found
572 subindex_tagname =
''
573 select case (this%mf6_input%subcomponent_type)
575 if (tagname ==
'DIVFLOW')
then
577 subindex_tagname =
'IDV'
588 character(len=*),
intent(in) :: varname
589 integer(I4B),
intent(in) :: threshold
591 integer(I4B) :: isize
592 integer(I4B),
pointer :: intptr
594 call get_isize(varname, this%mf6_input%mempath, isize)
596 call mem_setptr(intptr, varname, this%mf6_input%mempath)
607 type(inputparamdefinitiontype),
pointer :: idt
608 integer(I4B) :: icol, k, padj, nfeatures, nkeystring_items
609 character(len=LENVARNAME) :: dimname, subindex_tagname
610 logical(LGP) :: found, node
611 character(len=LINELENGTH),
allocatable :: item_names(:)
612 integer(I4B),
allocatable :: head_nbody(:)
613 logical(LGP),
allocatable :: item_is_body(:)
614 character(len=LENVARNAME) :: cur_head
616 if (.not. this%has_setting_dispatch)
return
619 call this%keystring_item_names(item_names, head_nbody, item_is_body, &
621 if (nkeystring_items < 1)
return
625 if (this%keystring_by_feature)
then
627 this%mf6_input%component_type, &
628 this%mf6_input%subcomponent_type, &
629 this%blockname, this%params(1),
'')
630 this%feature_id_varname = trim(idt%mf6varname)
634 node = this%keystring_by_node
636 allocate (this%keystring_items(nkeystring_items))
637 nfeatures = this%resolve_nfeatures()
640 do icol = this%nleading + 1,
size(this%params)
641 k = icol - this%nleading
643 this%mf6_input%component_type, &
644 this%mf6_input%subcomponent_type, &
645 this%blockname, this%params(icol),
'')
646 this%keystring_items(k)%idt => idt
647 this%keystring_items(k)%sa_icol = icol + padj
648 this%keystring_items(k)%is_body = item_is_body(k)
649 this%keystring_items(k)%head_nbody = head_nbody(k)
654 if (.not. this%keystring_items(k)%is_body)
then
655 if (this%keystring_items(k)%head_nbody > 0)
then
656 cur_head = trim(idt%mf6varname)
661 this%keystring_items(k)%head_setting_varname = trim(cur_head)
666 this%keystring_items(k)%idm_managed = &
667 (idt%datatype ==
'DOUBLE' .and. idt%timeseries .and. &
668 .not. this%keystring_items(k)%is_body)
670 if (this%keystring_items(k)%idm_managed)
then
672 this%keystring_items(k)%addr_mode =
addr_node
673 this%keystring_items(k)%init_value =
dnodata
674 if (
associated(this%nodes)) &
675 this%keystring_items(k)%nfeatures = this%nodes
678 this%keystring_items(k)%init_value =
dzero
679 this%keystring_items(k)%nfeatures = &
680 this%resolve_item_nfeatures(idt%tagname, idt%shape, nfeatures)
686 if (this%is_advanced .and. this%keystring_items(k)%is_body)
then
687 found = this%subindex_dependency(idt%tagname, dimname, &
691 this%keystring_items(k)%idm_managed = .true.
707 integer(I4B) :: nfeatures
708 integer(I4B) :: isize, nkeystring_items, nrow, ndim
709 integer(I4B),
pointer :: dimval
710 logical(LGP) :: have_dim, have_nrow
711 character(len=LINELENGTH) ::
errmsg
719 call mem_set_value(dimval, this%named_bound, this%mf6_input%mempath, &
720 have_dim, release=.false.)
721 if (have_dim) ndim = dimval
724 call get_isize(
'PACKAGEDATA_IFNO', this%mf6_input%mempath, isize)
725 have_nrow = (isize > 0)
728 if (have_dim .and. have_nrow .and. ndim /= nrow)
then
729 write (
errmsg,
'(a,1x,a,1x,i0,1x,a,1x,i0,a)') &
730 'IDM dimension mismatch:', trim(this%named_bound), ndim, &
731 'does not match the PACKAGEDATA row count', nrow,
'.'
738 else if (have_nrow)
then
746 nkeystring_items = this%nkeystring_items
747 if (nkeystring_items > 0 .and.
associated(this%maxbound))
then
748 if (this%maxbound > 0) nfeatures = this%maxbound / nkeystring_items
756 default_nfeatures)
result(nfeatures)
760 character(len=*),
intent(in) :: item_tagname
761 character(len=*),
intent(in) :: dimname
762 integer(I4B),
intent(in) :: default_nfeatures
763 integer(I4B) :: nfeatures
764 integer(I4B),
pointer :: shape_val => null()
765 integer(I4B),
dimension(:),
pointer,
contiguous :: shape_arr => null()
766 integer(I4B) :: isize
767 character(len=LINELENGTH) ::
errmsg
769 nfeatures = default_nfeatures
770 if (dimname ==
'')
return
771 call get_isize(trim(dimname), this%mf6_input%mempath, isize)
775 else if (isize == 0)
then
776 write (
errmsg,
'(a,1x,a,1x,a)') &
777 'item', trim(item_tagname)//
': DIMENSION', &
778 trim(dimname)//
' is not defined.'
782 else if (.not. this%shape_param_is_array(trim(dimname)))
then
783 call mem_setptr(shape_val, trim(dimname), this%mf6_input%mempath)
784 nfeatures = shape_val
786 call mem_setptr(shape_arr, trim(dimname), this%mf6_input%mempath)
787 nfeatures = sum(shape_arr)
796 character(len=*),
intent(in) :: shape_varname
797 logical(LGP) :: is_array
801 do i = 1,
size(this%mf6_input%param_dfns)
802 if (this%mf6_input%param_dfns(i)%component_type == &
803 this%mf6_input%component_type .and. &
804 this%mf6_input%param_dfns(i)%subcomponent_type == &
805 this%mf6_input%subcomponent_type .and. &
806 trim(this%mf6_input%param_dfns(i)%mf6varname) == &
807 trim(shape_varname))
then
809 (trim(this%mf6_input%param_dfns(i)%blockname) ==
'PACKAGEDATA')
823 type(inputparamdefinitiontype),
pointer :: idt, aidt
824 character(len=LINELENGTH),
dimension(:),
allocatable :: param_buf
825 character(len=LINELENGTH),
dimension(:),
allocatable :: cols
826 character(len=LINELENGTH),
allocatable :: item_names(:)
827 integer(I4B),
allocatable :: head_nbody(:)
828 logical(LGP),
allocatable :: item_is_body(:)
829 integer(I4B) :: keepcnt, iparam, nparam, nkeystring_items, n
830 logical(LGP) :: keep, tag_found
835 if (this%loadtype ==
list .or. &
840 this%mf6_input%component_type, &
841 this%mf6_input%subcomponent_type, &
846 nparam =
size(this%mf6_input%param_dfns)
850 do iparam = 1, nparam
851 if (this%loadtype ==
list .or. &
855 this%mf6_input%component_type, &
856 this%mf6_input%subcomponent_type, &
857 this%blockname, cols(iparam),
'', &
861 idt => this%mf6_input%param_dfns(iparam)
864 if (.not. tag_found)
then
866 else if (idt%blockname /= this%blockname)
then
869 keep = this%in_scope(idt%tagname)
873 keepcnt = keepcnt + 1
875 param_buf(keepcnt) = trim(idt%tagname)
880 if (this%loadtype ==
list .or. &
881 this%loadtype ==
keystring) this%nleading = keepcnt
886 call this%keystring_item_names(item_names, head_nbody, &
887 item_is_body, nkeystring_items)
888 this%nkeystring_items = nkeystring_items
889 do n = 1, nkeystring_items
890 keepcnt = keepcnt + 1
892 param_buf(keepcnt) = trim(item_names(n))
900 allocate (this%params(nparam))
901 do iparam = 1, nparam
902 this%params(iparam) = trim(param_buf(iparam))
906 if (
allocated(param_buf))
deallocate (param_buf)
918 character(len=*),
intent(in) :: mf6varname
919 character(len=LENVARNAME) :: varname
920 integer(I4B),
pointer :: intvar
922 call mem_allocate(intvar, varname, this%mf6_input%mempath)
931 if (
associated(this%setting_idt))
then
932 deallocate (this%setting_idt)
933 nullify (this%setting_idt)
936 if (this%set_scalars)
then
938 deallocate (this%naux)
939 deallocate (this%ncpl)
940 deallocate (this%nodes)
941 deallocate (this%maxbound)
942 deallocate (this%boundnames)
943 deallocate (this%iprpak)
948 nullify (this%nbound)
951 nullify (this%maxbound)
952 nullify (this%boundnames)
953 nullify (this%iprpak)
954 nullify (this%auxname_cst)
955 nullify (this%boundname_cst)
956 nullify (this%auxvar)
957 nullify (this%mshape)
966 character(len=LINELENGTH),
intent(in) :: rec_cols(:)
967 integer(I4B),
intent(in) :: nrec_col
968 type(inputparamdefinitiontype),
pointer :: ks_aidt
969 character(len=LINELENGTH) :: token, tagname
970 integer(I4B) :: m, n, ilen
973 token = trim(rec_cols(m))
975 ilen = len_trim(token)
978 if (token(ilen - 6:ilen) /=
'SETTING') cycle
979 do n = 1,
size(mf6_input%aggregate_dfns)
980 tagname = mf6_input%aggregate_dfns(n)%tagname
982 if (trim(tagname) == trim(token))
then
983 ks_aidt => mf6_input%aggregate_dfns(n)
984 if (
idt_datatype(ks_aidt) /=
'KEYSTRING') ks_aidt => null()
999 type(inputparamdefinitiontype),
pointer,
intent(in) :: rec_idt
1000 character(len=LINELENGTH),
allocatable,
intent(inout) :: item_names(:)
1001 integer(I4B),
intent(inout) :: nkeystring_items
1002 type(inputparamdefinitiontype),
pointer :: sub_idt
1003 character(len=LINELENGTH),
allocatable :: sub_cols(:)
1004 character(len=LINELENGTH) :: token, tagname
1005 integer(I4B) :: k, j, nsub_col
1008 token = trim(sub_cols(k))
1010 do j = 1,
size(mf6_input%param_dfns)
1011 sub_idt => mf6_input%param_dfns(j)
1012 if (sub_idt%blockname /=
'PERIOD') cycle
1013 tagname = sub_idt%tagname
1015 if (trim(tagname) /= trim(token)) cycle
1017 nkeystring_items = nkeystring_items + 1
1019 item_names(nkeystring_items) = trim(sub_idt%tagname)
1023 if (
allocated(sub_cols))
deallocate (sub_cols)
1032 logical(LGP) :: res, has_period
1033 type(inputparamdefinitiontype),
pointer :: aidt, ks_aidt
1034 character(len=LINELENGTH),
allocatable :: cols(:)
1035 integer(I4B) :: n, ncol
1037 has_period = .false.
1038 do n = 1,
size(mf6_input%block_dfns)
1039 if (mf6_input%block_dfns(n)%blockname ==
'PERIOD')
then
1043 if (.not. has_period)
return
1045 mf6_input%component_type, &
1046 mf6_input%subcomponent_type, &
1051 if (
associated(ks_aidt)) res = .true.
1053 if (
allocated(cols))
deallocate (cols)
1065 type(inputparamdefinitiontype),
pointer :: aidt
1066 character(len=LINELENGTH),
allocatable :: cols(:)
1067 integer(I4B) :: ncol
1071 mf6_input%component_type, &
1072 mf6_input%subcomponent_type, &
1076 if (
allocated(cols))
deallocate (cols)
1084 character(len=*),
intent(in) :: tagname
1086 select case (tagname)
1087 case (
'IFNO',
'NUMBER',
'BNDNO',
'RNO',
'LAKENO',
'MAWNO',
'UZFNO')
1099 res =
idm_is_advanced(mf6_input%component_type, mf6_input%subcomponent_type)
1107 item_is_body, nkeystring_items)
1113 character(len=LINELENGTH),
allocatable,
intent(out) :: item_names(:)
1114 integer(I4B),
allocatable,
intent(out) :: head_nbody(:)
1115 logical(LGP),
allocatable,
intent(out) :: item_is_body(:)
1116 integer(I4B),
intent(out) :: nkeystring_items
1117 type(inputparamdefinitiontype),
pointer :: aidt, ks_aidt, idt
1118 character(len=LINELENGTH),
allocatable :: rec_cols(:), ks_cols(:)
1119 character(len=LINELENGTH) :: rec_token, tagname
1120 integer(I4B) :: m, n, nrec_col, nks_col, nitems0, k
1122 nkeystring_items = 0
1126 this%mf6_input%component_type, &
1127 this%mf6_input%subcomponent_type, &
1133 if (
allocated(rec_cols))
deallocate (rec_cols)
1134 if (.not.
associated(ks_aidt))
return
1141 rec_token = trim(ks_cols(m))
1145 do n = 1,
size(this%mf6_input%param_dfns)
1146 if (this%mf6_input%param_dfns(n)%blockname /= this%blockname) cycle
1147 tagname = this%mf6_input%param_dfns(n)%tagname
1149 if (trim(tagname) /= trim(rec_token)) cycle
1151 idt => this%mf6_input%param_dfns(n)
1154 nitems0 = nkeystring_items
1158 do k = nitems0 + 1, nkeystring_items
1161 if (k == nitems0 + 1)
then
1162 head_nbody(k) = nkeystring_items - nitems0 - 1
1163 item_is_body(k) = .false.
1166 item_is_body(k) = .true.
1171 nkeystring_items = nkeystring_items + 1
1175 item_names(nkeystring_items) = &
1176 trim(this%mf6_input%param_dfns(n)%tagname)
1177 head_nbody(nkeystring_items) = 0
1178 item_is_body(nkeystring_items) = .false.
1184 if (
allocated(ks_cols))
deallocate (ks_cols)
1194 character(len=*),
intent(in) :: input_name
1195 type(inputparamdefinitiontype),
pointer :: idt
1196 character(len=LINELENGTH) :: dev_msg
1199 do n = 1,
size(this%params)
1201 this%mf6_input%component_type, &
1202 this%mf6_input%subcomponent_type, &
1203 this%blockname, this%params(n),
'')
1204 if (idt%developmode)
then
1205 dev_msg =
'Input tag "'//trim(idt%tagname)// &
1206 &
'" read from file "'//trim(input_name)// &
1207 &
'" is still under development. Install the &
1208 &nightly build or compile from source with IDEVELOPMODE = 1.'
1218 character(len=*),
intent(in) :: mf6varname
1219 character(len=LENVARNAME) :: varname
1220 integer(I4B) :: ilen
1221 character(len=2) :: prefix =
'IN'
1222 ilen = len_trim(mf6varname)
1224 varname = prefix//mf6varname(1:(
lenvarname - len(prefix)))
1226 varname = prefix//trim(mf6varname)
1237 character(len=*),
intent(in) :: blockname
1238 character(len=2) :: id
1239 select case (blockname)
1240 case (
'PACKAGEDATA')
1253 integer(I4B),
intent(in) :: nrow
1254 character(len=*),
intent(in) :: varname
1255 character(len=*),
intent(in) :: mempath
1256 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
1268 integer(I4B),
intent(in) :: nrow
1269 character(len=*),
intent(in) :: varname
1270 character(len=*),
intent(in) :: mempath
1271 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
1283 integer(I4B),
intent(in) :: ncol
1284 integer(I4B),
intent(in) :: nrow
1285 character(len=*),
intent(in) :: varname
1286 character(len=*),
intent(in) :: mempath
1287 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
1288 integer(I4B) :: n, m
1302 integer(I4B),
pointer,
intent(inout) :: intptr
1303 character(len=*),
intent(in) :: varname
1304 character(len=*),
intent(in) :: mempath
1305 logical(LGP) :: found
1308 call mem_set_value(intptr, varname, mempath, found, release=.false.)
1316 integer(I4B),
pointer,
intent(inout) :: intptr
1317 character(len=*),
intent(in) :: varname
1318 character(len=*),
intent(in) :: mempath
1319 integer(I4B) :: isize
1321 if (isize > -1)
then
1334 contiguous,
intent(inout) :: charstr1d
1335 character(len=*),
intent(in) :: varname
1336 character(len=*),
intent(in) :: mempath
1337 integer(I4B),
intent(in) :: strlen
1338 integer(I4B) :: isize
1340 if (isize > -1)
then
1343 call mem_allocate(charstr1d, strlen, 0, varname, mempath)
1352 real(DP),
dimension(:, :),
pointer, &
1353 contiguous,
intent(inout) :: auxvar
1354 character(len=*),
intent(in) :: mempath
1355 integer(I4B) :: isize
1356 call get_isize(
'AUXVAR', mempath, isize)
1357 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)
character(len=2) function, public tslink_id(blockname)
time series link identifier for a static block
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
@ rs_series
time-array series given in the most recent period block
@ rs_netcdf
values read from NetCDF in the most recent period block
@ rs_values
values given in the most recent period block
@ rs_none
not given in the most recent period block
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 init(this, mf6_input, blockname, named_bound)
Initialize the load context.
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)
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.