40 integer(I4B),
pointer :: iname => null()
41 character(len=24),
dimension(:),
pointer :: aname => null()
42 integer(I4B),
dimension(:),
pointer,
contiguous :: ibound => null()
43 real(dp),
dimension(:),
pointer,
contiguous :: hnew => null()
44 integer(I4B),
pointer :: ixt3d => null()
45 integer(I4B),
pointer :: ixt3drhs => null()
46 integer(I4B),
pointer :: iperched => null()
47 integer(I4B),
pointer :: ivarcv => null()
48 integer(I4B),
pointer :: idewatcv => null()
49 integer(I4B),
pointer :: ithickstrt => null()
50 integer(I4B),
pointer :: ihighcellsat => null()
51 integer(I4B),
pointer :: igwfnewtonur => null()
52 integer(I4B),
pointer :: icalcspdis => null()
53 integer(I4B),
pointer :: isavspdis => null()
54 integer(I4B),
pointer :: isavsat => null()
55 real(dp),
pointer :: hnoflo => null()
56 real(dp),
pointer :: satomega => null()
57 integer(I4B),
pointer :: irewet => null()
58 integer(I4B),
pointer :: iwetit => null()
59 integer(I4B),
pointer :: ihdwet => null()
60 integer(I4B),
pointer :: icellavg => null()
61 real(dp),
pointer :: wetfct => null()
62 real(dp),
pointer :: hdry => null()
63 integer(I4B),
dimension(:),
pointer,
contiguous :: icelltype => null()
64 integer(I4B),
dimension(:),
pointer,
contiguous :: ithickstartflag => null()
67 real(dp),
dimension(:),
pointer,
contiguous :: k11 => null()
68 real(dp),
dimension(:),
pointer,
contiguous :: k22 => null()
69 real(dp),
dimension(:),
pointer,
contiguous :: k33 => null()
70 real(dp),
dimension(:),
pointer,
contiguous :: k11input => null()
71 real(dp),
dimension(:),
pointer,
contiguous :: k22input => null()
72 real(dp),
dimension(:),
pointer,
contiguous :: k33input => null()
73 integer(I4B),
pointer :: iavgkeff => null()
74 integer(I4B),
pointer :: ik22 => null()
75 integer(I4B),
pointer :: ik33 => null()
76 integer(I4B),
pointer :: ik22overk => null()
77 integer(I4B),
pointer :: ik33overk => null()
78 integer(I4B),
pointer :: iangle1 => null()
79 integer(I4B),
pointer :: iangle2 => null()
80 integer(I4B),
pointer :: iangle3 => null()
81 real(dp),
dimension(:),
pointer,
contiguous :: angle1 => null()
82 real(dp),
dimension(:),
pointer,
contiguous :: angle2 => null()
83 real(dp),
dimension(:),
pointer,
contiguous :: angle3 => null()
85 integer(I4B),
pointer :: iwetdry => null()
86 real(dp),
dimension(:),
pointer,
contiguous :: wetdry => null()
87 real(dp),
dimension(:),
pointer,
contiguous :: sat => null()
88 real(dp),
dimension(:),
pointer,
contiguous :: condsat => null()
89 integer(I4B),
dimension(:),
pointer,
contiguous :: ibotnode => null()
91 real(dp),
dimension(:, :),
pointer,
contiguous :: spdis => null()
92 integer(I4B),
pointer :: nedges => null()
93 integer(I4B),
pointer :: lastedge => null()
94 integer(I4B),
dimension(:),
pointer,
contiguous :: nodedge => null()
95 integer(I4B),
dimension(:),
pointer,
contiguous :: ihcedge => null()
96 real(dp),
dimension(:, :),
pointer,
contiguous :: propsedge => null()
97 integer(I4B),
dimension(:),
pointer,
contiguous :: iedge_ptr => null()
98 integer(I4B),
dimension(:),
pointer,
contiguous :: edge_idxs => null()
101 integer(I4B),
pointer :: intvk => null()
102 integer(I4B),
pointer :: invsc => null()
104 integer(I4B),
pointer :: kchangeper => null()
105 integer(I4B),
pointer :: kchangestp => null()
106 integer(I4B),
dimension(:),
pointer,
contiguous :: nodekchange => null()
159 subroutine npf_cr(npfobj, name_model, input_mempath, inunit, iout)
165 character(len=*),
intent(in) :: name_model
166 character(len=*),
intent(in) :: input_mempath
167 integer(I4B),
intent(in) :: inunit
168 integer(I4B),
intent(in) :: iout
170 character(len=*),
parameter :: fmtheader = &
171 "(1x, /1x, 'NPF -- NODE PROPERTY FLOW PACKAGE, VERSION 1, 3/30/2015', &
172 &' INPUT READ FROM MEMPATH: ', A, /)"
178 call npfobj%set_names(1, name_model,
'NPF',
'NPF', input_mempath)
181 call npfobj%allocate_scalars()
184 npfobj%inunit = inunit
191 write (iout, fmtheader) input_mempath
195 allocate (npfobj%spdis_wa)
206 subroutine npf_df(this, dis, xt3d, ingnc, invsc, npf_options)
214 integer(I4B),
intent(in) :: ingnc
215 integer(I4B),
intent(in) :: invsc
222 if (invsc > 0) this%invsc = invsc
224 if (.not.
present(npf_options))
then
227 call this%source_options()
230 call this%allocate_arrays(this%dis%nodes, this%dis%njas)
233 call this%source_griddata()
234 call this%prepcheck()
236 call this%set_options(npf_options)
239 call this%allocate_arrays(this%dis%nodes, this%dis%njas)
242 call this%check_options()
246 if (this%ixt3d /= 0) xt3d%ixt3d = this%ixt3d
247 call this%xt3d%xt3d_df(dis)
250 if (this%ixt3d /= 0 .and. ingnc > 0)
then
251 call store_error(
'Error in model '//trim(this%name_model)// &
252 '. The XT3D option cannot be used with the GNC &
253 &Package.', terminate=.true.)
264 integer(I4B),
intent(in) :: moffset
268 if (this%ixt3d /= 0)
call this%xt3d%xt3d_ac(moffset, sparse)
273 subroutine npf_mc(this, moffset, matrix_sln)
276 integer(I4B),
intent(in) :: moffset
279 if (this%ixt3d /= 0)
call this%xt3d%xt3d_mc(moffset, matrix_sln)
287 subroutine npf_ar(this, ic, vsc, ibound, hnew)
292 type(
gwfictype),
pointer,
intent(in) :: ic
294 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: ibound
295 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: hnew
301 this%ibound => ibound
304 if (this%icalcspdis == 1)
then
305 call mem_reallocate(this%spdis, 3, this%dis%nodes,
'SPDIS', this%memoryPath)
306 call mem_reallocate(this%nodedge, this%nedges,
'NODEDGE', this%memoryPath)
307 call mem_reallocate(this%ihcedge, this%nedges,
'IHCEDGE', this%memoryPath)
308 call mem_reallocate(this%propsedge, 5, this%nedges,
'PROPSEDGE', &
311 'NREDGESNODE', this%memoryPath)
313 'EDGEIDXS', this%memoryPath)
315 do n = 1, this%nedges
316 this%edge_idxs(n) = 0
318 do n = 1, this%dis%nodes
319 this%iedge_ptr(n) = 0
320 this%spdis(:, n) =
dzero
325 if (this%invsc /= 0)
then
330 if (this%invsc > 0)
then
342 call this%store_original_k_arrays(this%dis%nodes, this%dis%njas)
346 call this%preprocess_input()
349 if (this%ixt3d /= 0)
then
350 call this%xt3d%xt3d_ar(ibound, this%k11, this%ik33, this%k33, &
351 this%sat, this%ik22, this%k22, &
352 this%iangle1, this%iangle2, this%iangle3, &
353 this%angle1, this%angle2, this%angle3, &
354 this%inewton, this%icelltype)
358 if (this%intvk /= 0)
then
359 call this%tvk%ar(this%dis)
373 if (this%intvk /= 0)
then
382 subroutine npf_ad(this, nodes, hold, hnew, irestore)
389 integer(I4B),
intent(in) :: nodes
390 real(DP),
dimension(nodes),
intent(inout) :: hold
391 real(DP),
dimension(nodes),
intent(inout) :: hnew
392 integer(I4B),
intent(in) :: irestore
397 if (this%irewet > 0)
then
398 do n = 1, this%dis%nodes
399 if (this%wetdry(n) ==
dzero) cycle
400 if (this%ibound(n) /= 0) cycle
401 hold(n) = this%dis%bot(n)
405 do n = 1, this%dis%nodes
406 if (this%wetdry(n) ==
dzero) cycle
407 if (this%ibound(n) /= 0) cycle
413 if (this%intvk /= 0)
then
419 if (this%invsc /= 0)
then
420 call this%vsc%update_k_with_vsc()
424 if (this%kchangeper ==
kper .and. this%kchangestp ==
kstp)
then
425 if (this%ixt3d == 0)
then
429 do n = 1, this%dis%nodes
430 if (this%nodekchange(n) == 1)
then
431 call this%calc_condsat(n, .false.)
437 if (this%xt3d%lamatsaved .and. .not. this%xt3d%ldispersion)
then
438 call this%xt3d%xt3d_fcpc(this%dis%nodes, .true.)
446 subroutine npf_cf(this, kiter, nodes, hnew)
449 integer(I4B) :: kiter
450 integer(I4B),
intent(in) :: nodes
451 real(DP),
intent(inout),
dimension(nodes) :: hnew
457 if (this%inewton /= 1)
then
458 call this%wd(kiter, hnew)
462 do n = 1, this%dis%nodes
463 if (this%icelltype(n) /= 0)
then
464 if (this%ibound(n) == 0)
then
467 call this%thksat(n, hnew(n), satn)
476 subroutine npf_fc(this, kiter, matrix_sln, idxglo, rhs, hnew)
481 integer(I4B) :: kiter
483 integer(I4B),
intent(in),
dimension(:) :: idxglo
484 real(DP),
intent(inout),
dimension(:) :: rhs
485 real(DP),
intent(inout),
dimension(:) :: hnew
487 integer(I4B) :: n, m, ii, idiag, ihc
488 integer(I4B) :: isymcon, idiagm
496 if (this%ixt3d /= 0)
then
497 call this%xt3d%xt3d_fc(kiter, matrix_sln, idxglo, rhs, hnew)
499 do n = 1, this%dis%nodes
500 do ii = this%dis%con%ia(n) + 1, this%dis%con%ia(n + 1) - 1
501 if (this%dis%con%mask(ii) == 0) cycle
503 m = this%dis%con%ja(ii)
508 ihc = this%dis%con%ihc(this%dis%con%jas(ii))
509 hyn = this%hy_eff(n, m, ihc, ipos=ii)
510 hym = this%hy_eff(m, n, ihc, ipos=ii)
513 if (ihc == c3d_vertical)
then
516 cond =
vcond(this%ibound(n), this%ibound(m), &
517 this%icelltype(n), this%icelltype(m), this%inewton, &
518 this%ivarcv, this%idewatcv, &
519 this%condsat(this%dis%con%jas(ii)), hnew(n), hnew(m), &
521 this%sat(n), this%sat(m), &
522 this%dis%top(n), this%dis%top(m), &
523 this%dis%bot(n), this%dis%bot(m), &
524 this%dis%con%hwva(this%dis%con%jas(ii)))
527 if (this%iperched /= 0)
then
528 if (this%icelltype(m) /= 0)
then
529 if (hnew(m) < this%dis%top(m))
then
532 idiag = this%dis%con%ia(n)
533 rhs(n) = rhs(n) - cond * this%dis%bot(n)
534 call matrix_sln%add_value_pos(idxglo(idiag), -cond)
537 isymcon = this%dis%con%isym(ii)
538 call matrix_sln%add_value_pos(idxglo(isymcon), cond)
539 rhs(m) = rhs(m) + cond * this%dis%bot(n)
550 if (this%ihighcellsat /= 0)
then
551 call this%highest_cell_saturation(n, m, &
557 cond =
hcond(this%ibound(n), this%ibound(m), &
558 this%icelltype(n), this%icelltype(m), &
560 this%dis%con%ihc(this%dis%con%jas(ii)), &
562 this%condsat(this%dis%con%jas(ii)), &
563 hnew(n), hnew(m), satn, satm, hyn, hym, &
564 this%dis%top(n), this%dis%top(m), &
565 this%dis%bot(n), this%dis%bot(m), &
566 this%dis%con%cl1(this%dis%con%jas(ii)), &
567 this%dis%con%cl2(this%dis%con%jas(ii)), &
568 this%dis%con%hwva(this%dis%con%jas(ii)))
572 idiag = this%dis%con%ia(n)
573 call matrix_sln%add_value_pos(idxglo(ii), cond)
574 call matrix_sln%add_value_pos(idxglo(idiag), -cond)
577 isymcon = this%dis%con%isym(ii)
578 idiagm = this%dis%con%ia(m)
579 call matrix_sln%add_value_pos(idxglo(isymcon), cond)
580 call matrix_sln%add_value_pos(idxglo(idiagm), -cond)
595 integer(I4B),
intent(in) :: n, m
596 real(DP),
intent(in) :: hn, hm
597 real(DP),
intent(inout) :: satn, satm
599 integer(I4B) :: ihdbot
600 real(DP) :: botn, botm
603 botn = this%dis%bot(n)
604 botm = this%dis%bot(m)
607 if (botm > botn) ihdbot = m
611 if (abs(botm - botn) >=
dem2)
then
612 top = this%dis%top(ihdbot)
613 bot = this%dis%bot(ihdbot)
621 subroutine npf_fn(this, kiter, matrix_sln, idxglo, rhs, hnew)
624 integer(I4B) :: kiter
626 integer(I4B),
intent(in),
dimension(:) :: idxglo
627 real(DP),
intent(inout),
dimension(:) :: rhs
628 real(DP),
intent(inout),
dimension(:) :: hnew
630 integer(I4B) :: nodes, nja
631 integer(I4B) :: n, m, ii, idiag
632 integer(I4B) :: isymcon, idiagm
637 real(DP) :: filledterm
645 nodes = this%dis%nodes
646 nja = this%dis%con%nja
647 if (this%ixt3d /= 0)
then
648 call this%xt3d%xt3d_fn(kiter, nodes, nja, matrix_sln, idxglo, rhs, hnew)
652 idiag = this%dis%con%ia(n)
653 do ii = this%dis%con%ia(n) + 1, this%dis%con%ia(n + 1) - 1
654 if (this%dis%con%mask(ii) == 0) cycle
656 m = this%dis%con%ja(ii)
657 isymcon = this%dis%con%isym(ii)
660 if (this%dis%con%ihc(this%dis%con%jas(ii)) == 0 .and. &
661 this%ivarcv == 0)
then
667 if (hnew(m) < hnew(n)) iups = n
669 if (iups == n) idn = m
672 if (this%icelltype(iups) == 0) cycle
676 topup = this%dis%top(iups)
677 botup = this%dis%bot(iups)
678 if (this%dis%con%ihc(this%dis%con%jas(ii)) == 2)
then
679 topup = min(this%dis%top(n), this%dis%top(m))
680 botup = max(this%dis%bot(n), this%dis%bot(m))
684 cond = this%condsat(this%dis%con%jas(ii))
687 consterm = -cond * (hnew(iups) - hnew(idn))
689 filledterm = matrix_sln%get_value_pos(idxglo(ii))
692 idiagm = this%dis%con%ia(m)
697 term = consterm * derv
698 rhs(n) = rhs(n) + term * hnew(n)
699 rhs(m) = rhs(m) - term * hnew(n)
701 call matrix_sln%add_value_pos(idxglo(idiag), term)
703 if (this%ibound(n) > 0)
then
704 filledterm = matrix_sln%get_value_pos(idxglo(ii))
705 call matrix_sln%set_value_pos(idxglo(ii), filledterm)
708 filledterm = matrix_sln%get_value_pos(idxglo(idiagm))
709 call matrix_sln%set_value_pos(idxglo(idiagm), filledterm)
711 if (this%ibound(m) > 0)
then
712 call matrix_sln%add_value_pos(idxglo(isymcon), -term)
717 term = -consterm * derv
718 rhs(n) = rhs(n) + term * hnew(m)
719 rhs(m) = rhs(m) - term * hnew(m)
721 filledterm = matrix_sln%get_value_pos(idxglo(idiag))
722 call matrix_sln%set_value_pos(idxglo(idiag), filledterm)
724 if (this%ibound(n) > 0)
then
725 call matrix_sln%add_value_pos(idxglo(ii), term)
728 call matrix_sln%add_value_pos(idxglo(idiagm), -term)
730 if (this%ibound(m) > 0)
then
731 filledterm = matrix_sln%get_value_pos(idxglo(isymcon))
732 call matrix_sln%set_value_pos(idxglo(isymcon), filledterm)
748 subroutine npf_nur(this, neqmod, x, xtemp, dx, inewtonur, dxmax, locmax)
751 integer(I4B),
intent(in) :: neqmod
752 real(DP),
dimension(neqmod),
intent(inout) :: x
753 real(DP),
dimension(neqmod),
intent(in) :: xtemp
754 real(DP),
dimension(neqmod),
intent(inout) :: dx
755 integer(I4B),
intent(inout) :: inewtonur
756 real(DP),
intent(inout) :: dxmax
757 integer(I4B),
intent(inout) :: locmax
765 do n = 1, this%dis%nodes
766 if (this%ibound(n) < 1) cycle
767 if (this%icelltype(n) > 0)
then
768 botm = this%dis%bot(this%ibotnode(n))
771 if (x(n) < botm)
then
775 if (abs(dxx) > abs(dxmax))
then
791 real(DP),
intent(inout),
dimension(:) :: hnew
792 real(DP),
intent(inout),
dimension(:) :: flowja
794 integer(I4B) :: n, ipos, m
799 if (this%ixt3d /= 0)
then
800 call this%xt3d%xt3d_flowja(hnew, flowja)
803 do n = 1, this%dis%nodes
804 do ipos = this%dis%con%ia(n) + 1, this%dis%con%ia(n + 1) - 1
805 m = this%dis%con%ja(ipos)
807 call this%qcalc(n, m, hnew(n), hnew(m), ipos, qnm)
809 flowja(this%dis%con%isym(ipos)) = -qnm
821 integer(I4B),
intent(in) :: n
822 real(DP),
intent(in) :: hn
823 real(DP),
intent(inout) :: thksat
826 if (hn >= this%dis%top(n))
then
829 thksat = (hn - this%dis%bot(n)) / (this%dis%top(n) - this%dis%bot(n))
833 if (this%inewton /= 0)
then
844 integer(I4B),
intent(in) :: n
845 integer(I4B),
intent(in) :: m
846 real(DP),
intent(in) :: hn
847 real(DP),
intent(in) :: hm
848 integer(I4B),
intent(in) :: icon
849 real(DP),
intent(inout) :: qnm
853 real(DP) :: hntemp, hmtemp
854 real(DP) :: satn, satm
858 ihc = this%dis%con%ihc(this%dis%con%jas(icon))
859 hyn = this%hy_eff(n, m, ihc, ipos=icon)
860 hym = this%hy_eff(m, n, ihc, ipos=icon)
864 condnm =
vcond(this%ibound(n), this%ibound(m), &
865 this%icelltype(n), this%icelltype(m), this%inewton, &
866 this%ivarcv, this%idewatcv, &
867 this%condsat(this%dis%con%jas(icon)), hn, hm, &
869 this%sat(n), this%sat(m), &
870 this%dis%top(n), this%dis%top(m), &
871 this%dis%bot(n), this%dis%bot(m), &
872 this%dis%con%hwva(this%dis%con%jas(icon)))
876 if (this%ihighcellsat /= 0)
then
877 call this%highest_cell_saturation(n, m, hn, hm, satn, satm)
880 condnm =
hcond(this%ibound(n), this%ibound(m), &
881 this%icelltype(n), this%icelltype(m), &
883 this%dis%con%ihc(this%dis%con%jas(icon)), &
885 this%condsat(this%dis%con%jas(icon)), &
886 hn, hm, satn, satm, hyn, hym, &
887 this%dis%top(n), this%dis%top(m), &
888 this%dis%bot(n), this%dis%bot(m), &
889 this%dis%con%cl1(this%dis%con%jas(icon)), &
890 this%dis%con%cl2(this%dis%con%jas(icon)), &
891 this%dis%con%hwva(this%dis%con%jas(icon)))
899 if (this%iperched /= 0)
then
900 if (this%dis%con%ihc(this%dis%con%jas(icon)) == 0)
then
902 if (this%icelltype(n) /= 0)
then
903 if (hn < this%dis%top(n)) hntemp = this%dis%bot(m)
906 if (this%icelltype(m) /= 0)
then
907 if (hm < this%dis%top(m)) hmtemp = this%dis%bot(n)
914 qnm = condnm * (hmtemp - hntemp)
922 real(DP),
dimension(:),
intent(in) :: flowja
923 integer(I4B),
intent(in) :: icbcfl
924 integer(I4B),
intent(in) :: icbcun
926 integer(I4B) :: ibinun
929 if (this%ipakcb < 0)
then
931 elseif (this%ipakcb == 0)
then
936 if (icbcfl == 0) ibinun = 0
939 if (ibinun /= 0)
then
940 call this%dis%record_connection_array(flowja, ibinun, this%iout)
944 if (this%isavspdis /= 0)
then
945 if (ibinun /= 0)
call this%sav_spdis(ibinun)
949 if (this%isavsat /= 0)
then
950 if (ibinun /= 0)
call this%sav_sat(ibinun)
962 integer(I4B),
intent(in) :: ibudfl
963 real(DP),
intent(inout),
dimension(:) :: flowja
965 character(len=LENBIGLINE) :: line
966 character(len=30) :: tempstr
967 integer(I4B) :: n, ipos, m
970 character(len=*),
parameter :: fmtiprflow = &
971 &
"(/,4x,'CALCULATED INTERCELL FLOW FOR PERIOD ', i0, ' STEP ', i0)"
974 if (ibudfl /= 0 .and. this%iprflow > 0)
then
975 write (this%iout, fmtiprflow)
kper,
kstp
976 do n = 1, this%dis%nodes
978 call this%dis%noder_to_string(n, tempstr)
979 line = trim(tempstr)//
':'
980 do ipos = this%dis%con%ia(n) + 1, this%dis%con%ia(n + 1) - 1
981 m = this%dis%con%ja(ipos)
982 call this%dis%noder_to_string(m, tempstr)
983 line = trim(line)//
' '//trim(tempstr)
985 write (tempstr,
'(1pg15.6)') qnm
986 line = trim(line)//
' '//trim(adjustl(tempstr))
988 write (this%iout,
'(a)') trim(line)
1003 if (this%icalcspdis == 1 .and. this%spdis_wa%is_created()) &
1004 call this%spdis_wa%destroy()
1005 deallocate (this%spdis_wa)
1011 if (this%intvk /= 0)
then
1013 deallocate (this%tvk)
1017 if (this%invsc /= 0)
then
1061 deallocate (this%aname)
1085 call this%NumericalPackageType%da()
1104 call this%NumericalPackageType%allocate_scalars()
1107 call mem_allocate(this%iname,
'INAME', this%memoryPath)
1108 call mem_allocate(this%ixt3d,
'IXT3D', this%memoryPath)
1109 call mem_allocate(this%ixt3drhs,
'IXT3DRHS', this%memoryPath)
1110 call mem_allocate(this%satomega,
'SATOMEGA', this%memoryPath)
1111 call mem_allocate(this%hnoflo,
'HNOFLO', this%memoryPath)
1113 call mem_allocate(this%icellavg,
'ICELLAVG', this%memoryPath)
1114 call mem_allocate(this%iavgkeff,
'IAVGKEFF', this%memoryPath)
1117 call mem_allocate(this%ik22overk,
'IK22OVERK', this%memoryPath)
1118 call mem_allocate(this%ik33overk,
'IK33OVERK', this%memoryPath)
1119 call mem_allocate(this%iperched,
'IPERCHED', this%memoryPath)
1120 call mem_allocate(this%ivarcv,
'IVARCV', this%memoryPath)
1121 call mem_allocate(this%idewatcv,
'IDEWATCV', this%memoryPath)
1122 call mem_allocate(this%ithickstrt,
'ITHICKSTRT', this%memoryPath)
1123 call mem_allocate(this%ihighcellsat,
'IHIGHCELLSAT', this%memoryPath)
1124 call mem_allocate(this%icalcspdis,
'ICALCSPDIS', this%memoryPath)
1125 call mem_allocate(this%isavspdis,
'ISAVSPDIS', this%memoryPath)
1126 call mem_allocate(this%isavsat,
'ISAVSAT', this%memoryPath)
1127 call mem_allocate(this%irewet,
'IREWET', this%memoryPath)
1128 call mem_allocate(this%wetfct,
'WETFCT', this%memoryPath)
1129 call mem_allocate(this%iwetit,
'IWETIT', this%memoryPath)
1130 call mem_allocate(this%ihdwet,
'IHDWET', this%memoryPath)
1131 call mem_allocate(this%iangle1,
'IANGLE1', this%memoryPath)
1132 call mem_allocate(this%iangle2,
'IANGLE2', this%memoryPath)
1133 call mem_allocate(this%iangle3,
'IANGLE3', this%memoryPath)
1134 call mem_allocate(this%iwetdry,
'IWETDRY', this%memoryPath)
1135 call mem_allocate(this%nedges,
'NEDGES', this%memoryPath)
1136 call mem_allocate(this%lastedge,
'LASTEDGE', this%memoryPath)
1137 call mem_allocate(this%intvk,
'INTVK', this%memoryPath)
1138 call mem_allocate(this%invsc,
'INVSC', this%memoryPath)
1139 call mem_allocate(this%kchangeper,
'KCHANGEPER', this%memoryPath)
1140 call mem_allocate(this%kchangestp,
'KCHANGESTP', this%memoryPath)
1143 call mem_setptr(this%igwfnewtonur,
'INEWTONUR', &
1150 this%satomega =
dzero
1163 this%ihighcellsat = 0
1183 this%iasym = this%inewton
1201 integer(I4B),
intent(in) :: ncells
1202 integer(I4B),
intent(in) :: njas
1208 this%k11input(n) = this%k11(n)
1209 this%k22input(n) = this%k22(n)
1210 this%k33input(n) = this%k33(n)
1219 integer(I4B),
intent(in) :: ncells
1220 integer(I4B),
intent(in) :: njas
1224 call mem_allocate(this%ithickstartflag, ncells,
'ITHICKSTARTFLAG', &
1226 call mem_allocate(this%icelltype, ncells,
'ICELLTYPE', this%memoryPath)
1227 call mem_allocate(this%k11, ncells,
'K11', this%memoryPath)
1228 call mem_allocate(this%sat, ncells,
'SAT', this%memoryPath)
1229 call mem_allocate(this%condsat, njas,
'CONDSAT', this%memoryPath)
1232 call mem_allocate(this%k22, ncells,
'K22', this%memoryPath)
1233 call mem_allocate(this%k33, ncells,
'K33', this%memoryPath)
1234 call mem_allocate(this%wetdry, ncells,
'WETDRY', this%memoryPath)
1235 call mem_allocate(this%angle1, ncells,
'ANGLE1', this%memoryPath)
1236 call mem_allocate(this%angle2, ncells,
'ANGLE2', this%memoryPath)
1237 call mem_allocate(this%angle3, ncells,
'ANGLE3', this%memoryPath)
1240 call mem_allocate(this%ibotnode, 0,
'IBOTNODE', this%memoryPath)
1241 call mem_allocate(this%nodedge, 0,
'NODEDGE', this%memoryPath)
1242 call mem_allocate(this%ihcedge, 0,
'IHCEDGE', this%memoryPath)
1243 call mem_allocate(this%propsedge, 0, 0,
'PROPSEDGE', this%memoryPath)
1244 call mem_allocate(this%iedge_ptr, 0,
'NREDGESNODE', this%memoryPath)
1245 call mem_allocate(this%edge_idxs, 0,
'EDGEIDXS', this%memoryPath)
1248 call mem_allocate(this%k11input, 0,
'K11INPUT', this%memoryPath)
1249 call mem_allocate(this%k22input, 0,
'K22INPUT', this%memoryPath)
1250 call mem_allocate(this%k33input, 0,
'K33INPUT', this%memoryPath)
1253 call mem_allocate(this%spdis, 3, 0,
'SPDIS', this%memoryPath)
1256 call mem_allocate(this%nodekchange, ncells,
'NODEKCHANGE', this%memoryPath)
1260 this%angle1(n) =
dzero
1261 this%angle2(n) =
dzero
1262 this%angle3(n) =
dzero
1263 this%wetdry(n) =
dzero
1264 this%nodekchange(n) =
dzero
1268 allocate (this%aname(this%iname))
1269 this%aname = [
' ICELLTYPE',
' K', &
1271 ' WETDRY',
' ANGLE1', &
1272 ' ANGLE2',
' ANGLE3']
1286 write (this%iout,
'(1x,a)')
'Setting NPF Options'
1287 if (found%iprflow) &
1288 write (this%iout,
'(4x,a)')
'Cell-by-cell flow information will be printed &
1289 &to listing file whenever ICBCFL is not zero.'
1291 write (this%iout,
'(4x,a)')
'Cell-by-cell flow information will be saved &
1292 &to binary file whenever ICBCFL is not zero.'
1293 if (found%cellavg) &
1294 write (this%iout,
'(4x,a,i0)')
'Alternative cell averaging [1=logarithmic, &
1295 &2=AMT-LMK, 3=AMT-HMK] set to: ', &
1297 if (found%ithickstrt) &
1298 write (this%iout,
'(4x,a)')
'THICKSTRT option has been activated.'
1299 if (found%ihighcellsat) &
1300 write (this%iout,
'(4x,a)')
'HIGHEST_CELL_SATURATION option &
1301 &has been activated.'
1302 if (found%iperched) &
1303 write (this%iout,
'(4x,a)')
'Vertical flow will be adjusted for perched &
1306 write (this%iout,
'(4x,a)')
'Vertical conductance varies with water table.'
1307 if (found%idewatcv) &
1308 write (this%iout,
'(4x,a)')
'Vertical conductance is calculated using &
1309 &only the saturated thickness and properties &
1310 &of the overlying cell if the head in the &
1311 &underlying cell is below its top.'
1312 if (found%ixt3d)
write (this%iout,
'(4x,a)')
'XT3D formulation is selected.'
1313 if (found%ixt3drhs) &
1314 write (this%iout,
'(4x,a)')
'XT3D RHS formulation is selected.'
1315 if (found%isavspdis) &
1316 write (this%iout,
'(4x,a)')
'Specific discharge will be calculated at cell &
1317 ¢ers and written to DATA-SPDIS in budget &
1318 &file when requested.'
1319 if (found%isavsat) &
1320 write (this%iout,
'(4x,a)')
'Saturation will be written to DATA-SAT in &
1321 &budget file when requested.'
1322 if (found%ik22overk) &
1323 write (this%iout,
'(4x,a)')
'Values specified for K22 are anisotropy &
1324 &ratios and will be multiplied by K before &
1325 &being used in calculations.'
1326 if (found%ik33overk) &
1327 write (this%iout,
'(4x,a)')
'Values specified for K33 are anisotropy &
1328 &ratios and will be multiplied by K before &
1329 &being used in calculations.'
1330 if (found%inewton) &
1331 write (this%iout,
'(4x,a)')
'NEWTON-RAPHSON method disabled for unconfined &
1333 if (found%satomega) &
1334 write (this%iout,
'(4x,a,1pg15.6)')
'Saturation omega: ', this%satomega
1336 write (this%iout,
'(4x,a)')
'Rewetting is active.'
1338 write (this%iout,
'(4x,a,1pg15.6)') &
1339 'Wetting factor (WETFCT) has been set to: ', this%wetfct
1341 write (this%iout,
'(4x,a,i5)') &
1342 'Wetting iteration interval (IWETIT) has been set to: ', this%iwetit
1344 write (this%iout,
'(4x,a,i5)') &
1345 'Head rewet equation (IHDWET) has been set to: ', this%ihdwet
1346 write (this%iout,
'(1x,a,/)')
'End Setting NPF Options'
1362 character(len=LENVARNAME),
dimension(3) :: cellavg_method = &
1363 &[character(len=LENVARNAME) ::
'LOGARITHMIC',
'AMT-LMK',
'AMT-HMK']
1365 character(len=LINELENGTH) :: tvk6_filename
1368 call mem_set_value(this%iprflow,
'IPRFLOW', this%input_mempath, found%iprflow)
1369 call mem_set_value(this%ipakcb,
'IPAKCB', this%input_mempath, found%ipakcb)
1370 call mem_set_value(this%icellavg,
'CELLAVG', this%input_mempath, &
1371 cellavg_method, found%cellavg)
1372 call mem_set_value(this%ithickstrt,
'ITHICKSTRT', this%input_mempath, &
1374 call mem_set_value(this%ihighcellsat,
'IHIGHCELLSAT', this%input_mempath, &
1376 call mem_set_value(this%iperched,
'IPERCHED', this%input_mempath, &
1378 call mem_set_value(this%ivarcv,
'IVARCV', this%input_mempath, found%ivarcv)
1379 call mem_set_value(this%idewatcv,
'IDEWATCV', this%input_mempath, &
1381 call mem_set_value(this%ixt3d,
'IXT3D', this%input_mempath, found%ixt3d)
1382 call mem_set_value(this%ixt3drhs,
'IXT3DRHS', this%input_mempath, &
1384 call mem_set_value(this%isavspdis,
'ISAVSPDIS', this%input_mempath, &
1386 call mem_set_value(this%isavsat,
'ISAVSAT', this%input_mempath, found%isavsat)
1387 call mem_set_value(this%ik22overk,
'IK22OVERK', this%input_mempath, &
1389 call mem_set_value(this%ik33overk,
'IK33OVERK', this%input_mempath, &
1391 call mem_set_value(this%inewton,
'INEWTON', this%input_mempath, found%inewton)
1392 call mem_set_value(this%satomega,
'SATOMEGA', this%input_mempath, &
1394 call mem_set_value(this%irewet,
'IREWET', this%input_mempath, found%irewet)
1395 call mem_set_value(this%wetfct,
'WETFCT', this%input_mempath, found%wetfct)
1396 call mem_set_value(this%iwetit,
'IWETIT', this%input_mempath, found%iwetit)
1397 call mem_set_value(this%ihdwet,
'IHDWET', this%input_mempath, found%ihdwet)
1400 if (found%ipakcb) this%ipakcb = -1
1403 if (found%ixt3d .and. found%ixt3drhs) this%ixt3d = 2
1406 if (found%isavspdis) this%icalcspdis = this%isavspdis
1409 if (found%inewton)
then
1415 if (
filein_fname(tvk6_filename,
'TVK6_FILENAME', this%input_mempath, &
1416 this%input_fname))
then
1417 call openfile(this%intvk, this%iout, tvk6_filename,
'TVK')
1418 call tvk_cr(this%tvk, this%name_model, this%intvk, this%iout)
1422 if (found%cellavg)
then
1423 if (this%icellavg == 0)
then
1424 errmsg =
'Unrecognized input value for ALTERNATIVE_CELL_AVERAGING option.'
1431 if (this%iout > 0)
then
1432 call this%log_options(found)
1443 this%ithickstrt = options%ithickstrt
1444 this%ihighcellsat = options%ihighcellsat
1445 this%iperched = options%iperched
1446 this%ivarcv = options%ivarcv
1447 this%idewatcv = options%idewatcv
1448 this%irewet = options%irewet
1449 this%wetfct = options%wetfct
1450 this%iwetit = options%iwetit
1451 this%ihdwet = options%ihdwet
1465 if (this%inewton > 0)
then
1466 this%satomega = dem6
1469 if (this%inewton > 0)
then
1470 if (this%iperched > 0)
then
1471 write (
errmsg,
'(a)')
'ERROR IN NPF OPTIONS. NEWTON OPTION CANNOT '// &
1472 'BE USED WITH PERCHED OPTION.'
1475 if (this%ivarcv > 0)
then
1476 write (
errmsg,
'(a)')
'ERROR IN NPF OPTIONS. NEWTON OPTION CANNOT '// &
1477 'BE USED WITH VARIABLECV OPTION.'
1480 if (this%irewet > 0)
then
1481 write (
errmsg,
'(a)')
'ERROR IN NPF OPTIONS. NEWTON OPTION CANNOT '// &
1482 'BE USED WITH REWET OPTION.'
1486 if (this%ihighcellsat /= 0)
then
1487 write (
warnmsg,
'(a)')
'HIGHEST_CELL_SATURATION '// &
1488 'option cannot be used when NEWTON option in not specified. '// &
1489 'Resetting HIGHEST_CELL_SATURATION option to off.'
1490 this%ihighcellsat = 0
1495 if (this%ixt3d /= 0)
then
1496 if (this%icellavg > 0)
then
1497 write (
errmsg,
'(a)')
'ERROR IN NPF OPTIONS. '// &
1498 'ALTERNATIVE_CELL_AVERAGING OPTION '// &
1499 'CANNOT BE USED WITH XT3D OPTION.'
1502 if (this%ithickstrt > 0)
then
1503 write (
errmsg,
'(a)')
'ERROR IN NPF OPTIONS. THICKSTRT OPTION '// &
1504 'CANNOT BE USED WITH XT3D OPTION.'
1507 if (this%iperched > 0)
then
1508 write (
errmsg,
'(a)')
'ERROR IN NPF OPTIONS. PERCHED OPTION '// &
1509 'CANNOT BE USED WITH XT3D OPTION.'
1512 if (this%ivarcv > 0)
then
1513 write (
errmsg,
'(a)')
'ERROR IN NPF OPTIONS. VARIABLECV OPTION '// &
1514 'CANNOT BE USED WITH XT3D OPTION.'
1534 write (this%iout,
'(1x,a)')
'Setting NPF Griddata'
1536 if (found%icelltype)
then
1537 write (this%iout,
'(4x,a)')
'ICELLTYPE set from input file'
1541 write (this%iout,
'(4x,a)')
'K set from input file'
1545 write (this%iout,
'(4x,a)')
'K33 set from input file'
1547 write (this%iout,
'(4x,a)')
'K33 not provided. Setting K33 = K.'
1551 write (this%iout,
'(4x,a)')
'K22 set from input file'
1553 write (this%iout,
'(4x,a)')
'K22 not provided. Setting K22 = K.'
1556 if (found%wetdry)
then
1557 write (this%iout,
'(4x,a)')
'WETDRY set from input file'
1560 if (found%angle1)
then
1561 write (this%iout,
'(4x,a)')
'ANGLE1 set from input file'
1564 if (found%angle2)
then
1565 write (this%iout,
'(4x,a)')
'ANGLE2 set from input file'
1568 if (found%angle3)
then
1569 write (this%iout,
'(4x,a)')
'ANGLE3 set from input file'
1572 write (this%iout,
'(1x,a,/)')
'End Setting NPF Griddata'
1586 character(len=LINELENGTH) :: errmsg
1588 logical,
dimension(2) :: afound
1589 integer(I4B),
dimension(:),
pointer,
contiguous :: map
1593 if (this%dis%nodes < this%dis%nodesuser) map => this%dis%nodeuser
1596 call mem_set_value(this%icelltype,
'ICELLTYPE', this%input_mempath, map, &
1598 call mem_set_value(this%k11,
'K', this%input_mempath, map, found%k)
1599 call mem_set_value(this%k33,
'K33', this%input_mempath, map, found%k33)
1600 call mem_set_value(this%k22,
'K22', this%input_mempath, map, found%k22)
1601 call mem_set_value(this%wetdry,
'WETDRY', this%input_mempath, map, &
1603 call mem_set_value(this%angle1,
'ANGLE1', this%input_mempath, map, &
1605 call mem_set_value(this%angle2,
'ANGLE2', this%input_mempath, map, &
1607 call mem_set_value(this%angle3,
'ANGLE3', this%input_mempath, map, &
1611 if (.not. found%icelltype)
then
1612 write (errmsg,
'(a)')
'Error in GRIDDATA block: ICELLTYPE not found.'
1617 if (.not. found%k)
then
1618 write (errmsg,
'(a)')
'Error in GRIDDATA block: K not found.'
1623 if (.not. found%k33 .and. this%ik33overk /= 0)
then
1624 write (errmsg,
'(a)')
'K33OVERK option specified but K33 not specified.'
1629 if (.not. found%k22 .and. this%ik22overk /= 0)
then
1630 write (errmsg,
'(a)')
'K22OVERK option specified but K22 not specified.'
1635 if (found%k33) this%ik33 = 1
1636 if (found%k22) this%ik22 = 1
1637 if (found%wetdry) this%iwetdry = 1
1638 if (found%angle1) this%iangle1 = 1
1639 if (found%angle2) this%iangle2 = 1
1640 if (found%angle3) this%iangle3 = 1
1643 if (.not. found%k33)
then
1644 call mem_set_value(this%k33,
'K', this%input_mempath, map, afound(1))
1646 if (.not. found%k22)
then
1647 call mem_set_value(this%k22,
'K', this%input_mempath, map, afound(2))
1649 if (.not. found%wetdry)
call mem_reallocate(this%wetdry, 1,
'WETDRY', &
1650 trim(this%memoryPath))
1651 if (.not. found%angle1 .and. this%ixt3d == 0) &
1652 call mem_reallocate(this%angle1, 0,
'ANGLE1', trim(this%memoryPath))
1653 if (.not. found%angle2 .and. this%ixt3d == 0) &
1654 call mem_reallocate(this%angle2, 0,
'ANGLE2', trim(this%memoryPath))
1655 if (.not. found%angle3 .and. this%ixt3d == 0) &
1656 call mem_reallocate(this%angle3, 0,
'ANGLE3', trim(this%memoryPath))
1659 if (this%iout > 0)
then
1660 call this%log_griddata(found)
1673 character(len=24),
dimension(:),
pointer :: aname
1674 character(len=LINELENGTH) :: cellstr, errmsg
1675 integer(I4B) :: nerr, n
1677 character(len=*),
parameter :: fmtkerr = &
1678 &
"(1x, 'Hydraulic property ',a,' is <= 0 for cell ',a, ' ', 1pg15.6)"
1679 character(len=*),
parameter :: fmtkerr2 = &
1680 &
"(1x, '... ', i0,' additional errors not shown for ',a)"
1687 do n = 1,
size(this%k11)
1688 if (this%k11(n) <= dzero)
then
1690 if (nerr <= 20)
then
1691 call this%dis%noder_to_string(n, cellstr)
1692 write (errmsg, fmtkerr) trim(adjustl(aname(2))), trim(cellstr), &
1699 write (errmsg, fmtkerr2) nerr, trim(adjustl(aname(2)))
1704 if (this%ik33 /= 0)
then
1708 do n = 1,
size(this%k33)
1709 if (this%ik33overk /= 0) this%k33(n) = this%k33(n) * this%k11(n)
1710 if (this%k33(n) <= dzero)
then
1712 if (nerr <= 20)
then
1713 call this%dis%noder_to_string(n, cellstr)
1714 write (errmsg, fmtkerr) trim(adjustl(aname(3))), trim(cellstr), &
1721 write (errmsg, fmtkerr2) nerr, trim(adjustl(aname(3)))
1727 if (this%ik22 /= 0)
then
1730 if (this%dis%con%ianglex == 0)
then
1731 write (errmsg,
'(a)')
'Error. ANGLDEGX not provided in '// &
1732 'discretization file, but K22 was specified. '
1738 do n = 1,
size(this%k22)
1739 if (this%ik22overk /= 0) this%k22(n) = this%k22(n) * this%k11(n)
1740 if (this%k22(n) <= dzero)
then
1742 if (nerr <= 20)
then
1743 call this%dis%noder_to_string(n, cellstr)
1744 write (errmsg, fmtkerr) trim(adjustl(aname(4))), trim(cellstr), &
1751 write (errmsg, fmtkerr2) nerr, trim(adjustl(aname(4)))
1757 if (this%irewet == 1)
then
1758 if (this%iwetdry == 0)
then
1759 write (errmsg,
'(a, a, a)')
'Error in GRIDDATA block: ', &
1760 trim(adjustl(aname(5))),
' not found.'
1766 if (this%iangle1 /= 0)
then
1767 do n = 1,
size(this%angle1)
1768 this%angle1(n) = this%angle1(n) *
dpio180
1771 if (this%ixt3d /= 0)
then
1773 write (this%iout,
'(a)')
'XT3D IN USE, BUT ANGLE1 NOT SPECIFIED. '// &
1774 'SETTING ANGLE1 TO ZERO.'
1775 do n = 1,
size(this%angle1)
1776 this%angle1(n) = dzero
1780 if (this%iangle2 /= 0)
then
1781 if (this%iangle1 == 0)
then
1782 write (errmsg,
'(a)')
'ANGLE2 SPECIFIED BUT NOT ANGLE1. '// &
1783 'ANGLE2 REQUIRES ANGLE1. '
1786 if (this%iangle3 == 0)
then
1787 write (errmsg,
'(a)')
'ANGLE2 SPECIFIED BUT NOT ANGLE3. '// &
1788 'SPECIFY BOTH OR NEITHER ONE. '
1791 do n = 1,
size(this%angle2)
1792 this%angle2(n) = this%angle2(n) *
dpio180
1795 if (this%iangle3 /= 0)
then
1796 if (this%iangle1 == 0)
then
1797 write (errmsg,
'(a)')
'ANGLE3 SPECIFIED BUT NOT ANGLE1. '// &
1798 'ANGLE3 REQUIRES ANGLE1. '
1801 if (this%iangle2 == 0)
then
1802 write (errmsg,
'(a)')
'ANGLE3 SPECIFIED BUT NOT ANGLE2. '// &
1803 'SPECIFY BOTH OR NEITHER ONE. '
1806 do n = 1,
size(this%angle3)
1807 this%angle3(n) = this%angle3(n) *
dpio180
1834 integer(I4B) :: n, m, ii, nn
1835 real(DP) :: hyn, hym
1836 real(DP) :: satn, topn, botn
1837 integer(I4B) :: nextn
1838 real(DP) :: minbot, botm
1840 character(len=LINELENGTH) :: cellstr, errmsg
1842 character(len=*),
parameter :: fmtcnv = &
1844 &' ELIMINATED BECAUSE ALL HYDRAULIC CONDUCTIVITIES TO NODE ARE 0.')"
1845 character(len=*),
parameter :: fmtnct = &
1846 &
"(1X,'Negative cell thickness at cell ', A)"
1847 character(len=*),
parameter :: fmtihbe = &
1848 &
"(1X,'Initial head, bottom elevation:',1P,2G13.5)"
1849 character(len=*),
parameter :: fmttebe = &
1850 &
"(1X,'Top elevation, bottom elevation:',1P,2G13.5)"
1852 do n = 1, this%dis%nodes
1853 this%ithickstartflag(n) = 0
1859 nodeloop:
do n = 1, this%dis%nodes
1862 if (this%ibound(n) == 0)
then
1863 if (this%irewet /= 0)
then
1864 if (this%wetdry(n) == dzero) cycle nodeloop
1871 if (this%k11(n) /= dzero) cycle nodeloop
1875 do ii = this%dis%con%ia(n) + 1, this%dis%con%ia(n + 1) - 1
1876 m = this%dis%con%ja(ii)
1877 if (this%dis%con%ihc(this%dis%con%jas(ii)) == 0)
then
1879 if (this%ik33 /= 0) hyn = this%k33(n)
1880 if (hyn /= dzero)
then
1882 if (this%ik33 /= 0) hym = this%k33(m)
1883 if (hym /= dzero) cycle
1891 this%hnew(n) = this%hnoflo
1892 if (this%irewet /= 0) this%wetdry(n) = dzero
1893 call this%dis%noder_to_string(n, cellstr)
1894 write (this%iout, fmtcnv) trim(adjustl(cellstr))
1899 if (this%inewton == 0)
then
1902 call this%wd(0, this%hnew)
1908 if (this%ivarcv == 1)
then
1909 do n = 1, this%dis%nodes
1910 if (this%hnew(n) < this%dis%bot(n))
then
1911 this%hnew(n) = this%dis%bot(n) + dem6
1919 if (this%ithickstrt == 0)
then
1920 do n = 1, this%dis%nodes
1921 if (this%icelltype(n) < 0)
then
1922 this%icelltype(n) = 1
1932 do n = 1, this%dis%nodes
1933 if (this%ibound(n) == 0)
then
1935 if (this%icelltype(n) < 0 .and. this%ithickstrt /= 0)
then
1936 this%ithickstartflag(n) = 1
1937 this%icelltype(n) = 0
1940 topn = this%dis%top(n)
1941 botn = this%dis%bot(n)
1942 if (this%icelltype(n) < 0 .and. this%ithickstrt /= 0)
then
1943 call this%thksat(n, this%ic%strt(n), satn)
1944 if (botn > this%ic%strt(n))
then
1945 call this%dis%noder_to_string(n, cellstr)
1946 write (errmsg, fmtnct) trim(adjustl(cellstr))
1948 write (errmsg, fmtihbe) this%ic%strt(n), botn
1951 this%ithickstartflag(n) = 1
1952 this%icelltype(n) = 0
1955 if (botn > topn)
then
1956 call this%dis%noder_to_string(n, cellstr)
1957 write (errmsg, fmtnct) trim(adjustl(cellstr))
1959 write (errmsg, fmttebe) topn, botn
1972 if (this%ixt3d == 0)
then
1977 do n = 1, this%dis%nodes
1978 call this%calc_condsat(n, .true.)
1984 if (this%igwfnewtonur /= 0)
then
1986 trim(this%memoryPath))
1987 do n = 1, this%dis%nodes
1989 minbot = this%dis%bot(n)
1992 do while (.not. finished)
1996 do ii = this%dis%con%ia(nn) + 1, this%dis%con%ia(nn + 1) - 1
1999 m = this%dis%con%ja(ii)
2000 botm = this%dis%bot(m)
2003 if (this%dis%con%ihc(this%dis%con%jas(ii)) == 0)
then
2004 if (m > nn .and. botm < minbot)
then
2016 this%ibotnode(n) = nn
2021 this%igwfnewtonur => null()
2032 integer(I4B),
intent(in) :: node
2033 logical,
intent(in) :: upperOnly
2035 integer(I4B) :: ii, m, n, ihc, jj
2036 real(DP) :: topm, topn, topnode, botm, botn, botnode, satm, satn, satnode
2037 real(DP) :: hyn, hym, hn, hm, fawidth, csat
2039 satnode = this%calc_initial_sat(node)
2041 topnode = this%dis%top(node)
2042 botnode = this%dis%bot(node)
2045 do ii = this%dis%con%ia(node) + 1, this%dis%con%ia(node + 1) - 1
2049 m = this%dis%con%ja(ii)
2050 jj = this%dis%con%jas(ii)
2052 if (upperonly) cycle
2059 topn = this%dis%top(n)
2060 botn = this%dis%bot(n)
2061 satn = this%calc_initial_sat(n)
2068 topm = this%dis%top(m)
2069 botm = this%dis%bot(m)
2070 satm = this%calc_initial_sat(m)
2073 ihc = this%dis%con%ihc(jj)
2074 hyn = this%hy_eff(n, m, ihc, ipos=ii)
2075 hym = this%hy_eff(m, n, ihc, ipos=ii)
2076 if (this%ithickstartflag(n) == 0)
then
2079 hn = this%ic%strt(n)
2081 if (this%ithickstartflag(m) == 0)
then
2084 hm = this%ic%strt(m)
2092 csat =
vcond(1, 1, 1, 1, 0, 1, 1,
done, &
2098 this%dis%con%hwva(jj))
2102 fawidth = this%dis%con%hwva(jj)
2103 csat =
hcond(1, 1, 1, 1, 0, &
2107 hn, hm, satn, satm, hyn, hym, &
2110 this%dis%con%cl1(jj), &
2111 this%dis%con%cl2(jj), &
2114 this%condsat(jj) = csat
2128 integer(I4B),
intent(in) :: n
2133 if (this%ibound(n) /= 0 .and. this%ithickstartflag(n) /= 0)
then
2134 call this%thksat(n, this%ic%strt(n), satn)
2147 integer(I4B),
intent(in) :: kiter
2148 real(DP),
intent(inout),
dimension(:) :: hnew
2150 integer(I4B) :: n, m, ii, ihc
2151 real(DP) :: ttop, bbot, thick
2152 integer(I4B) :: ncnvrt, ihdcnv
2153 character(len=30),
dimension(5) :: nodcnvrt
2154 character(len=30) :: nodestr
2155 character(len=3),
dimension(5) :: acnvrt
2156 character(len=LINELENGTH) :: errmsg
2157 integer(I4B) :: irewet
2159 character(len=*),
parameter :: fmtnct = &
2160 "(1X,/1X,'Negative cell thickness at (layer,row,col)', &
2162 character(len=*),
parameter :: fmttopbot = &
2163 &
"(1X,'Top elevation, bottom elevation:',1P,2G13.5)"
2164 character(len=*),
parameter :: fmttopbotthk = &
2165 &
"(1X,'Top elevation, bottom elevation, thickness:',1P,3G13.5)"
2166 character(len=*),
parameter :: fmtdrychd = &
2167 &
"(1X,/1X,'CONSTANT-HEAD CELL WENT DRY -- SIMULATION ABORTED')"
2168 character(len=*),
parameter :: fmtni = &
2169 &
"(1X,'CELLID=',a,' ITERATION=',I0,' TIME STEP=',I0,' STRESS PERIOD=',I0)"
2176 do n = 1, this%dis%nodes
2177 do ii = this%dis%con%ia(n) + 1, this%dis%con%ia(n + 1) - 1
2178 m = this%dis%con%ja(ii)
2179 ihc = this%dis%con%ihc(this%dis%con%jas(ii))
2180 call this%rewet_check(kiter, n, hnew(m), this%ibound(m), ihc, hnew, &
2182 if (irewet == 1)
then
2183 call this%wdmsg(2, ncnvrt, nodcnvrt, acnvrt, ihdcnv, kiter, n)
2189 do n = 1, this%dis%nodes
2192 if (this%ibound(n) == 0) cycle
2193 if (this%icelltype(n) == 0) cycle
2196 bbot = this%dis%bot(n)
2197 ttop = this%dis%top(n)
2198 if (bbot > ttop)
then
2199 write (errmsg, fmtnct) n
2201 write (errmsg, fmttopbot) ttop, bbot
2207 if (this%icelltype(n) /= 0)
then
2208 if (hnew(n) < ttop) ttop = hnew(n)
2213 if (thick <= dzero)
then
2214 call this%wdmsg(1, ncnvrt, nodcnvrt, acnvrt, ihdcnv, kiter, n)
2216 if (this%ibound(n) < 0)
then
2217 errmsg =
'CONSTANT-HEAD CELL WENT DRY -- SIMULATION ABORTED'
2219 write (errmsg, fmttopbotthk) ttop, bbot, thick
2221 call this%dis%noder_to_string(n, nodestr)
2222 write (errmsg, fmtni) trim(adjustl(nodestr)), kiter,
kstp,
kper
2231 call this%wdmsg(0, ncnvrt, nodcnvrt, acnvrt, ihdcnv, kiter, n)
2234 do n = 1, this%dis%nodes
2235 if (this%ibound(n) == 30000) this%ibound(n) = 1
2246 subroutine rewet_check(this, kiter, node, hm, ibdm, ihc, hnew, irewet)
2249 integer(I4B),
intent(in) :: kiter
2250 integer(I4B),
intent(in) :: node
2251 real(DP),
intent(in) :: hm
2252 integer(I4B),
intent(in) :: ibdm
2253 integer(I4B),
intent(in) :: ihc
2254 real(DP),
intent(inout),
dimension(:) :: hnew
2255 integer(I4B),
intent(out) :: irewet
2257 integer(I4B) :: itflg
2258 real(DP) :: wd, awd, turnon, bbot
2263 if (this%irewet > 0)
then
2264 itflg = mod(kiter, this%iwetit)
2265 if (itflg == 0)
then
2266 if (this%ibound(node) == 0 .and. this%wetdry(node) /=
dzero)
then
2269 bbot = this%dis%bot(node)
2270 wd = this%wetdry(node)
2272 if (wd < 0) awd = -wd
2280 if (ibdm > 0 .and. hm >= turnon) irewet = 1
2282 if (wd >
dzero)
then
2285 if (ibdm > 0 .and. hm >= turnon) irewet = 1
2289 if (irewet == 1)
then
2292 if (this%ihdwet == 0)
then
2293 hnew(node) = bbot + this%wetfct * (hm - bbot)
2295 hnew(node) = bbot + this%wetfct * awd
2297 this%ibound(node) = 30000
2312 integer(I4B),
intent(in) :: icode
2313 integer(I4B),
intent(inout) :: ncnvrt
2314 character(len=30),
dimension(5),
intent(inout) :: nodcnvrt
2315 character(len=3),
dimension(5),
intent(inout) :: acnvrt
2316 integer(I4B),
intent(inout) :: ihdcnv
2317 integer(I4B),
intent(in) :: kiter
2318 integer(I4B),
intent(in) :: n
2322 character(len=*),
parameter :: fmtcnvtn = &
2323 "(1X,/1X,'CELL CONVERSIONS FOR ITER.=',I0, &
2324 &' STEP=',I0,' PERIOD=',I0,' (NODE or LRC)')"
2325 character(len=*),
parameter :: fmtnode =
"(1X,3X,5(A4, A20))"
2330 call this%dis%noder_to_string(n, nodcnvrt(ncnvrt))
2331 if (icode == 1)
then
2332 acnvrt(ncnvrt) =
'DRY'
2334 acnvrt(ncnvrt) =
'WET'
2340 if (ncnvrt == 5 .or. (icode == 0 .and. ncnvrt > 0))
then
2341 if (ihdcnv == 0)
write (this%iout, fmtcnvtn) kiter,
kstp,
kper
2343 write (this%iout, fmtnode) &
2344 (acnvrt(l), trim(adjustl(nodcnvrt(l))), l=1, ncnvrt)
2359 function hy_eff(this, n, m, ihc, ipos, vg)
result(hy)
2364 integer(I4B),
intent(in) :: n
2365 integer(I4B),
intent(in) :: m
2366 integer(I4B),
intent(in) :: ihc
2367 integer(I4B),
intent(in),
optional :: ipos
2368 real(dp),
dimension(3),
intent(in),
optional :: vg
2370 integer(I4B) :: iipos
2371 real(dp) :: hy11, hy22, hy33
2372 real(dp) :: ang1, ang2, ang3
2373 real(dp) :: vg1, vg2, vg3
2377 if (
present(ipos)) iipos = ipos
2391 if (this%iangle2 > 0)
then
2392 if (
present(vg))
then
2397 call this%dis%connection_normal(n, m, ihc, vg1, vg2, vg3, iipos)
2399 ang1 = this%angle1(n)
2400 ang2 = this%angle2(n)
2402 if (this%iangle3 > 0) ang3 = this%angle3(n)
2403 hy =
hyeff(hy11, hy22, hy33, ang1, ang2, ang3, vg1, vg2, vg3, &
2411 if (this%ik22 > 0)
then
2412 if (
present(vg))
then
2417 call this%dis%connection_normal(n, m, ihc, vg1, vg2, vg3, iipos)
2422 if (this%iangle1 > 0)
then
2423 ang1 = this%angle1(n)
2424 if (this%iangle2 > 0)
then
2425 ang2 = this%angle2(n)
2426 if (this%iangle3 > 0) ang3 = this%angle3(n)
2429 hy =
hyeff(hy11, hy22, hy33, ang1, ang2, ang3, vg1, vg2, vg3, &
2443 real(DP),
intent(in),
dimension(:) :: flowja
2447 integer(I4B) :: ipos
2448 integer(I4B) :: iedge
2449 integer(I4B) :: isympos
2477 logical :: nozee = .true.
2481 if (this%icalcspdis /= 0 .and. this%dis%con%ianglex == 0)
then
2482 call store_error(
'Error. ANGLDEGX not provided in '// &
2483 'discretization file. ANGLDEGX required for '// &
2484 'calculation of specific discharge.', terminate=.true.)
2487 swa => this%spdis_wa
2488 if (.not. swa%is_created())
then
2490 call this%spdis_wa%create(this%calc_max_conns())
2493 if (this%nedges > 0)
call this%prepare_edge_lookup()
2497 do n = 1, this%dis%nodes
2507 do ipos = this%dis%con%ia(n) + 1, this%dis%con%ia(n + 1) - 1
2508 m = this%dis%con%ja(ipos)
2509 isympos = this%dis%con%jas(ipos)
2510 ihc = this%dis%con%ihc(isympos)
2511 area = this%dis%con%hwva(isympos)
2517 call this%dis%connection_vector(n, m, nozee, this%sat(n), this%sat(m), &
2518 ihc, xc, yc, zc, dltot)
2519 cl1 = this%dis%con%cl1(isympos)
2520 cl2 = this%dis%con%cl2(isympos)
2522 cl1 = this%dis%con%cl2(isympos)
2523 cl2 = this%dis%con%cl1(isympos)
2525 ooclsum =
done / (cl1 + cl2)
2526 swa%diz(iz) = dltot * cl1 * ooclsum
2529 swa%viz(iz) = qz / area
2534 dz =
thksatnm(this%ibound(n), this%ibound(m), &
2535 this%icelltype(n), this%icelltype(m), &
2536 this%inewton, ihc, &
2537 this%hnew(n), this%hnew(m), this%sat(n), this%sat(m), &
2538 this%dis%top(n), this%dis%top(m), this%dis%bot(n), &
2541 call this%dis%connection_normal(n, m, ihc, xn, yn, zn, ipos)
2542 call this%dis%connection_vector(n, m, nozee, this%sat(n), this%sat(m), &
2543 ihc, xc, yc, zc, dltot)
2544 cl1 = this%dis%con%cl1(isympos)
2545 cl2 = this%dis%con%cl2(isympos)
2547 cl1 = this%dis%con%cl2(isympos)
2548 cl2 = this%dis%con%cl1(isympos)
2550 ooclsum =
done / (cl1 + cl2)
2553 swa%di(ic) = dltot * cl1 * ooclsum
2554 if (area >
dzero)
then
2555 swa%vi(ic) = flowja(ipos) / area
2563 if (this%nedges > 0)
then
2564 do ipos = this%iedge_ptr(n), this%iedge_ptr(n + 1) - 1
2565 iedge = this%edge_idxs(ipos)
2568 ihc = this%ihcedge(iedge)
2569 area = this%propsedge(2, iedge)
2572 swa%viz(iz) = this%propsedge(1, iedge) / area
2573 swa%diz(iz) = this%propsedge(5, iedge)
2576 swa%nix(ic) = -this%propsedge(3, iedge)
2577 swa%niy(ic) = -this%propsedge(4, iedge)
2578 swa%di(ic) = this%propsedge(5, iedge)
2579 if (area >
dzero)
then
2580 swa%vi(ic) = this%propsedge(1, iedge) / area
2598 dsumz = dsumz + swa%diz(iz)
2600 denom = (ncz -
done)
2602 dsumz = dsumz +
dem10 * dsumz
2604 if (dsumz >
dzero) swa%wiz(iz) =
done - swa%diz(iz) / dsumz
2606 swa%wiz(iz) = swa%wiz(iz) / denom
2614 vz = vz + swa%wiz(iz) * swa%viz(iz)
2623 swa%wix(ic) = swa%di(ic) * abs(swa%nix(ic))
2624 swa%wiy(ic) = swa%di(ic) * abs(swa%niy(ic))
2625 dsumx = dsumx + swa%wix(ic)
2626 dsumy = dsumy + swa%wiy(ic)
2633 dsumx = dsumx +
dem10 * dsumx
2634 dsumy = dsumy +
dem10 * dsumy
2636 swa%wix(ic) = (dsumx - swa%wix(ic)) * abs(swa%nix(ic))
2637 swa%wiy(ic) = (dsumy - swa%wiy(ic)) * abs(swa%niy(ic))
2644 swa%bix(ic) = swa%wix(ic) * sign(
done, swa%nix(ic))
2645 swa%biy(ic) = swa%wiy(ic) * sign(
done, swa%niy(ic))
2646 dsumx = dsumx + swa%wix(ic) * abs(swa%nix(ic))
2647 dsumy = dsumy + swa%wiy(ic) * abs(swa%niy(ic))
2654 swa%bix(ic) = swa%bix(ic) * dsumx
2655 swa%biy(ic) = swa%biy(ic) * dsumy
2656 axy = axy + swa%bix(ic) * swa%niy(ic)
2657 ayx = ayx + swa%biy(ic) * swa%nix(ic)
2670 vx = vx + (swa%bix(ic) - axy * swa%biy(ic)) * swa%vi(ic)
2671 vy = vy + (swa%biy(ic) - ayx * swa%bix(ic)) * swa%vi(ic)
2673 denom =
done - axy * ayx
2674 if (denom /=
dzero)
then
2679 this%spdis(1, n) = vx
2680 this%spdis(2, n) = vy
2681 this%spdis(3, n) = vz
2692 integer(I4B),
intent(in) :: ibinun
2694 character(len=16) :: text
2695 character(len=16),
dimension(3) :: auxtxt
2697 integer(I4B) :: naux
2700 text =
' DATA-SPDIS'
2702 auxtxt(:) = [
' qx',
' qy',
' qz']
2703 call this%dis%record_srcdst_list_header(text, this%name_model, &
2704 this%packName, this%name_model, &
2705 this%packName, naux, auxtxt, ibinun, &
2706 this%dis%nodes, this%iout)
2709 do n = 1, this%dis%nodes
2710 call this%dis%record_mf6_list_entry(ibinun, n, n,
dzero, naux, &
2720 integer(I4B),
intent(in) :: ibinun
2722 character(len=16) :: text
2723 character(len=16),
dimension(1) :: auxtxt
2724 real(DP),
dimension(1) :: a
2726 integer(I4B) :: naux
2731 auxtxt(:) = [
' sat']
2732 call this%dis%record_srcdst_list_header(text, this%name_model, &
2733 this%packName, this%name_model, &
2734 this%packName, naux, auxtxt, ibinun, &
2735 this%dis%nodes, this%iout)
2738 do n = 1, this%dis%nodes
2740 call this%dis%record_mf6_list_entry(ibinun, n, n,
dzero, naux, a)
2752 integer(I4B),
intent(in) :: nedges
2754 this%nedges = this%nedges + nedges
2761 integer(I4B) :: max_conns
2763 integer(I4B) :: n, m, ic
2766 do n = 1, this%dis%nodes
2769 ic = this%dis%con%ia(n + 1) - this%dis%con%ia(n) - 1
2772 do m = 1, this%nedges
2773 if (this%nodedge(m) == n)
then
2779 if (ic > max_conns) max_conns = ic
2790 integer(I4B),
intent(in) :: nodedge
2791 integer(I4B),
intent(in) :: ihcedge
2792 real(DP),
intent(in) :: q
2793 real(DP),
intent(in) :: area
2794 real(DP),
intent(in) :: nx
2795 real(DP),
intent(in) :: ny
2796 real(DP),
intent(in) :: distance
2798 integer(I4B) :: lastedge
2800 this%lastedge = this%lastedge + 1
2801 lastedge = this%lastedge
2802 this%nodedge(lastedge) = nodedge
2803 this%ihcedge(lastedge) = ihcedge
2804 this%propsedge(1, lastedge) = q
2805 this%propsedge(2, lastedge) = area
2806 this%propsedge(3, lastedge) = nx
2807 this%propsedge(4, lastedge) = ny
2808 this%propsedge(5, lastedge) = distance
2812 if (this%lastedge == this%nedges) this%lastedge = 0
2818 integer(I4B) :: i, inode, iedge
2819 integer(I4B) :: n, start, end
2820 integer(I4B) :: prev_cnt, strt_idx, ipos
2822 do i = 1,
size(this%iedge_ptr)
2823 this%iedge_ptr(i) = 0
2825 do i = 1,
size(this%edge_idxs)
2826 this%edge_idxs(i) = 0
2830 do iedge = 1, this%nedges
2831 n = this%nodedge(iedge)
2832 this%iedge_ptr(n) = this%iedge_ptr(n) + 1
2836 prev_cnt = this%iedge_ptr(1)
2837 this%iedge_ptr(1) = 1
2838 do inode = 2, this%dis%nodes + 1
2839 strt_idx = this%iedge_ptr(inode - 1) + prev_cnt
2840 prev_cnt = this%iedge_ptr(inode)
2841 this%iedge_ptr(inode) = strt_idx
2845 do iedge = 1, this%nedges
2846 n = this%nodedge(iedge)
2847 start = this%iedge_ptr(n)
2848 end = this%iedge_ptr(n + 1) - 1
2849 do ipos = start,
end
2850 if (this%edge_idxs(ipos) > 0) cycle
2851 this%edge_idxs(ipos) = iedge
2867 real(dp) :: satthickness
2869 satthickness = thksatnm(this%ibound(n), &
2871 this%icelltype(n), &
2872 this%icelltype(m), &
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
@ c3d_vertical
vertical connection
real(dp), parameter dhdry
real dry cell constant
real(dp), parameter dp9
real constant 9/10
real(dp), parameter dem10
real constant 1e-10
real(dp), parameter dem7
real constant 1e-7
real(dp), parameter dem8
real constant 1e-8
integer(i4b), parameter lenbigline
maximum length of a big line
real(dp), parameter dhnoflo
real no flow constant
integer(i4b), parameter lenvarname
maximum length of a variable name
real(dp), parameter dhalf
real constant 1/2
real(dp), parameter dpio180
real constant
real(dp), parameter dem6
real constant 1e-6
real(dp), parameter dzero
real constant zero
real(dp), parameter dem9
real constant 1e-9
real(dp), parameter dem2
real constant 1e-2
real(dp), parameter dtwo
real constant 2
integer(i4b), parameter lenmempath
maximum length of the memory path
real(dp), parameter done
real constant 1
This module contains stateless conductance functions.
real(dp) function, public thksatnm(ibdn, ibdm, ictn, ictm, iupstream, ihc, hn, hm, satn, satm, topn, topm, botn, botm)
Calculate wetted cell thickness at interface between two cells.
real(dp) function, public condmean(k1, k2, thick1, thick2, cl1, cl2, width, iavgmeth)
Calculate the conductance between two cells.
real(dp) function, public hcond(ibdn, ibdm, ictn, ictm, iupstream, ihc, icellavg, condsat, hn, hm, satn, satm, hkn, hkm, topn, topm, botn, botm, cln, clm, fawidth)
Horizontal conductance between two cells.
@, public ccond_hmean
Harmonic mean.
real(dp) function, public vcond(ibdn, ibdm, ictn, ictm, inewton, ivarcv, idewatcv, condsat, hn, hm, vkn, vkm, satn, satm, topn, topm, botn, botm, flowarea)
Vertical conductance between two cells.
subroutine set_options(this, options)
Set options in the NPF object.
subroutine npf_save_model_flows(this, flowja, icbcfl, icbcun)
Record flowja and calculate specific discharge if requested.
subroutine source_options(this)
Update simulation options from input mempath.
real(dp) function calc_initial_sat(this, n)
Calculate initial saturation for the given node.
subroutine calc_condsat(this, node, upperOnly)
Calculate CONDSAT array entries for the given node.
subroutine rewet_check(this, kiter, node, hm, ibdm, ihc, hnew, irewet)
Determine if a cell should rewet.
integer(i4b) function calc_max_conns(this)
Calculate the maximum number of connections for any cell.
subroutine npf_mc(this, moffset, matrix_sln)
Map connections and construct iax, jax, and idxglox.
subroutine npf_fc(this, kiter, matrix_sln, idxglo, rhs, hnew)
Formulate coefficients.
subroutine npf_ac(this, moffset, sparse)
Add connections for extended neighbors to the sparse matrix.
subroutine sgwf_npf_wetdry(this, kiter, hnew)
Perform wetting and drying.
subroutine source_griddata(this)
Update simulation griddata from input mempath.
subroutine npf_nur(this, neqmod, x, xtemp, dx, inewtonur, dxmax, locmax)
Under-relaxation.
subroutine sav_spdis(this, ibinun)
Save specific discharge in binary format to ibinun.
subroutine sgwf_npf_thksat(this, n, hn, thksat)
Fractional cell saturation.
subroutine preprocess_input(this)
preprocess the NPF input data
subroutine set_edge_properties(this, nodedge, ihcedge, q, area, nx, ny, distance)
Provide the npf package with edge properties.
subroutine prepare_edge_lookup(this)
subroutine npf_da(this)
Deallocate variables.
subroutine log_griddata(this, found)
Write dimensions to list file.
real(dp) function hy_eff(this, n, m, ihc, ipos, vg)
Calculate the effective hydraulic conductivity for the n-m connection.
subroutine calc_spdis(this, flowja)
Calculate the 3 components of specific discharge at the cell center.
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 increase_edge_count(this, nedges)
Reserve space for nedges cells that have an edge on them.
subroutine npf_fn(this, kiter, matrix_sln, idxglo, rhs, hnew)
Fill newton terms.
subroutine log_options(this, found)
Log npf options sourced from the input mempath.
subroutine npf_print_model_flows(this, ibudfl, flowja)
Print budget.
subroutine allocate_arrays(this, ncells, njas)
Allocate npf arrays.
subroutine sav_sat(this, ibinun)
Save saturation in binary format to ibinun.
subroutine prepcheck(this)
Initialize and check NPF data.
subroutine npf_df(this, dis, xt3d, ingnc, invsc, npf_options)
Define the NPF package instance.
subroutine highest_cell_saturation(this, n, m, hn, hm, satn, satm)
Calculate dry cell saturation.
subroutine npf_ad(this, nodes, hold, hnew, irestore)
Advance.
subroutine sgwf_npf_wdmsg(this, icode, ncnvrt, nodcnvrt, acnvrt, ihdcnv, kiter, n)
Print wet/dry message.
subroutine sgwf_npf_qcalc(this, n, m, hn, hm, icon, qnm)
Flow between two cells.
subroutine npf_rp(this)
Read and prepare method for package.
real(dp) function calcsatthickness(this, n, m, ihc)
Calculate saturated thickness between cell n and m.
subroutine store_original_k_arrays(this, ncells, njas)
@ brief Store backup copy of hydraulic conductivity when the VSC package is activate
subroutine allocate_scalars(this)
@ brief Allocate scalars
subroutine npf_cq(this, hnew, flowja)
Calculate flowja.
subroutine npf_ar(this, ic, vsc, ibound, hnew)
Allocate and read this NPF instance.
subroutine check_options(this)
Check for conflicting NPF options.
subroutine npf_cf(this, kiter, nodes, hnew)
Routines associated fill coefficients.
General-purpose hydrogeologic functions.
real(dp) function, public hyeff(k11, k22, k33, ang1, ang2, ang3, vg1, vg2, vg3, iavgmeth)
Calculate the effective horizontal hydraulic conductivity from an ellipse using a specified direction...
This module defines variable data types.
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 get_isize(name, mem_path, isize)
@ brief Get the number of elements for this variable
This module contains the base numerical package type.
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
character(len=maxcharlen) warnmsg
warning message string
real(dp) function squadraticsaturation(top, bot, x, eps)
@ brief sQuadraticSaturation
real(dp) function squadraticsaturationderivative(top, bot, x, eps)
@ brief Derivative of the quadratic saturation function
This module contains the SourceCommonModule.
logical(lgp) function, public filein_fname(filename, tagname, input_mempath, input_fname)
enforce and set a single input filename provided via FILEIN keyword
integer(i4b), pointer, public kstp
current time step number
integer(i4b), pointer, public kper
current stress period number
This module contains time-varying conductivity package methods.
subroutine, public tvk_cr(tvk, name_model, inunit, iout)
Create a new TvkType object.
subroutine, public xt3d_cr(xt3dobj, name_model, inunit, iout, ldispopt)
Create a new xt3d object.
This class is used to store a single deferred-length character string. It was designed to work in an ...
Data structure and helper methods for passing NPF options into npf_df, as an alternative to reading t...
Helper class with work arrays for the SPDIS calculation in NPF.