c1_average Subroutine

public pure subroutine c1_average(c, c1ave)

Uses

  • proc~~c1_average~~UsesGraph proc~c1_average c1_average module~web_par web_par proc~c1_average->module~web_par module~daskr_kinds daskr_kinds module~web_par->module~daskr_kinds iso_fortran_env iso_fortran_env module~daskr_kinds->iso_fortran_env

This routine computes the spatial average value of .

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: c(*)
real(kind=rk), intent(out) :: c1ave

Called by

proc~~c1_average~~CalledByGraph proc~c1_average c1_average proc~rt~4 rt proc~rt~4->proc~c1_average program~example_web example_web program~example_web->proc~c1_average

Variables

Type Visibility Attributes Name Initial
integer, public :: ioff
integer, public :: iyoff
integer, public :: jx
integer, public :: jy
real(kind=rk), public :: total

Source Code

   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