!
!  cell_avg.f90
!
      subroutine cell_avg(v,vavg,n)
      implicit none
      integer :: n
      real :: v(n),vavg
      real :: vsum
      integer :: i
!
      vsum = 0.0       
      do i=1,n
        vsum = vsum + v(i) 
      enddo
      vavg = vsum/n
!
      end subroutine cell_avg 