get_global_maxima Subroutine

public subroutine get_global_maxima(wmax)

Uses

  • proc~~get_global_maxima~~UsesGraph proc~get_global_maxima get_global_maxima module~mod_global_parameters mod_global_parameters proc~get_global_maxima->module~mod_global_parameters module~mod_basic_types mod_basic_types module~mod_global_parameters->module~mod_basic_types module~mod_connectivity mod_connectivity module~mod_global_parameters->module~mod_connectivity module~mod_constants mod_constants module~mod_global_parameters->module~mod_constants module~mod_physicaldata mod_physicaldata module~mod_global_parameters->module~mod_physicaldata module~mod_variables mod_variables module~mod_global_parameters->module~mod_variables mpi mpi module~mod_global_parameters->mpi module~mod_variables->module~mod_basic_types

Compute global maxima of iw variables over the leaves of the grid.

Arguments

Type IntentOptional Attributes Name
double precision, intent(out) :: wmax(nw)

The global maxima


Calls

proc~~get_global_maxima~~CallsGraph proc~get_global_maxima get_global_maxima mpi_allreduce mpi_allreduce proc~get_global_maxima->mpi_allreduce

Source Code

  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