      subroutine qgvel(f,m,n,dx,v0,u,v)

      dimension f(m,n)

      i = (m + 1) / 2
      j = (n + 1) / 2

      u=v0*((f(i,j)+f(i+1,j))-
     .      (f(i,j+1)+f(i+1,j+1)))/(dx*2.)
      v=v0*((f(i+1,j)+f(i+1,j+1))-
     .      (f(i,j)+f(i,j+1)))/(dx*2.)
      
      return
      end
