subroutine fric(lm,tau,ddtddg,ddtddp,dslip,sed,spd,
     1 ddtddt,pnewdt,statev,dgam,taulm,press,dpress,ddpddh,
     2 slip,kstep,kinc,time,dtime,noel,ciname,slname,
     3 msname,npt,node,npatch,coords,rcoord,drot,temp,
     4 predef,nfdir,mcrd,npred,nstatv,chrlngth,props,nprops)
c
       include 'aba_param.inc'
c
       character*80 ciname,slname,msname
       dimension tau(nfdir),ddtddg(nfdir,nfdir),ddtddp(nfdir),
     1           dslip(nfdir),ddtddt(nfdir,2),statev(*),
     2           dgam(nfdir),taulm(nfdir),slip(nfdir),time(2),
     3           coords(mcrd),rcoord(mcrd),drot(2,2),temp(2),
     4           predef(2,*),props(nprops)
c
       parameter(zero=0.0D0)
c
       if (lm .eq. 2) return
c
c      viscosity, k
c
       xk=props(1)
c
       lm=0
c      dg/dtime= xk*tau
       ddtddg(1,1)=1.0/(xk*dtime)
       ddtddg(2,2)=1.0/(xk*dtime)
       ddtddg(1,2)=zero
       ddtddg(2,1)=zero
       tau(1)=dgam(1)/(xk*dtime)
       tau(2)=dgam(2)/(xk*dtime)
       dslip(1)=dgam(1)
       dslip(2)=dgam(2)

       if (kinc.eq.1.and.kstep.eq.1) then
         if (statev(1).ne.1.0 .or. statev(2).ne.2.0) then
           write (7,*) '***ERROR: SDVINI failure'
           call xit()
         end if
       end if

       statev(1) = dslip(1)
       statev(2) = dslip(2)

       return
       end

C
C  User routine for initial SDV input
C
      subroutine sdvini(statev,coords,nstatv,ncrds,noel,npt,layer,kspt)
c
C
       include 'aba_param.inc'
c
      dimension statev(nstatv),coords(ncrds)
c
      statev(1) = 1.0
      statev(2) = 2.0
c
      return
      end