C THIS SUBROUTINE CALCULATES TERRAIN RESISTANCE OF THE VEHCILE
common/m1/nwhls(10),rads(10),width(10),pload(10),area(10),aa(10)
common/m2/ip(10),pres1(10),tlength(10)
common/m5/iveh,nunits,pmax,gclear,gvw
common/m6/def,sec
common/m7/ibase,rci,idist,slope
dimension xl2(10),rres1(10)
C START LOOP FOR RESISTANCE
flag = 1.0
rsnow = 0.0
soilz = 0.0
do i=1,10
xl2(i)=0.0
rres1(i)=0.0
end do
i=1
UNIT CHARACTERISTICS AND PMAX
C WHEELED VEHICLES
if (iveh.eq.0) then
C ACCT FOR WEAK SOIL BASE
if(ibase.eq.5) then
pn = 1.
!IS THE NUMBER OF PASSES THE VEHICLE MAKES
s = 0.05
!SLIP ASSUMMED CONSTANT FOR THIS CALC
C def IS THE LOADED TIRE DEFLECTION
C sec IS THE UNLOADED TIRE SECTION HEIGHT
soilz=(10.*rads(i)*pn**.5)/((rci*2.*rads(i)*width(i))/
&(pload(i)*(1.-def/sec)**(3./2.)*s**0.2))**(5./3.)
if (soilz.lt.0.0) soilz=0.0
soilz = soilz*2.54
end if
sumz=zmax+soilz
!sumz IS IN cm
C RESISTANCE PARAMETER, WHEELED VEHICLES IN SNOW
xl2(i)=rads(i)*acos((rads(i)-(sumz/2.54))/rads(i)) !INCHES
xl2(i)=xl2(i)*2.54
!cm
c
write(*,*)'xl2',xl2,'rads',rads(i)
C ACCOUNT FOR TIRE CURVATURE/DEEP SNOW FLAG
radscm = rads(i)*2.54
28