detfreestrtmp Subroutine

public subroutine detfreestrtmp(freestrtmp)

Uses

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

Arguments

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

Calls

proc~~detfreestrtmp~~CallsGraph proc~detfreestrtmp modforces::detfreestrtmp mpi_allreduce mpi_allreduce proc~detfreestrtmp->mpi_allreduce

Contents

Source Code


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