!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
SUBROUTINE avrh(a,axy,im,jm,nm)
!***********************************************************************
!                                                                      *
!        Average four scalar points => result is in the wind points    *
!                                                                      *
!***********************************************************************
!-----------------------------------------------------------------------
!INCLUDE 'param_c.h'
!-----------------------------------------------------------------------
REAL, DIMENSION(0:im+1,0:jm+1,nm):: a, axy
REAL, DIMENSION(0:im+1,0:jm+1)::  axp
!-----------------------------------------------------------------------
                   DO n = 1, nm
      DO j=0,jm+1
      DO i=0,im
        axp(i,j)=a(i,j,n)+a(i+1,j,n)
      END DO
      END DO

      DO j=0,jm
      DO i=0,im
        axy(i,j,n)=axp(i,j)+axp(i,j+1)
      END DO
      END DO
                   END DO
!-----------------------------------------------------------------------
END SUBROUTINE avrh
