smooth__ Subroutine

private subroutine smooth__()

Note

Function that applies a low-pass filter to the surface PARAM%surf

Arguments

None

Calls

proc~~smooth__~~CallsGraph proc~smooth__ smooth__ fft_filter fft_filter proc~smooth__->fft_filter std_array std_array proc~smooth__->std_array

Called by

proc~~smooth__~~CalledByGraph proc~smooth__ smooth__ proc~read_job read_job proc~read_job->proc~smooth__ proc~prg_surf prg_surf proc~prg_surf->proc~read_job program~main main program~main->proc~prg_surf

Source Code

   subroutine smooth__()
   !================================================================================================
   !<@note Function that applies a low-pass filter to the surface PARAM%surf
   !<
   !<@endnote
   !------------------------------------------------------------------------------------------------
   implicit none

      integer(kind=I4) :: w, h

      real(kind=R8), dimension(:,:), allocatable :: tab_tmp

      real(kind=R8) :: cutoff

      read(JOB,*) cutoff ; LINE_READ = LINE_READ +1 ; write(SPY,*) "line: ", LINE_READ, "cutoff ", cutoff

      PARAM%cutoff = cutoff

      w = PARAM%width
      h = PARAM%height

      ! forces FFT reinitialization
      FFT_DIM = 0

      allocate( tab_tmp(1:w, 1:h) )

      ! remark: if cutoff is negative, the filter is a top-hat instead of Gaussian
      call fft_filter(       tab = PARAM%surf(1:w, 1:h),    &  ! IN
                            long = w,                       &  ! IN
                            larg = h,                       &  ! IN
                          cutoff = PARAM%cutoff,            &  ! IN
                          bf_tab = tab_tmp(1:w, 1:h),       &  ! OUT
                       multi_fft = .false.,                 &  ! IN
                             pad = -1._R8,                  &  ! IN
                             ext = 'constant' )                ! IN

      ! standardize surface
      call std_array( tab = tab_tmp(1:w, 1:h) )

      PARAM%surf(1:w, 1:h) = tab_tmp(1:w, 1:h)

      deallocate( tab_tmp )

      FFT_DIM = 0

   return
   endsubroutine smooth__