1566 class(UzfCellGroupType) :: this
1567 integer(I4B),
intent(in) :: icell
1568 real(DP),
intent(in) :: delt
1569 integer(I4B),
intent(in) :: ietflag
1570 integer(I4B),
intent(inout) :: ierr
1572 type(UzfCellGroupType) :: uzfktemp
1574 real(DP) :: thetaout
1577 real(DP) :: thtsrinv
1578 real(DP) :: epsfksthts
1593 integer(I4B) :: jhold
1597 integer(I4B) :: numadd
1600 integer(I4B) :: itest
1603 this%etact(icell) = dzero
1604 if (this%extdpuz(icell) < dem7)
return
1605 petsub = this%rootact(icell) * this%pet(icell) * &
1606 this%extdpuz(icell) / this%extdp(icell)
1607 thetaout = delt * petsub / this%extdp(icell)
1608 if (ietflag == 1) thetaout = delt * this%pet(icell) / this%extdp(icell)
1609 if (thetaout < dem10)
return
1610 depth = this%uzdpst(1, icell)
1611 st = this%unsat_stor(icell, depth)
1612 if (st < dem4)
return
1615 nwv = this%nwavst(icell)
1617 call uzfktemp%init(1, nwv)
1620 call uzfktemp%wave_shift(this, 1, icell, 0, 1, nwv, 1)
1622 this%etact(icell) = dzero
1623 if (this%thts(icell) - this%thtr(icell) < dem7)
then
1624 thtsrinv = 1.0 / dem7
1626 thtsrinv = done / (this%thts(icell) - this%thtr(icell))
1628 epsfksthts = this%eps(icell) * this%vks(icell) * thtsrinv
1629 this%etact(icell) = dzero
1631 extwc1 = this%extwc(icell) - this%thtr(icell)
1632 if (extwc1 < dem6) extwc1 = dem7
1638 do while (itest == 0)
1640 if (k > 1 .AND. abs(fmp - petsub) > dem5 * petsub)
then
1641 factor = factor / (fm / petsub)
1645 if (this%nwavst(icell) == 1 .AND. &
1646 this%uzdpst(1, icell) <= this%extdpuz(icell))
then
1647 if (ietflag == 2)
then
1648 tho = this%uzthst(1, icell)
1649 fktho = this%uzflst(1, icell)
1650 hcap = this%caph(icell, tho)
1651 thetaout = this%rate_et_z(icell, factor, fktho, hcap)
1653 if ((this%uzthst(1, icell) - thetaout) > this%thtr(icell) + extwc1)
then
1654 this%uzthst(1, icell) = this%uzthst(1, icell) - thetaout
1655 this%uzflst(1, icell) = &
1656 this%vks(icell) * (((this%uzthst(1, icell) - &
1657 this%thtr(icell)) * thtsrinv)**this%eps(icell))
1658 else if (this%uzthst(1, icell) > this%thtr(icell) + extwc1)
then
1659 this%uzthst(1, icell) = this%thtr(icell) + extwc1
1660 this%uzflst(1, icell) = &
1661 this%vks(icell) * (((this%uzthst(1, icell) - &
1662 this%thtr(icell)) * thtsrinv)**this%eps(icell))
1666 else if (this%nwavst(icell) > 1 .AND. &
1667 this%uzdpst(this%nwavst(icell), icell) > this%extdpuz(icell))
then
1668 if (ietflag == 2)
then
1669 tho = this%uzthst(this%nwavst(icell), icell)
1670 fktho = this%uzflst(this%nwavst(icell), icell)
1671 hcap = this%caph(icell, tho)
1672 thetaout = this%rate_et_z(icell, factor, fktho, hcap)
1674 if (this%uzthst(this%nwavst(icell), icell) - thetaout > &
1675 this%thtr(icell) + extwc1)
then
1676 this%uzthst(this%nwavst(icell) + 1, icell) = &
1677 this%uzthst(this%nwavst(icell), icell) - thetaout
1679 else if (this%uzthst(this%nwavst(icell), icell) > &
1680 this%thtr(icell) + extwc1)
then
1681 this%uzthst(this%nwavst(icell) + 1, icell) = this%thtr(icell) + extwc1
1684 if (numadd == 1)
then
1685 this%uzflst(this%nwavst(icell) + 1, icell) = &
1687 (((this%uzthst(this%nwavst(icell) + 1, icell) - &
1688 this%thtr(icell)) * thtsrinv)**this%eps(icell))
1689 theta2 = this%uzthst(this%nwavst(icell) + 1, icell)
1690 flux2 = this%uzflst(this%nwavst(icell) + 1, icell)
1691 flux1 = this%uzflst(this%nwavst(icell), icell)
1692 theta1 = this%uzthst(this%nwavst(icell), icell)
1693 this%uzspst(this%nwavst(icell) + 1, icell) = &
1694 leadspeed(theta1, theta2, flux1, flux2, this%thts(icell), &
1695 this%thtr(icell), this%eps(icell), this%vks(icell))
1696 this%uzdpst(this%nwavst(icell) + 1, icell) = this%extdpuz(icell)
1697 this%nwavst(icell) = this%nwavst(icell) + 1
1698 if (this%nwavst(icell) > this%nwav(icell))
then
1709 else if (this%nwavst(icell) == 1)
then
1710 if (ietflag == 2)
then
1711 tho = this%uzthst(1, icell)
1712 fktho = this%uzflst(1, icell)
1713 hcap = this%caph(icell, tho)
1714 thetaout = this%rate_et_z(icell, factor, fktho, hcap)
1716 if ((this%uzthst(1, icell) - thetaout) > this%thtr(icell) + extwc1)
then
1717 if (thetaout > dem30)
then
1718 this%uzthst(2, icell) = this%uzthst(1, icell) - thetaout
1719 this%uzflst(2, icell) = &
1720 this%vks(icell) * (((this%uzthst(2, icell) - this%thtr(icell)) * &
1721 thtsrinv)**this%eps(icell))
1722 this%uzdpst(2, icell) = this%extdpuz(icell)
1723 theta2 = this%uzthst(2, icell)
1724 flux2 = this%uzflst(2, icell)
1725 flux1 = this%uzflst(1, icell)
1726 theta1 = this%uzthst(1, icell)
1727 this%uzspst(2, icell) = &
1728 leadspeed(theta1, theta2, flux1, flux2, this%thts(icell), &
1729 this%thtr(icell), this%eps(icell), this%vks(icell))
1730 this%nwavst(icell) = this%nwavst(icell) + 1
1731 if (this%nwavst(icell) > this%nwav(icell))
then
1738 else if (this%uzthst(1, icell) > this%thtr(icell) + extwc1)
then
1739 if (thetaout > dem30)
then
1740 this%uzthst(2, icell) = this%thtr(icell) + extwc1
1741 this%uzflst(2, icell) = &
1742 this%vks(icell) * (((this%uzthst(2, icell) - &
1743 this%thtr(icell)) * thtsrinv)**this%eps(icell))
1744 this%uzdpst(2, icell) = this%extdpuz(icell)
1745 theta2 = this%uzthst(2, icell)
1746 flux2 = this%uzflst(2, icell)
1747 flux1 = this%uzflst(1, icell)
1748 theta1 = this%uzthst(1, icell)
1749 this%uzspst(2, icell) = &
1750 leadspeed(theta1, theta2, flux1, flux2, this%thts(icell), &
1751 this%thtr(icell), this%eps(icell), this%vks(icell))
1752 this%nwavst(icell) = this%nwavst(icell) + 1
1753 if (this%nwavst(icell) > this%nwav(icell))
then
1764 if (this%uzdpst(1, icell) - this%extdpuz(icell) > dem7)
then
1770 diff = this%uzdpst(j, icell) - this%extdpuz(icell)
1771 if (diff > dzero)
then
1778 if (this%uzthst(j, icell) > this%thtr(icell) + extwc1)
then
1781 if (abs(diff) > dem5)
then
1782 call this%wave_shift(this, icell, icell, -1, &
1783 this%nwavst(icell) + 1, j, -1)
1784 this%uzdpst(j, icell) = this%extdpuz(icell)
1785 this%nwavst(icell) = this%nwavst(icell) + 1
1786 if (this%nwavst(icell) > this%nwav(icell))
then
1795 jhold = this%nwavst(icell)
1797 do while (i < this%nwavst(icell))
1798 if (this%uzthst(i, icell) > this%thtr(icell) + extwc1)
then
1800 i = this%nwavst(icell) + 1
1812 do while (kk <= this%nwavst(icell))
1813 if (ietflag == 2)
then
1814 tho = this%uzthst(kk, icell)
1815 fktho = this%uzflst(kk, icell)
1816 hcap = this%caph(icell, tho)
1817 thetaout = this%rate_et_z(icell, factor, fktho, hcap)
1819 if (this%uzthst(kk, icell) > this%thtr(icell) + extwc1)
then
1820 if (this%uzthst(kk, icell) - thetaout > &
1821 this%thtr(icell) + extwc1)
then
1822 this%uzthst(kk, icell) = this%uzthst(kk, icell) - thetaout
1823 else if (this%uzthst(kk, icell) > this%thtr(icell) + extwc1)
then
1824 this%uzthst(kk, icell) = this%thtr(icell) + extwc1
1827 this%uzflst(kk, icell) = &
1829 (((this%uzthst(kk, icell) - &
1830 this%thtr(icell)) * thtsrinv)**this%eps(icell))
1834 this%vks(icell) * ((this%uzthst(kk - 1, icell) - &
1835 this%thtr(icell)) * thtsrinv)**this%eps(icell)
1837 this%vks(icell) * ((this%uzthst(kk, icell) - &
1838 this%thtr(icell)) * thtsrinv)**this%eps(icell)
1839 this%uzflst(kk, icell) = flux2
1840 theta2 = this%uzthst(kk, icell)
1841 theta1 = this%uzthst(kk - 1, icell)
1842 this%uzspst(kk, icell) = leadspeed(theta1, theta2, flux1, flux2, &
1845 this%eps(icell), this%vks(icell))
1854 do while (kj <= this%nwavst(icell) - 1)
1855 if (abs(this%uzthst(kj, icell) - this%uzthst(kj + 1, icell)) < dem6)
then
1856 call this%wave_shift(this, icell, icell, 1, kj + 1, &
1857 this%nwavst(icell) - 1, 1)
1859 this%nwavst(icell) = this%nwavst(icell) - 1
1863 depth = this%uzdpst(1, icell)
1864 fm = this%unsat_stor(icell, depth)
1865 this%etact(icell) = st - fm
1866 fm = this%etact(icell) / delt
1867 if (this%etact(icell) < dzero)
then
1868 call this%wave_shift(uzfktemp, icell, 1, 0, 1, nwv, 1)
1869 this%nwavst(icell) = nwv
1870 this%etact(icell) = dzero
1871 elseif (petsub - fm < -dem15 .AND. ietflag == 2)
then
1874 call this%wave_shift(uzfktemp, icell, 1, 0, 1, nwv, 1)
1875 this%nwavst(icell) = nwv
1876 this%etact(icell) = dzero
1885 elseif (ietflag < 2)
then
1893 call uzfktemp%dealloc()