c    @(#)getuv.f	1.3
      subroutine getuv
c
c leonard walstad
c
c 5/84
c
c
c
c routine to calculate u,v from the q-g streamfunction, vorticity
c and surface density.
c
c----------------------------------------------------------------------
c
c
      include'mladv.inc'
c
c
c
c
c
c----------------------------------------------------------------------
c
c variables needed from the qg model.
c
      common/scrat/r(mn0),r1(mn0),r2(mn0),r3(mn0)
      common/fields/vort(mn0,k0),stream(mn0,k0),prvjac(mn0,k0),
     +     topden(mn0),botden(mn0),relief(mn0),prvtop(mn0),
     +     prvbot(mn0),topfct(k0),botfct(k0),pvort(mn0)
      common/parm/kz,m,mm1,mm2,mp1,msq,tim,tmax,tstart,hy,rea,dt,
     +   xbasin,yy(mx0),icalc,kzp1,kzm1,iftop,ifbot,iftvv,ifrel,theta,
     +   ifsbl,ifeva
                
      common/threed/hz(k0),scsig,sigz(k01),eigval(k0),ainv(k0,k0),
     .              amat(k0,k0)
      common/user/pram(16)
      common/dynam/alpha,beta,rf
      common/unit/iin,iout,idff,idif,iorr,iowr,iplt,ifndd
      common /cnn/ n, nm1, nm2, np1
      common /extpar/ rlat0, rlng0, t0, v0, dhor, ht, time0,
     +                r0,f0star
c
c
c----------------------------------------------------------------------
c
c
c
c
      fact=hz(1)*.5/scsig/sigz(1)
      do 5 ip=1,msq
        strm0(ip)=stream(ip,1)+fact*topden(ip)
    5 continue
c
c
c
      return
      end
