max_2D Function

public function max_2D(map, dim_y, dim_x)

Compute the MAX of a 2D map

Arguments

Type IntentOptional AttributesName
real(kind=xp), intent(in), dimension(:,:), allocatable:: map

2D array

integer, intent(in) :: dim_y

dimension along spatial axis y

integer, intent(in) :: dim_x

dimension along spatial axis x

Return Value real(kind=xp)


Calls

proc~~max_2d~~CallsGraph proc~max_2d max_2D proc~ravel_2d ravel_2D proc~max_2d->proc~ravel_2d

Called by

proc~~max_2d~~CalledByGraph proc~max_2d max_2D proc~max_spectrum max_spectrum proc~max_spectrum->proc~max_2d

Contents

Source Code


Source Code

  function max_2D(map, dim_y, dim_x)
    !! Compute the MAX of a 2D map
    implicit none

    integer, intent(in) :: dim_y !! dimension along spatial axis y
    integer, intent(in) :: dim_x !! dimension along spatial axis x
    real(xp), intent(in), dimension(:,:), allocatable :: map !! 2D array
    real(xp), dimension(:), allocatable :: vector !! 1D array 
    real(xp) :: max_2D

    allocate(vector(dim_y*dim_x))

    call ravel_2D(map, vector, dim_y, dim_x)
    max_2D = maxval(vector)

    deallocate(vector)

  end function max_2D