subroutine set_hc(smtill,smutil,hour,bdtill,bdutil) c c +++PURPOSE+++ c This function is called from the "WINTER" function on an hourly c basis and its purpose is to initialize inputs for and to cal- c culate the values for Hydraulic Conductivities. c c Authors(s): John Witte, UofMn WCES @ USDA-ARS-NCSRL c Date: 10/27/93 c Verified and tested by Reza Savabi, USDA-ARS, NSERL 317-494-5051 c August 1994 c c +++ARGUMENT DECLARATIONS+++ real smtill,smutil,bdtill,bdutil integer hour c c +++ARGUMENT DEFINITIONS+++ c smtill - The soil moisture of the tilled soil. (%/100) c smutil - The soil moisture of the untilled soil. (%/100) c hour - Hour of the day that the model is running. (hr) c bdtill - Bulk density of the tilled soil layer. (Kg/m^3) c bdutil - Bulk density of the untilled soil layer. (Kg/m^3) c +++PARAMETERS+++ include 'pmxpln.inc' include 'pmxnsl.inc' include 'pmxhil.inc' include 'pmxtls.inc' include 'pmxtil.inc' include 'pmxcrp.inc' include 'pmxpnd.inc' c +++COMMON BLOCKS+++ include 'cstruc.inc' c read: iplane c include 'cwater.inc' c read: ssc,st,fctill(mxplan),fcutil(mxplan) c include 'cwint.inc' c read: thetdr,ssc,hk c include 'cparame.inc' c read: ks c c +++LOCAL VARIABLES+++ save real portil,adjtil,adjutl,kstill, 1 ksutil,kutill,kuutil,temp,porutl integer count c c +++LOCAL DEFINITIONS+++ c portil - Calculated porosity of the tilled soil layer. (%/100) c porutl - Calculated porosity of the untilled soil layr.(%/100) c adjtil - Calculated Hyd. Conductivity adjustment-tilled. (*) c adjutl - Calculated Hyd. Conductivity adjustment-untilled. (*) c kstill - Saturated Hyd. Cond of tilled layer. (m/hr) c ksutil - Saturated Hyd. Cond of untilled layer. (m/hr) c kutill - Unsaturated Hyd. Cond of tilled layer. (m/hr) c kuutil - Unsaturated Hyd. Cond of untilled layer. (m/hr) c count - Temporary counter. (*) c temp - Temporary real variable. (m/s) c c c +++END SPECIFICATIONS+++ c -- Porosity values for both tilled and untilled. portil = (2650. - bdtill) / 2650. porutl = (2650. - bdutil) / 2650. c -- Adjusted values for both tilled and untilled. adjtil = (hk(1) + hk(2)) / 2. temp = 0. do 100 count = 3, nsl(iplane), 1 temp = temp + hk(count) 100 continue c adjutl = temp / (nsl(iplane) -2 ) c c XXX For test data set 19 - only have 2 soil layers (nsl(iplane)=2) c Thus - nsl(iplane) - 2 = 0, and you get a divide by zero. c This needs to be examined and fixed properly. c Currently ADJUTL isn't used for anything anyway. dcf 2/25/94 c if(nsl(iplane)-2 .gt. 0)then adjutl = temp / float(nsl(iplane) - 2 ) else adjutl = hk(2) endif c -- 1/3 bar water content values for both tilled and untilled. c wiltil = (thetdr(1,iplane) + thetdr(2,iplane)) / 2. c temp = 0. c do 200 count = 3, nsl(iplane), 1 c temp = temp + thetdr(count,iplane) c 200 continue c wilutl = temp / (nsl(iplane) -2) c c XXX For test data set 19 - only have 2 soil layers (nsl(iplane)=2) c Thus - nsl(iplane) - 2 = 0, and you get a divide by zero. c This needs to be examined and fixed properly. c WILUTL is used in subroutine CALCHC. Following needs fixed c as my value for WILUTL will not be correct. dcf 2/25/94 c c if(nsl(iplane)-2 .gt. 0)then c wilutl = temp / float(nsl(iplane) - 2 ) c else c wilutl = thetdr(2,iplane) c endif c -- Saturated hydraulic conductivity for tilled and untilled soil. kstill = (ssc(1,iplane) + ssc(2,iplane)) / 2. temp = 0. do 300 count = 3, nsl(iplane), 1 temp = temp + ssc(count,iplane) 300 continue c ksutil = temp / (nsl(iplane) -2) c c XXX For test data set 19 - only have 2 soil layers (nsl(iplane)=2) c Thus - nsl(iplane) - 2 = 0, and you get a divide by zero. c This needs to be examined and fixed properly. c KSUTIL is used in subroutine CALCHC. Following needs fixed c as my value for KSUTIL will not be correct. dcf 2/25/94 c if(nsl(iplane)-2 .gt. 0)then ksutil = temp / float(nsl(iplane) - 2 ) else ksutil = ssc(2,iplane) endif kstill = kstill * 3600 ksutil = ksutil * 3600 c -- We must change the above units from m/sec to m/hr. c kstill = 0.0084 c ksutil = 0.0084 c -- Palous... kstill = 0.0036 c -- ksutil = 0.0036 c -- Morris... kstill = 0.0084 c -- ksutil = 0.0084 c -- Field capacity for tilled and untilled soil layers. c fctill = (thetfc(1,iplane) + thetfc(2,iplane)) / 2. temp = 0. do 400 count = 3, nsl(iplane), 1 temp = temp + thetfc(count,iplane) 400 continue c fcutil = temp / (nsl(iplane) -2) c c XXX For test data set 19 - only have 2 soil layers (nsl(iplane)=2) c Thus - nsl(iplane) - 2 = 0, and you get a divide by zero. c This needs to be examined and fixed properly. c FCUTIL is used in subroutine CALCHC. Following needs fixed c as my value for FCUTIL will not be correct. dcf 2/25/94 c c if(nsl(iplane)-2 .gt. 0)then c fcutil = temp / float(nsl(iplane) - 2 ) c else c fcutil = thetfc(2,iplane) c endif call calchc(smtill,portil,wiltil(iplane), 1 kstill,kutill,fctill(iplane)) call calchc(smutil,porutl,wilutl(iplane), 1 ksutil,kuutil,fcutil(iplane)) usatkt(iplane) = kutill usatku(iplane) = kuutil return end