subroutine calcreyn use modglobal, only : ib,ie,jb,je,ke,kb,dy,dxh,dzh use modfields, only : u0,v0,w0 use modmpi, only : myid,comm3d,mpi_sum,mpi_max,my_real,mpierr use modsubgriddata, only : ekm,ekh implicit none real reyntotl,reyntot integer :: i,j,k reyntotl = 0. reyntot = 0. do k=kb,ke do j=jb,je do i=ib,ie reyntotl = max(reyntotl, u0(i,j,k) * dxh(i) / ekm(i,j,k), v0(i,j,k) * dy / ekm(i,j,k), & w0(i,j,k) * dzh(k) / ekm(i,j,k)) ! or should I interpolate ekm to the correct position? end do end do end do call MPI_ALLREDUCE(reyntotl,reyntot,1,MY_REAL,MPI_MAX,comm3d,mpierr) if (myid==0) then write(6,'(A,ES10.2)') 'Cell Reynolds number:',reyntot end if end subroutine calcreyn