subroutine ranrou( * csfsil, csfsan, * bszrr, bszrro, * cumpa, dcump, cf2cov, csvroc) c + + + ARGUMENT DECLARATIONS + + + real csfsil, csfsan real bszrr, bszrro, * cumpa, dcump, cf2cov, csvroc c + + + LOCAL VARIABLES + + + real arr, crr c + + + LOCAL DEFINITIONS + + + c c arr - regression coef. to calc. random roughness c crr - regression coefficient for random roughness decrease c csfsan - top layer fraction of sand. c csfsil - top layer fraction of silt. c csvroc - soil volume fraction of rock in top layer c RANDOM ROUGHNESS SECTION: c calc. reg. coefficients (eq. S-12, S-13) arr = 91.08 + 765.8 * csfsil crr = 0.53 + 4.66 * csfsan - 3.8 * csfsan**1.5 & - 1.22*(csfsan)**0.5 c calc. apparent precip. (eq. S-11 is S-14 solved for a bare surface) C changed * to ** to conform to equ S-10 c erosion could make bszrr > bszrro so insert fix - LH if(bszrr .ge. bszrro) then cumpa = 0.0 bszrro = bszrr else cumpa = arr * (-log(bszrr / bszrro)) ** (1.0 / crr) end if c update random roughness (eq. S-14) C *** debugging fix if ((cumpa + (1.0 - csvroc) * cf2cov * dcump)/arr * .lt. 0.) then bszrr = bszrro c write(*,*) 'soil: debugging fix executed 1' c write(*,*) ' cumpa, dcump, cf2cov, arr, csvroc ', c * cumpa, dcump, cf2cov, arr, csvroc else C *** end of debugging fix C *** write(*,*) ' crr ', crr bszrr = bszrro * exp(-((cumpa + (1.0 - csvroc)* * cf2cov*dcump) /arr)**crr) endif if ( bszrr .lt. 2.0) bszrr = 2.0 end