51 integer(I4B),
pointer :: inic => null()
52 integer(I4B),
pointer :: inoc => null()
53 integer(I4B),
pointer :: innpf => null()
54 integer(I4B),
pointer :: inbuy => null()
55 integer(I4B),
pointer :: invsc => null()
56 integer(I4B),
pointer :: insto => null()
57 integer(I4B),
pointer :: incsub => null()
58 integer(I4B),
pointer :: inmvr => null()
59 integer(I4B),
pointer :: inhfb => null()
60 integer(I4B),
pointer :: ingnc => null()
61 integer(I4B),
pointer :: inobs => null()
62 integer(I4B),
pointer :: iss => null()
63 integer(I4B),
pointer :: inewtonur => null()
108 character(len=LENPACKAGETYPE),
dimension(GWF_NBASEPKG) ::
gwf_basepkg
109 data gwf_basepkg/
'DIS6 ',
'DISV6',
'DISU6',
' ',
' ', &
110 &
'NPF6 ',
'BUY6 ',
'VSC6 ',
'GNC6 ',
' ', &
111 &
'HFB6 ',
'STO6 ',
'IC6 ',
'CSUB6',
' ', &
112 &
'MVR6 ',
'OC6 ',
'OBS6 ',
' ',
' ', &
121 character(len=LENPACKAGETYPE),
dimension(GWF_NMULTIPKG) ::
gwf_multipkg
122 data gwf_multipkg/
'WEL6 ',
'DRN6 ',
'RIV6 ',
'GHB6 ',
' ', &
123 &
'RCH6 ',
'EVT6 ',
'CHD6 ',
' ',
' ', &
124 &
'MAW6 ',
'SFR6 ',
'LAK6 ',
'UZF6 ',
'API6 ', &
138 subroutine gwf_cr(filename, id, modelname)
149 character(len=*),
intent(in) :: filename
150 integer(I4B),
intent(in) :: id
151 character(len=*),
intent(in) :: modelname
155 character(len=LENMEMPATH) :: input_mempath
156 character(len=LINELENGTH) :: lst_fname
166 call this%allocate_scalars(modelname)
171 this%filename = filename
172 this%name = modelname
173 this%macronym =
'GWF'
180 call mem_set_value(lst_fname,
'LIST', input_mempath, found%list)
181 call mem_set_value(this%inewton,
'NEWTON', input_mempath, found%newton)
182 call mem_set_value(this%inewtonur,
'UNDER_RELAXATION', input_mempath, &
183 found%under_relaxation)
184 call mem_set_value(this%iprpak,
'PRINT_INPUT', input_mempath, &
186 call mem_set_value(this%iprflow,
'PRINT_FLOWS', input_mempath, &
188 call mem_set_value(this%ipakcb,
'SAVE_FLOWS', input_mempath, found%save_flows)
191 call this%create_lstfile(lst_fname, filename, found%list, &
192 'GROUNDWATER FLOW MODEL (GWF)')
195 if (found%save_flows)
then
200 if (this%iout > 0)
then
201 call this%log_namfile_options(found)
208 call this%create_packages()
223 class(
bndtype),
pointer :: packobj
226 call this%dis%dis_df()
227 call this%npf%npf_df(this%dis, this%xt3d, this%ingnc, this%invsc)
229 call this%budget%budget_df(
niunit_gwf,
'VOLUME',
'L**3')
230 if (this%inbuy > 0)
call this%buy%buy_df(this%dis)
231 if (this%invsc > 0)
call this%vsc%vsc_df(this%dis)
232 if (this%ingnc > 0)
call this%gnc%gnc_df(this)
236 this%neq = this%dis%nodes
237 this%nja = this%dis%nja
238 this%ia => this%dis%con%ia
239 this%ja => this%dis%con%ja
242 call this%allocate_arrays()
245 do ip = 1, this%bndlist%Count()
247 call packobj%bnd_df(this%neq, this%dis)
251 call this%obs%obs_df(this%iout, this%name,
'GWF', this%dis)
263 class(
bndtype),
pointer :: packobj
267 call this%dis%dis_ac(this%moffset, sparse)
270 if (this%innpf > 0)
call this%npf%npf_ac(this%moffset, sparse)
273 do ip = 1, this%bndlist%Count()
275 call packobj%bnd_ac(this%moffset, sparse)
279 if (this%ingnc > 0)
call this%gnc%gnc_ac(sparse)
290 class(
bndtype),
pointer :: packobj
295 call this%dis%dis_mc(this%moffset, this%idxglo, matrix_sln)
298 if (this%innpf > 0)
call this%npf%npf_mc(this%moffset, matrix_sln)
301 do ip = 1, this%bndlist%Count()
303 call packobj%bnd_mc(this%moffset, matrix_sln)
308 if (this%ingnc > 0)
call this%gnc%gnc_mc(matrix_sln)
322 class(
bndtype),
pointer :: packobj
325 if (this%inic > 0)
call this%ic%ic_ar(this%x)
326 if (this%innpf > 0)
call this%npf%npf_ar(this%ic, this%vsc, this%ibound, &
328 if (this%invsc > 0)
call this%vsc%vsc_ar(this%ibound)
329 if (this%inbuy > 0)
call this%buy%buy_ar(this%npf, this%ibound)
330 if (this%inhfb > 0)
call this%hfb%hfb_ar(this%ibound, this%xt3d, this%dis, &
331 this%invsc, this%vsc)
332 if (this%insto > 0)
call this%sto%sto_ar(this%dis, this%ibound)
333 if (this%incsub > 0)
call this%csub%csub_ar(this%dis, this%ibound)
334 if (this%inmvr > 0)
call this%mvr%mvr_ar()
335 if (this%inobs > 0)
call this%obs%gwf_obs_ar(this%ic, this%x, this%flowja)
338 call this%dis%dis_ar(this%npf%icelltype)
341 call this%oc%oc_ar(this%x, this%dis, this%npf%hnoflo)
342 call this%budget%set_ibudcsv(this%oc%ibudcsv)
345 do ip = 1, this%bndlist%Count()
347 call packobj%set_pointers(this%dis%nodes, this%ibound, this%x, &
348 this%xold, this%flowja)
350 call packobj%bnd_ar()
351 if (this%inbuy > 0)
call this%buy%buy_ar_bnd(packobj, this%x)
352 if (this%invsc > 0)
call this%vsc%vsc_ar_bnd(packobj)
367 class(
bndtype),
pointer :: packobj
374 if (this%innpf > 0)
call this%npf%npf_rp()
375 if (this%inbuy > 0)
call this%buy%buy_rp()
376 if (this%invsc > 0)
call this%vsc%vsc_rp()
377 if (this%inhfb > 0)
call this%hfb%hfb_rp()
378 if (this%inoc > 0)
call this%oc%oc_rp()
379 if (this%insto > 0)
call this%sto%sto_rp()
380 if (this%incsub > 0)
call this%csub%csub_rp()
381 if (this%inmvr > 0)
call this%mvr%mvr_rp()
382 do ip = 1, this%bndlist%Count()
384 call packobj%bnd_rp()
385 call packobj%bnd_rp_log()
386 call packobj%bnd_rp_obs()
390 call this%steady_period_check()
403 class(
bndtype),
pointer :: packobj
405 integer(I4B) :: irestore
406 integer(I4B) :: ip, n
411 if (irestore == 0)
then
414 do n = 1, this%dis%nodes
415 this%xold(n) = this%x(n)
420 do n = 1, this%dis%nodes
421 this%x(n) = this%xold(n)
426 if (this%invsc > 0)
call this%vsc%vsc_ad()
427 if (this%innpf > 0)
call this%npf%npf_ad(this%dis%nodes, this%xold, &
429 if (this%insto > 0)
call this%sto%sto_ad()
430 if (this%incsub > 0)
call this%csub%csub_ad(this%dis%nodes, this%x)
431 if (this%inbuy > 0)
call this%buy%buy_ad()
432 if (this%inmvr > 0)
call this%mvr%mvr_ad()
433 do ip = 1, this%bndlist%Count()
435 call packobj%bnd_ad()
436 if (this%invsc > 0)
call this%vsc%vsc_ad_bnd(packobj, this%x)
438 call packobj%bnd_ck()
443 call this%obs%obs_ad()
451 integer(I4B),
intent(in) :: kiter
453 class(
bndtype),
pointer :: packobj
457 if (this%innpf > 0)
call this%npf%npf_cf(kiter, this%dis%nodes, this%x)
458 if (this%inbuy > 0)
call this%buy%buy_cf(kiter)
459 do ip = 1, this%bndlist%Count()
461 call packobj%bnd_cf()
462 if (this%inbuy > 0)
call this%buy%buy_cf_bnd(packobj, this%x)
468 subroutine gwf_fc(this, kiter, matrix_sln, inwtflag)
471 integer(I4B),
intent(in) :: kiter
473 integer(I4B),
intent(in) :: inwtflag
475 class(
bndtype),
pointer :: packobj
477 integer(I4B) :: inwt, inwtsto, inwtcsub, inwtpak
481 if (inwtflag == 1) inwt = this%npf%inewton
483 if (this%insto > 0)
then
484 if (inwtflag == 1) inwtsto = this%sto%inewton
487 if (this%incsub > 0)
then
488 if (inwtflag == 1) inwtcsub = this%csub%inewton
492 if (this%innpf > 0)
call this%npf%npf_fc(kiter, matrix_sln, this%idxglo, &
494 if (this%inbuy > 0)
call this%buy%buy_fc(kiter, matrix_sln, this%idxglo, &
496 if (this%inhfb > 0)
call this%hfb%hfb_fc(kiter, matrix_sln, this%idxglo, &
498 if (this%ingnc > 0)
call this%gnc%gnc_fc(kiter, matrix_sln)
500 if (this%insto > 0)
then
501 call this%sto%sto_fc(kiter, this%xold, this%x, matrix_sln, &
502 this%idxglo, this%rhs)
505 if (this%incsub > 0)
then
506 call this%csub%csub_fc(kiter, this%xold, this%x, matrix_sln, &
507 this%idxglo, this%rhs)
509 if (this%inmvr > 0)
call this%mvr%mvr_fc()
510 do ip = 1, this%bndlist%Count()
512 call packobj%bnd_fc(this%rhs, this%ia, this%idxglo, matrix_sln)
516 if (this%innpf > 0)
then
518 call this%npf%npf_fn(kiter, matrix_sln, this%idxglo, this%rhs, this%x)
523 if (this%ingnc > 0)
then
525 call this%gnc%gnc_fn(kiter, matrix_sln, this%npf%condsat, &
526 ivarcv_opt=this%npf%ivarcv, &
527 ictm1_opt=this%npf%icelltype, &
528 ictm2_opt=this%npf%icelltype)
533 if (this%insto > 0)
then
534 if (inwtsto /= 0)
then
535 call this%sto%sto_fn(kiter, this%xold, this%x, matrix_sln, &
536 this%idxglo, this%rhs)
541 if (this%incsub > 0)
then
542 if (inwtcsub /= 0)
then
543 call this%csub%csub_fn(kiter, this%xold, this%x, matrix_sln, &
544 this%idxglo, this%rhs)
549 do ip = 1, this%bndlist%Count()
552 if (inwtflag == 1) inwtpak = packobj%inewton
553 if (inwtpak /= 0)
then
554 call packobj%bnd_fn(this%rhs, this%ia, this%idxglo, matrix_sln)
564 subroutine gwf_cc(this, innertot, kiter, iend, icnvgmod, cpak, ipak, dpak)
567 integer(I4B),
intent(in) :: innertot
568 integer(I4B),
intent(in) :: kiter
569 integer(I4B),
intent(in) :: iend
570 integer(I4B),
intent(in) :: icnvgmod
571 character(len=LENPAKLOC),
intent(inout) :: cpak
572 integer(I4B),
intent(inout) :: ipak
573 real(DP),
intent(inout) :: dpak
575 class(
bndtype),
pointer :: packobj
580 if (this%inmvr > 0)
then
581 call this%mvr%mvr_cc(innertot, kiter, iend, icnvgmod, cpak, ipak, dpak)
585 if (this%incsub > 0)
then
586 call this%csub%csub_cc(innertot, kiter, iend, icnvgmod, &
587 this%dis%nodes, this%x, this%xold, &
592 do ip = 1, this%bndlist%Count()
594 call packobj%bnd_cc(innertot, kiter, iend, icnvgmod, cpak, ipak, dpak)
606 integer(I4B),
intent(inout) :: iptc
612 if (this%iss > 0)
then
613 if (this%inewton > 0)
then
616 iptc = this%npf%inewton
627 subroutine gwf_ptc(this, vec_residual, iptc, ptcf)
634 integer(I4B),
intent(inout) :: iptc
635 real(DP),
intent(inout) :: ptcf
638 integer(I4B) :: iptct
641 real(DP) :: ptcdelem1
648 if (this%iss > 0)
then
649 if (this%inewton > 0)
then
652 iptct = this%npf%inewton
660 do n = 1, this%dis%nodes
661 if (this%npf%ibound(n) < 1) cycle
664 v = this%dis%get_cell_volume(n, this%dis%top(n))
667 resid = vec_residual%get_value_local(n)
671 ptcdelem1 = abs(resid) / v
676 if (ptcdelem1 > ptcf) ptcf = ptcdelem1
680 if (ptcf == dzero)
then
687 if (iptct > 0) iptc = 1
698 subroutine gwf_nur(this, neqmod, x, xtemp, dx, inewtonur, dxmax, locmax)
703 integer(I4B),
intent(in) :: neqmod
704 real(DP),
dimension(neqmod),
intent(inout) :: x
705 real(DP),
dimension(neqmod),
intent(in) :: xtemp
706 real(DP),
dimension(neqmod),
intent(inout) :: dx
707 integer(I4B),
intent(inout) :: inewtonur
708 real(DP),
intent(inout) :: dxmax
709 integer(I4B),
intent(inout) :: locmax
713 class(
bndtype),
pointer :: packobj
719 if (this%inewton /= 0 .and. this%inewtonur /= 0)
then
720 if (this%innpf > 0)
then
721 call this%npf%npf_nur(neqmod, x, xtemp, dx, inewtonur, dxmax, locmax)
725 i0 = this%dis%nodes + 1
726 do ip = 1, this%bndlist%Count()
728 if (packobj%npakeq > 0)
then
729 i1 = i0 + packobj%npakeq - 1
730 call packobj%bnd_nur(packobj%npakeq, x(i0:i1), xtemp(i0:i1), &
731 dx(i0:i1), inewtonur, dxmax, locmax)
743 subroutine gwf_cq(this, icnvg, isuppress_output)
747 integer(I4B),
intent(in) :: icnvg
748 integer(I4B),
intent(in) :: isuppress_output
752 class(
bndtype),
pointer :: packobj
760 this%flowja(i) =
dzero
762 if (this%innpf > 0)
call this%npf%npf_cq(this%x, this%flowja)
763 if (this%inbuy > 0)
call this%buy%buy_cq(this%x, this%flowja)
764 if (this%inhfb > 0)
call this%hfb%hfb_cq(this%x, this%flowja)
765 if (this%ingnc > 0)
call this%gnc%gnc_cq(this%flowja)
766 if (this%insto > 0)
call this%sto%sto_cq(this%flowja, this%x, this%xold)
767 if (this%incsub > 0)
call this%csub%csub_cq(this%dis%nodes, this%x, &
768 this%xold, isuppress_output, &
774 do ip = 1, this%bndlist%Count()
776 call packobj%bnd_cf()
777 if (this%inbuy > 0)
call this%buy%buy_cf_bnd(packobj, this%x)
778 call packobj%bnd_cq(this%x, this%flowja)
787 subroutine gwf_bd(this, icnvg, isuppress_output)
792 integer(I4B),
intent(in) :: icnvg
793 integer(I4B),
intent(in) :: isuppress_output
796 class(
bndtype),
pointer :: packobj
810 call this%budget%reset()
811 if (this%insto > 0)
call this%sto%sto_bd(isuppress_output, this%budget)
812 if (this%incsub > 0)
call this%csub%csub_bd(isuppress_output, this%budget)
813 if (this%inmvr > 0)
call this%mvr%mvr_bd()
814 do ip = 1, this%bndlist%Count()
816 call packobj%bnd_bd(this%budget)
821 if (this%innpf > 0)
then
822 if (this%npf%icalcspdis /= 0)
then
823 call this%npf%calc_spdis(this%flowja)
836 integer(I4B) :: idvsave
837 integer(I4B) :: idvprint
838 integer(I4B) :: icbcfl
839 integer(I4B) :: icbcun
840 integer(I4B) :: ibudfl
841 integer(I4B) :: ipflag
843 character(len=*),
parameter :: fmtnocnvg = &
844 "(1X,/9X,'****FAILED TO MEET SOLVER CONVERGENCE CRITERIA IN TIME STEP ', &
845 &I0,' OF STRESS PERIOD ',I0,'****')"
852 if (this%oc%oc_save(
'HEAD')) idvsave = 1
853 if (this%oc%oc_print(
'HEAD')) idvprint = 1
854 if (this%oc%oc_save(
'BUDGET')) icbcfl = 1
855 if (this%oc%oc_print(
'BUDGET')) ibudfl = 1
856 icbcun = this%oc%oc_save_unit(
'BUDGET')
860 ibudfl = this%oc%set_print_flag(
'BUDGET', this%icnvg,
endofperiod)
861 idvprint = this%oc%set_print_flag(
'HEAD', this%icnvg,
endofperiod)
864 call this%gwf_ot_obs()
867 call this%gwf_ot_flow(icbcfl, ibudfl, icbcun)
870 call this%gwf_ot_dv(idvsave, idvprint, ipflag)
873 call this%gwf_ot_bdsummary(ibudfl, ipflag)
877 if (ipflag == 1)
call tdis_ot(this%iout)
880 if (this%icnvg == 0)
then
881 write (this%iout, fmtnocnvg)
kstp,
kper
889 class(
bndtype),
pointer :: packobj
893 call this%obs%obs_bd()
894 call this%obs%obs_ot()
897 if (this%incsub > 0)
then
898 call this%csub%csub_bd_obs()
899 call this%csub%obs%obs_ot()
903 do ip = 1, this%bndlist%Count()
905 call packobj%bnd_bd_obs()
906 call packobj%bnd_ot_obs()
915 integer(I4B),
intent(in) :: icbcfl
916 integer(I4B),
intent(in) :: ibudfl
917 integer(I4B),
intent(in) :: icbcun
918 class(
bndtype),
pointer :: packobj
922 if (this%insto > 0)
then
923 call this%sto%sto_save_model_flows(icbcfl, icbcun)
925 if (this%innpf > 0)
then
926 call this%npf%npf_save_model_flows(this%flowja, icbcfl, icbcun)
928 if (this%incsub > 0)
call this%csub%csub_save_model_flows(icbcfl, icbcun)
929 do ip = 1, this%bndlist%Count()
931 call packobj%bnd_ot_model_flows(icbcfl=icbcfl, ibudfl=0, icbcun=icbcun)
935 do ip = 1, this%bndlist%Count()
937 call packobj%bnd_ot_package_flows(icbcfl=icbcfl, ibudfl=0)
939 if (this%inmvr > 0)
then
940 call this%mvr%mvr_ot_saveflow(icbcfl, ibudfl)
944 if (this%innpf > 0)
call this%npf%npf_print_model_flows(ibudfl, this%flowja)
945 if (this%ingnc > 0)
call this%gnc%gnc_ot(ibudfl)
946 do ip = 1, this%bndlist%Count()
948 call packobj%bnd_ot_model_flows(icbcfl=icbcfl, ibudfl=ibudfl, icbcun=0)
952 do ip = 1, this%bndlist%Count()
954 call packobj%bnd_ot_package_flows(icbcfl=0, ibudfl=ibudfl)
956 if (this%inmvr > 0)
then
957 call this%mvr%mvr_ot_printflow(icbcfl, ibudfl)
966 integer(I4B),
intent(in) :: idvsave
967 integer(I4B),
intent(in) :: idvprint
968 integer(I4B),
intent(inout) :: ipflag
969 class(
bndtype),
pointer :: packobj
973 if (this%incsub > 0)
call this%csub%csub_ot_dv(idvsave, idvprint)
976 if (this%inbuy > 0)
then
977 call this%buy%buy_ot_dv(idvsave)
981 if (this%invsc > 0)
then
982 call this%vsc%vsc_ot_dv(idvsave)
986 do ip = 1, this%bndlist%Count()
988 call packobj%bnd_ot_dv(idvsave, idvprint)
992 call this%oc%oc_ot(ipflag)
1000 integer(I4B),
intent(in) :: ibudfl
1001 integer(I4B),
intent(inout) :: ipflag
1002 class(
bndtype),
pointer :: packobj
1006 do ip = 1, this%bndlist%Count()
1008 call packobj%bnd_ot_bdsummary(
kstp,
kper, this%iout, ibudfl)
1012 if (this%inmvr > 0)
then
1013 call this%mvr%mvr_ot_bdsummary(ibudfl)
1017 call this%budget%finalize_step(
delt)
1018 if (ibudfl /= 0)
then
1020 call this%budget%budget_ot(
kstp,
kper, this%iout)
1024 call this%budget%writecsv(
totim)
1035 class(
bndtype),
pointer :: packobj => null()
1038 do ip = 1, this%bndlist%Count()
1040 call packobj%bnd_dt()
1050 class(
bndtype),
pointer :: packobj => null()
1053 if (this%incsub > 0)
then
1054 call this%csub%csub_fp()
1058 do ip = 1, this%bndlist%Count()
1060 call packobj%bnd_fp()
1075 class(
bndtype),
pointer :: packobj
1082 call this%dis%dis_da()
1083 call this%ic%ic_da()
1084 call this%npf%npf_da()
1085 call this%xt3d%xt3d_da()
1086 call this%buy%buy_da()
1087 call this%vsc%vsc_da()
1088 call this%gnc%gnc_da()
1089 call this%sto%sto_da()
1090 call this%csub%csub_da()
1091 call this%budget%budget_da()
1092 call this%hfb%hfb_da()
1093 call this%mvr%mvr_da()
1094 call this%oc%oc_da()
1095 call this%obs%obs_da()
1098 deallocate (this%dis)
1099 deallocate (this%ic)
1100 deallocate (this%npf)
1101 deallocate (this%xt3d)
1102 deallocate (this%buy)
1103 deallocate (this%vsc)
1104 deallocate (this%gnc)
1105 deallocate (this%sto)
1106 deallocate (this%csub)
1107 deallocate (this%budget)
1108 deallocate (this%hfb)
1109 deallocate (this%mvr)
1110 deallocate (this%obs)
1111 deallocate (this%oc)
1114 do ip = 1, this%bndlist%Count()
1116 call packobj%bnd_da()
1117 deallocate (packobj)
1136 call this%NumericalModelType%model_da()
1150 real(DP),
dimension(:, :),
intent(in) :: budterm
1151 character(len=LENBUDTXT),
dimension(:),
intent(in) :: budtxt
1152 character(len=*),
intent(in) :: rowlabel
1154 call this%budget%addentry(budterm,
delt, budtxt, rowlabel=rowlabel)
1163 integer(I4B) :: iasym
1165 class(
bndtype),
pointer :: packobj
1171 if (this%innpf > 0)
then
1172 if (this%npf%iasym /= 0) iasym = 1
1173 if (this%npf%ixt3d /= 0) iasym = 1
1177 if (this%ingnc > 0)
then
1178 if (this%gnc%iasym /= 0) iasym = 1
1182 do ip = 1, this%bndlist%Count()
1184 if (packobj%iasym /= 0) iasym = 1
1195 character(len=*),
intent(in) :: modelname
1198 call this%NumericalModelType%allocate_scalars(modelname)
1203 call mem_allocate(this%innpf,
'INNPF', this%memoryPath)
1204 call mem_allocate(this%inbuy,
'INBUY', this%memoryPath)
1205 call mem_allocate(this%invsc,
'INVSC', this%memoryPath)
1206 call mem_allocate(this%insto,
'INSTO', this%memoryPath)
1207 call mem_allocate(this%incsub,
'INCSUB', this%memoryPath)
1208 call mem_allocate(this%inmvr,
'INMVR', this%memoryPath)
1209 call mem_allocate(this%inhfb,
'INHFB', this%memoryPath)
1210 call mem_allocate(this%ingnc,
'INGNC', this%memoryPath)
1211 call mem_allocate(this%inobs,
'INOBS', this%memoryPath)
1213 call mem_allocate(this%inewtonur,
'INEWTONUR', this%memoryPath)
1255 character(len=*),
intent(in) :: filtyp
1256 integer(I4B),
intent(in) :: ipakid
1257 integer(I4B),
intent(in) :: ipaknum
1258 character(len=*),
intent(in) :: pakname
1259 character(len=*),
intent(in) :: mempath
1260 integer(I4B),
intent(in) :: inunit
1261 integer(I4B),
intent(in) :: iout
1263 class(
bndtype),
pointer :: packobj
1264 class(
bndtype),
pointer :: packobj2
1268 select case (filtyp)
1270 call chd_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
1273 call wel_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
1276 call drn_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
1279 call riv_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
1282 call ghb_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
1285 call rch_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
1288 call evt_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
1291 call maw_create(packobj, ipakid, ipaknum, inunit, iout, this%name, pakname)
1293 call sfr_create(packobj, ipakid, ipaknum, inunit, iout, this%name, pakname)
1295 call lak_create(packobj, ipakid, ipaknum, inunit, iout, this%name, pakname)
1297 call uzf_create(packobj, ipakid, ipaknum, inunit, iout, this%name, pakname)
1299 call api_create(packobj, ipakid, ipaknum, inunit, iout, this%name, &
1302 write (
errmsg, *)
'Invalid package type: ', filtyp
1308 do ip = 1, this%bndlist%Count()
1310 if (packobj2%packName == pakname)
then
1311 write (
errmsg,
'(a,a)')
'Cannot create package. Package name '// &
1312 'already exists: ', trim(pakname)
1327 integer(I4B),
intent(in) :: indis
1331 if (this%inic == 0)
then
1333 'Initial Conditions (IC6) package not specified.'
1336 if (indis == 0)
then
1338 'Discretization (DIS6, DISV6, or DISU6) Package not specified.'
1341 if (this%innpf == 0)
then
1343 'Node Property Flow (NPF6) Package not specified.'
1348 write (
errmsg,
'(a)')
'One or more required package(s) not specified.'
1350 call store_error_filename(this%filename)
1358 class(*),
pointer,
intent(inout) :: model
1362 if (.not.
associated(model))
return
1378 integer(I4B),
dimension(:),
allocatable,
intent(inout) :: bndpkgs
1380 pointer,
intent(inout) :: pkgtypes
1382 pointer,
intent(inout) :: pkgnames
1384 pointer,
intent(inout) :: mempaths
1385 integer(I4B),
dimension(:),
contiguous, &
1386 pointer,
intent(inout) :: inunits
1388 integer(I4B) :: ipakid, ipaknum
1389 character(len=LENFTYPE) :: pkgtype, bndptype
1390 character(len=LENPACKAGENAME) :: pkgname
1391 character(len=LENMEMPATH) :: mempath
1392 integer(I4B),
pointer :: inunit
1395 if (
allocated(bndpkgs))
then
1400 do n = 1,
size(bndpkgs)
1402 pkgtype = pkgtypes(bndpkgs(n))
1403 pkgname = pkgnames(bndpkgs(n))
1404 mempath = mempaths(bndpkgs(n))
1405 inunit => inunits(bndpkgs(n))
1407 if (bndptype /= pkgtype)
then
1412 call this%package_create(pkgtype, ipakid, ipaknum, pkgname, mempath, &
1415 ipaknum = ipaknum + 1
1419 deallocate (bndpkgs)
1450 pointer :: pkgtypes => null()
1452 pointer :: pkgnames => null()
1454 pointer :: mempaths => null()
1455 integer(I4B),
dimension(:),
contiguous, &
1456 pointer :: inunits => null()
1457 character(len=LENMEMPATH) :: model_mempath
1458 character(len=LENFTYPE) :: pkgtype
1459 character(len=LENPACKAGENAME) :: pkgname
1460 character(len=LENMEMPATH) :: mempath
1461 integer(I4B),
pointer :: inunit
1462 integer(I4B),
dimension(:),
allocatable :: bndpkgs
1464 integer(I4B) :: indis = 0
1465 character(len=LENMEMPATH) :: mempathbuy =
''
1466 character(len=LENMEMPATH) :: mempathcsub =
''
1467 character(len=LENMEMPATH) :: mempathhfb =
''
1468 character(len=LENMEMPATH) :: mempathic =
''
1469 character(len=LENMEMPATH) :: mempathnpf =
''
1470 character(len=LENMEMPATH) :: mempathoc =
''
1471 character(len=LENMEMPATH) :: mempathsto =
''
1472 character(len=LENMEMPATH) :: mempathvsc =
''
1478 call mem_setptr(pkgtypes,
'PKGTYPES', model_mempath)
1479 call mem_setptr(pkgnames,
'PKGNAMES', model_mempath)
1480 call mem_setptr(mempaths,
'MEMPATHS', model_mempath)
1481 call mem_setptr(inunits,
'INUNITS', model_mempath)
1483 do n = 1,
size(pkgtypes)
1486 pkgtype = pkgtypes(n)
1487 pkgname = pkgnames(n)
1488 mempath = mempaths(n)
1489 inunit => inunits(n)
1492 select case (pkgtype)
1495 call dis_cr(this%dis, this%name, mempath, indis, this%iout)
1498 call disv_cr(this%dis, this%name, mempath, indis, this%iout)
1501 call disu_cr(this%dis, this%name, mempath, indis, this%iout)
1504 mempathnpf = mempath
1507 mempathbuy = mempath
1510 mempathvsc = mempath
1515 mempathhfb = mempath
1518 mempathsto = mempath
1521 mempathcsub = mempath
1532 case (
'WEL6',
'DRN6',
'RIV6',
'GHB6',
'RCH6', &
1533 'EVT6',
'API6',
'CHD6',
'MAW6',
'SFR6', &
1536 bndpkgs(
size(bndpkgs)) = n
1543 call npf_cr(this%npf, this%name, mempathnpf, this%innpf, this%iout)
1544 call xt3d_cr(this%xt3d, this%name, this%innpf, this%iout)
1545 call buy_cr(this%buy, this%name, mempathbuy, this%inbuy, this%iout)
1546 call vsc_cr(this%vsc, this%name, mempathvsc, this%invsc, this%iout)
1547 call gnc_cr(this%gnc, this%name, this%ingnc, this%iout)
1548 call hfb_cr(this%hfb, this%name, mempathhfb, this%inhfb, this%iout)
1549 call sto_cr(this%sto, this%name, mempathsto, this%insto, this%iout)
1550 call csub_cr(this%csub, this%name, mempathcsub, this%insto, &
1551 this%sto%packName, this%incsub, this%iout)
1552 call ic_cr(this%ic, this%name, mempathic, this%inic, this%iout, this%dis)
1553 call mvr_cr(this%mvr, this%name, this%inmvr, this%iout, this%dis)
1554 call oc_cr(this%oc, this%name, mempathoc, this%inoc, this%iout)
1558 call this%ftype_check(indis)
1560 call this%create_bndpkgs(bndpkgs, pkgtypes, pkgnames, mempaths, inunits)
1570 write (this%iout,
'(1x,a)')
'NAMEFILE OPTIONS:'
1572 if (found%newton)
then
1573 write (this%iout,
'(4x,a)') &
1574 'NEWTON-RAPHSON method enabled for the model.'
1575 if (found%under_relaxation)
then
1576 write (this%iout,
'(4x,a,a)') &
1577 'NEWTON-RAPHSON UNDER-RELAXATION based on the bottom ', &
1578 'elevation of the model will be applied to the model.'
1582 if (found%print_input)
then
1583 write (this%iout,
'(4x,a)')
'STRESS PACKAGE INPUT WILL BE PRINTED '// &
1584 'FOR ALL MODEL STRESS PACKAGES'
1587 if (found%print_flows)
then
1588 write (this%iout,
'(4x,a)')
'PACKAGE FLOWS WILL BE PRINTED '// &
1589 'FOR ALL MODEL PACKAGES'
1592 if (found%save_flows)
then
1593 write (this%iout,
'(4x,a)') &
1594 'FLOWS WILL BE SAVED TO BUDGET FILE SPECIFIED IN OUTPUT CONTROL'
1597 write (this%iout,
'(1x,a)')
'END NAMEFILE OPTIONS:'
1614 if (this%iss == 1)
then
1615 if (
ats%isAdaptivePeriod(
kper))
then
1616 write (
warnmsg,
'(a,a,a,i0,a)') &
1617 'GWF Model (', trim(this%name),
') is steady state for period ', &
1618 kper,
' and adaptive time stepping is active. Adaptive time &
1619 &stepping may not work properly for steady-state conditions.'
This module contains the API package methods.
subroutine, public api_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath)
@ brief Create a new package object
subroutine, public addbasemodeltolist(list, model)
This module contains the base boundary package.
subroutine, public addbndtolist(list, bnd)
Add boundary to package list.
class(bndtype) function, pointer, public getbndfromlist(list, idx)
Get boundary from package list.
This module contains the BudgetModule.
subroutine, public budget_cr(this, name_model)
@ brief Create a new budget object
subroutine, public chd_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath)
Create a new constant head package.
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
integer(i4b), parameter lenpackagename
maximum length of the package name
real(dp), parameter dp9
real constant 9/10
integer(i4b), parameter lenpackagetype
maximum length of a package type (DIS6, SFR6, CSUB6, etc.)
integer(i4b), parameter lenpakloc
maximum length of a package location
integer(i4b), parameter lenftype
maximum length of a package type (DIS, WEL, OC, etc.)
real(dp), parameter dzero
real constant zero
real(dp), parameter dten
real constant 10
integer(i4b), parameter lenbudtxt
maximum length of a budget component names
integer(i4b), parameter lenmempath
maximum length of the memory path
real(dp), parameter done
real constant 1
subroutine, public dis_cr(dis, name_model, input_mempath, inunit, iout)
Create a new structured discretization object.
subroutine, public disu_cr(dis, name_model, input_mempath, inunit, iout)
Create a new unstructured discretization object.
subroutine, public disv_cr(dis, name_model, input_mempath, inunit, iout)
Create a new discretization by vertices object.
subroutine, public drn_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath)
Create a New Drn Package and point packobj to the new package.
subroutine, public evt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath)
Create a new Evapotranspiration Segments Package and point pakobj to the new package.
subroutine, public ghb_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath)
Create a New Ghb Package and point bndobj to the new package.
subroutine, public gnc_cr(gncobj, name_parent, inunit, iout)
Create new GNC exchange object.
subroutine, public buy_cr(buyobj, name_model, input_mempath, inunit, iout)
Create a new BUY object.
This module contains the CSUB package methods.
subroutine, public csub_cr(csubobj, name_model, mempath, istounit, stoPckName, inunit, iout)
@ brief Create a new package object
subroutine, public hfb_cr(hfbobj, name_model, input_mempath, inunit, iout)
Create a new hfb object.
subroutine, public ic_cr(ic, name_model, input_mempath, inunit, iout, dis)
Create a new initial conditions object.
subroutine gwf_df(this)
Define packages of the model.
subroutine, public gwf_cr(filename, id, modelname)
Create a new groundwater flow model object.
subroutine gwf_ptcchk(this, iptc)
check if pseudo-transient continuation factor should be used
subroutine log_namfile_options(this, found)
Write model namfile options to list file.
subroutine gwf_ptc(this, vec_residual, iptc, ptcf)
calculate maximum pseudo-transient continuation factor
subroutine allocate_scalars(this, modelname)
Allocate memory for non-allocatable members.
subroutine gwf_ot_flow(this, icbcfl, ibudfl, icbcun)
Groundwater Flow Model output flows.
integer(i4b) function gwf_get_iasym(this)
return 1 if any package causes the matrix to be asymmetric. Otherwise return 0.
subroutine gwf_da(this)
Deallocate.
subroutine create_packages(this)
Source package info and begin to process.
subroutine gwf_mc(this, matrix_sln)
Map the positions of this models connections in the numerical solution coefficient matrix.
subroutine gwf_cc(this, innertot, kiter, iend, icnvgmod, cpak, ipak, dpak)
GroundWater Flow Model Final Convergence Check for Boundary Packages.
subroutine gwf_rp(this)
GroundWater Flow Model Read and Prepare.
subroutine steady_period_check(this)
Check for steady state period.
class(gwfmodeltype) function, pointer, public castasgwfmodel(model)
Cast to GWF model.
subroutine package_create(this, filtyp, ipakid, ipaknum, pakname, mempath, inunit, iout)
Create boundary condition packages for this model.
subroutine gwf_ot_dv(this, idvsave, idvprint, ipflag)
Groundwater Flow Model output dependent variable.
integer(i4b), parameter, public gwf_nmultipkg
GWF multi package array descriptors.
subroutine create_bndpkgs(this, bndpkgs, pkgtypes, pkgnames, mempaths, inunits)
Source package info and begin to process.
subroutine gwf_ot(this)
GroundWater Flow Model Output.
character(len=lenpackagetype), dimension(gwf_nmultipkg), public gwf_multipkg
subroutine gwf_cf(this, kiter)
GroundWater Flow Model calculate coefficients.
integer(i4b), parameter niunit_gwf
subroutine gwf_ot_obs(this)
GroundWater Flow Model output observations.
subroutine gwf_dt(this)
Submit boundary-package ATS time step requests.
subroutine gwf_ot_bdsummary(this, ibudfl, ipflag)
Groundwater Flow Model output budget summary.
subroutine gwf_ac(this, sparse)
Add the internal connections of this model to the sparse matrix.
subroutine gwf_fc(this, kiter, matrix_sln, inwtflag)
GroundWater Flow Model fill coefficients.
subroutine gwf_ar(this)
GroundWater Flow Model Allocate and Read.
subroutine gwf_bdentry(this, budterm, budtxt, rowlabel)
GroundWater Flow Model Budget Entry.
subroutine gwf_nur(this, neqmod, x, xtemp, dx, inewtonur, dxmax, locmax)
under-relaxation
subroutine gwf_ad(this)
GroundWater Flow Model Time Step Advance.
subroutine gwf_cq(this, icnvg, isuppress_output)
Groundwater flow model calculate flow.
subroutine gwf_bd(this, icnvg, isuppress_output)
GroundWater Flow Model Budget.
integer(i4b), parameter, public gwf_nbasepkg
GWF base package array descriptors.
character(len=lenpackagetype), dimension(gwf_nbasepkg), public gwf_basepkg
subroutine ftype_check(this, indis)
Check to make sure required input files have been specified.
subroutine, public mvr_cr(mvrobj, name_parent, inunit, iout, dis, iexgmvr)
Create a new mvr object.
subroutine, public npf_cr(npfobj, name_model, input_mempath, inunit, iout)
Create a new NPF object. Pass a inunit value of 0 if npf data will initialized from memory.
subroutine, public gwf_obs_cr(obs, inobs)
Create a new GwfObsType object.
subroutine, public oc_cr(ocobj, name_model, input_mempath, inunit, iout)
@ brief Create GwfOcType
This module contains the storage package methods.
subroutine, public sto_cr(stoobj, name_model, mempath, inunit, iout)
@ brief Create a new package object
subroutine, public vsc_cr(vscobj, name_model, input_mempath, inunit, iout)
@ brief Create a new package object
This module defines variable data types.
subroutine, public lak_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname)
Create a new LAK Package and point bndobj to the new package.
type(listtype), public basemodellist
subroutine, public maw_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname)
Create a New Multi-Aquifer Well (MAW) Package.
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
subroutine, public memorystore_remove(component, subcomponent, context)
subroutine, public rch_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath)
Create a New Recharge Package.
subroutine, public riv_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath)
Create a New Riv Package and point packobj to the new package.
This module contains the SFR package methods.
subroutine, public sfr_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname)
@ brief Create a new package object
This module contains simulation methods.
subroutine, public store_warning(msg, substring)
Store warning message.
subroutine, public store_error(msg, terminate)
Store an error message.
integer(i4b) function, public count_errors()
Return number of errors.
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
character(len=linelength) idm_context
integer(i4b) isimcheck
simulation input check flag (1) to check input, (0) to ignore checks
integer(i4b) ifailedstepretry
current retry for this time step
character(len=maxcharlen) warnmsg
warning message string
subroutine csr_diagsum(ia, flowja)
logical(lgp), pointer, public endofperiod
flag indicating end of stress period
subroutine, public tdis_ot(iout)
Print simulation time.
real(dp), pointer, public totim
time relative to start of simulation
class(atstype), pointer, public ats
logical(lgp), pointer, public readnewdata
flag indicating time to read new data
integer(i4b), pointer, public kstp
current time step number
integer(i4b), pointer, public kper
current stress period number
real(dp), pointer, public delt
length of the current time step
subroutine, public uzf_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname)
Create a New UZF Package and point packobj to the new package.
This module contains the WEL package methods.
subroutine, public wel_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, mempath)
@ brief Create a new package object
subroutine, public xt3d_cr(xt3dobj, name_model, inunit, iout, ldispopt)
Create a new xt3d object.
Highest level model type. All models extend this parent type.
Derived type for the Budget object.
This class is used to store a single deferred-length character string. It was designed to work in an ...
@ brief Output control for GWF