1554 class(UzfCellGroupType) :: this
1555 integer(I4B),
intent(in) :: icell
1556 real(DP),
intent(in) :: delt
1557 integer(I4B),
intent(in) :: ietflag
1558 integer(I4B),
intent(inout) :: ierr
1561 real(DP) :: thetaout
1564 real(DP) :: thtsrinv
1565 real(DP) :: epsfksthts
1580 integer(I4B) :: jhold
1584 integer(I4B) :: numadd
1587 integer(I4B) :: itest
1590 this%etact(icell) = dzero
1591 if (this%extdpuz(icell) < dem7)
return
1592 petsub = this%rootact(icell) * this%pet(icell) * &
1593 this%extdpuz(icell) / this%extdp(icell)
1594 thetaout = delt * petsub / this%extdp(icell)
1595 if (ietflag == 1) thetaout = delt * this%pet(icell) / this%extdp(icell)
1596 if (thetaout < dem10)
return
1597 depth = this%uzdpst(1, icell)
1598 st = this%unsat_stor(icell, depth)
1599 if (st < dem4)
return
1602 nwv = this%nwavst(icell)
1604 call this%store_waves(icell, this%etsav)
1606 this%etact(icell) = dzero
1607 if (this%thts(icell) - this%thtr(icell) < dem7)
then
1608 thtsrinv = 1.0 / dem7
1610 thtsrinv = done / (this%thts(icell) - this%thtr(icell))
1612 epsfksthts = this%eps(icell) * this%vks(icell) * thtsrinv
1613 this%etact(icell) = dzero
1615 extwc1 = this%extwc(icell) - this%thtr(icell)
1616 if (extwc1 < dem6) extwc1 = dem7
1622 do while (itest == 0)
1624 if (k > 1 .AND. abs(fmp - petsub) > dem5 * petsub)
then
1625 factor = factor / (fm / petsub)
1629 if (this%nwavst(icell) == 1 .AND. &
1630 this%uzdpst(1, icell) <= this%extdpuz(icell))
then
1631 if (ietflag == 2)
then
1632 tho = this%uzthst(1, icell)
1633 fktho = this%uzflst(1, icell)
1634 hcap = this%caph(icell, tho)
1635 thetaout = this%rate_et_z(icell, factor, fktho, hcap)
1637 if ((this%uzthst(1, icell) - thetaout) > this%thtr(icell) + extwc1)
then
1638 this%uzthst(1, icell) = this%uzthst(1, icell) - thetaout
1639 this%uzflst(1, icell) = &
1640 this%vks(icell) * (((this%uzthst(1, icell) - &
1641 this%thtr(icell)) * thtsrinv)**this%eps(icell))
1642 else if (this%uzthst(1, icell) > this%thtr(icell) + extwc1)
then
1643 this%uzthst(1, icell) = this%thtr(icell) + extwc1
1644 this%uzflst(1, icell) = &
1645 this%vks(icell) * (((this%uzthst(1, icell) - &
1646 this%thtr(icell)) * thtsrinv)**this%eps(icell))
1650 else if (this%nwavst(icell) > 1 .AND. &
1651 this%uzdpst(this%nwavst(icell), icell) > this%extdpuz(icell))
then
1652 if (ietflag == 2)
then
1653 tho = this%uzthst(this%nwavst(icell), icell)
1654 fktho = this%uzflst(this%nwavst(icell), icell)
1655 hcap = this%caph(icell, tho)
1656 thetaout = this%rate_et_z(icell, factor, fktho, hcap)
1658 if (this%nwavst(icell) + 1 > this%nwav)
then
1664 if (this%uzthst(this%nwavst(icell), icell) - thetaout > &
1665 this%thtr(icell) + extwc1)
then
1666 this%uzthst(this%nwavst(icell) + 1, icell) = &
1667 this%uzthst(this%nwavst(icell), icell) - thetaout
1669 else if (this%uzthst(this%nwavst(icell), icell) > &
1670 this%thtr(icell) + extwc1)
then
1671 this%uzthst(this%nwavst(icell) + 1, icell) = this%thtr(icell) + extwc1
1674 if (numadd == 1)
then
1675 this%uzflst(this%nwavst(icell) + 1, icell) = &
1677 (((this%uzthst(this%nwavst(icell) + 1, icell) - &
1678 this%thtr(icell)) * thtsrinv)**this%eps(icell))
1679 theta2 = this%uzthst(this%nwavst(icell) + 1, icell)
1680 flux2 = this%uzflst(this%nwavst(icell) + 1, icell)
1681 flux1 = this%uzflst(this%nwavst(icell), icell)
1682 theta1 = this%uzthst(this%nwavst(icell), icell)
1683 this%uzspst(this%nwavst(icell) + 1, icell) = &
1684 leadspeed(theta1, theta2, flux1, flux2, this%thts(icell), &
1685 this%thtr(icell), this%eps(icell), this%vks(icell))
1686 this%uzdpst(this%nwavst(icell) + 1, icell) = this%extdpuz(icell)
1687 this%nwavst(icell) = this%nwavst(icell) + 1
1688 if (this%nwavst(icell) > this%nwav)
then
1699 else if (this%nwavst(icell) == 1)
then
1700 if (this%nwavst(icell) + 1 > this%nwav)
then
1706 if (ietflag == 2)
then
1707 tho = this%uzthst(1, icell)
1708 fktho = this%uzflst(1, icell)
1709 hcap = this%caph(icell, tho)
1710 thetaout = this%rate_et_z(icell, factor, fktho, hcap)
1712 if ((this%uzthst(1, icell) - thetaout) > this%thtr(icell) + extwc1)
then
1713 if (thetaout > dem30)
then
1714 this%uzthst(2, icell) = this%uzthst(1, icell) - thetaout
1715 this%uzflst(2, icell) = &
1716 this%vks(icell) * (((this%uzthst(2, icell) - this%thtr(icell)) * &
1717 thtsrinv)**this%eps(icell))
1718 this%uzdpst(2, icell) = this%extdpuz(icell)
1719 theta2 = this%uzthst(2, icell)
1720 flux2 = this%uzflst(2, icell)
1721 flux1 = this%uzflst(1, icell)
1722 theta1 = this%uzthst(1, icell)
1723 this%uzspst(2, icell) = &
1724 leadspeed(theta1, theta2, flux1, flux2, this%thts(icell), &
1725 this%thtr(icell), this%eps(icell), this%vks(icell))
1726 this%nwavst(icell) = this%nwavst(icell) + 1
1727 if (this%nwavst(icell) > this%nwav)
then
1734 else if (this%uzthst(1, icell) > this%thtr(icell) + extwc1)
then
1735 if (thetaout > dem30)
then
1736 this%uzthst(2, icell) = this%thtr(icell) + extwc1
1737 this%uzflst(2, icell) = &
1738 this%vks(icell) * (((this%uzthst(2, icell) - &
1739 this%thtr(icell)) * thtsrinv)**this%eps(icell))
1740 this%uzdpst(2, icell) = this%extdpuz(icell)
1741 theta2 = this%uzthst(2, icell)
1742 flux2 = this%uzflst(2, icell)
1743 flux1 = this%uzflst(1, icell)
1744 theta1 = this%uzthst(1, icell)
1745 this%uzspst(2, icell) = &
1746 leadspeed(theta1, theta2, flux1, flux2, this%thts(icell), &
1747 this%thtr(icell), this%eps(icell), this%vks(icell))
1748 this%nwavst(icell) = this%nwavst(icell) + 1
1749 if (this%nwavst(icell) > this%nwav)
then
1760 if (this%uzdpst(1, icell) - this%extdpuz(icell) > dem7)
then
1766 diff = this%uzdpst(j, icell) - this%extdpuz(icell)
1767 if (diff > dzero)
then
1774 if (this%uzthst(j, icell) > this%thtr(icell) + extwc1)
then
1777 if (abs(diff) > dem5)
then
1778 if (this%nwavst(icell) + 1 > this%nwav)
then
1784 call this%shift_waves(icell, -1, &
1785 this%nwavst(icell) + 1, j, -1)
1786 this%uzdpst(j, icell) = this%extdpuz(icell)
1787 this%nwavst(icell) = this%nwavst(icell) + 1
1788 if (this%nwavst(icell) > this%nwav)
then
1797 jhold = this%nwavst(icell)
1799 do while (i < this%nwavst(icell))
1800 if (this%uzthst(i, icell) > this%thtr(icell) + extwc1)
then
1802 i = this%nwavst(icell) + 1
1814 do while (kk <= this%nwavst(icell))
1815 if (ietflag == 2)
then
1816 tho = this%uzthst(kk, icell)
1817 fktho = this%uzflst(kk, icell)
1818 hcap = this%caph(icell, tho)
1819 thetaout = this%rate_et_z(icell, factor, fktho, hcap)
1821 if (this%uzthst(kk, icell) > this%thtr(icell) + extwc1)
then
1822 if (this%uzthst(kk, icell) - thetaout > &
1823 this%thtr(icell) + extwc1)
then
1824 this%uzthst(kk, icell) = this%uzthst(kk, icell) - thetaout
1825 else if (this%uzthst(kk, icell) > this%thtr(icell) + extwc1)
then
1826 this%uzthst(kk, icell) = this%thtr(icell) + extwc1
1829 this%uzflst(kk, icell) = &
1831 (((this%uzthst(kk, icell) - &
1832 this%thtr(icell)) * thtsrinv)**this%eps(icell))
1836 this%vks(icell) * ((this%uzthst(kk - 1, icell) - &
1837 this%thtr(icell)) * thtsrinv)**this%eps(icell)
1839 this%vks(icell) * ((this%uzthst(kk, icell) - &
1840 this%thtr(icell)) * thtsrinv)**this%eps(icell)
1841 this%uzflst(kk, icell) = flux2
1842 theta2 = this%uzthst(kk, icell)
1843 theta1 = this%uzthst(kk - 1, icell)
1844 this%uzspst(kk, icell) = leadspeed(theta1, theta2, flux1, flux2, &
1847 this%eps(icell), this%vks(icell))
1856 do while (kj <= this%nwavst(icell) - 1)
1857 if (abs(this%uzthst(kj, icell) - this%uzthst(kj + 1, icell)) < dem6)
then
1858 call this%shift_waves(icell, 1, kj + 1, &
1859 this%nwavst(icell) - 1, 1)
1861 this%nwavst(icell) = this%nwavst(icell) - 1
1865 depth = this%uzdpst(1, icell)
1866 fm = this%unsat_stor(icell, depth)
1867 this%etact(icell) = st - fm
1868 fm = this%etact(icell) / delt
1869 if (this%etact(icell) < dzero)
then
1870 call this%load_waves(icell, this%etsav)
1871 this%nwavst(icell) = nwv
1872 this%etact(icell) = dzero
1873 elseif (petsub - fm < -dem15 .AND. ietflag == 2)
then
1876 call this%load_waves(icell, this%etsav)
1877 this%nwavst(icell) = nwv
1878 this%etact(icell) = dzero
1887 elseif (ietflag < 2)
then