39 integer(I4B),
pointer :: iname => null()
40 character(len=24),
dimension(:),
pointer :: aname => null()
41 integer(I4B),
dimension(:),
pointer,
contiguous :: ibound => null()
42 real(dp),
dimension(:),
pointer,
contiguous :: hnew => null()
43 integer(I4B),
pointer :: ixt3d => null()
44 integer(I4B),
pointer :: ixt3drhs => null()
45 integer(I4B),
pointer :: iperched => null()
46 integer(I4B),
pointer :: ivarcv => null()
47 integer(I4B),
pointer :: idewatcv => null()
48 integer(I4B),
pointer :: ithickstrt => null()
49 integer(I4B),
pointer :: ihighcellsat => null()
50 integer(I4B),
pointer :: igwfnewtonur => null()
51 integer(I4B),
pointer :: icalcspdis => null()
52 integer(I4B),
pointer :: isavspdis => null()
53 integer(I4B),
pointer :: isavsat => null()
54 real(dp),
pointer :: hnoflo => null()
55 real(dp),
pointer :: satomega => null()
56 integer(I4B),
pointer :: irewet => null()
57 integer(I4B),
pointer :: iwetit => null()
58 integer(I4B),
pointer :: ihdwet => null()
59 integer(I4B),
pointer :: icellavg => null()
60 real(dp),
pointer :: wetfct => null()
61 real(dp),
pointer :: hdry => null()
62 integer(I4B),
dimension(:),
pointer,
contiguous :: icelltype => null()
63 integer(I4B),
dimension(:),
pointer,
contiguous :: ithickstartflag => null()
66 real(dp),
dimension(:),
pointer,
contiguous :: k11 => null()
67 real(dp),
dimension(:),
pointer,
contiguous :: k22 => null()
68 real(dp),
dimension(:),
pointer,
contiguous :: k33 => null()
69 real(dp),
dimension(:),
pointer,
contiguous :: k11input => null()
70 real(dp),
dimension(:),
pointer,
contiguous :: k22input => null()
71 real(dp),
dimension(:),
pointer,
contiguous :: k33input => null()
72 integer(I4B),
pointer :: iavgkeff => null()
73 integer(I4B),
pointer :: ik22 => null()
74 integer(I4B),
pointer :: ik33 => null()
75 integer(I4B),
pointer :: ik22overk => null()
76 integer(I4B),
pointer :: ik33overk => null()
77 integer(I4B),
pointer :: iangle1 => null()
78 integer(I4B),
pointer :: iangle2 => null()
79 integer(I4B),
pointer :: iangle3 => null()
80 real(dp),
dimension(:),
pointer,
contiguous :: angle1 => null()
81 real(dp),
dimension(:),
pointer,
contiguous :: angle2 => null()
82 real(dp),
dimension(:),
pointer,
contiguous :: angle3 => null()
84 integer(I4B),
pointer :: iwetdry => null()
85 real(dp),
dimension(:),
pointer,
contiguous :: wetdry => null()
86 real(dp),
dimension(:),
pointer,
contiguous :: sat => null()
87 real(dp),
dimension(:),
pointer,
contiguous :: condsat => null()
88 integer(I4B),
dimension(:),
pointer,
contiguous :: ibotnode => null()
90 real(dp),
dimension(:, :),
pointer,
contiguous :: spdis => null()
91 integer(I4B),
pointer :: nedges => null()
92 integer(I4B),
pointer :: lastedge => null()
93 integer(I4B),
dimension(:),
pointer,
contiguous :: nodedge => null()
94 integer(I4B),
dimension(:),
pointer,
contiguous :: ihcedge => null()
95 real(dp),
dimension(:, :),
pointer,
contiguous :: propsedge => null()
96 integer(I4B),
dimension(:),
pointer,
contiguous :: iedge_ptr => null()
97 integer(I4B),
dimension(:),
pointer,
contiguous :: edge_idxs => null()
100 integer(I4B),
pointer :: intvk => null()
101 integer(I4B),
pointer :: invsc => null()
103 integer(I4B),
pointer :: kchangeper => null()
104 integer(I4B),
pointer :: kchangestp => null()
105 integer(I4B),
dimension(:),
pointer,
contiguous :: nodekchange => null()
158 subroutine npf_cr(npfobj, name_model, input_mempath, inunit, iout)
164 character(len=*),
intent(in) :: name_model
165 character(len=*),
intent(in) :: input_mempath
166 integer(I4B),
intent(in) :: inunit
167 integer(I4B),
intent(in) :: iout
169 character(len=*),
parameter :: fmtheader = &
170 "(1x, /1x, 'NPF -- NODE PROPERTY FLOW PACKAGE, VERSION 1, 3/30/2015', &
171 &' INPUT READ FROM MEMPATH: ', A, /)"
177 call npfobj%set_names(1, name_model,
'NPF',
'NPF', input_mempath)
180 call npfobj%allocate_scalars()
183 npfobj%inunit = inunit
190 write (iout, fmtheader) input_mempath
194 allocate (npfobj%spdis_wa)
205 subroutine npf_df(this, dis, xt3d, ingnc, invsc, npf_options)
213 integer(I4B),
intent(in) :: ingnc
214 integer(I4B),
intent(in) :: invsc
221 if (invsc > 0) this%invsc = invsc
223 if (.not.
present(npf_options))
then
226 call this%source_options()
229 call this%allocate_arrays(this%dis%nodes, this%dis%njas)
232 call this%source_griddata()
233 call this%prepcheck()
235 call this%set_options(npf_options)
238 call this%allocate_arrays(this%dis%nodes, this%dis%njas)
241 call this%check_options()
245 if (this%ixt3d /= 0) xt3d%ixt3d = this%ixt3d
246 call this%xt3d%xt3d_df(dis)
249 if (this%ixt3d /= 0 .and. ingnc > 0)
then
250 call store_error(
'Error in model '//trim(this%name_model)// &
251 '. The XT3D option cannot be used with the GNC &
252 &Package.', terminate=.true.)
263 integer(I4B),
intent(in) :: moffset
267 if (this%ixt3d /= 0)
call this%xt3d%xt3d_ac(moffset, sparse)
272 subroutine npf_mc(this, moffset, matrix_sln)
275 integer(I4B),
intent(in) :: moffset
278 if (this%ixt3d /= 0)
call this%xt3d%xt3d_mc(moffset, matrix_sln)
286 subroutine npf_ar(this, ic, vsc, ibound, hnew)
291 type(
gwfictype),
pointer,
intent(in) :: ic
293 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: ibound
294 real(DP),
dimension(:),
pointer,
contiguous,
intent(inout) :: hnew
300 this%ibound => ibound
303 if (this%icalcspdis == 1)
then
304 call mem_reallocate(this%spdis, 3, this%dis%nodes,
'SPDIS', this%memoryPath)
305 call mem_reallocate(this%nodedge, this%nedges,
'NODEDGE', this%memoryPath)
306 call mem_reallocate(this%ihcedge, this%nedges,
'IHCEDGE', this%memoryPath)
307 call mem_reallocate(this%propsedge, 5, this%nedges,
'PROPSEDGE', &
310 'NREDGESNODE', this%memoryPath)
312 'EDGEIDXS', this%memoryPath)
314 do n = 1, this%nedges
315 this%edge_idxs(n) = 0
317 do n = 1, this%dis%nodes
318 this%iedge_ptr(n) = 0
319 this%spdis(:, n) =
dzero
324 if (this%invsc /= 0)
then
329 if (this%invsc > 0)
then
341 call this%store_original_k_arrays(this%dis%nodes, this%dis%njas)
345 call this%preprocess_input()
348 if (this%ixt3d /= 0)
then
349 call this%xt3d%xt3d_ar(ibound, this%k11, this%ik33, this%k33, &
350 this%sat, this%ik22, this%k22, &
351 this%iangle1, this%iangle2, this%iangle3, &
352 this%angle1, this%angle2, this%angle3, &
353 this%inewton, this%icelltype)
357 if (this%intvk /= 0)
then
358 call this%tvk%ar(this%dis)
372 if (this%intvk /= 0)
then
381 subroutine npf_ad(this, nodes, hold, hnew, irestore)
388 integer(I4B),
intent(in) :: nodes
389 real(DP),
dimension(nodes),
intent(inout) :: hold
390 real(DP),
dimension(nodes),
intent(inout) :: hnew
391 integer(I4B),
intent(in) :: irestore
396 if (this%irewet > 0)
then
397 do n = 1, this%dis%nodes
398 if (this%wetdry(n) ==
dzero) cycle
399 if (this%ibound(n) /= 0) cycle
400 hold(n) = this%dis%bot(n)
404 do n = 1, this%dis%nodes
405 if (this%wetdry(n) ==
dzero) cycle
406 if (this%ibound(n) /= 0) cycle
412 if (this%intvk /= 0)
then
418 if (this%invsc /= 0)
then
419 call this%vsc%update_k_with_vsc()
423 if (this%kchangeper ==
kper .and. this%kchangestp ==
kstp)
then
424 if (this%ixt3d == 0)
then
428 do n = 1, this%dis%nodes
429 if (this%nodekchange(n) == 1)
then
430 call this%calc_condsat(n, .false.)
436 if (this%xt3d%lamatsaved .and. .not. this%xt3d%ldispersion)
then
437 call this%xt3d%xt3d_fcpc(this%dis%nodes, .true.)
445 subroutine npf_cf(this, kiter, nodes, hnew)
448 integer(I4B) :: kiter
449 integer(I4B),
intent(in) :: nodes
450 real(DP),
intent(inout),
dimension(nodes) :: hnew
456 if (this%inewton /= 1)
then
457 call this%wd(kiter, hnew)
461 do n = 1, this%dis%nodes
462 if (this%icelltype(n) /= 0)
then
463 if (this%ibound(n) == 0)
then
466 call this%thksat(n, hnew(n), satn)
475 subroutine npf_fc(this, kiter, matrix_sln, idxglo, rhs, hnew)
480 integer(I4B) :: kiter
482 integer(I4B),
intent(in),
dimension(:) :: idxglo
483 real(DP),
intent(inout),
dimension(:) :: rhs
484 real(DP),
intent(inout),
dimension(:) :: hnew
486 integer(I4B) :: n, m, ii, idiag, ihc
487 integer(I4B) :: isymcon, idiagm
495 if (this%ixt3d /= 0)
then
496 call this%xt3d%xt3d_fc(kiter, matrix_sln, idxglo, rhs, hnew)
498 do n = 1, this%dis%nodes
499 do ii = this%dis%con%ia(n) + 1, this%dis%con%ia(n + 1) - 1
500 if (this%dis%con%mask(ii) == 0) cycle
502 m = this%dis%con%ja(ii)
507 ihc = this%dis%con%ihc(this%dis%con%jas(ii))
508 hyn = this%hy_eff(n, m, ihc, ipos=ii)
509 hym = this%hy_eff(m, n, ihc, ipos=ii)
512 if (ihc == c3d_vertical)
then
515 cond =
vcond(this%ibound(n), this%ibound(m), &
516 this%icelltype(n), this%icelltype(m), this%inewton, &
517 this%ivarcv, this%idewatcv, &
518 this%condsat(this%dis%con%jas(ii)), hnew(n), hnew(m), &
520 this%sat(n), this%sat(m), &
521 this%dis%top(n), this%dis%top(m), &
522 this%dis%bot(n), this%dis%bot(m), &
523 this%dis%con%hwva(this%dis%con%jas(ii)))
526 if (this%iperched /= 0)
then
527 if (this%icelltype(m) /= 0)
then
528 if (hnew(m) < this%dis%top(m))
then
531 idiag = this%dis%con%ia(n)
532 rhs(n) = rhs(n) - cond * this%dis%bot(n)
533 call matrix_sln%add_value_pos(idxglo(idiag), -cond)
536 isymcon = this%dis%con%isym(ii)
537 call matrix_sln%add_value_pos(idxglo(isymcon), cond)
538 rhs(m) = rhs(m) + cond * this%dis%bot(n)
549 if (this%ihighcellsat /= 0)
then
550 call this%highest_cell_saturation(n, m, &
556 cond =
hcond(this%ibound(n), this%ibound(m), &
557 this%icelltype(n), this%icelltype(m), &
559 this%dis%con%ihc(this%dis%con%jas(ii)), &
561 this%condsat(this%dis%con%jas(ii)), &
562 hnew(n), hnew(m), satn, satm, hyn, hym, &
563 this%dis%top(n), this%dis%top(m), &
564 this%dis%bot(n), this%dis%bot(m), &
565 this%dis%con%cl1(this%dis%con%jas(ii)), &
566 this%dis%con%cl2(this%dis%con%jas(ii)), &
567 this%dis%con%hwva(this%dis%con%jas(ii)))
571 idiag = this%dis%con%ia(n)
572 call matrix_sln%add_value_pos(idxglo(ii), cond)
573 call matrix_sln%add_value_pos(idxglo(idiag), -cond)
576 isymcon = this%dis%con%isym(ii)
577 idiagm = this%dis%con%ia(m)
578 call matrix_sln%add_value_pos(idxglo(isymcon), cond)
579 call matrix_sln%add_value_pos(idxglo(idiagm), -cond)
594 integer(I4B),
intent(in) :: n, m
595 real(DP),
intent(in) :: hn, hm
596 real(DP),
intent(inout) :: satn, satm
598 integer(I4B) :: ihdbot
599 real(DP) :: botn, botm
602 botn = this%dis%bot(n)
603 botm = this%dis%bot(m)
606 if (botm > botn) ihdbot = m
610 if (abs(botm - botn) >=
dem2)
then
611 top = this%dis%top(ihdbot)
612 bot = this%dis%bot(ihdbot)
620 subroutine npf_fn(this, kiter, matrix_sln, idxglo, rhs, hnew)
623 integer(I4B) :: kiter
625 integer(I4B),
intent(in),
dimension(:) :: idxglo
626 real(DP),
intent(inout),
dimension(:) :: rhs
627 real(DP),
intent(inout),
dimension(:) :: hnew
629 integer(I4B) :: nodes, nja
630 integer(I4B) :: n, m, ii, idiag
631 integer(I4B) :: isymcon, idiagm
636 real(DP) :: filledterm
644 nodes = this%dis%nodes
645 nja = this%dis%con%nja
646 if (this%ixt3d /= 0)
then
647 call this%xt3d%xt3d_fn(kiter, nodes, nja, matrix_sln, idxglo, rhs, hnew)
651 idiag = this%dis%con%ia(n)
652 do ii = this%dis%con%ia(n) + 1, this%dis%con%ia(n + 1) - 1
653 if (this%dis%con%mask(ii) == 0) cycle
655 m = this%dis%con%ja(ii)
656 isymcon = this%dis%con%isym(ii)
659 if (this%dis%con%ihc(this%dis%con%jas(ii)) == 0 .and. &
660 this%ivarcv == 0)
then
666 if (hnew(m) < hnew(n)) iups = n
668 if (iups == n) idn = m
671 if (this%icelltype(iups) == 0) cycle
675 topup = this%dis%top(iups)
676 botup = this%dis%bot(iups)
677 if (this%dis%con%ihc(this%dis%con%jas(ii)) == 2)
then
678 topup = min(this%dis%top(n), this%dis%top(m))
679 botup = max(this%dis%bot(n), this%dis%bot(m))
683 cond = this%condsat(this%dis%con%jas(ii))
686 consterm = -cond * (hnew(iups) - hnew(idn))
688 filledterm = matrix_sln%get_value_pos(idxglo(ii))
691 idiagm = this%dis%con%ia(m)
696 term = consterm * derv
697 rhs(n) = rhs(n) + term * hnew(n)
698 rhs(m) = rhs(m) - term * hnew(n)
700 call matrix_sln%add_value_pos(idxglo(idiag), term)
702 if (this%ibound(n) > 0)
then
703 filledterm = matrix_sln%get_value_pos(idxglo(ii))
704 call matrix_sln%set_value_pos(idxglo(ii), filledterm)
707 filledterm = matrix_sln%get_value_pos(idxglo(idiagm))
708 call matrix_sln%set_value_pos(idxglo(idiagm), filledterm)
710 if (this%ibound(m) > 0)
then
711 call matrix_sln%add_value_pos(idxglo(isymcon), -term)
716 term = -consterm * derv
717 rhs(n) = rhs(n) + term * hnew(m)
718 rhs(m) = rhs(m) - term * hnew(m)
720 filledterm = matrix_sln%get_value_pos(idxglo(idiag))
721 call matrix_sln%set_value_pos(idxglo(idiag), filledterm)
723 if (this%ibound(n) > 0)
then
724 call matrix_sln%add_value_pos(idxglo(ii), term)
727 call matrix_sln%add_value_pos(idxglo(idiagm), -term)
729 if (this%ibound(m) > 0)
then
730 filledterm = matrix_sln%get_value_pos(idxglo(isymcon))
731 call matrix_sln%set_value_pos(idxglo(isymcon), filledterm)
747 subroutine npf_nur(this, neqmod, x, xtemp, dx, inewtonur, dxmax, locmax)
750 integer(I4B),
intent(in) :: neqmod
751 real(DP),
dimension(neqmod),
intent(inout) :: x
752 real(DP),
dimension(neqmod),
intent(in) :: xtemp
753 real(DP),
dimension(neqmod),
intent(inout) :: dx
754 integer(I4B),
intent(inout) :: inewtonur
755 real(DP),
intent(inout) :: dxmax
756 integer(I4B),
intent(inout) :: locmax
765 do n = 1, this%dis%nodes
766 if (this%ibound(n) < 1) cycle
767 ibot = this%ibotnode(n)
770 if (this%icelltype(n) > 0 .and. this%icelltype(ibot) > 0)
then
771 botm = this%dis%bot(ibot)
774 if (x(n) < botm)
then
778 if (abs(dxx) > abs(dxmax))
then
783 dx(n) = xtemp(n) - x(n)
794 real(DP),
intent(inout),
dimension(:) :: hnew
795 real(DP),
intent(inout),
dimension(:) :: flowja
797 integer(I4B) :: n, ipos, m
802 if (this%ixt3d /= 0)
then
803 call this%xt3d%xt3d_flowja(hnew, flowja)
806 do n = 1, this%dis%nodes
807 do ipos = this%dis%con%ia(n) + 1, this%dis%con%ia(n + 1) - 1
808 m = this%dis%con%ja(ipos)
810 call this%qcalc(n, m, hnew(n), hnew(m), ipos, qnm)
812 flowja(this%dis%con%isym(ipos)) = -qnm
824 integer(I4B),
intent(in) :: n
825 real(DP),
intent(in) :: hn
826 real(DP),
intent(inout) :: thksat
829 if (hn >= this%dis%top(n))
then
832 thksat = (hn - this%dis%bot(n)) / (this%dis%top(n) - this%dis%bot(n))
836 if (this%inewton /= 0)
then
847 integer(I4B),
intent(in) :: n
848 integer(I4B),
intent(in) :: m
849 real(DP),
intent(in) :: hn
850 real(DP),
intent(in) :: hm
851 integer(I4B),
intent(in) :: icon
852 real(DP),
intent(inout) :: qnm
856 real(DP) :: hntemp, hmtemp
857 real(DP) :: satn, satm
861 ihc = this%dis%con%ihc(this%dis%con%jas(icon))
862 hyn = this%hy_eff(n, m, ihc, ipos=icon)
863 hym = this%hy_eff(m, n, ihc, ipos=icon)
867 condnm =
vcond(this%ibound(n), this%ibound(m), &
868 this%icelltype(n), this%icelltype(m), this%inewton, &
869 this%ivarcv, this%idewatcv, &
870 this%condsat(this%dis%con%jas(icon)), hn, hm, &
872 this%sat(n), this%sat(m), &
873 this%dis%top(n), this%dis%top(m), &
874 this%dis%bot(n), this%dis%bot(m), &
875 this%dis%con%hwva(this%dis%con%jas(icon)))
879 if (this%ihighcellsat /= 0)
then
880 call this%highest_cell_saturation(n, m, hn, hm, satn, satm)
883 condnm =
hcond(this%ibound(n), this%ibound(m), &
884 this%icelltype(n), this%icelltype(m), &
886 this%dis%con%ihc(this%dis%con%jas(icon)), &
888 this%condsat(this%dis%con%jas(icon)), &
889 hn, hm, satn, satm, hyn, hym, &
890 this%dis%top(n), this%dis%top(m), &
891 this%dis%bot(n), this%dis%bot(m), &
892 this%dis%con%cl1(this%dis%con%jas(icon)), &
893 this%dis%con%cl2(this%dis%con%jas(icon)), &
894 this%dis%con%hwva(this%dis%con%jas(icon)))
902 if (this%iperched /= 0)
then
903 if (this%dis%con%ihc(this%dis%con%jas(icon)) == 0)
then
905 if (this%icelltype(n) /= 0)
then
906 if (hn < this%dis%top(n)) hntemp = this%dis%bot(m)
909 if (this%icelltype(m) /= 0)
then
910 if (hm < this%dis%top(m)) hmtemp = this%dis%bot(n)
917 qnm = condnm * (hmtemp - hntemp)
925 real(DP),
dimension(:),
intent(in) :: flowja
926 integer(I4B),
intent(in) :: icbcfl
927 integer(I4B),
intent(in) :: icbcun
929 integer(I4B) :: ibinun
932 if (this%ipakcb < 0)
then
934 elseif (this%ipakcb == 0)
then
939 if (icbcfl == 0) ibinun = 0
942 if (ibinun /= 0)
then
943 call this%dis%record_connection_array(flowja, ibinun, this%iout)
947 if (this%isavspdis /= 0)
then
948 if (ibinun /= 0)
call this%sav_spdis(ibinun)
952 if (this%isavsat /= 0)
then
953 if (ibinun /= 0)
call this%sav_sat(ibinun)
965 integer(I4B),
intent(in) :: ibudfl
966 real(DP),
intent(inout),
dimension(:) :: flowja
968 character(len=LENBIGLINE) :: line
969 character(len=30) :: tempstr
970 integer(I4B) :: n, ipos, m
973 character(len=*),
parameter :: fmtiprflow = &
974 &
"(/,4x,'CALCULATED INTERCELL FLOW FOR PERIOD ', i0, ' STEP ', i0)"
977 if (ibudfl /= 0 .and. this%iprflow > 0)
then
978 write (this%iout, fmtiprflow)
kper,
kstp
979 do n = 1, this%dis%nodes
981 call this%dis%noder_to_string(n, tempstr)
982 line = trim(tempstr)//
':'
983 do ipos = this%dis%con%ia(n) + 1, this%dis%con%ia(n + 1) - 1
984 m = this%dis%con%ja(ipos)
985 call this%dis%noder_to_string(m, tempstr)
986 line = trim(line)//
' '//trim(tempstr)
988 write (tempstr,
'(1pg15.6)') qnm
989 line = trim(line)//
' '//trim(adjustl(tempstr))
991 write (this%iout,
'(a)') trim(line)
1006 if (this%icalcspdis == 1 .and. this%spdis_wa%is_created()) &
1007 call this%spdis_wa%destroy()
1008 deallocate (this%spdis_wa)
1014 if (this%intvk /= 0)
then
1016 deallocate (this%tvk)
1020 if (this%invsc /= 0)
then
1064 deallocate (this%aname)
1088 call this%NumericalPackageType%da()
1107 call this%NumericalPackageType%allocate_scalars()
1110 call mem_allocate(this%iname,
'INAME', this%memoryPath)
1111 call mem_allocate(this%ixt3d,
'IXT3D', this%memoryPath)
1112 call mem_allocate(this%ixt3drhs,
'IXT3DRHS', this%memoryPath)
1113 call mem_allocate(this%satomega,
'SATOMEGA', this%memoryPath)
1114 call mem_allocate(this%hnoflo,
'HNOFLO', this%memoryPath)
1116 call mem_allocate(this%icellavg,
'ICELLAVG', this%memoryPath)
1117 call mem_allocate(this%iavgkeff,
'IAVGKEFF', this%memoryPath)
1120 call mem_allocate(this%ik22overk,
'IK22OVERK', this%memoryPath)
1121 call mem_allocate(this%ik33overk,
'IK33OVERK', this%memoryPath)
1122 call mem_allocate(this%iperched,
'IPERCHED', this%memoryPath)
1123 call mem_allocate(this%ivarcv,
'IVARCV', this%memoryPath)
1124 call mem_allocate(this%idewatcv,
'IDEWATCV', this%memoryPath)
1125 call mem_allocate(this%ithickstrt,
'ITHICKSTRT', this%memoryPath)
1126 call mem_allocate(this%ihighcellsat,
'IHIGHCELLSAT', this%memoryPath)
1127 call mem_allocate(this%icalcspdis,
'ICALCSPDIS', this%memoryPath)
1128 call mem_allocate(this%isavspdis,
'ISAVSPDIS', this%memoryPath)
1129 call mem_allocate(this%isavsat,
'ISAVSAT', this%memoryPath)
1130 call mem_allocate(this%irewet,
'IREWET', this%memoryPath)
1131 call mem_allocate(this%wetfct,
'WETFCT', this%memoryPath)
1132 call mem_allocate(this%iwetit,
'IWETIT', this%memoryPath)
1133 call mem_allocate(this%ihdwet,
'IHDWET', this%memoryPath)
1134 call mem_allocate(this%iangle1,
'IANGLE1', this%memoryPath)
1135 call mem_allocate(this%iangle2,
'IANGLE2', this%memoryPath)
1136 call mem_allocate(this%iangle3,
'IANGLE3', this%memoryPath)
1137 call mem_allocate(this%iwetdry,
'IWETDRY', this%memoryPath)
1138 call mem_allocate(this%nedges,
'NEDGES', this%memoryPath)
1139 call mem_allocate(this%lastedge,
'LASTEDGE', this%memoryPath)
1140 call mem_allocate(this%intvk,
'INTVK', this%memoryPath)
1141 call mem_allocate(this%invsc,
'INVSC', this%memoryPath)
1142 call mem_allocate(this%kchangeper,
'KCHANGEPER', this%memoryPath)
1143 call mem_allocate(this%kchangestp,
'KCHANGESTP', this%memoryPath)
1146 call mem_setptr(this%igwfnewtonur,
'INEWTONUR', &
1153 this%satomega =
dzero
1166 this%ihighcellsat = 0
1186 this%iasym = this%inewton
1204 integer(I4B),
intent(in) :: ncells
1205 integer(I4B),
intent(in) :: njas
1211 this%k11input(n) = this%k11(n)
1212 this%k22input(n) = this%k22(n)
1213 this%k33input(n) = this%k33(n)
1222 integer(I4B),
intent(in) :: ncells
1223 integer(I4B),
intent(in) :: njas
1227 call mem_allocate(this%ithickstartflag, ncells,
'ITHICKSTARTFLAG', &
1229 call mem_allocate(this%icelltype, ncells,
'ICELLTYPE', this%memoryPath)
1230 call mem_allocate(this%k11, ncells,
'K11', this%memoryPath)
1231 call mem_allocate(this%sat, ncells,
'SAT', this%memoryPath)
1232 call mem_allocate(this%condsat, njas,
'CONDSAT', this%memoryPath)
1235 call mem_allocate(this%k22, ncells,
'K22', this%memoryPath)
1236 call mem_allocate(this%k33, ncells,
'K33', this%memoryPath)
1237 call mem_allocate(this%wetdry, ncells,
'WETDRY', this%memoryPath)
1238 call mem_allocate(this%angle1, ncells,
'ANGLE1', this%memoryPath)
1239 call mem_allocate(this%angle2, ncells,
'ANGLE2', this%memoryPath)
1240 call mem_allocate(this%angle3, ncells,
'ANGLE3', this%memoryPath)
1243 call mem_allocate(this%ibotnode, 0,
'IBOTNODE', this%memoryPath)
1244 call mem_allocate(this%nodedge, 0,
'NODEDGE', this%memoryPath)
1245 call mem_allocate(this%ihcedge, 0,
'IHCEDGE', this%memoryPath)
1246 call mem_allocate(this%propsedge, 0, 0,
'PROPSEDGE', this%memoryPath)
1247 call mem_allocate(this%iedge_ptr, 0,
'NREDGESNODE', this%memoryPath)
1248 call mem_allocate(this%edge_idxs, 0,
'EDGEIDXS', this%memoryPath)
1251 call mem_allocate(this%k11input, 0,
'K11INPUT', this%memoryPath)
1252 call mem_allocate(this%k22input, 0,
'K22INPUT', this%memoryPath)
1253 call mem_allocate(this%k33input, 0,
'K33INPUT', this%memoryPath)
1256 call mem_allocate(this%spdis, 3, 0,
'SPDIS', this%memoryPath)
1259 call mem_allocate(this%nodekchange, ncells,
'NODEKCHANGE', this%memoryPath)
1263 this%angle1(n) =
dzero
1264 this%angle2(n) =
dzero
1265 this%angle3(n) =
dzero
1266 this%wetdry(n) =
dzero
1267 this%nodekchange(n) =
dzero
1271 allocate (this%aname(this%iname))
1272 this%aname = [
' ICELLTYPE',
' K', &
1274 ' WETDRY',
' ANGLE1', &
1275 ' ANGLE2',
' ANGLE3']
1289 write (this%iout,
'(1x,a)')
'Setting NPF Options'
1290 if (found%iprflow) &
1291 write (this%iout,
'(4x,a)')
'Cell-by-cell flow information will be printed &
1292 &to listing file whenever ICBCFL is not zero.'
1294 write (this%iout,
'(4x,a)')
'Cell-by-cell flow information will be saved &
1295 &to binary file whenever ICBCFL is not zero.'
1296 if (found%cellavg) &
1297 write (this%iout,
'(4x,a,i0)')
'Alternative cell averaging [1=logarithmic, &
1298 &2=AMT-LMK, 3=AMT-HMK] set to: ', &
1300 if (found%ithickstrt) &
1301 write (this%iout,
'(4x,a)')
'THICKSTRT option has been activated.'
1302 if (found%ihighcellsat) &
1303 write (this%iout,
'(4x,a)')
'HIGHEST_CELL_SATURATION option &
1304 &has been activated.'
1305 if (found%iperched) &
1306 write (this%iout,
'(4x,a)')
'Vertical flow will be adjusted for perched &
1309 write (this%iout,
'(4x,a)')
'Vertical conductance varies with water table.'
1310 if (found%idewatcv) &
1311 write (this%iout,
'(4x,a)')
'Vertical conductance is calculated using &
1312 &only the saturated thickness and properties &
1313 &of the overlying cell if the head in the &
1314 &underlying cell is below its top.'
1315 if (found%ixt3d)
write (this%iout,
'(4x,a)')
'XT3D formulation is selected.'
1316 if (found%ixt3drhs) &
1317 write (this%iout,
'(4x,a)')
'XT3D RHS formulation is selected.'
1318 if (found%isavspdis) &
1319 write (this%iout,
'(4x,a)')
'Specific discharge will be calculated at cell &
1320 ¢ers and written to DATA-SPDIS in budget &
1321 &file when requested.'
1322 if (found%isavsat) &
1323 write (this%iout,
'(4x,a)')
'Saturation will be written to DATA-SAT in &
1324 &budget file when requested.'
1325 if (found%ik22overk) &
1326 write (this%iout,
'(4x,a)')
'Values specified for K22 are anisotropy &
1327 &ratios and will be multiplied by K before &
1328 &being used in calculations.'
1329 if (found%ik33overk) &
1330 write (this%iout,
'(4x,a)')
'Values specified for K33 are anisotropy &
1331 &ratios and will be multiplied by K before &
1332 &being used in calculations.'
1333 if (found%inewton) &
1334 write (this%iout,
'(4x,a)')
'NEWTON-RAPHSON method disabled for unconfined &
1336 if (found%satomega) &
1337 write (this%iout,
'(4x,a,1pg15.6)')
'Saturation omega: ', this%satomega
1339 write (this%iout,
'(4x,a)')
'Rewetting is active.'
1341 write (this%iout,
'(4x,a,1pg15.6)') &
1342 'Wetting factor (WETFCT) has been set to: ', this%wetfct
1344 write (this%iout,
'(4x,a,i5)') &
1345 'Wetting iteration interval (IWETIT) has been set to: ', this%iwetit
1347 write (this%iout,
'(4x,a,i5)') &
1348 'Head rewet equation (IHDWET) has been set to: ', this%ihdwet
1349 write (this%iout,
'(1x,a,/)')
'End Setting NPF Options'
1365 character(len=LENVARNAME),
dimension(3) :: cellavg_method = &
1366 &[character(len=LENVARNAME) ::
'LOGARITHMIC',
'AMT-LMK',
'AMT-HMK']
1369 character(len=LINELENGTH) :: tvk6_filename
1370 character(len=LENMEMPATH) :: tvk6_mempath
1373 call mem_set_value(this%iprflow,
'IPRFLOW', this%input_mempath, found%iprflow)
1374 call mem_set_value(this%ipakcb,
'IPAKCB', this%input_mempath, found%ipakcb)
1375 call mem_set_value(this%icellavg,
'CELLAVG', this%input_mempath, &
1376 cellavg_method, found%cellavg)
1377 call mem_set_value(this%ithickstrt,
'ITHICKSTRT', this%input_mempath, &
1379 call mem_set_value(this%ihighcellsat,
'IHIGHCELLSAT', this%input_mempath, &
1381 call mem_set_value(this%iperched,
'IPERCHED', this%input_mempath, &
1383 call mem_set_value(this%ivarcv,
'IVARCV', this%input_mempath, found%ivarcv)
1384 call mem_set_value(this%idewatcv,
'IDEWATCV', this%input_mempath, &
1386 call mem_set_value(this%ixt3d,
'IXT3D', this%input_mempath, found%ixt3d)
1387 call mem_set_value(this%ixt3drhs,
'IXT3DRHS', this%input_mempath, &
1389 call mem_set_value(this%isavspdis,
'ISAVSPDIS', this%input_mempath, &
1391 call mem_set_value(this%isavsat,
'ISAVSAT', this%input_mempath, found%isavsat)
1392 call mem_set_value(this%ik22overk,
'IK22OVERK', this%input_mempath, &
1394 call mem_set_value(this%ik33overk,
'IK33OVERK', this%input_mempath, &
1396 call mem_set_value(this%inewton,
'INEWTON', this%input_mempath, found%inewton)
1397 call mem_set_value(this%satomega,
'SATOMEGA', this%input_mempath, &
1399 call mem_set_value(this%irewet,
'IREWET', this%input_mempath, found%irewet)
1400 call mem_set_value(this%wetfct,
'WETFCT', this%input_mempath, found%wetfct)
1401 call mem_set_value(this%iwetit,
'IWETIT', this%input_mempath, found%iwetit)
1402 call mem_set_value(this%ihdwet,
'IHDWET', this%input_mempath, found%ihdwet)
1405 if (found%ipakcb) this%ipakcb = -1
1408 if (found%ixt3d .and. found%ixt3drhs) this%ixt3d = 2
1411 if (found%isavspdis) this%icalcspdis = this%isavspdis
1414 if (found%inewton)
then
1421 this%input_mempath, this%input_fname))
then
1422 call mem_setptr(tvk6_mempaths,
'TVK6_MEMPATH', this%input_mempath)
1423 tvk6_mempath = tvk6_mempaths(1)
1425 call tvk_cr(this%tvk, this%name_model, tvk6_mempath, this%intvk, this%iout)
1429 if (found%cellavg)
then
1430 if (this%icellavg == 0)
then
1431 errmsg =
'Unrecognized input value for ALTERNATIVE_CELL_AVERAGING option.'
1438 if (this%iout > 0)
then
1439 call this%log_options(found)
1450 this%ithickstrt = options%ithickstrt
1451 this%ihighcellsat = options%ihighcellsat
1452 this%iperched = options%iperched
1453 this%ivarcv = options%ivarcv
1454 this%idewatcv = options%idewatcv
1455 this%irewet = options%irewet
1456 this%wetfct = options%wetfct
1457 this%iwetit = options%iwetit
1458 this%ihdwet = options%ihdwet
1472 if (this%inewton > 0)
then
1473 this%satomega = dem6
1476 if (this%inewton > 0)
then
1477 if (this%iperched > 0)
then
1478 write (
errmsg,
'(a)')
'ERROR IN NPF OPTIONS. NEWTON OPTION CANNOT '// &
1479 'BE USED WITH PERCHED OPTION.'
1482 if (this%ivarcv > 0)
then
1483 write (
errmsg,
'(a)')
'ERROR IN NPF OPTIONS. NEWTON OPTION CANNOT '// &
1484 'BE USED WITH VARIABLECV OPTION.'
1487 if (this%irewet > 0)
then
1488 write (
errmsg,
'(a)')
'ERROR IN NPF OPTIONS. NEWTON OPTION CANNOT '// &
1489 'BE USED WITH REWET OPTION.'
1493 if (this%ihighcellsat /= 0)
then
1494 write (
warnmsg,
'(a)')
'HIGHEST_CELL_SATURATION '// &
1495 'option cannot be used when NEWTON option in not specified. '// &
1496 'Resetting HIGHEST_CELL_SATURATION option to off.'
1497 this%ihighcellsat = 0
1502 if (this%ixt3d /= 0)
then
1503 if (this%icellavg > 0)
then
1504 write (
errmsg,
'(a)')
'ERROR IN NPF OPTIONS. '// &
1505 'ALTERNATIVE_CELL_AVERAGING OPTION '// &
1506 'CANNOT BE USED WITH XT3D OPTION.'
1509 if (this%ithickstrt > 0)
then
1510 write (
errmsg,
'(a)')
'ERROR IN NPF OPTIONS. THICKSTRT OPTION '// &
1511 'CANNOT BE USED WITH XT3D OPTION.'
1514 if (this%iperched > 0)
then
1515 write (
errmsg,
'(a)')
'ERROR IN NPF OPTIONS. PERCHED OPTION '// &
1516 'CANNOT BE USED WITH XT3D OPTION.'
1519 if (this%ivarcv > 0)
then
1520 write (
errmsg,
'(a)')
'ERROR IN NPF OPTIONS. VARIABLECV OPTION '// &
1521 'CANNOT BE USED WITH XT3D OPTION.'
1541 write (this%iout,
'(1x,a)')
'Setting NPF Griddata'
1543 if (found%icelltype)
then
1544 write (this%iout,
'(4x,a)')
'ICELLTYPE set from input file'
1548 write (this%iout,
'(4x,a)')
'K set from input file'
1552 write (this%iout,
'(4x,a)')
'K33 set from input file'
1554 write (this%iout,
'(4x,a)')
'K33 not provided. Setting K33 = K.'
1558 write (this%iout,
'(4x,a)')
'K22 set from input file'
1560 write (this%iout,
'(4x,a)')
'K22 not provided. Setting K22 = K.'
1563 if (found%wetdry)
then
1564 write (this%iout,
'(4x,a)')
'WETDRY set from input file'
1567 if (found%angle1)
then
1568 write (this%iout,
'(4x,a)')
'ANGLE1 set from input file'
1571 if (found%angle2)
then
1572 write (this%iout,
'(4x,a)')
'ANGLE2 set from input file'
1575 if (found%angle3)
then
1576 write (this%iout,
'(4x,a)')
'ANGLE3 set from input file'
1579 write (this%iout,
'(1x,a,/)')
'End Setting NPF Griddata'
1593 character(len=LINELENGTH) :: errmsg
1595 logical,
dimension(2) :: afound
1596 integer(I4B),
dimension(:),
pointer,
contiguous :: map
1600 if (this%dis%nodes < this%dis%nodesuser) map => this%dis%nodeuser
1603 call mem_set_value(this%icelltype,
'ICELLTYPE', this%input_mempath, map, &
1605 call mem_set_value(this%k11,
'K', this%input_mempath, map, found%k, &
1607 call mem_set_value(this%k33,
'K33', this%input_mempath, map, found%k33)
1608 call mem_set_value(this%k22,
'K22', this%input_mempath, map, found%k22)
1609 call mem_set_value(this%wetdry,
'WETDRY', this%input_mempath, map, &
1611 call mem_set_value(this%angle1,
'ANGLE1', this%input_mempath, map, &
1613 call mem_set_value(this%angle2,
'ANGLE2', this%input_mempath, map, &
1615 call mem_set_value(this%angle3,
'ANGLE3', this%input_mempath, map, &
1619 if (.not. found%icelltype)
then
1620 write (errmsg,
'(a)')
'Error in GRIDDATA block: ICELLTYPE not found.'
1625 if (.not. found%k)
then
1626 write (errmsg,
'(a)')
'Error in GRIDDATA block: K not found.'
1631 if (.not. found%k33 .and. this%ik33overk /= 0)
then
1632 write (errmsg,
'(a)')
'K33OVERK option specified but K33 not specified.'
1637 if (.not. found%k22 .and. this%ik22overk /= 0)
then
1638 write (errmsg,
'(a)')
'K22OVERK option specified but K22 not specified.'
1643 if (found%k33) this%ik33 = 1
1644 if (found%k22) this%ik22 = 1
1645 if (found%wetdry) this%iwetdry = 1
1646 if (found%angle1) this%iangle1 = 1
1647 if (found%angle2) this%iangle2 = 1
1648 if (found%angle3) this%iangle3 = 1
1651 if (.not. found%k33)
then
1652 call mem_set_value(this%k33,
'K', this%input_mempath, map, afound(1), &
1655 if (.not. found%k22)
then
1656 call mem_set_value(this%k22,
'K', this%input_mempath, map, afound(2), &
1659 if (.not. found%wetdry)
call mem_reallocate(this%wetdry, 1,
'WETDRY', &
1660 trim(this%memoryPath))
1661 if (.not. found%angle1 .and. this%ixt3d == 0) &
1662 call mem_reallocate(this%angle1, 0,
'ANGLE1', trim(this%memoryPath))
1663 if (.not. found%angle2 .and. this%ixt3d == 0) &
1664 call mem_reallocate(this%angle2, 0,
'ANGLE2', trim(this%memoryPath))
1665 if (.not. found%angle3 .and. this%ixt3d == 0) &
1666 call mem_reallocate(this%angle3, 0,
'ANGLE3', trim(this%memoryPath))
1672 if (this%iout > 0)
then
1673 call this%log_griddata(found)
1686 character(len=24),
dimension(:),
pointer :: aname
1687 character(len=LINELENGTH) :: cellstr, errmsg
1688 integer(I4B) :: nerr, n
1690 character(len=*),
parameter :: fmtkerr = &
1691 &
"(1x, 'Hydraulic property ',a,' is <= 0 for cell ',a, ' ', 1pg15.6)"
1692 character(len=*),
parameter :: fmtkerr2 = &
1693 &
"(1x, '... ', i0,' additional errors not shown for ',a)"
1700 do n = 1,
size(this%k11)
1701 if (this%k11(n) <= dzero)
then
1703 if (nerr <= 20)
then
1704 call this%dis%noder_to_string(n, cellstr)
1705 write (errmsg, fmtkerr) trim(adjustl(aname(2))), trim(cellstr), &
1712 write (errmsg, fmtkerr2) nerr, trim(adjustl(aname(2)))
1717 if (this%ik33 /= 0)
then
1721 do n = 1,
size(this%k33)
1722 if (this%ik33overk /= 0) this%k33(n) = this%k33(n) * this%k11(n)
1723 if (this%k33(n) <= dzero)
then
1725 if (nerr <= 20)
then
1726 call this%dis%noder_to_string(n, cellstr)
1727 write (errmsg, fmtkerr) trim(adjustl(aname(3))), trim(cellstr), &
1734 write (errmsg, fmtkerr2) nerr, trim(adjustl(aname(3)))
1740 if (this%ik22 /= 0)
then
1743 if (this%dis%con%ianglex == 0)
then
1744 write (errmsg,
'(a)')
'Error. ANGLDEGX not provided in '// &
1745 'discretization file, but K22 was specified. '
1751 do n = 1,
size(this%k22)
1752 if (this%ik22overk /= 0) this%k22(n) = this%k22(n) * this%k11(n)
1753 if (this%k22(n) <= dzero)
then
1755 if (nerr <= 20)
then
1756 call this%dis%noder_to_string(n, cellstr)
1757 write (errmsg, fmtkerr) trim(adjustl(aname(4))), trim(cellstr), &
1764 write (errmsg, fmtkerr2) nerr, trim(adjustl(aname(4)))
1770 if (this%irewet == 1)
then
1771 if (this%iwetdry == 0)
then
1772 write (errmsg,
'(a, a, a)')
'Error in GRIDDATA block: ', &
1773 trim(adjustl(aname(5))),
' not found.'
1779 if (this%iangle1 /= 0)
then
1780 do n = 1,
size(this%angle1)
1781 this%angle1(n) = this%angle1(n) *
dpio180
1784 if (this%ixt3d /= 0)
then
1786 write (this%iout,
'(a)')
'XT3D IN USE, BUT ANGLE1 NOT SPECIFIED. '// &
1787 'SETTING ANGLE1 TO ZERO.'
1788 do n = 1,
size(this%angle1)
1789 this%angle1(n) = dzero
1793 if (this%iangle2 /= 0)
then
1794 if (this%iangle1 == 0)
then
1795 write (errmsg,
'(a)')
'ANGLE2 SPECIFIED BUT NOT ANGLE1. '// &
1796 'ANGLE2 REQUIRES ANGLE1. '
1799 if (this%iangle3 == 0)
then
1800 write (errmsg,
'(a)')
'ANGLE2 SPECIFIED BUT NOT ANGLE3. '// &
1801 'SPECIFY BOTH OR NEITHER ONE. '
1804 do n = 1,
size(this%angle2)
1805 this%angle2(n) = this%angle2(n) *
dpio180
1808 if (this%iangle3 /= 0)
then
1809 if (this%iangle1 == 0)
then
1810 write (errmsg,
'(a)')
'ANGLE3 SPECIFIED BUT NOT ANGLE1. '// &
1811 'ANGLE3 REQUIRES ANGLE1. '
1814 if (this%iangle2 == 0)
then
1815 write (errmsg,
'(a)')
'ANGLE3 SPECIFIED BUT NOT ANGLE2. '// &
1816 'SPECIFY BOTH OR NEITHER ONE. '
1819 do n = 1,
size(this%angle3)
1820 this%angle3(n) = this%angle3(n) *
dpio180
1847 integer(I4B) :: n, m, ii, nn
1848 real(DP) :: hyn, hym
1849 real(DP) :: satn, topn, botn
1850 integer(I4B) :: nextn
1851 real(DP) :: minbot, botm
1853 character(len=LINELENGTH) :: cellstr, errmsg
1855 character(len=*),
parameter :: fmtcnv = &
1857 &' ELIMINATED BECAUSE ALL HYDRAULIC CONDUCTIVITIES TO NODE ARE 0.')"
1858 character(len=*),
parameter :: fmtnct = &
1859 &
"(1X,'Negative cell thickness at cell ', A)"
1860 character(len=*),
parameter :: fmtihbe = &
1861 &
"(1X,'Initial head, bottom elevation:',1P,2G13.5)"
1862 character(len=*),
parameter :: fmttebe = &
1863 &
"(1X,'Top elevation, bottom elevation:',1P,2G13.5)"
1865 do n = 1, this%dis%nodes
1866 this%ithickstartflag(n) = 0
1872 nodeloop:
do n = 1, this%dis%nodes
1875 if (this%ibound(n) == 0)
then
1876 if (this%irewet /= 0)
then
1877 if (this%wetdry(n) == dzero) cycle nodeloop
1884 if (this%k11(n) /= dzero) cycle nodeloop
1888 do ii = this%dis%con%ia(n) + 1, this%dis%con%ia(n + 1) - 1
1889 m = this%dis%con%ja(ii)
1890 if (this%dis%con%ihc(this%dis%con%jas(ii)) == 0)
then
1892 if (this%ik33 /= 0) hyn = this%k33(n)
1893 if (hyn /= dzero)
then
1895 if (this%ik33 /= 0) hym = this%k33(m)
1896 if (hym /= dzero) cycle
1904 this%hnew(n) = this%hnoflo
1905 if (this%irewet /= 0) this%wetdry(n) = dzero
1906 call this%dis%noder_to_string(n, cellstr)
1907 write (this%iout, fmtcnv) trim(adjustl(cellstr))
1912 if (this%inewton == 0)
then
1915 call this%wd(0, this%hnew)
1921 if (this%ivarcv == 1)
then
1922 do n = 1, this%dis%nodes
1923 if (this%hnew(n) < this%dis%bot(n))
then
1924 this%hnew(n) = this%dis%bot(n) + dem6
1932 if (this%ithickstrt == 0)
then
1933 do n = 1, this%dis%nodes
1934 if (this%icelltype(n) < 0)
then
1935 this%icelltype(n) = 1
1945 do n = 1, this%dis%nodes
1946 if (this%ibound(n) == 0)
then
1948 if (this%icelltype(n) < 0 .and. this%ithickstrt /= 0)
then
1949 this%ithickstartflag(n) = 1
1950 this%icelltype(n) = 0
1953 topn = this%dis%top(n)
1954 botn = this%dis%bot(n)
1955 if (this%icelltype(n) < 0 .and. this%ithickstrt /= 0)
then
1956 call this%thksat(n, this%ic%strt(n), satn)
1957 if (botn > this%ic%strt(n))
then
1958 call this%dis%noder_to_string(n, cellstr)
1959 write (errmsg, fmtnct) trim(adjustl(cellstr))
1961 write (errmsg, fmtihbe) this%ic%strt(n), botn
1964 this%ithickstartflag(n) = 1
1965 this%icelltype(n) = 0
1968 if (botn > topn)
then
1969 call this%dis%noder_to_string(n, cellstr)
1970 write (errmsg, fmtnct) trim(adjustl(cellstr))
1972 write (errmsg, fmttebe) topn, botn
1985 if (this%ixt3d == 0)
then
1990 do n = 1, this%dis%nodes
1991 call this%calc_condsat(n, .true.)
1997 if (this%igwfnewtonur /= 0)
then
1999 trim(this%memoryPath))
2000 do n = 1, this%dis%nodes
2002 minbot = this%dis%bot(n)
2005 do while (.not. finished)
2009 do ii = this%dis%con%ia(nn) + 1, this%dis%con%ia(nn + 1) - 1
2012 m = this%dis%con%ja(ii)
2013 botm = this%dis%bot(m)
2016 if (this%dis%con%ihc(this%dis%con%jas(ii)) == 0)
then
2017 if (m > nn .and. botm < minbot)
then
2029 this%ibotnode(n) = nn
2034 this%igwfnewtonur => null()
2045 integer(I4B),
intent(in) :: node
2046 logical,
intent(in) :: upperOnly
2048 integer(I4B) :: ii, m, n, ihc, jj
2049 real(DP) :: topm, topn, topnode, botm, botn, botnode, satm, satn, satnode
2050 real(DP) :: hyn, hym, hn, hm, fawidth, csat
2052 satnode = this%calc_initial_sat(node)
2054 topnode = this%dis%top(node)
2055 botnode = this%dis%bot(node)
2058 do ii = this%dis%con%ia(node) + 1, this%dis%con%ia(node + 1) - 1
2062 m = this%dis%con%ja(ii)
2063 jj = this%dis%con%jas(ii)
2065 if (upperonly) cycle
2072 topn = this%dis%top(n)
2073 botn = this%dis%bot(n)
2074 satn = this%calc_initial_sat(n)
2081 topm = this%dis%top(m)
2082 botm = this%dis%bot(m)
2083 satm = this%calc_initial_sat(m)
2086 ihc = this%dis%con%ihc(jj)
2087 hyn = this%hy_eff(n, m, ihc, ipos=ii)
2088 hym = this%hy_eff(m, n, ihc, ipos=ii)
2089 if (this%ithickstartflag(n) == 0)
then
2092 hn = this%ic%strt(n)
2094 if (this%ithickstartflag(m) == 0)
then
2097 hm = this%ic%strt(m)
2105 csat =
vcond(1, 1, 1, 1, 0, 1, 1,
done, &
2111 this%dis%con%hwva(jj))
2115 fawidth = this%dis%con%hwva(jj)
2116 csat =
hcond(1, 1, 1, 1, 0, &
2120 hn, hm, satn, satm, hyn, hym, &
2123 this%dis%con%cl1(jj), &
2124 this%dis%con%cl2(jj), &
2127 this%condsat(jj) = csat
2141 integer(I4B),
intent(in) :: n
2146 if (this%ibound(n) /= 0 .and. this%ithickstartflag(n) /= 0)
then
2147 call this%thksat(n, this%ic%strt(n), satn)
2160 integer(I4B),
intent(in) :: kiter
2161 real(DP),
intent(inout),
dimension(:) :: hnew
2163 integer(I4B) :: n, m, ii, ihc
2164 real(DP) :: ttop, bbot, thick
2165 integer(I4B) :: ncnvrt, ihdcnv
2166 character(len=30),
dimension(5) :: nodcnvrt
2167 character(len=30) :: nodestr
2168 character(len=3),
dimension(5) :: acnvrt
2169 character(len=LINELENGTH) :: errmsg
2170 integer(I4B) :: irewet
2172 character(len=*),
parameter :: fmtnct = &
2173 "(1X,/1X,'Negative cell thickness at (layer,row,col)', &
2175 character(len=*),
parameter :: fmttopbot = &
2176 &
"(1X,'Top elevation, bottom elevation:',1P,2G13.5)"
2177 character(len=*),
parameter :: fmttopbotthk = &
2178 &
"(1X,'Top elevation, bottom elevation, thickness:',1P,3G13.5)"
2179 character(len=*),
parameter :: fmtdrychd = &
2180 &
"(1X,/1X,'CONSTANT-HEAD CELL WENT DRY -- SIMULATION ABORTED')"
2181 character(len=*),
parameter :: fmtni = &
2182 &
"(1X,'CELLID=',a,' ITERATION=',I0,' TIME STEP=',I0,' STRESS PERIOD=',I0)"
2189 do n = 1, this%dis%nodes
2190 do ii = this%dis%con%ia(n) + 1, this%dis%con%ia(n + 1) - 1
2191 m = this%dis%con%ja(ii)
2192 ihc = this%dis%con%ihc(this%dis%con%jas(ii))
2193 call this%rewet_check(kiter, n, hnew(m), this%ibound(m), ihc, hnew, &
2195 if (irewet == 1)
then
2196 call this%wdmsg(2, ncnvrt, nodcnvrt, acnvrt, ihdcnv, kiter, n)
2202 do n = 1, this%dis%nodes
2205 if (this%ibound(n) == 0) cycle
2206 if (this%icelltype(n) == 0) cycle
2209 bbot = this%dis%bot(n)
2210 ttop = this%dis%top(n)
2211 if (bbot > ttop)
then
2212 write (errmsg, fmtnct) n
2214 write (errmsg, fmttopbot) ttop, bbot
2220 if (this%icelltype(n) /= 0)
then
2221 if (hnew(n) < ttop) ttop = hnew(n)
2226 if (thick <= dzero)
then
2227 call this%wdmsg(1, ncnvrt, nodcnvrt, acnvrt, ihdcnv, kiter, n)
2229 if (this%ibound(n) < 0)
then
2230 errmsg =
'CONSTANT-HEAD CELL WENT DRY -- SIMULATION ABORTED'
2232 write (errmsg, fmttopbotthk) ttop, bbot, thick
2234 call this%dis%noder_to_string(n, nodestr)
2235 write (errmsg, fmtni) trim(adjustl(nodestr)), kiter,
kstp,
kper
2244 call this%wdmsg(0, ncnvrt, nodcnvrt, acnvrt, ihdcnv, kiter, n)
2247 do n = 1, this%dis%nodes
2248 if (this%ibound(n) == 30000) this%ibound(n) = 1
2259 subroutine rewet_check(this, kiter, node, hm, ibdm, ihc, hnew, irewet)
2262 integer(I4B),
intent(in) :: kiter
2263 integer(I4B),
intent(in) :: node
2264 real(DP),
intent(in) :: hm
2265 integer(I4B),
intent(in) :: ibdm
2266 integer(I4B),
intent(in) :: ihc
2267 real(DP),
intent(inout),
dimension(:) :: hnew
2268 integer(I4B),
intent(out) :: irewet
2270 integer(I4B) :: itflg
2271 real(DP) :: wd, awd, turnon, bbot
2276 if (this%irewet > 0)
then
2277 itflg = mod(kiter, this%iwetit)
2278 if (itflg == 0)
then
2279 if (this%ibound(node) == 0 .and. this%wetdry(node) /=
dzero)
then
2282 bbot = this%dis%bot(node)
2283 wd = this%wetdry(node)
2285 if (wd < 0) awd = -wd
2293 if (ibdm > 0 .and. hm >= turnon) irewet = 1
2295 if (wd >
dzero)
then
2298 if (ibdm > 0 .and. hm >= turnon) irewet = 1
2302 if (irewet == 1)
then
2305 if (this%ihdwet == 0)
then
2306 hnew(node) = bbot + this%wetfct * (hm - bbot)
2308 hnew(node) = bbot + this%wetfct * awd
2310 this%ibound(node) = 30000
2325 integer(I4B),
intent(in) :: icode
2326 integer(I4B),
intent(inout) :: ncnvrt
2327 character(len=30),
dimension(5),
intent(inout) :: nodcnvrt
2328 character(len=3),
dimension(5),
intent(inout) :: acnvrt
2329 integer(I4B),
intent(inout) :: ihdcnv
2330 integer(I4B),
intent(in) :: kiter
2331 integer(I4B),
intent(in) :: n
2335 character(len=*),
parameter :: fmtcnvtn = &
2336 "(1X,/1X,'CELL CONVERSIONS FOR ITER.=',I0, &
2337 &' STEP=',I0,' PERIOD=',I0,' (NODE or LRC)')"
2338 character(len=*),
parameter :: fmtnode =
"(1X,3X,5(A4, A20))"
2343 call this%dis%noder_to_string(n, nodcnvrt(ncnvrt))
2344 if (icode == 1)
then
2345 acnvrt(ncnvrt) =
'DRY'
2347 acnvrt(ncnvrt) =
'WET'
2353 if (ncnvrt == 5 .or. (icode == 0 .and. ncnvrt > 0))
then
2354 if (ihdcnv == 0)
write (this%iout, fmtcnvtn) kiter,
kstp,
kper
2356 write (this%iout, fmtnode) &
2357 (acnvrt(l), trim(adjustl(nodcnvrt(l))), l=1, ncnvrt)
2372 function hy_eff(this, n, m, ihc, ipos, vg)
result(hy)
2377 integer(I4B),
intent(in) :: n
2378 integer(I4B),
intent(in) :: m
2379 integer(I4B),
intent(in) :: ihc
2380 integer(I4B),
intent(in),
optional :: ipos
2381 real(dp),
dimension(3),
intent(in),
optional :: vg
2383 integer(I4B) :: iipos
2384 real(dp) :: hy11, hy22, hy33
2385 real(dp) :: ang1, ang2, ang3
2386 real(dp) :: vg1, vg2, vg3
2390 if (
present(ipos)) iipos = ipos
2404 if (this%iangle2 > 0)
then
2405 if (
present(vg))
then
2410 call this%dis%connection_normal(n, m, ihc, vg1, vg2, vg3, iipos)
2412 ang1 = this%angle1(n)
2413 ang2 = this%angle2(n)
2415 if (this%iangle3 > 0) ang3 = this%angle3(n)
2416 hy =
hyeff(hy11, hy22, hy33, ang1, ang2, ang3, vg1, vg2, vg3, &
2424 if (this%ik22 > 0)
then
2425 if (
present(vg))
then
2430 call this%dis%connection_normal(n, m, ihc, vg1, vg2, vg3, iipos)
2435 if (this%iangle1 > 0)
then
2436 ang1 = this%angle1(n)
2437 if (this%iangle2 > 0)
then
2438 ang2 = this%angle2(n)
2439 if (this%iangle3 > 0) ang3 = this%angle3(n)
2442 hy =
hyeff(hy11, hy22, hy33, ang1, ang2, ang3, vg1, vg2, vg3, &
2456 real(DP),
intent(in),
dimension(:) :: flowja
2460 integer(I4B) :: ipos
2461 integer(I4B) :: iedge
2462 integer(I4B) :: isympos
2490 logical :: nozee = .true.
2494 if (this%icalcspdis /= 0 .and. this%dis%con%ianglex == 0)
then
2495 call store_error(
'Error. ANGLDEGX not provided in '// &
2496 'discretization file. ANGLDEGX required for '// &
2497 'calculation of specific discharge.', terminate=.true.)
2500 swa => this%spdis_wa
2501 if (.not. swa%is_created())
then
2503 call this%spdis_wa%create(this%calc_max_conns())
2506 if (this%nedges > 0)
call this%prepare_edge_lookup()
2510 do n = 1, this%dis%nodes
2520 do ipos = this%dis%con%ia(n) + 1, this%dis%con%ia(n + 1) - 1
2521 m = this%dis%con%ja(ipos)
2522 isympos = this%dis%con%jas(ipos)
2523 ihc = this%dis%con%ihc(isympos)
2524 area = this%dis%con%hwva(isympos)
2530 call this%dis%connection_vector(n, m, nozee, this%sat(n), this%sat(m), &
2531 ihc, xc, yc, zc, dltot)
2532 cl1 = this%dis%con%cl1(isympos)
2533 cl2 = this%dis%con%cl2(isympos)
2535 cl1 = this%dis%con%cl2(isympos)
2536 cl2 = this%dis%con%cl1(isympos)
2538 ooclsum =
done / (cl1 + cl2)
2539 swa%diz(iz) = dltot * cl1 * ooclsum
2542 swa%viz(iz) = qz / area
2547 dz =
thksatnm(this%ibound(n), this%ibound(m), &
2548 this%icelltype(n), this%icelltype(m), &
2549 this%inewton, ihc, &
2550 this%hnew(n), this%hnew(m), this%sat(n), this%sat(m), &
2551 this%dis%top(n), this%dis%top(m), this%dis%bot(n), &
2554 call this%dis%connection_normal(n, m, ihc, xn, yn, zn, ipos)
2555 call this%dis%connection_vector(n, m, nozee, this%sat(n), this%sat(m), &
2556 ihc, xc, yc, zc, dltot)
2557 cl1 = this%dis%con%cl1(isympos)
2558 cl2 = this%dis%con%cl2(isympos)
2560 cl1 = this%dis%con%cl2(isympos)
2561 cl2 = this%dis%con%cl1(isympos)
2563 ooclsum =
done / (cl1 + cl2)
2566 swa%di(ic) = dltot * cl1 * ooclsum
2567 if (area >
dzero)
then
2568 swa%vi(ic) = flowja(ipos) / area
2576 if (this%nedges > 0)
then
2577 do ipos = this%iedge_ptr(n), this%iedge_ptr(n + 1) - 1
2578 iedge = this%edge_idxs(ipos)
2581 ihc = this%ihcedge(iedge)
2582 area = this%propsedge(2, iedge)
2585 swa%viz(iz) = this%propsedge(1, iedge) / area
2586 swa%diz(iz) = this%propsedge(5, iedge)
2589 swa%nix(ic) = -this%propsedge(3, iedge)
2590 swa%niy(ic) = -this%propsedge(4, iedge)
2591 swa%di(ic) = this%propsedge(5, iedge)
2592 if (area >
dzero)
then
2593 swa%vi(ic) = this%propsedge(1, iedge) / area
2611 dsumz = dsumz + swa%diz(iz)
2613 denom = (ncz -
done)
2615 dsumz = dsumz +
dem10 * dsumz
2617 if (dsumz >
dzero) swa%wiz(iz) =
done - swa%diz(iz) / dsumz
2619 swa%wiz(iz) = swa%wiz(iz) / denom
2627 vz = vz + swa%wiz(iz) * swa%viz(iz)
2636 swa%wix(ic) = swa%di(ic) * abs(swa%nix(ic))
2637 swa%wiy(ic) = swa%di(ic) * abs(swa%niy(ic))
2638 dsumx = dsumx + swa%wix(ic)
2639 dsumy = dsumy + swa%wiy(ic)
2646 dsumx = dsumx +
dem10 * dsumx
2647 dsumy = dsumy +
dem10 * dsumy
2649 swa%wix(ic) = (dsumx - swa%wix(ic)) * abs(swa%nix(ic))
2650 swa%wiy(ic) = (dsumy - swa%wiy(ic)) * abs(swa%niy(ic))
2657 swa%bix(ic) = swa%wix(ic) * sign(
done, swa%nix(ic))
2658 swa%biy(ic) = swa%wiy(ic) * sign(
done, swa%niy(ic))
2659 dsumx = dsumx + swa%wix(ic) * abs(swa%nix(ic))
2660 dsumy = dsumy + swa%wiy(ic) * abs(swa%niy(ic))
2667 swa%bix(ic) = swa%bix(ic) * dsumx
2668 swa%biy(ic) = swa%biy(ic) * dsumy
2669 axy = axy + swa%bix(ic) * swa%niy(ic)
2670 ayx = ayx + swa%biy(ic) * swa%nix(ic)
2683 vx = vx + (swa%bix(ic) - axy * swa%biy(ic)) * swa%vi(ic)
2684 vy = vy + (swa%biy(ic) - ayx * swa%bix(ic)) * swa%vi(ic)
2686 denom =
done - axy * ayx
2687 if (denom /=
dzero)
then
2692 this%spdis(1, n) = vx
2693 this%spdis(2, n) = vy
2694 this%spdis(3, n) = vz
2705 integer(I4B),
intent(in) :: ibinun
2707 character(len=16) :: text
2708 character(len=16),
dimension(3) :: auxtxt
2710 integer(I4B) :: naux
2713 text =
' DATA-SPDIS'
2715 auxtxt(:) = [
' qx',
' qy',
' qz']
2716 call this%dis%record_srcdst_list_header(text, this%name_model, &
2717 this%packName, this%name_model, &
2718 this%packName, naux, auxtxt, ibinun, &
2719 this%dis%nodes, this%iout)
2722 do n = 1, this%dis%nodes
2723 call this%dis%record_mf6_list_entry(ibinun, n, n,
dzero, naux, &
2733 integer(I4B),
intent(in) :: ibinun
2735 character(len=16) :: text
2736 character(len=16),
dimension(1) :: auxtxt
2737 real(DP),
dimension(1) :: a
2739 integer(I4B) :: naux
2744 auxtxt(:) = [
' sat']
2745 call this%dis%record_srcdst_list_header(text, this%name_model, &
2746 this%packName, this%name_model, &
2747 this%packName, naux, auxtxt, ibinun, &
2748 this%dis%nodes, this%iout)
2751 do n = 1, this%dis%nodes
2753 call this%dis%record_mf6_list_entry(ibinun, n, n,
dzero, naux, a)
2765 integer(I4B),
intent(in) :: nedges
2767 this%nedges = this%nedges + nedges
2774 integer(I4B) :: max_conns
2776 integer(I4B) :: n, m, ic
2779 do n = 1, this%dis%nodes
2782 ic = this%dis%con%ia(n + 1) - this%dis%con%ia(n) - 1
2785 do m = 1, this%nedges
2786 if (this%nodedge(m) == n)
then
2792 if (ic > max_conns) max_conns = ic
2803 integer(I4B),
intent(in) :: nodedge
2804 integer(I4B),
intent(in) :: ihcedge
2805 real(DP),
intent(in) :: q
2806 real(DP),
intent(in) :: area
2807 real(DP),
intent(in) :: nx
2808 real(DP),
intent(in) :: ny
2809 real(DP),
intent(in) :: distance
2811 integer(I4B) :: lastedge
2813 this%lastedge = this%lastedge + 1
2814 lastedge = this%lastedge
2815 this%nodedge(lastedge) = nodedge
2816 this%ihcedge(lastedge) = ihcedge
2817 this%propsedge(1, lastedge) = q
2818 this%propsedge(2, lastedge) = area
2819 this%propsedge(3, lastedge) = nx
2820 this%propsedge(4, lastedge) = ny
2821 this%propsedge(5, lastedge) = distance
2825 if (this%lastedge == this%nedges) this%lastedge = 0
2831 integer(I4B) :: i, inode, iedge
2832 integer(I4B) :: n, start, end
2833 integer(I4B) :: prev_cnt, strt_idx, ipos
2835 do i = 1,
size(this%iedge_ptr)
2836 this%iedge_ptr(i) = 0
2838 do i = 1,
size(this%edge_idxs)
2839 this%edge_idxs(i) = 0
2843 do iedge = 1, this%nedges
2844 n = this%nodedge(iedge)
2845 this%iedge_ptr(n) = this%iedge_ptr(n) + 1
2849 prev_cnt = this%iedge_ptr(1)
2850 this%iedge_ptr(1) = 1
2851 do inode = 2, this%dis%nodes + 1
2852 strt_idx = this%iedge_ptr(inode - 1) + prev_cnt
2853 prev_cnt = this%iedge_ptr(inode)
2854 this%iedge_ptr(inode) = strt_idx
2858 do iedge = 1, this%nedges
2859 n = this%nodedge(iedge)
2860 start = this%iedge_ptr(n)
2861 end = this%iedge_ptr(n + 1) - 1
2862 do ipos = start,
end
2863 if (this%edge_idxs(ipos) > 0) cycle
2864 this%edge_idxs(ipos) = iedge
2880 real(dp) :: satthickness
2882 satthickness = thksatnm(this%ibound(n), &
2884 this%icelltype(n), &
2885 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 memorystore_release(varname, memory_path)
Release a single variable from the memory store.
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, mempath, 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.