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__ calc_moments calc_moments proc~smooth__->calc_moments fft_filter fft_filter proc~smooth__->fft_filter

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

      type(MOMENT_STAT) :: m_res

      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

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

      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

      call calc_moments(    tab = tab_tmp(1:w, 1:h),        &  ! IN
                             mx = m_res,                    &  ! OUT
                         nb_mom = 2 )                          ! IN

      ! the surface has been modified, so recenter and rescale
      PARAM%surf(1:w, 1:h) = ( tab_tmp(1:w, 1:h) - m_res%mu ) / m_res%si

      deallocate( tab_tmp )

   return
   endsubroutine smooth__