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