r.watershed el=AST_DEM_patched th=10000 accum=baccum.30m drain=bdir.30m basin=bbasin.30m
r.watershed el=astdempenag30m th=10000 accum=accum.30m drain=dir.30m basin=basin.30m
r.watershed el=dem10m.z th=100000 accum=accum.10m drain=dir.10m basin=basin.10m

r.mapcalc "bstreams.30=if(abs(baccum.30m)>100,1,null())"
r.mapcalc "streams.30=if(abs(accum.30m)>100,1,null())"
r.mapcalc "streams.10=if(abs(accum.10m)>1000,1,null())"
r.mapcalc "streams.10b=if(abs(accum.10m)>10000,1,null())"

r.random -d astdempenag30m n=100000 vect=astdem30mcw100K

v.surf.rst -t astdem30mcw100K elev=dem10m.z slo=dem10m.slp asp=dem10m.asp pcu=dem10m.pc tcu=dem10m.tc dmin=10 smo=1. ten=80 lay=0
fi=44
v.surf.rst -t astdem30mcw100K elev=dem10mt45.z slo=dem10mt45.slp asp=dem10mt45.asp pcu=dem10mt45.pc tcu=dem10mt45.tc dmin=10 smo=2. ten=45 lay=0
fi=25
v.surf.rst -td astdem30mcw100K elev=dem10mt30.z slo=dem10mt30.dx asp=dem10mt30.dy dmin=35 smo=2.5 ten=30 lay=0

r.flow astdempenag30m dsout=dsd30m
r.flow dem10m.z dsout=dsd10m
r.flow dem10mt45.z dsout=dsd10mt45

USLE3D

r.mapcalc "ls3d.14.10m=1.4*exp(dsd10mt45*10./22.1,0.4)*exp(sin(dem10mt45.slp)/0.0896,1.2)"

R=100 K=0.32 C=1. (bare) C=0.002 (undisturbed forest, 50% canopy)
usle3dbare.14.10m=100*0.32.*1.*1.4*exp(dsd10mt45*10./22.1,0.4)*exp(sin(dem10mt45.slp)/0.0896,1.2)
usle3dforest.14.10m=100*0.32.*0.002*1.4*exp(dsd10mt45*10./22.1,0.4)*exp(sin(dem10mt45.slp)/0.0896,1.2)
Cfacagri 0.002, 0.1(agri)
usle3dagri.14.10m=100*0.32.*Cfacagri1*1.4*exp(dsd10mt45*10./22.1,0.4)*exp(sin(dem10mt45.slp)/0.0896,1.2)