uv=gm('ERA-40/x.01m',m=1,sc=15201+[0,1],pm=[99999,1,0])
uv1=pp_regrid(uv,get_orog(),/pole)

print,' '
print,'Testing mixed flow'
print,'------------------'
print,' '
sfvp=fsfvp(uv1)
print,'Range of [u,v]: ',pp_range(uv1)
; print,'Range of sfvp: ',pp_range(sfvp)
div=fgrad(sfvp(1))
rot=kcross(fgrad(sfvp(0)))
print,'Range of div wind: ',pp_range(div)
print,'Range of rot wind: ',pp_range(rot)
print,' '
print,'Range of div(rot_wind) (should be zero): ',pp_range(fdiv(rot))
print,'Range of curl(div_wind) (should be zero): ',pp_range(fcurl(div))
print,' '

!p.multi=[0,2,2]
pp_plot,/glob,model=0,/vec,lev=(indgen(5)+1)*3,skip=[4,3],col=3,xmarg=[0,0],/notit,abc='Raw wind',uv1
pp_plot,/glob,model=0,/vec,lev=(indgen(5)+1)*3,skip=[4,3],col=3,xmarg=[0,0],/notit,abc='Rot wind',rot
pp_plot,/glob,model=0,/vec,lev=(indgen(5)+1),skip=[4,3],col=3,xmarg=[0,0],/notit,abc='Div wind',div
pp_plot,/glob,model=0,/vec,lev=(indgen(5)+1),skip=[4,3],col=3,wpp_ff(wpp_ff(rot,div,3),uv1,4) ,/notit,abc='Rot+Div-Raw',xmarg=[0,0]

; gettwogifs,out='test_sfvp1'
