!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
      subroutine avrv_oc(v,vxy,lsd)
!     ******************************************************************
!     *                                                                *
!     *  Averaging four wind points => result is in the scalar points  *
!     *                                                                *
!     ******************************************************************
!----------------------------------------------------------------------
      include 'param_o.h'
!-----------------------------------------------------------------------
      integer::lsd
!-----------------------------------------------------------------------
      real, dimension(0:im+1,0:jm+1,nm,lsd):: v, vxy
      real, dimension(0:im+1,0:jm+1,lsd):: vxp
!-----------------------------------------------------------------------
      do n=1,nm
        do j=0,jm
        do i=1,im
          vxp(i,j,:)=v(i,j,n,:)+v(i-1,j,n,:)
        end do
        end do

        do j=1,jm
        do i=1,im
          vxy(i,j,n,:)=vxp(i,j,:)+vxp(i,j-1,:)
        end do
        end do
      end do
!-----------------------------------------------------------------------
                              return
                              end        
