Compute global maxima of iw variables over the leaves of the grid.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| double precision, | intent(out) | :: | wmax(nw) |
The global maxima |
subroutine get_global_maxima(wmax) use mod_global_parameters double precision, intent(out) :: wmax(nw) !< The global maxima integer :: iigrid, igrid, iw double precision :: wmax_mype(nw),wmax_recv(nw) wmax_mype(1:nw) = -bigdouble ! Loop over all the grids do iigrid = 1, igridstail igrid = igrids(iigrid) do iw = 1, nw wmax_mype(iw)=max(wmax_mype(iw),maxval(ps(igrid)%w(ixMlo1:ixMhi1,& ixMlo2:ixMhi2,ixMlo3:ixMhi3,iw))) end do end do ! Make the information available on all tasks call MPI_ALLREDUCE(wmax_mype, wmax_recv, nw, MPI_DOUBLE_PRECISION, MPI_MAX,& icomm, ierrmpi) wmax(1:nw)=wmax_recv(1:nw) end subroutine get_global_maxima