detfreestrtmp Subroutine

public subroutine detfreestrtmp(freestrtmp)

Uses

  • proc~~detfreestrtmp~~UsesGraph proc~detfreestrtmp detfreestrtmp module~modfields modfields proc~detfreestrtmp->module~modfields module~modglobal modglobal proc~detfreestrtmp->module~modglobal module~modmpi modmpi proc~detfreestrtmp->module~modmpi decomp_2d decomp_2d module~modfields->decomp_2d mpi mpi module~modmpi->mpi

Arguments

Type IntentOptional Attributes Name
real, intent(out) :: freestrtmp

Calls

proc~~detfreestrtmp~~CallsGraph proc~detfreestrtmp detfreestrtmp mpi_allreduce mpi_allreduce proc~detfreestrtmp->mpi_allreduce

Source Code

  subroutine detfreestrtmp(freestrtmp)
    use modglobal, only : ib,ie,jb,je,kb,ke,kh,dxf,xh,dt,&
                          Uinf
    use modfields, only : thl0,dpdxl,dgdt,dpdx
    use modmpi, only    : myid,comm3d,mpierr,mpi_sum,my_real,nprocs
    implicit none

    real, intent(out) :: freestrtmp

    real  ttop
    integer i,j

    ttop = 0.

    do j =jb,je
      do i =ib,ie
        ttop = ttop + thl0(i,j,ke)*dxf(i)
      end do
    end do
    ttop = ttop / ( (je-jb+1)*(xh(ie+1)-xh(ib) ) )
    call MPI_ALLREDUCE(ttop,    freestrtmp,1,MY_REAL,MPI_SUM,comm3d,mpierr)
    freestrtmp = freestrtmp / nprocs

  end subroutine detfreestrtmp