1707 class(UzfCellGroupType) :: this
1708 integer(I4B),
intent(in) :: icell
1709 real(DP),
intent(in) :: delt
1710 integer(I4B),
intent(in) :: ietflag
1711 integer(I4B),
intent(inout) :: ierr
1713 type(UzfCellGroupType) :: uzfktemp
1715 real(DP) :: thetaout
1718 real(DP) :: thtsrinv
1719 real(DP) :: epsfksthts
1734 integer(I4B) :: jhold
1738 integer(I4B) :: numadd
1741 integer(I4B) :: itest
1744 this%etact(icell) = dzero
1745 if (this%extdpuz(icell) < dem7)
return
1746 petsub = this%rootact(icell) * this%pet(icell) * &
1747 this%extdpuz(icell) / this%extdp(icell)
1748 thetaout = delt * petsub / this%extdp(icell)
1749 if (ietflag == 1) thetaout = delt * this%pet(icell) / this%extdp(icell)
1750 if (thetaout < dem10)
return
1751 depth = this%uzdpst(1, icell)
1752 st = this%unsat_stor(icell, depth)
1753 if (st < dem4)
return
1756 nwv = this%nwavst(icell)
1758 call uzfktemp%init(1, nwv)
1761 call uzfktemp%wave_shift(this, 1, icell, 0, 1, nwv, 1)
1763 this%etact(icell) = dzero
1764 if (this%thts(icell) - this%thtr(icell) < dem7)
then
1765 thtsrinv = 1.0 / dem7
1767 thtsrinv = done / (this%thts(icell) - this%thtr(icell))
1769 epsfksthts = this%eps(icell) * this%vks(icell) * thtsrinv
1770 this%etact(icell) = dzero
1772 extwc1 = this%extwc(icell) - this%thtr(icell)
1773 if (extwc1 < dem6) extwc1 = dem7
1779 do while (itest == 0)
1781 if (k > 1 .AND. abs(fmp - petsub) > dem5 * petsub)
then
1782 factor = factor / (fm / petsub)
1786 if (this%nwavst(icell) == 1 .AND. &
1787 this%uzdpst(1, icell) <= this%extdpuz(icell))
then
1788 if (ietflag == 2)
then
1789 tho = this%uzthst(1, icell)
1790 fktho = this%uzflst(1, icell)
1791 hcap = this%caph(icell, tho)
1792 thetaout = this%rate_et_z(icell, factor, fktho, hcap)
1794 if ((this%uzthst(1, icell) - thetaout) > this%thtr(icell) + extwc1)
then
1795 this%uzthst(1, icell) = this%uzthst(1, icell) - thetaout
1796 this%uzflst(1, icell) = &
1797 this%vks(icell) * (((this%uzthst(1, icell) - &
1798 this%thtr(icell)) * thtsrinv)**this%eps(icell))
1799 else if (this%uzthst(1, icell) > this%thtr(icell) + extwc1)
then
1800 this%uzthst(1, icell) = this%thtr(icell) + extwc1
1801 this%uzflst(1, icell) = &
1802 this%vks(icell) * (((this%uzthst(1, icell) - &
1803 this%thtr(icell)) * thtsrinv)**this%eps(icell))
1807 else if (this%nwavst(icell) > 1 .AND. &
1808 this%uzdpst(this%nwavst(icell), icell) > this%extdpuz(icell))
then
1809 if (ietflag == 2)
then
1810 tho = this%uzthst(this%nwavst(icell), icell)
1811 fktho = this%uzflst(this%nwavst(icell), icell)
1812 hcap = this%caph(icell, tho)
1813 thetaout = this%rate_et_z(icell, factor, fktho, hcap)
1815 if (this%uzthst(this%nwavst(icell), icell) - thetaout > &
1816 this%thtr(icell) + extwc1)
then
1817 this%uzthst(this%nwavst(icell) + 1, icell) = &
1818 this%uzthst(this%nwavst(icell), icell) - thetaout
1820 else if (this%uzthst(this%nwavst(icell), icell) > &
1821 this%thtr(icell) + extwc1)
then
1822 this%uzthst(this%nwavst(icell) + 1, icell) = this%thtr(icell) + extwc1
1825 if (numadd == 1)
then
1826 this%uzflst(this%nwavst(icell) + 1, icell) = &
1828 (((this%uzthst(this%nwavst(icell) + 1, icell) - &
1829 this%thtr(icell)) * thtsrinv)**this%eps(icell))
1830 theta2 = this%uzthst(this%nwavst(icell) + 1, icell)
1831 flux2 = this%uzflst(this%nwavst(icell) + 1, icell)
1832 flux1 = this%uzflst(this%nwavst(icell), icell)
1833 theta1 = this%uzthst(this%nwavst(icell), icell)
1834 this%uzspst(this%nwavst(icell) + 1, icell) = &
1835 leadspeed(theta1, theta2, flux1, flux2, this%thts(icell), &
1836 this%thtr(icell), this%eps(icell), this%vks(icell))
1837 this%uzdpst(this%nwavst(icell) + 1, icell) = this%extdpuz(icell)
1838 this%nwavst(icell) = this%nwavst(icell) + 1
1839 if (this%nwavst(icell) > this%nwav(icell))
then
1850 else if (this%nwavst(icell) == 1)
then
1851 if (ietflag == 2)
then
1852 tho = this%uzthst(1, icell)
1853 fktho = this%uzflst(1, icell)
1854 hcap = this%caph(icell, tho)
1855 thetaout = this%rate_et_z(icell, factor, fktho, hcap)
1857 if ((this%uzthst(1, icell) - thetaout) > this%thtr(icell) + extwc1)
then
1858 if (thetaout > dem30)
then
1859 this%uzthst(2, icell) = this%uzthst(1, icell) - thetaout
1860 this%uzflst(2, icell) = &
1861 this%vks(icell) * (((this%uzthst(2, icell) - this%thtr(icell)) * &
1862 thtsrinv)**this%eps(icell))
1863 this%uzdpst(2, icell) = this%extdpuz(icell)
1864 theta2 = this%uzthst(2, icell)
1865 flux2 = this%uzflst(2, icell)
1866 flux1 = this%uzflst(1, icell)
1867 theta1 = this%uzthst(1, icell)
1868 this%uzspst(2, icell) = &
1869 leadspeed(theta1, theta2, flux1, flux2, this%thts(icell), &
1870 this%thtr(icell), this%eps(icell), this%vks(icell))
1871 this%nwavst(icell) = this%nwavst(icell) + 1
1872 if (this%nwavst(icell) > this%nwav(icell))
then
1879 else if (this%uzthst(1, icell) > this%thtr(icell) + extwc1)
then
1880 if (thetaout > dem30)
then
1881 this%uzthst(2, icell) = this%thtr(icell) + extwc1
1882 this%uzflst(2, icell) = &
1883 this%vks(icell) * (((this%uzthst(2, icell) - &
1884 this%thtr(icell)) * thtsrinv)**this%eps(icell))
1885 this%uzdpst(2, icell) = this%extdpuz(icell)
1886 theta2 = this%uzthst(2, icell)
1887 flux2 = this%uzflst(2, icell)
1888 flux1 = this%uzflst(1, icell)
1889 theta1 = this%uzthst(1, icell)
1890 this%uzspst(2, icell) = &
1891 leadspeed(theta1, theta2, flux1, flux2, this%thts(icell), &
1892 this%thtr(icell), this%eps(icell), this%vks(icell))
1893 this%nwavst(icell) = this%nwavst(icell) + 1
1894 if (this%nwavst(icell) > this%nwav(icell))
then
1905 if (this%uzdpst(1, icell) - this%extdpuz(icell) > dem7)
then
1911 diff = this%uzdpst(j, icell) - this%extdpuz(icell)
1912 if (diff > dzero)
then
1919 if (this%uzthst(j, icell) > this%thtr(icell) + extwc1)
then
1922 if (abs(diff) > dem5)
then
1923 call this%wave_shift(this, icell, icell, -1, &
1924 this%nwavst(icell) + 1, j, -1)
1925 this%uzdpst(j, icell) = this%extdpuz(icell)
1926 this%nwavst(icell) = this%nwavst(icell) + 1
1927 if (this%nwavst(icell) > this%nwav(icell))
then
1936 jhold = this%nwavst(icell)
1938 do while (i < this%nwavst(icell))
1939 if (this%uzthst(i, icell) > this%thtr(icell) + extwc1)
then
1941 i = this%nwavst(icell) + 1
1953 do while (kk <= this%nwavst(icell))
1954 if (ietflag == 2)
then
1955 tho = this%uzthst(kk, icell)
1956 fktho = this%uzflst(kk, icell)
1957 hcap = this%caph(icell, tho)
1958 thetaout = this%rate_et_z(icell, factor, fktho, hcap)
1960 if (this%uzthst(kk, icell) > this%thtr(icell) + extwc1)
then
1961 if (this%uzthst(kk, icell) - thetaout > &
1962 this%thtr(icell) + extwc1)
then
1963 this%uzthst(kk, icell) = this%uzthst(kk, icell) - thetaout
1964 else if (this%uzthst(kk, icell) > this%thtr(icell) + extwc1)
then
1965 this%uzthst(kk, icell) = this%thtr(icell) + extwc1
1968 this%uzflst(kk, icell) = &
1970 (((this%uzthst(kk, icell) - &
1971 this%thtr(icell)) * thtsrinv)**this%eps(icell))
1975 this%vks(icell) * ((this%uzthst(kk - 1, icell) - &
1976 this%thtr(icell)) * thtsrinv)**this%eps(icell)
1978 this%vks(icell) * ((this%uzthst(kk, icell) - &
1979 this%thtr(icell)) * thtsrinv)**this%eps(icell)
1980 this%uzflst(kk, icell) = flux2
1981 theta2 = this%uzthst(kk, icell)
1982 theta1 = this%uzthst(kk - 1, icell)
1983 this%uzspst(kk, icell) = leadspeed(theta1, theta2, flux1, flux2, &
1986 this%eps(icell), this%vks(icell))
1995 do while (kj <= this%nwavst(icell) - 1)
1996 if (abs(this%uzthst(kj, icell) - this%uzthst(kj + 1, icell)) < dem6)
then
1997 call this%wave_shift(this, icell, icell, 1, kj + 1, &
1998 this%nwavst(icell) - 1, 1)
2000 this%nwavst(icell) = this%nwavst(icell) - 1
2004 depth = this%uzdpst(1, icell)
2005 fm = this%unsat_stor(icell, depth)
2006 this%etact(icell) = st - fm
2007 fm = this%etact(icell) / delt
2008 if (this%etact(icell) < dzero)
then
2009 call this%wave_shift(uzfktemp, icell, 1, 0, 1, nwv, 1)
2010 this%nwavst(icell) = nwv
2011 this%etact(icell) = dzero
2012 elseif (petsub - fm < -dem15 .AND. ietflag == 2)
then
2015 call this%wave_shift(uzfktemp, icell, 1, 0, 1, nwv, 1)
2016 this%nwavst(icell) = nwv
2017 this%etact(icell) = dzero
2026 elseif (ietflag < 2)
then
2034 call uzfktemp%dealloc()