This routine computes the spatial average value of .
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rk), | intent(in) | :: | c(*) | |||
real(kind=rk), | intent(out) | :: | c1ave |
pure subroutine c1_average(c, c1ave) !! This routine computes the spatial average value of \(c_1\). use web_par, only: mx, my, ns, mxns real(rk), intent(in) :: c(*) real(rk), intent(out) :: c1ave integer :: ioff, iyoff, jx, jy real(rk) :: total total = zero do jy = 1, my iyoff = mxns*(jy - 1) do jx = 1, mx ioff = iyoff + ns*(jx - 1) total = total + c(ioff + 1) end do end do c1ave = total/(mx*my) end subroutine c1_average